cortex-react-components 2.28.0 → 2.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ORODSHZN.mjs → chunk-255P6K5W.mjs} +1 -1
- package/dist/{chunk-D76LTQRD.mjs → chunk-2RQDJ5XT.mjs} +1 -1
- package/dist/chunk-2TUBS2HM.mjs +4 -0
- package/dist/{chunk-JDIPWJBD.mjs → chunk-46N4YPMB.mjs} +1 -1
- package/dist/{chunk-27XIU7FW.mjs → chunk-4LUF5GZ6.mjs} +1 -1
- package/dist/{chunk-KBEXWUKI.mjs → chunk-5NIEZE7A.mjs} +1 -1
- package/dist/{chunk-LKUK55GC.mjs → chunk-5SHZBJ5R.mjs} +1 -1
- package/dist/{chunk-KAAHIHZK.mjs → chunk-5WVFEIMC.mjs} +1 -1
- package/dist/{chunk-XSCZQEYP.mjs → chunk-62A35O55.mjs} +1 -1
- package/dist/{chunk-43YJ2VYN.mjs → chunk-67QPOSVV.mjs} +1 -1
- package/dist/{chunk-VDFRWGXR.mjs → chunk-6PS55VJZ.mjs} +1 -1
- package/dist/{chunk-YI6EQRWN.mjs → chunk-6ZMZX5TB.mjs} +1 -1
- package/dist/{chunk-WDRL3N5V.mjs → chunk-7GMAMIHM.mjs} +1 -1
- package/dist/{chunk-75HU5Q6A.mjs → chunk-AHMDJQZI.mjs} +1 -1
- package/dist/{chunk-XX4GSGRP.mjs → chunk-AQQCH7Z2.mjs} +1 -1
- package/dist/{chunk-YVXFRQPA.mjs → chunk-ATPB5HSG.mjs} +1 -1
- package/dist/{chunk-ZA6MGTGM.mjs → chunk-B7AXSCTN.mjs} +1 -1
- package/dist/{chunk-D44OXIPN.mjs → chunk-CDVRH3MC.mjs} +1 -1
- package/dist/{chunk-OQBCIB4L.mjs → chunk-CK2TD4BY.mjs} +1 -1
- package/dist/{chunk-633ESSXN.mjs → chunk-COBOHCBL.mjs} +1 -1
- package/dist/{chunk-KEOMDWUC.mjs → chunk-EHSOO47V.mjs} +1 -1
- package/dist/{chunk-2R3ECSWF.mjs → chunk-ERJXTG6X.mjs} +1 -1
- package/dist/{chunk-CXHPLJDO.mjs → chunk-F6DMXMR4.mjs} +1 -1
- package/dist/{chunk-VKCDLKYH.mjs → chunk-FJ2HHNPX.mjs} +1 -1
- package/dist/{chunk-6L7VJ7IH.mjs → chunk-FKU4VQR6.mjs} +1 -1
- package/dist/chunk-GED5VYLZ.mjs +4 -0
- package/dist/{chunk-DTKZ3I6Z.mjs → chunk-H3CJOE6S.mjs} +1 -1
- package/dist/{chunk-RCI3L3M5.mjs → chunk-HD6E7KI2.mjs} +1 -1
- package/dist/{chunk-YG7SLO6G.mjs → chunk-HKGW6JI2.mjs} +1 -1
- package/dist/{chunk-24R7CI5Q.mjs → chunk-I2GNNRFH.mjs} +1 -1
- package/dist/{chunk-FRYADWTQ.mjs → chunk-IF3425JX.mjs} +1 -1
- package/dist/{chunk-I6D5JCNY.mjs → chunk-IQQ7ZWCP.mjs} +1 -1
- package/dist/chunk-IUVPH5LV.mjs +4 -0
- package/dist/{chunk-6VRPQKAK.mjs → chunk-JCWFPKF3.mjs} +1 -1
- package/dist/chunk-JQL4XGAF.mjs +4 -0
- package/dist/{chunk-WUA65ZZB.mjs → chunk-L3BLBPSR.mjs} +1 -1
- package/dist/{chunk-CLGBBNRB.mjs → chunk-LAQ3QAUW.mjs} +1 -1
- package/dist/{chunk-5FWH5YVM.mjs → chunk-LHO4WFYP.mjs} +1 -1
- package/dist/{chunk-2O54GV6Q.mjs → chunk-LJFBHY4P.mjs} +1 -1
- package/dist/{chunk-GXVC6ETI.mjs → chunk-LJQPLE4S.mjs} +1 -1
- package/dist/{chunk-YPQUYIGO.mjs → chunk-LLED3RQS.mjs} +1 -1
- package/dist/{chunk-GRNOF6LY.mjs → chunk-M7NV6EFH.mjs} +1 -1
- package/dist/chunk-MCOHKE2T.mjs +1 -0
- package/dist/{chunk-SWE754OC.mjs → chunk-MH4YPGH4.mjs} +1 -1
- package/dist/{chunk-B63FA7LF.mjs → chunk-MXCW6SOT.mjs} +1 -1
- package/dist/{chunk-4ITG3T35.mjs → chunk-N3B3XNV3.mjs} +1 -1
- package/dist/{chunk-4FEVXBNU.mjs → chunk-NCJAMNMQ.mjs} +1 -1
- package/dist/{chunk-NJ7PW5T7.mjs → chunk-NWISIJFD.mjs} +1 -1
- package/dist/{chunk-O3BCESMN.mjs → chunk-NXAXOI33.mjs} +1 -1
- package/dist/{chunk-MX3JKY3V.mjs → chunk-P7S6XFU4.mjs} +1 -1
- package/dist/{chunk-IBC5Z55T.mjs → chunk-PK3OBSCB.mjs} +1 -1
- package/dist/{chunk-SADWUWLZ.mjs → chunk-PTSAG7IY.mjs} +1 -1
- package/dist/{chunk-AMAB4E2X.mjs → chunk-QKDYTCZC.mjs} +1 -1
- package/dist/{chunk-2IMY4VWR.mjs → chunk-RR4QSUV2.mjs} +1 -1
- package/dist/{chunk-XQ3XV5DH.mjs → chunk-RS4VD3ML.mjs} +1 -1
- package/dist/{chunk-UBZYXZ7B.mjs → chunk-RS4WAAGI.mjs} +1 -1
- package/dist/chunk-SMKYMYUV.mjs +1 -0
- package/dist/{chunk-LEF6M5ZD.mjs → chunk-SNFBF6KT.mjs} +1 -1
- package/dist/{chunk-ZZFYIP6H.mjs → chunk-TKCFCYEQ.mjs} +1 -1
- package/dist/{chunk-OWL3KUE3.mjs → chunk-TKY52BNP.mjs} +1 -1
- package/dist/{chunk-I75OOO4H.mjs → chunk-VRHJOUL3.mjs} +1 -1
- package/dist/{chunk-MDIJOHFV.mjs → chunk-WLI2YTOQ.mjs} +1 -1
- package/dist/{chunk-O5QXPC23.mjs → chunk-X2JWNPWT.mjs} +1 -1
- package/dist/{chunk-XMYXQR5W.mjs → chunk-X3YJJBFJ.mjs} +1 -1
- package/dist/{chunk-LBVWIF2J.mjs → chunk-XJKNH5LL.mjs} +1 -1
- package/dist/{chunk-IFUIQ57U.mjs → chunk-XKGBG5FX.mjs} +1 -1
- package/dist/{chunk-MX6GXHJJ.mjs → chunk-YKG4FNS4.mjs} +1 -1
- package/dist/chunk-YRDJBAYA.mjs +4 -0
- package/dist/chunk-Z4ZRNNSX.mjs +4 -0
- package/dist/{chunk-O5P35LEY.mjs → chunk-ZFUP5NVF.mjs} +1 -1
- package/dist/components/AdvancedComponents/AppSidebar.mjs +1 -1
- package/dist/components/AdvancedComponents/CommentSection.mjs +1 -1
- package/dist/components/AdvancedComponents/EditableField.mjs +1 -1
- package/dist/components/AdvancedComponents/app-header.mjs +1 -1
- package/dist/components/AdvancedComponents/index.mjs +1 -1
- package/dist/components/AdvancedComponents/navigation-tabs.mjs +1 -1
- package/dist/components/AdvancedComponents/notifications-panel.mjs +1 -1
- package/dist/components/AdvancedComponents/switch.mjs +1 -1
- package/dist/components/AdvancedComponents/theme-toggle.mjs +1 -1
- package/dist/components/AdvancedComponents/user-selection.mjs +1 -1
- package/dist/components/Blocks/Banner.mjs +1 -1
- package/dist/components/Blocks/CallToAction.mjs +1 -1
- package/dist/components/Blocks/CaseStudy.mjs +1 -1
- package/dist/components/Blocks/Code.client.mjs +1 -1
- package/dist/components/Blocks/Code.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
- package/dist/components/Blocks/ConsultantProfile.mjs +1 -1
- package/dist/components/Blocks/Content.mjs +1 -1
- package/dist/components/Blocks/CopyButton.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
- package/dist/components/Blocks/ProposalSummary.mjs +1 -1
- package/dist/components/Blocks/RelatedPosts.mjs +1 -1
- package/dist/components/Blocks/RenderBlocks.mjs +1 -1
- package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/CRM/CogeBoard.js +1 -1
- package/dist/components/CRM/CogeBoard.mjs +1 -1
- package/dist/components/CRM/DealCard.mjs +1 -1
- package/dist/components/CRM/DealDetails.mjs +1 -1
- package/dist/components/CRM/KanbanBoard.js +1 -1
- package/dist/components/CRM/KanbanBoard.mjs +1 -1
- package/dist/components/CRM/KanbanColumn.js +1 -1
- package/dist/components/CRM/KanbanColumn.mjs +1 -1
- package/dist/components/CRM/NewCustomerForm.mjs +1 -1
- package/dist/components/CRM/NewDealForm.mjs +1 -1
- package/dist/components/CRM/index.js +1 -1
- package/dist/components/CRM/index.mjs +1 -1
- package/dist/components/CRM/types.d.ts +1 -1
- package/dist/components/CRM/types.js +1 -1
- package/dist/components/Cards/ContentCard.mjs +1 -1
- package/dist/components/Cards/CustomerCard.mjs +1 -1
- package/dist/components/Cards/EventCard.mjs +1 -1
- package/dist/components/Cards/FeatureCard.mjs +1 -1
- package/dist/components/Cards/HeroCard.mjs +1 -1
- package/dist/components/Cards/Image.mjs +1 -1
- package/dist/components/Cards/PricingCard.mjs +1 -1
- package/dist/components/Cards/ServiceCard.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/Chat/ChatInterface.js +7 -7
- package/dist/components/Chat/ChatInterface.mjs +1 -1
- package/dist/components/Chat/Components/ChatCardArtefact.mjs +1 -1
- package/dist/components/Chat/Components/ChatCardTask.mjs +1 -1
- package/dist/components/Chat/Components/Conversation.mjs +1 -1
- package/dist/components/Chat/Components/Message.mjs +1 -1
- package/dist/components/Chat/CopilotInterface.js +11 -10
- package/dist/components/Chat/CopilotInterface.mjs +1 -1
- package/dist/components/Chat/PartTypes/CodeBlock.d.ts +7 -5
- package/dist/components/Chat/PartTypes/CodeBlock.js +1 -1
- package/dist/components/Chat/PartTypes/CodeBlock.mjs +1 -1
- package/dist/components/Chat/PartTypes/ColleagueHandoff.mjs +1 -1
- package/dist/components/Chat/PartTypes/Confirmation.css +1 -0
- package/dist/components/Chat/PartTypes/Confirmation.d.ts +49 -0
- package/dist/components/Chat/PartTypes/Confirmation.js +4 -0
- package/dist/components/Chat/PartTypes/Confirmation.mjs +2 -0
- package/dist/components/Chat/PartTypes/Conversation.css +1 -0
- package/dist/components/Chat/PartTypes/Conversation.d.ts +15 -0
- package/dist/components/Chat/PartTypes/Conversation.js +4 -0
- package/dist/components/Chat/PartTypes/Conversation.mjs +2 -0
- package/dist/components/Chat/PartTypes/MessageHandler.js +8 -7
- package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
- package/dist/components/Chat/PartTypes/Reasoning.mjs +1 -1
- package/dist/components/Chat/PartTypes/Response.mjs +1 -1
- package/dist/components/Chat/PartTypes/Tool.d.ts +12 -11
- package/dist/components/Chat/PartTypes/Tool.js +1 -1
- package/dist/components/Chat/PartTypes/Tool.mjs +1 -1
- package/dist/components/Chat/PartTypes/index.d.ts +2 -0
- package/dist/components/Chat/PartTypes/index.js +9 -8
- package/dist/components/Chat/PartTypes/index.mjs +1 -1
- package/dist/components/Chat/capability-menu.mjs +1 -1
- package/dist/components/Chat/chat-session-sidebar.mjs +1 -1
- package/dist/components/Chat/demo-long-messages.js +18 -17
- package/dist/components/Chat/demo-long-messages.mjs +1 -1
- package/dist/components/Chat/demo-tests.js +89 -88
- package/dist/components/Chat/demo-tests.mjs +1 -1
- package/dist/components/Chat/demo.js +11 -10
- package/dist/components/Chat/demo.mjs +1 -1
- package/dist/components/Chat/example-usage.js +11 -10
- package/dist/components/Chat/example-usage.mjs +1 -1
- package/dist/components/Chat/example-with-file-uploads.mjs +1 -1
- package/dist/components/Chat/example-with-vercel-ai.js +11 -10
- package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
- package/dist/components/Chat/index.js +11 -10
- package/dist/components/Chat/index.mjs +1 -1
- package/dist/components/DeliveryLead/DeliveryLeadSubmission.mjs +1 -1
- package/dist/components/DeliveryLead/DeliveryLeadSubmissionList.mjs +1 -1
- package/dist/components/DeliveryLead/DeliveryLeadSubmissionWithList.mjs +1 -1
- package/dist/components/DeliveryLead/index.mjs +1 -1
- package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
- package/dist/components/DigitalColleagues/DashboardHeader.mjs +1 -1
- package/dist/components/DigitalColleagues/DigitalColleageusLayout.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
- package/dist/components/DigitalColleagues/SearchableSelect.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/ColleaguesView.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/KnowledgeView.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/TeamsIndexView.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
- package/dist/components/DigitalColleagues/colleague-card.mjs +1 -1
- package/dist/components/DigitalColleagues/colleague-form.mjs +1 -1
- package/dist/components/DigitalColleagues/colleague-type-selection.mjs +1 -1
- package/dist/components/DigitalColleagues/digital-colleague-clone.mjs +1 -1
- package/dist/components/DigitalColleagues/digital-colleague-options.mjs +1 -1
- package/dist/components/DigitalColleagues/document-edit.mjs +1 -1
- package/dist/components/DigitalColleagues/document-preview-examples.mjs +1 -1
- package/dist/components/DigitalColleagues/document-preview.mjs +1 -1
- package/dist/components/DigitalColleagues/index.mjs +1 -1
- package/dist/components/DigitalColleagues/knowledge-browser.mjs +1 -1
- package/dist/components/DigitalColleagues/knowledge-search.mjs +1 -1
- package/dist/components/DigitalColleagues/team-form.mjs +1 -1
- package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
- package/dist/components/Foundary/DashboardHeader.mjs +1 -1
- package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
- package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
- package/dist/components/Foundary/Knowledge/manage-team-context.mjs +1 -1
- package/dist/components/Foundary/LandingMenu.mjs +1 -1
- package/dist/components/Foundary/Login.mjs +1 -1
- package/dist/components/Foundary/MainPage.mjs +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
- package/dist/components/Foundary/RichText/components/RawUploadComponent/index.mjs +1 -1
- package/dist/components/Foundary/RichText/index.mjs +1 -1
- package/dist/components/Foundary/RichText/nodes/image-node.mjs +1 -1
- package/dist/components/Foundary/RichText/plugins/image-plugin.mjs +1 -1
- package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
- package/dist/components/Foundary/SearchableSelect.mjs +1 -1
- package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
- package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
- package/dist/components/Foundary/Views/TeamsIndexView.mjs +1 -1
- package/dist/components/Foundary/Views/index.mjs +1 -1
- package/dist/components/Foundary/colleague-card.mjs +1 -1
- package/dist/components/Foundary/colleague-form.mjs +1 -1
- package/dist/components/Foundary/colleague-type-selection.mjs +1 -1
- package/dist/components/Foundary/document-edit.mjs +1 -1
- package/dist/components/Foundary/document-preview-examples.mjs +1 -1
- package/dist/components/Foundary/document-preview.mjs +1 -1
- package/dist/components/Foundary/file-edit.mjs +1 -1
- package/dist/components/Foundary/foundary-clone.mjs +1 -1
- package/dist/components/Foundary/foundary-layout.mjs +1 -1
- package/dist/components/Foundary/foundary-options.mjs +1 -1
- package/dist/components/Foundary/index.mjs +1 -1
- package/dist/components/Foundary/knowledge-browser.mjs +1 -1
- package/dist/components/Foundary/knowledge-search.mjs +1 -1
- package/dist/components/Foundary/team-form.mjs +1 -1
- package/dist/components/HeaderFooter/Footer.mjs +1 -1
- package/dist/components/HeaderFooter/Header.mjs +1 -1
- package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
- package/dist/components/HeaderFooter/HeaderMenu.mjs +1 -1
- package/dist/components/HeaderFooter/RelatedPagesMenu.mjs +1 -1
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/HeaderFooter/SimpleHeader.mjs +1 -1
- package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
- package/dist/components/HeaderFooter/enhanced-header.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/DashboardHero/DashboardHero.mjs +1 -1
- package/dist/components/Heros/DashboardHero/index.mjs +1 -1
- package/dist/components/Heros/HighImpact/index.mjs +1 -1
- package/dist/components/Heros/LowImpact/index.mjs +1 -1
- package/dist/components/Heros/MediumImpact/index.mjs +1 -1
- package/dist/components/Heros/PostHero/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/SectionHero/index.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Holidays/ApproveLeave.mjs +1 -1
- package/dist/components/Holidays/CalendarView.mjs +1 -1
- package/dist/components/Holidays/HolidayGrid.mjs +1 -1
- package/dist/components/Holidays/HolidayTracker.mjs +1 -1
- package/dist/components/Holidays/RequestLeave.mjs +1 -1
- package/dist/components/Holidays/index.mjs +1 -1
- package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
- package/dist/components/Layouts/Print.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Menus/Categories.mjs +1 -1
- package/dist/components/Menus/Filter.mjs +1 -1
- package/dist/components/Menus/ProjectTeam.mjs +1 -1
- package/dist/components/Menus/RelatedContent.mjs +1 -1
- package/dist/components/Menus/SidebarLeft.mjs +1 -1
- package/dist/components/Menus/SidebarRight.mjs +1 -1
- package/dist/components/Menus/index.mjs +1 -1
- package/dist/components/Other/Container.mjs +1 -1
- package/dist/components/Other/index.mjs +1 -1
- package/dist/components/Payload/Link/index.mjs +1 -1
- package/dist/components/Payload/Pagination/index.mjs +1 -1
- package/dist/components/Payload/RichText/index.mjs +1 -1
- package/dist/components/Payload/RichText/serialize.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/Projects/AddEpicModal.mjs +1 -1
- package/dist/components/Projects/AddFileModal.mjs +1 -1
- package/dist/components/Projects/AddSprintModal.mjs +1 -1
- package/dist/components/Projects/AddTaskModal.mjs +1 -1
- package/dist/components/Projects/EpicFilter.mjs +1 -1
- package/dist/components/Projects/EpicsView.mjs +1 -1
- package/dist/components/Projects/FileView.mjs +1 -1
- package/dist/components/Projects/KanbanBoardView.mjs +1 -1
- package/dist/components/Projects/KanbanColumn.mjs +1 -1
- package/dist/components/Projects/PlanningView.mjs +1 -1
- package/dist/components/Projects/ProjectPage.mjs +1 -1
- package/dist/components/Projects/ProjectView.mjs +1 -1
- package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
- package/dist/components/Projects/TaskCard.mjs +1 -1
- package/dist/components/Projects/TaskDetailsModal.mjs +1 -1
- package/dist/components/Projects/TaskSelect.mjs +1 -1
- package/dist/components/Projects/TaskSidebar.mjs +1 -1
- package/dist/components/Projects/TasksView.mjs +1 -1
- package/dist/components/Projects/TeamSwitcher.mjs +1 -1
- package/dist/components/Projects/business-unit-switcher.mjs +1 -1
- package/dist/components/Projects/file-list.mjs +1 -1
- package/dist/components/Projects/index.mjs +1 -1
- package/dist/components/Projects/project-card.mjs +1 -1
- package/dist/components/Projects/project-form.mjs +1 -1
- package/dist/components/Projects/team-card.mjs +1 -1
- package/dist/components/Projects/team-switcher-bar.mjs +1 -1
- package/dist/components/dc-temp/creative.mjs +1 -1
- package/dist/components/dc-temp/dashboard-integration-example.mjs +1 -1
- package/dist/components/dc-temp/index.mjs +1 -1
- package/dist/components/dc-temp/markdown-renderer.mjs +1 -1
- package/dist/components/index.js +24 -23
- package/dist/components/index.mjs +1 -1
- package/dist/components/ui/alert.mjs +1 -1
- package/dist/components/ui/avatar.mjs +1 -1
- package/dist/components/ui/badge.mjs +1 -1
- package/dist/components/ui/breadcrumb.mjs +1 -1
- package/dist/components/ui/button.mjs +1 -1
- package/dist/components/ui/calendar.mjs +1 -1
- package/dist/components/ui/card.mjs +1 -1
- package/dist/components/ui/checkbox.mjs +1 -1
- package/dist/components/ui/command.mjs +1 -1
- package/dist/components/ui/dialog.mjs +1 -1
- package/dist/components/ui/dropdown-menu.mjs +1 -1
- package/dist/components/ui/hover-card.mjs +1 -1
- package/dist/components/ui/index.mjs +1 -1
- package/dist/components/ui/input.mjs +1 -1
- package/dist/components/ui/inputs/common/styles/index.mjs +1 -1
- package/dist/components/ui/inputs/text-input/index.mjs +1 -1
- package/dist/components/ui/inputs/textarea-input/index.mjs +1 -1
- package/dist/components/ui/label.mjs +1 -1
- package/dist/components/ui/pagination.mjs +1 -1
- package/dist/components/ui/popover.mjs +1 -1
- package/dist/components/ui/progress.mjs +1 -1
- package/dist/components/ui/scroll-area.mjs +1 -1
- package/dist/components/ui/select.mjs +1 -1
- package/dist/components/ui/separator.mjs +1 -1
- package/dist/components/ui/sheet.mjs +1 -1
- package/dist/components/ui/sidebar.mjs +1 -1
- package/dist/components/ui/skeleton.mjs +1 -1
- package/dist/components/ui/switch.mjs +1 -1
- package/dist/components/ui/tabs.mjs +1 -1
- package/dist/components/ui/textarea.mjs +1 -1
- package/dist/components/ui/toast.mjs +1 -1
- package/dist/components/ui/toaster.mjs +1 -1
- package/dist/components/ui/toggle-group.mjs +1 -1
- package/dist/components/ui/toggle.mjs +1 -1
- package/dist/components/ui/tooltip.mjs +1 -1
- package/dist/globals.css +1 -1
- package/dist/index.js +28 -27
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/payload-types.d.ts +1 -1
- package/dist/sections/AboutSection.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogList.mjs +1 -1
- package/dist/sections/BlogListSection.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/ImageSection.mjs +1 -1
- package/dist/sections/MainPageSection.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/ServiceDetail.mjs +1 -1
- package/dist/sections/ServiceDetailSection.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/form/index.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/dist/styles/Colors.mjs +1 -1
- package/dist/utils/index.mjs +1 -1
- package/package.json +3 -2
- package/dist/chunk-7JDMW5R3.mjs +0 -4
- package/dist/chunk-IMRGPVFS.mjs +0 -1
- package/dist/chunk-SZXMQMZ6.mjs +0 -4
- package/dist/chunk-UA2E23AS.mjs +0 -4
- package/dist/chunk-V6GC3UGV.mjs +0 -1
- package/dist/chunk-WBDSOPDY.mjs +0 -4
|
@@ -2,20 +2,21 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
'use client'
|
|
4
4
|
'use client';
|
|
5
|
+
"use client";
|
|
5
6
|
|
|
6
|
-
"use strict";var ui=Object.create;var Dt=Object.defineProperty;var gi=Object.getOwnPropertyDescriptor;var fi=Object.getOwnPropertyNames;var bi=Object.getPrototypeOf,vi=Object.prototype.hasOwnProperty;var hi=(e,t)=>{for(var o in t)Dt(e,o,{get:t[o],enumerable:!0})},Ao=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of fi(t))!vi.call(e,n)&&n!==o&&Dt(e,n,{get:()=>t[n],enumerable:!(a=gi(t,n))||a.enumerable});return e};var G=(e,t,o)=>(o=e!=null?ui(bi(e)):{},Ao(t||!e||!e.__esModule?Dt(o,"default",{value:e,enumerable:!0}):o,e)),yi=e=>Ao(Dt({},"__esModule",{value:!0}),e);var Ar={};hi(Ar,{ExampleChatInterface:()=>Sr});module.exports=yi(Ar);var Qe=G(require("react"));var jo=require("clsx");var Yt="-",xi=e=>{let t=wi(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:r=>{let s=r.split(Yt);return s[0]===""&&s.length!==1&&s.shift(),Bo(s,t)||Ci(r)},getConflictingClassGroupIds:(r,s)=>{let c=o[r]||[];return s&&a[r]?[...c,...a[r]]:c}}},Bo=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),n=a?Bo(e.slice(1),a):void 0;if(n)return n;if(t.validators.length===0)return;let i=e.join(Yt);return t.validators.find(({validator:r})=>r(i))?.classGroupId},Mo=/^\[(.+)\]$/,Ci=e=>{if(Mo.test(e)){let t=Mo.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},wi=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return ki(Object.entries(e.classGroups),o).forEach(([i,r])=>{Xt(r,a,i,t)}),a},Xt=(e,t,o,a)=>{e.forEach(n=>{if(typeof n=="string"){let i=n===""?t:Io(t,n);i.classGroupId=o;return}if(typeof n=="function"){if(Ni(n)){Xt(n(a),t,o,a);return}t.validators.push({validator:n,classGroupId:o});return}Object.entries(n).forEach(([i,r])=>{Xt(r,Io(t,i),o,a)})})},Io=(e,t)=>{let o=e;return t.split(Yt).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},Ni=e=>e.isThemeGetter,ki=(e,t)=>t?e.map(([o,a])=>{let n=a.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([r,s])=>[t+r,s])):i);return[o,n]}):e,Pi=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,n=(i,r)=>{o.set(i,r),t++,t>e&&(t=0,a=o,o=new Map)};return{get(i){let r=o.get(i);if(r!==void 0)return r;if((r=a.get(i))!==void 0)return n(i,r),r},set(i,r){o.has(i)?o.set(i,r):n(i,r)}}},Lo="!",Ti=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,n=t[0],i=t.length,r=s=>{let c=[],p=0,h=0,u;for(let C=0;C<s.length;C++){let k=s[C];if(p===0){if(k===n&&(a||s.slice(C,C+i)===t)){c.push(s.slice(h,C)),h=C+i;continue}if(k==="/"){u=C;continue}}k==="["?p++:k==="]"&&p--}let v=c.length===0?s:s.substring(h),S=v.startsWith(Lo),T=S?v.substring(1):v,N=u&&u>h?u-h:void 0;return{modifiers:c,hasImportantModifier:S,baseClassName:T,maybePostfixModifierPosition:N}};return o?s=>o({className:s,parseClassName:r}):r},Di=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},Ri=e=>({cache:Pi(e.cacheSize),parseClassName:Ti(e),...xi(e)}),Si=/\s+/,Ai=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:n}=t,i=[],r=e.trim().split(Si),s="";for(let c=r.length-1;c>=0;c-=1){let p=r[c],{modifiers:h,hasImportantModifier:u,baseClassName:v,maybePostfixModifierPosition:S}=o(p),T=!!S,N=a(T?v.substring(0,S):v);if(!N){if(!T){s=p+(s.length>0?" "+s:s);continue}if(N=a(v),!N){s=p+(s.length>0?" "+s:s);continue}T=!1}let C=Di(h).join(":"),k=u?C+Lo:C,B=k+N;if(i.includes(B))continue;i.push(B);let M=n(N,T);for(let I=0;I<M.length;++I){let Y=M[I];i.push(k+Y)}s=p+(s.length>0?" "+s:s)}return s};function Mi(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Eo(t))&&(a&&(a+=" "),a+=o);return a}var Eo=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=Eo(e[a]))&&(o&&(o+=" "),o+=t);return o};function Ii(e,...t){let o,a,n,i=r;function r(c){let p=t.reduce((h,u)=>u(h),e());return o=Ri(p),a=o.cache.get,n=o.cache.set,i=s,s(c)}function s(c){let p=a(c);if(p)return p;let h=Ai(c,o);return n(c,h),h}return function(){return i(Mi.apply(null,arguments))}}var O=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},zo=/^\[(?:([a-z-]+):)?(.+)\]$/i,Bi=/^\d+\/\d+$/,Li=new Set(["px","full","screen"]),Ei=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zi=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|Xe|min|max))|\Xe(calc|min|max|clamp)\(.+\)|^0$/,Ui=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Hi=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ji=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Be=e=>ot(e)||Li.has(e)||Bi.test(e),Oe=e=>at(e,"length",_i),ot=e=>!!e&&!Number.isNaN(Number(e)),Qt=e=>at(e,"number",ot),ht=e=>!!e&&Number.isInteger(Number(e)),Fi=e=>e.endsWith("%")&&ot(e.slice(0,-1)),w=e=>zo.test(e),Ve=e=>Ei.test(e),Oi=new Set(["length","size","percentage"]),Vi=e=>at(e,Oi,Uo),Wi=e=>at(e,"position",Uo),Gi=new Set(["image","url"]),$i=e=>at(e,Gi,Ji),qi=e=>at(e,"",Ki),yt=()=>!0,at=(e,t,o)=>{let a=zo.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},_i=e=>zi.test(e)&&!Ui.test(e),Uo=()=>!1,Ki=e=>Hi.test(e),Ji=e=>ji.test(e);var Qi=()=>{let e=O("colors"),t=O("spacing"),o=O("blur"),a=O("brightness"),n=O("borderColor"),i=O("borderRadius"),r=O("borderSpacing"),s=O("borderWidth"),c=O("contrast"),p=O("grayscale"),h=O("hueRotate"),u=O("invert"),v=O("gap"),S=O("gradientColorStops"),T=O("gradientColorStopPositions"),N=O("inset"),C=O("margin"),k=O("opacity"),B=O("padding"),M=O("saturate"),I=O("scale"),Y=O("sepia"),_=O("skew"),ce=O("space"),ae=O("translate"),W=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],de=()=>["auto",w,t],L=()=>[w,t],Fe=()=>["",Be,Oe],ye=()=>["auto",ot,w],d=()=>["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"],pe=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",w],g=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[ot,w];return{cacheSize:500,separator:":",theme:{colors:[yt],spacing:[Be,Oe],blur:["none","",Ve,w],brightness:H(),borderColor:[e],borderRadius:["none","","full",Ve,w],borderSpacing:L(),borderWidth:Fe(),contrast:H(),grayscale:$(),hueRotate:H(),invert:$(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[Fi,Oe],inset:de(),margin:de(),opacity:H(),padding:L(),saturate:H(),scale:H(),sepia:$(),skew:H(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",w]}],container:["container"],columns:[{columns:[Ve]}],"break-after":[{"break-after":g()}],"break-before":[{"break-before":g()}],"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(),w]}],overflow:[{overflow:K()}],"overflow-Xe":[{"overflow-Xe":K()}],"overflow-Xe":[{"overflow-Xe":K()}],overscroll:[{overscroll:W()}],"overscroll-Xe":[{"overscroll-Xe":W()}],"overscroll-Xe":[{"overscroll-Xe":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[N]}],"inset-Xe":[{"inset-Xe":[N]}],"inset-Xe":[{"inset-Xe":[N]}],start:[{start:[N]}],end:[{end:[N]}],top:[{top:[N]}],right:[{right:[N]}],bottom:[{bottom:[N]}],left:[{left:[N]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ht,w]}],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",w]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",ht,w]}],"grid-cols":[{"grid-cols":[yt]}],"col-start-end":[{col:["auto",{span:["full",ht,w]},w]}],"col-start":[{"col-start":ye()}],"col-end":[{"col-end":ye()}],"grid-rows":[{"grid-rows":[yt]}],"row-start-end":[{row:["auto",{span:[ht,w]},w]}],"row-start":[{"row-start":ye()}],"row-end":[{"row-end":ye()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",w]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",w]}],gap:[{gap:[v]}],"gap-Xe":[{"gap-Xe":[v]}],"gap-Xe":[{"gap-Xe":[v]}],"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:[B]}],px:[{px:[B]}],py:[{py:[B]}],ps:[{ps:[B]}],pe:[{pe:[B]}],pt:[{pt:[B]}],pr:[{pr:[B]}],pb:[{pb:[B]}],pl:[{pl:[B]}],Xe:[{Xe:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-Xe":[{"space-Xe":[ce]}],"space-Xe-reverse":["space-Xe-reverse"],"space-Xe":[{"space-Xe":[ce]}],"space-Xe-reverse":["space-Xe-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",w,t]}],"min-w":[{"min-w":[w,t,"min","max","fit"]}],"max-w":[{"max-w":[w,t,"none","full","min","max","fit","prose",{screen:[Ve]},Ve]}],h:[{h:[w,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[w,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[w,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[w,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",Qt]}],"font-family":[{font:[yt]}],"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",w]}],"line-clamp":[{"line-clamp":["none",ot,Qt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Be,w]}],"list-image":[{"list-image":["none",w]}],"list-style-type":[{list:["none","disc","decimal",w]}],"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:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Be,Oe]}],"underline-offset":[{"underline-offset":["auto",Be,w]}],"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",w]}],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",w]}],"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(),Wi]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","Xe","Xe","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Vi]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","Xe","bl","l","tl"]},$i]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[T]}],"gradient-via-pos":[{via:[T]}],"gradient-to-pos":[{to:[T]}],"gradient-from":[{from:[S]}],"gradient-via":[{via:[S]}],"gradient-to":[{to:[S]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-Xe":[{"rounded-Xe":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-Xe":[{"rounded-Xe":[i]}],"rounded-Wo":[{"rounded-Wo":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-Xe":[{"border-Xe":[s]}],"border-w-Xe":[{"border-Xe":[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-Xe":[{"border-Xe":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...z(),"hidden"]}],"divide-Xe":[{"divide-Xe":[s]}],"divide-Xe-reverse":["divide-Xe-reverse"],"divide-Xe":[{"divide-Xe":[s]}],"divide-Xe-reverse":["divide-Xe-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:z()}],"border-color":[{border:[n]}],"border-color-Xe":[{"border-Xe":[n]}],"border-color-Xe":[{"border-Xe":[n]}],"border-color-s":[{"border-s":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-Xe":[{"border-Xe":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[Be,w]}],"outline-w":[{outline:[Be,Oe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[Be,Oe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ve,qi]}],"shadow-color":[{shadow:[yt]}],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",Ve,w]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[u]}],saturate:[{saturate:[M]}],sepia:[{sepia:[Y]}],"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":[h]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[M]}],"backdrop-sepia":[{"backdrop-sepia":[Y]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[r]}],"border-spacing-Xe":[{"border-spacing-Xe":[r]}],"border-spacing-Xe":[{"border-spacing-Xe":[r]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",w]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",w]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",w]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[I]}],"scale-Xe":[{"scale-Xe":[I]}],"scale-Xe":[{"scale-Xe":[I]}],rotate:[{rotate:[ht,w]}],"translate-Xe":[{"translate-Xe":[ae]}],"translate-Xe":[{"translate-Xe":[ae]}],"skew-Xe":[{"skew-Xe":[_]}],"skew-Xe":[{"skew-Xe":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",w]}],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","Xe-resize","nw-resize","Xe-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",w]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","Xe","Xe",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-Xe":[{"scroll-Xe":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":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","Xe","Xe","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-Xe":[{"touch-pan":["Xe","left","right"]}],"touch-Xe":[{"touch-pan":["Xe","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",w]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Be,Oe,Qt]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-Xe","overflow-Xe"],overscroll:["overscroll-Xe","overscroll-Xe"],inset:["inset-Xe","inset-Xe","start","end","top","right","bottom","left"],"inset-Xe":["right","left"],"inset-Xe":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-Xe","gap-Xe"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],Xe:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-Xe","rounded-l","rounded-ss","rounded-Xe","rounded-Wo","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Xe","rounded-Wo"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-Xe":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-Xe","border-spacing-Xe"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-Xe","border-w-l"],"border-w-Xe":["border-w-r","border-w-l"],"border-w-Xe":["border-w-t","border-w-Xe"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-Xe","border-color-l"],"border-color-Xe":["border-color-r","border-color-l"],"border-color-Xe":["border-color-t","border-color-Xe"],"scroll-Xe":["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-Xe","touch-Xe","touch-pz"],"touch-Xe":["touch"],"touch-Xe":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ho=Ii(Qi);function l(...e){return Ho((0,jo.clsx)(e))}var Xe=require("react/jsx-runtime"),fe=Qe.forwardRef(({className:e,...t},o)=>(0,Xe.jsx)("div",{ref:o,className:l("rounded-xl border bg-card text-card-foreground shadow",e),...t}));fe.displayName="Card";var Le=Qe.forwardRef(({className:e,...t},o)=>(0,Xe.jsx)("div",{ref:o,className:l("flex flex-col space-Xe-1.5 p-6",e),...t}));Le.displayName="CardHeader";var Ee=Qe.forwardRef(({className:e,...t},o)=>(0,Xe.jsx)("div",{ref:o,className:l("font-semibold leading-none tracking-tight",e),...t}));Ee.displayName="CardTitle";var Zt=Qe.forwardRef(({className:e,...t},o)=>(0,Xe.jsx)("div",{ref:o,className:l("text-sm text-muted-foreground",e),...t}));Zt.displayName="CardDescription";var Pe=Qe.forwardRef(({className:e,...t},o)=>(0,Xe.jsx)("div",{ref:o,className:l("p-6 pt-0",e),...t}));Pe.displayName="CardContent";var xt=Qe.forwardRef(({className:e,...t},o)=>(0,Xe.jsx)("div",{ref:o,className:l("flex items-center p-6 pt-0",e),...t}));xt.displayName="CardFooter";var Fo=require("class-variance-authority");var Xi=(0,Fo.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,Xe.jsx)("div",{className:l(Xi({variant:t}),e),...o})}var Wo=require("lucide-react"),Go=require("date-fns");var it=require("react");function Vo({taskId:e,polling:t=!0,system:o="payload"}){let[a,n]=(0,it.useState)(null),[i,r]=(0,it.useState)(!1),[s,c]=(0,it.useState)(null),p=async(u=!0)=>{if(e){u&&r(!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();n(S)}catch(v){console.error("Error fetching task:",v),c(v instanceof Error?v:new Error("Unknown error occurred"))}finally{u&&r(!1)}}},h=()=>p(!1);return(0,it.useEffect)(()=>{e&&p(!0);let u=null;return e&&t&&(u=setInterval(h,5e3)),()=>{u&&clearInterval(u)}},[e,t]),{task:a,loading:i,error:s}}var Yi=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"}},Zi=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function $o({data:e}){let{id:t,system:o,fetchLatest:a,taskData:n,error:i}=e||{};if(!t)return null;let r=null,s=!0,c=i,p=a!==void 0?a:!0;if(r=n||{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:r,error:c}),p){let{task:S,loading:T,error:N}=Vo({taskId:t,system:o});r=S,s=T,c=N}else s=!1;let h=Yi(r?.status||"todo"),u=Zi(r?.status||"todo"),v=r?.dateLogged||new Date().toISOString();try{let S=new Date(r?.dateLogged||"");isNaN(S.getTime())||(v=(0,Go.formatDistanceToNow)(S,{addSuffix:!0}))}catch{}return(0,Xe.jsxs)(fe,{className:l("w-full max-w-md shadow-md",c&&"border border-destructive"),children:[(0,Xe.jsxs)(Le,{className:"pb-2",children:[(0,Xe.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Xe.jsx)(Ee,{className:"text-lg font-semibold",children:s?"Loading...":r?.name||"Task"}),(0,Xe.jsx)(ie,{className:`${h}`,children:u})]}),r?.project&&(0,Xe.jsxs)(Zt,{className:"text-sm text-gray-500",children:["Project: ",r.project.name]})]}),(0,Xe.jsx)(Pe,{className:"pb-2",children:s?(0,Xe.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):c?(0,Xe.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Xe.jsx)("p",{className:"text-sm text-foreground",children:r?.description||"......."})}),(0,Xe.jsx)(xt,{className:"pt-2 flex items-center justify-between",children:(0,Xe.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Xe.jsx)(Wo.Clock,{className:"h-3 w-3 mr-1"}),(0,Xe.jsxs)("span",{children:["Created ",v]}),(0,Xe.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Xe.jsxs)("span",{children:["Task #",t]})]})})]})}var qo={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"]};function eo(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function Jo({artefact:e,taskId:t,taskData:o,loading:a=!1,error:n=null}){let i=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},r=i.dateLogged;try{let s=new Date(i.dateLogged);isNaN(s.getTime())||(r=(0,Go.formatDistanceToNow)(s,{addSuffix:!0}))}catch{}return(0,Xe.jsxs)(fe,{className:"w-full max-w-md shadow-md",children:[(0,Xe.jsx)(Le,{className:"pb-2",children:(0,Xe.jsx)("div",{className:"flex justify-between items-start",children:(0,Xe.jsx)(Ee,{className:"text-lg font-semibold",children:a?"Loading...":i.name})})}),(0,Xe.jsx)(Pe,{className:"pb-2",children:a?(0,Xe.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):n?(0,Xe.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Xe.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,Xe.jsx)(xt,{className:"pt-2 flex items-center justify-between",children:(0,Xe.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Xe.jsx)(Wo.Clock,{className:"h-3 w-3 mr-1"}),(0,Xe.jsxs)("span",{children:["Created ",r]}),(0,Xe.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Xe.jsxs)("span",{children:["Task #",i.id]})]})})]})}var Ja=require("@ai-sdk/react"),Kt=require("motion/react");var Et=G(require("react")),zt=G(require("next/link"));var Qo=require("@radix-ui/react-slot"),Yo=G(require("react")),er=(0,Fo.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),R=Yo.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...n},i)=>(0,Xe.jsx)(e?Qo.Slot:"button",{className:l(er({className:t,size:o,variant:a})),ref:i,...n}));R.displayName="Button";var ea=G(require("react"));var Ct=ea.forwardRef(({className:e,type:t,...o},a)=>(0,Xe.jsx)("input",{type:t,className:l("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...o}));Ct.displayName="Input";var to=G(require("react")),be=G(require("@radix-ui/react-scroll-area"));var Te=to.forwardRef(({className:e,children:t,...o},a)=>(0,Xe.jsxs)(be.Root,{ref:a,className:l("relative overflow-hidden",e),...o,children:[(0,Xe.jsx)(be.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Xe.jsx)(oa,{}),(0,Xe.jsx)(be.Corner,{})]}));Te.displayName=be.Root.displayName;var oa=to.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,Xe.jsx)(be.ScrollAreaScrollbar,{ref:a,orientation:t,className:l("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,Xe.jsx)(be.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));oa.displayName=be.ScrollAreaScrollbar.displayName;var wt=G(require("react")),J=G(require("@radix-ui/react-dialog"));var ia=J.Root;var tr=J.Portal;var ra=wt.forwardRef(({className:e,...t},o)=>(0,Xe.jsx)(J.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}));ra.displayName=J.Overlay.displayName;var oo=wt.forwardRef(({className:e,children:t,...o},a)=>(0,Xe.jsxs)(tr,{children:[(0,Xe.jsx)(ra,{}),(0,Xe.jsxs)(J.Content,{ref:a,className:l("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-Xe-[-50%] translate-Xe-[-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,Xe.jsxs)(J.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,Xe.jsx)(Wo.Xe,{className:"h-4 w-4"}),(0,Xe.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));oo.displayName=J.Content.displayName;var ao=({className:e,...t})=>(0,Xe.jsx)("div",{className:l("flex flex-col space-Xe-1.5 text-center sm:text-left",e),...t});ao.displayName="DialogHeader";var or=({className:e,...t})=>(0,Xe.jsx)("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-Xe-2",e),...t});or.displayName="DialogFooter";var io=wt.forwardRef(({className:e,...t},o)=>(0,Xe.jsx)(J.Title,{ref:o,className:l("text-lg font-semibold leading-none tracking-tight",e),...t}));io.displayName=J.Title.displayName;var ar=wt.forwardRef(({className:e,...t},o)=>(0,Xe.jsx)(J.Description,{ref:o,className:l("text-sm text-muted-foreground",e),...t}));ar.displayName=J.Description.displayName;var Nt=G(require("@radix-ui/react-checkbox")),sa=G(require("react")),ro=sa.forwardRef(({className:e,...t},o)=>(0,Xe.jsx)(Nt.Root,{className:l("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,Xe.jsx)(Nt.Indicator,{className:l("flex items-center justify-center text-current"),children:(0,Xe.jsx)(Wo.Check,{className:"h-4 w-4"})})}));ro.displayName=Nt.Root.displayName;var De=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var ca=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Xe.jsx)(Wo.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Xe.jsx)(Wo.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Xe.jsx)(Wo.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Xe.jsx)(Wo.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,Xe.jsx)(Wo.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Xe.jsx)(Wo.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Xe.jsx)(Wo.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Xe.jsx)(Wo.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Xe.jsx)(Wo.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Xe.jsx)(Wo.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Mt=[{id:"1",name:"Xe-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 no=[{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}],St=[{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}],Bt=[{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")}],ir=[...Bt,{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")}],rr=[...Mt,{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}],At={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:[]},la={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:Bt.filter(e=>e.epicId==="1")};var hn={empty:{initialProjects:At.projects,initialEpics:At.epics,initialSprints:At.sprints,initialTasks:At.tasks},default:{initialProjects:Mt,initialEpics:no,initialSprints:St,initialTasks:Bt},highDensity:{initialProjects:Mt,initialEpics:no,initialSprints:St,initialTasks:ir},singleEpic:{initialProjects:Mt,initialEpics:la.epics,initialSprints:St,initialTasks:la.tasks},multipleProjects:{initialProjects:rr,initialEpics:no,initialSprints:St,initialTasks:Bt}},It=[{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","R","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}],yn=[{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:It.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:It.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:It.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 xn=It.filter(e=>e.type==="digital");function da(e,t){let[o,a]=(0,it.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch{return t}}),n=i=>{try{a(i),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(i))}catch{}};return(0,it.useEffect)(()=>{n(o)},[]),[o,n]}function so({items:e,isOpen:t,isMobile:o=!1,onClose:a,currentBusinessUnit:n=ca[0],onBusinessUnitChange:i,onSearch:r,className:s,logo:c="/headerlogo.png",logoLink:p="/teams",appName:h="Nuvia",tagline:u="Collaboration Platform"}){let[v,S]=Et.useState({}),[T,N]=da("sidebar-favorites",{}),[C,k]=Et.useState(null),[B,M]=Et.useState(""),I=d=>{S(z=>({...z,[d]:!z[d]}))},Y=d=>{i?.(d)},_=()=>{B.trim()&&r?.(B.trim())},ce=d=>{d.key==="Enter"&&(d.preventDefault(),_())},ae=(d,z)=>{let A=T[d]||[],pe=A.includes(z)?A.filter($=>$!==z):A.concat(z);N({...T,[d]:pe})},W=d=>{if(!d.items||!d.maxItems||d.items.length<=d.maxItems)return d.items||[];let z=T[d.id]||[],A=d.items.filter($=>z.includes($.id)),pe=d.items.filter($=>!z.includes($.id));return[...A,...pe].slice(0,d.maxItems)},K=d=>d.maxItems&&d.items&&d.items.length>d.maxItems,de=e,L=d=>{let z=K(d),A=W(d),pe=(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsxs)("div",{className:"flex items-center gap-3",children:[d.icon,(0,Xe.jsx)("span",{children:d.title})]}),d.badge&&(0,Xe.jsx)(ie,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:d.badge}),d.items&&(0,Xe.jsx)(Wo.ChevronDown,{className:l("ml-2 h-4 w-4 transition-transform",v[d.title]?"rotate-180":"")})]}),$=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,Xe.jsx)(zt.default,{href:d.url,className:$,onClick:o?a:void 0,children:pe}):(0,Xe.jsx)("button",{className:$,onClick:()=>d.items&&I(d.title),children:pe})},Fe=()=>{let d=e.find(A=>A.id===C);if(!d||!d.items||!d.maxItems)return null;let z=T[d.id]||[];return(0,Xe.jsx)(ia,{open:!!C,onOpenChange:A=>!A&&k(null),children:(0,Xe.jsxs)(oo,{className:"sm:max-w-md",children:[(0,Xe.jsxs)(ao,{children:[(0,Xe.jsxs)(io,{children:["Manage ",d.title," Favorites"]}),(0,Xe.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",d.maxItems," items to show in ",d.title.toLowerCase(),"."]})]}),(0,Xe.jsx)(Te,{className:"max-h-96 pr-4",children:(0,Xe.jsx)("div",{className:"space-Xe-4",children:d.items.map(A=>(0,Xe.jsxs)("div",{className:"flex items-center space-Xe-2",children:[(0,Xe.jsx)(ro,{id:A.id,checked:z.includes(A.id),onCheckedChange:()=>ae(d.id,A.id),disabled:!z.includes(A.id)&&z.length>=(d.maxItems||0)}),(0,Xe.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,Xe.jsx)(ie,{variant:"outline",className:"text-xs",children:A.badge})]})]},A.id))})})]})})},ye=(0,Xe.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,Xe.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Xe.jsxs)(zt.default,{href:p,className:"flex items-center gap-3",children:[(0,Xe.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,Xe.jsx)("img",{src:c,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,Xe.jsxs)("div",{children:[(0,Xe.jsx)("h2",{className:"font-semibold",children:h}),(0,Xe.jsx)("p",{className:"text-xs text-muted-foreground",children:u})]})]}),o&&(0,Xe.jsx)(R,{variant:"ghost",size:"icon",onClick:a,children:(0,Xe.jsx)(Wo.Xe,{className:"h-5 w-5"})})]}),(0,Xe.jsx)("div",{className:"px-3 py-2",children:(0,Xe.jsxs)("div",{className:"relative",children:[(0,Xe.jsx)(Wo.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Xe.jsx)(Ct,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:B,onChange:d=>M(d.target.value),onKeyPress:ce})]})}),(0,Xe.jsx)(Te,{className:"flex-1 px-3 py-2",children:(0,Xe.jsx)("div",{className:"space-Xe-1",children:de.map(d=>(0,Xe.jsxs)("div",{className:"mb-1",children:[L(d),d.items&&v[d.title]&&(0,Xe.jsxs)("div",{className:"mt-1 ml-6 space-Xe-1 border-l pl-3",children:[W(d).map(z=>(0,Xe.jsxs)(zt.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,Xe.jsx)(ie,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:z.badge})]},z.id)),K(d)&&d.items&&d.items.length>W(d).length&&(0,Xe.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-W(d).length," more available"]})]})]},d.id))})}),(0,Xe.jsx)("div",{className:"p-3",children:(0,Xe.jsx)("div",{className:"space-Xe-1",children:(0,Xe.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,Xe.jsx)(Wo.Settings,{className:"h-5 w-5"}),(0,Xe.jsx)("span",{children:"Settings"})]})})}),(0,Xe.jsx)(Fe,{})]});return o?(0,Xe.jsx)("div",{className:l("fixed inset-Xe-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-Xe-0":"-translate-Xe-full",s),children:ye}):(0,Xe.jsx)("div",{className:l("fixed inset-Xe-0 left-0 z-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-Xe-0":"-translate-Xe-full",s),children:ye})}var Ut=G(require("react")),ze=G(require("@radix-ui/react-avatar"));var rt=Ut.forwardRef(({className:e,...t},o)=>(0,Xe.jsx)(ze.Root,{ref:o,className:l("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));rt.displayName=ze.Root.displayName;var lo=Ut.forwardRef(({className:e,...t},o)=>(0,Xe.jsx)(ze.Image,{ref:o,className:l("aspect-square h-full w-full",e),...t}));lo.displayName=ze.Image.displayName;var nt=Ut.forwardRef(({className:e,...t},o)=>(0,Xe.jsx)(ze.Fallback,{ref:o,className:l("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));nt.displayName=ze.Fallback.displayName;var pa=G(require("react")),we=G(require("@radix-ui/react-tooltip"));var st=we.Provider,lt=we.Root,ct=we.Trigger,Ye=pa.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Xe.jsx)(we.Portal,{children:(0,Xe.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})}));Ye.displayName=we.Content.displayName;var ma=require("next-themes");function ua(){let{setTheme:e,theme:t}=(0,ma.useTheme)();return(0,Xe.jsx)(st,{children:(0,Xe.jsxs)(lt,{children:[(0,Xe.jsx)(ct,{asChild:!0,children:(0,Xe.jsxs)(R,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Xe.jsx)(Wo.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Xe.jsx)(Wo.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Xe.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,Xe.jsx)(Ye,{children:"Toggle theme"})]})})}function ga({notifications:e,open:t,onClose:o,onNotificationRemove:a,onRemoveAll:n,className:i}){let r=e.filter(p=>!p.read),s=r.length,c=p=>{switch(p){case"info":return(0,Xe.jsx)(Wo.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,Xe.jsx)(Wo.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,Xe.jsx)(Wo.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,Xe.jsx)(Wo.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,Xe.jsx)(Kt.AnimatePresence,{children:t&&(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(Kt.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,Xe.jsx)(Kt.motion.div,{initial:{Xe:"100%"},animate:{Xe:0},exit:{Xe:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:l("fixed inset-Xe-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",i),children:(0,Xe.jsxs)("div",{className:"flex h-full flex-col",children:[(0,Xe.jsxs)("div",{className:"flex items-center justify-between border-Xe p-4",children:[(0,Xe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Xe.jsx)(Wo.Bell,{className:"h-5 w-5"}),(0,Xe.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),s>0&&(0,Xe.jsxs)(ie,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[s," new"]})]}),(0,Xe.jsxs)(R,{variant:"ghost",size:"icon",onClick:o,className:"rounded-full",children:[(0,Xe.jsx)(Wo.Xe,{className:"h-5 w-5"}),(0,Xe.jsx)("span",{className:"sr-only",children:"Close"})]})]}),s>0&&(0,Xe.jsxs)("div",{className:"flex items-center justify-between border-Xe p-2",children:[(0,Xe.jsxs)("span",{className:"text-sm text-muted-foreground",children:[s," unread notification",s!==1?"s":""]}),(0,Xe.jsx)(R,{variant:"ghost",size:"sm",onClick:n,className:"text-sm",children:"Dismiss all"})]}),r.length>0?(0,Xe.jsx)(Te,{className:"flex-1",children:(0,Xe.jsx)("div",{className:"divide-Xe",children:r.map(p=>(0,Xe.jsxs)("div",{className:l("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Xe.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:c(p.type)}),(0,Xe.jsxs)("div",{className:"flex-1 space-Xe-1",children:[(0,Xe.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Xe.jsx)("p",{className:"font-medium",children:p.title}),(0,Xe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Xe.jsx)("p",{className:"text-xs text-muted-foreground",children:p.time}),(0,Xe.jsx)(R,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>a?.(p.id),title:"Dismiss",children:(0,Xe.jsx)(Wo.Check,{className:"h-3 w-3"})})]})]}),(0,Xe.jsx)("p",{className:"text-sm text-muted-foreground",children:p.description}),p.actionLabel&&(0,Xe.jsxs)(R,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:p.onAction,children:[p.actionLabel,(0,Xe.jsx)(Wo.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},p.id))})}):(0,Xe.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Xe.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Xe.jsx)(Wo.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,Xe.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"ho notifications"}),(0,Xe.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var Ze=G(require("@radix-ui/react-tabs"));function fa({className:e,...t}){return(0,Xe.jsx)(Ze.Root,{"data-slot":"tabs",className:l("flex flex-col gap-2",e),...t})}function ba({className:e,...t}){return(0,Xe.jsx)(Ze.List,{"data-slot":"tabs-list",className:l("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function va({className:e,...t}){return(0,Xe.jsx)(Ze.Trigger,{"data-slot":"tabs-trigger",className:l("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var Ue=G(require("react")),D=G(require("@radix-ui/react-dropdown-menu")),dt=require("@radix-ui/react-icons");var ha=D.Root,ya=D.Trigger;var nr=Ue.forwardRef(({className:e,inset:t,children:o,...a},n)=>(0,Xe.jsxs)(D.SubTrigger,{ref:n,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,Xe.jsx)(dt.ChevronRightIcon,{className:"ml-auto"})]}));nr.displayName=D.SubTrigger.displayName;var sr=Ue.forwardRef(({className:e,...t},o)=>(0,Xe.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}));sr.displayName=D.SubContent.displayName;var po=Ue.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Xe.jsx)(D.Portal,{children:(0,Xe.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})}));po.displayName=D.Content.displayName;var mo=Ue.forwardRef(({className:e,inset:t,...o},a)=>(0,Xe.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}));mo.displayName=D.Item.displayName;var lr=Ue.forwardRef(({className:e,children:t,checked:o,...a},n)=>(0,Xe.jsxs)(D.CheckboxItem,{ref:n,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,Xe.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Xe.jsx)(D.ItemIndicator,{children:(0,Xe.jsx)(dt.CheckIcon,{className:"h-4 w-4"})})}),t]}));lr.displayName=D.CheckboxItem.displayName;var cr=Ue.forwardRef(({className:e,children:t,...o},a)=>(0,Xe.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,Xe.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Xe.jsx)(D.ItemIndicator,{children:(0,Xe.jsx)(dt.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));cr.displayName=D.RadioItem.displayName;var dr=Ue.forwardRef(({className:e,inset:t,...o},a)=>(0,Xe.jsx)(D.Label,{ref:a,className:l("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));dr.displayName=D.Label.displayName;var pr=Ue.forwardRef(({className:e,...t},o)=>(0,Xe.jsx)(D.Separator,{ref:o,className:l("-mx-1 my-1 h-px bg-muted",e),...t}));pr.displayName=D.Separator.displayName;var mr=({className:e,...t})=>(0,Xe.jsx)("span",{className:l("ml-auto text-xs tracking-widest opacity-60",e),...t});mr.displayName="DropdownMenuShortcut";function Ca({activeTab:e,onTabChange:t,tabOptions:o,className:a="",maxWidth:n="700px",gridCols:i=6}){let r=o.find(s=>s.value===e);return(0,Xe.jsxs)(Kt.motion.div,{className:`flex-1 flex justify-center ${a}`,initial:{opacity:0,Xe:-20},animate:{opacity:1,Xe:0},transition:{duration:.3,ease:"easeOut"},children:[(0,Xe.jsx)("div",{className:"hidden lg:block",children:(0,Xe.jsx)(fa,{value:e,onValueChange:t,children:(0,Xe.jsx)(ba,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:n,gridTemplateColumns:`repeat(${Math.min(i,o.length)}, minmax(0, 1fr))`},children:o.map(s=>(0,Xe.jsx)(Kt.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Xe.jsx)(va,{value:s.value,onClick:()=>t?.(s.value),className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:s.label})},s.value))})})}),(0,Xe.jsx)("div",{className:"lg:hidden",children:(0,Xe.jsxs)(ha,{children:[(0,Xe.jsx)(ya,{asChild:!0,children:(0,Xe.jsxs)(R,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[r?.label||"Select",(0,Xe.jsx)(Wo.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Xe.jsx)(po,{align:"center",className:"w-[180px]",children:o.map(s=>(0,Xe.jsx)(mo,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}function wa({title:e,notifications:t=[],onToggleSidebar:o,onToggleMobileMenu:a,sidebarOpen:n=!0,className:i,activeTab:r="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:h,actionIcon:u=(0,Xe.jsx)(Wo.Bot,{className:"mr-2 h-4 w-4"}),actionText:v="Action",onNotificationRemove:S,onRemoveAll:T,logo:N="/headerlogo.png",appName:C="Nuvia",tagline:k="Collaboration Platform"}){let[B,M]=(0,it.useState)(!1),[I,Y]=(0,it.useState)(t),_=I.filter(W=>!W.read).length,ce=W=>{Y(K=>K.filter(de=>de.id!==W)),S?.(W)},ae=()=>{Y(W=>W.filter(K=>K.read)),T?.()};return(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${i||""}`,children:[(0,Xe.jsx)(R,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,Xe.jsx)(Wo.Menu,{className:"h-5 w-5"})}),(0,Xe.jsx)(R,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:o,children:(0,Xe.jsx)(Wo.PanelLeft,{className:"h-5 w-5"})}),!n&&(0,Xe.jsxs)($e.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,Xe:-20},animate:{opacity:1,Xe:0},transition:{duration:.3},children:[(0,Xe.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,Xe.jsx)("img",{src:N,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,Xe.jsxs)("div",{children:[(0,Xe.jsx)("h2",{className:"font-semibold text-sm",children:C}),(0,Xe.jsx)("p",{className:"text-xs text-muted-foreground",children:k})]})]}),(0,Xe.jsxs)("div",{className:"flex flex-1 items-center",children:[c&&(0,Xe.jsx)(Ca,{activeTab:r,onTabChange:s,tabOptions:p}),(0,Xe.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Xe.jsx)($e.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,Xe:20},animate:{opacity:1,Xe:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,Xe.jsx)($e.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Xe.jsxs)(R,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:h,children:[u,v]})})}),(0,Xe.jsx)(ua,{}),(0,Xe.jsx)(st,{children:(0,Xe.jsxs)(lt,{children:[(0,Xe.jsx)(ct,{asChild:!0,children:(0,Xe.jsx)($e.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Xe.jsxs)(R,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>M(!0),children:[(0,Xe.jsx)($e.motion.div,{animate:_>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:_>0?1/0:0,repeatDelay:3},children:(0,Xe.jsx)(Wo.Bell,{className:"h-5 w-5"})}),_>0&&(0,Xe.jsx)($e.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:_})]})})}),(0,Xe.jsx)(Ye,{children:"Notifications"})]})}),(0,Xe.jsx)($e.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Xe.jsxs)(rt,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Xe.jsx)(lo,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Xe.jsx)(nt,{})]})})]})]})]}),(0,Xe.jsx)(ga,{notifications:I,open:B,onClose:()=>M(!1),onNotificationRemove:ce,onRemoveAll:ae})]})}var Na=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Xe.jsx)(Wo.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Pa({sidebarItems:e,children:t,title:o="Digital Colleagues",notifications:a=[],currentBusinessUnit:n=Na[0],onBusinessUnitChange:i,onSearch:r,businessUnits:s=Na,activeTab:c,onTabChange:p,showTabs:h=!1,onActionClick:u,actionIcon:v,actionText:S="Action",onNotificationRemove:T,onRemoveAll:N,logo:C="/headerlogo.png",appName:k="Nuvia",tagline:B="Collaboration Platform",sidebarInitiallyClosed:M=!1}){let[I,Y]=(0,it.useState)(!M),[_,ce]=(0,it.useState)(!1),[ae,W]=(0,it.useState)(n),K=de=>{W(de),i?.(de)};return(0,Xe.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[_&&(0,Xe.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>ce(!1)}),(0,Xe.jsx)("div",{className:"md:hidden",children:(0,Xe.jsx)(so,{items:e,isOpen:_,isMobile:!0,onClose:()=>ce(!1),currentBusinessUnit:ae,onBusinessUnitChange:K,onSearch:r,logo:C,appName:k,tagline:B})}),(0,Xe.jsx)("div",{className:"hidden md:block",children:(0,Xe.jsx)(so,{items:e,isOpen:I,isMobile:!1,currentBusinessUnit:ae,onBusinessUnitChange:K,onSearch:r,logo:C,appName:k,tagline:B})}),(0,Xe.jsxs)("div",{className:l("min-h-screen fixed w-full transition-all duration-300 ease-in-out",I?"md:pl-64":"md:pl-0"),children:[(0,Xe.jsx)(wa,{title:o,notifications:a,onToggleSidebar:()=>Y(!I),onToggleMobileMenu:()=>ce(!0),sidebarOpen:I,activeTab:c,onTabChange:p,showTabs:h,onActionClick:u,actionIcon:v,actionText:S,onNotificationRemove:T,onRemoveAll:N,logo:C,appName:k,tagline:B}),(0,Xe.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}function Ta({sessions:e,currentSession:t,teams:o,onNewChat:a,onSessionSelect:n,onSessionEdit:i,onSessionDelete:r,className:s}){return(0,Xe.jsx)(st,{children:(0,Xe.jsx)("div",{className:`space-Xe-4 h-full ${s||""}`,children:(0,Xe.jsxs)(fe,{className:"shadow-sm h-full",children:[(0,Xe.jsx)("div",{className:"p-4 border-Xe",children:(0,Xe.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Xe.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,Xe.jsx)(Wo.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,Xe.jsxs)(R,{onClick:a,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,Xe.jsx)(Wo.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,Xe.jsx)(Te,{className:"h-[600px]",children:(0,Xe.jsx)("div",{className:"p-2",children:e.length===0?(0,Xe.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"ho chat sessions yet"}):e.map(c=>(0,Xe.jsxs)(lt,{children:[(0,Xe.jsx)(ct,{asChild:!0,children:(0,Xe.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:()=>n(c),children:(0,Xe.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,Xe.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,Xe.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:c.title}),(0,Xe.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:c.lastMessage})]}),(0,Xe.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[i&&(0,Xe.jsx)(R,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:p=>{p.stopPropagation(),i(c.id)},children:(0,Xe.jsx)(Wo.Edit3,{className:"h-3 w-3"})}),r&&(0,Xe.jsx)(R,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:p=>{p.stopPropagation(),r(c.id)},children:(0,Xe.jsx)(Wo.Trash2,{className:"h-3 w-3"})})]})]})})}),(0,Xe.jsx)(Ye,{side:"right",className:"max-w-xs",children:(0,Xe.jsxs)("div",{className:"space-Xe-1",children:[(0,Xe.jsx)("p",{className:"font-medium text-sm",children:c.title}),(0,Xe.jsx)("p",{className:"text-xs",children:c.lastMessage})]})})]},c.id))})})]})})})}var gt=G(require("motion/react-client"));function Da({capabilities:e,isOpen:t,onToggle:o,onActionSelect:a,onContextChange:n,colorScheme:i=qo,className:r}){let[s,c]=(0,it.useState)([]),[p,h]=(0,it.useState)([]),u=s[s.length-1],v=u?.children||e,S=(M,I)=>{switch(M.type){case"category":return i.categories[I%i.categories.length];case"list":return i.lists[I%i.lists.length];case"item":return i.items[I%i.items.length];default:return i.primary}},T=(0,it.useMemo)(()=>({path:s,selectedItems:p,filters:{}}),[s,p]);(0,it.useEffect)(()=>{n&&n(T)},[T,n]);let N=M=>{M.type==="category"||M.type==="list"?c([...s,M]):M.type==="item"&&h([...p,M])},C=()=>{c(s.slice(0,-1))},k=M=>{c(s.slice(0,M+1))},B=()=>u?.actions?u.actions:[];return t?(0,Xe.jsxs)("div",{className:l("w-full",r),children:[(0,Xe.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Xe.jsxs)("div",{className:"flex items-center gap-2",children:[s.length>0&&(0,Xe.jsx)(Kt.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 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Xe.jsx)(Wo.ChevronLeft,{className:l("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-Xe-0.5")})}),(0,Xe.jsx)("h4",{className:"font-medium text-sm",children:u?.name||"Capabilities"})]}),(0,Xe.jsx)(Kt.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 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Xe.jsx)(Wo.Xe,{className:l("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),s.length>0&&(0,Xe.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,Xe.jsx)(Kt.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,Xe.jsxs)("span",{className:"relative",children:["Capabilities",(0,Xe.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-Xe-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),s.map((M,I)=>(0,Xe.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Xe.jsx)(Wo.ChevronRight,{className:"h-2 w-2"}),(0,Xe.jsx)(Kt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>k(I),className:l("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Xe.jsxs)("span",{className:"relative",children:[M.name,(0,Xe.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-Xe-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},M.id))]}),(0,Xe.jsx)("div",{className:"max-h-40 overflow-Xe-auto",children:(0,Xe.jsx)(Kt.AnimatePresence,{mode:"wait",children:(0,Xe.jsx)(Kt.motion.div,{initial:{opacity:0,Xe:-4},animate:{opacity:1,Xe:0},exit:{opacity:0,Xe:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:u?.type==="list"&&u.data?(0,Xe.jsx)(fr,{data:u.data,onItemSelect:M=>h([...p,M]),colorScheme:i}):(0,Xe.jsx)(ur,{capabilities:v,onSelect:N,colorScheme:i})},u?.id||"root")})})]}):(0,Xe.jsxs)(R,{onClick:o,size:"sm",variant:"outline",className:"rounded-full",children:[(0,Xe.jsx)(Wo.Menu,{className:"h-4 w-4"}),(0,Xe.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function ur({capabilities:e,onSelect:t,colorScheme:o}){return(0,Xe.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,n)=>(0,Xe.jsx)(gr,{capability:a,onClick:()=>t(a),color:o.categories[n%o.categories.length]},a.id))})}function gr({capability:e,onClick:t,selected:o,color:a}){return(0,Xe.jsxs)(Kt.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,Xe.jsx)("div",{className:l("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a)}),(0,Xe.jsxs)("span",{className:"truncate relative",children:[e.name,(0,Xe.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-Xe-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,Xe.jsx)(Wo.ChevronRight,{className:l("h-3 w-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-Xe-0.5")}),e.type==="list"&&e.data&&(0,Xe.jsx)(ie,{variant:"secondary",className:l("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function fr({data:e,onItemSelect:t,colorScheme:o}){return(0,Xe.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,n)=>(0,Xe.jsxs)(Kt.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,Xe.jsx)("div",{className:l("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o.items[n%o.items.length])}),(0,Xe.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Xe.jsxs)("span",{className:"truncate relative font-medium",children:[a.title,(0,Xe.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-Xe-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),a.subtitle&&(0,Xe.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,Xe.jsx)(ie,{variant:"secondary",className:l("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:a.value})]},a.id))})}var Sa=G(require("react"));var Ra=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:a,description:n="This endpoint requires authentication to sync functions."})=>{let[i,r]=(0,it.useState)(!1),[s,c]=(0,it.useState)(""),p=()=>{if(!t){c("ho authentication URL provided");return}r(!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."),r(!1);return}let v=setInterval(()=>{try{u.closed&&(clearInterval(v),r(!1),a(),o())}catch{}},1e3);setTimeout(()=>{u.closed||(u.close(),clearInterval(v),r(!1),c("Authentication timed out. Please try again."))},6e5)}catch{c("Failed to open authentication window"),r(!1)}},h=async()=>{try{await navigator.clipboard.writeText(t),c("")}catch{c("Failed to copy URL to clipboard")}};return e?(0,Xe.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,Xe.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,Xe.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,Xe.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:n}),s&&(0,Xe.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:s}),(0,Xe.jsxs)("div",{className:"flex gap-2",children:[(0,Xe.jsx)("button",{onClick:p,disabled:i||!t,className:`
|
|
7
|
+
"use strict";var gi=Object.create;var Nt=Object.defineProperty;var fi=Object.getOwnPropertyDescriptor;var bi=Object.getOwnPropertyNames;var vi=Object.getPrototypeOf,hi=Object.prototype.hasOwnProperty;var yi=(e,t)=>{for(var o in t)Nt(e,o,{get:t[o],enumerable:!0})},To=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of bi(t))!hi.call(e,n)&&n!==o&&Nt(e,n,{get:()=>t[n],enumerable:!(a=fi(t,n))||a.enumerable});return e};var V=(e,t,o)=>(o=e!=null?gi(vi(e)):{},To(t||!e||!e.__esModule?Nt(o,"default",{value:e,enumerable:!0}):o,e)),xi=e=>To(Nt({},"__esModule",{value:!0}),e);var Ar={};yi(Ar,{ExampleChatInterface:()=>Sr});module.exports=xi(Ar);var Je=V(require("react"));var Eo=require("clsx");var $t="-",Ci=e=>{let t=Ni(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{let s=i.split($t);return s[0]===""&&s.length!==1&&s.shift(),So(s,t)||wi(i)},getConflictingClassGroupIds:(i,s)=>{let c=o[i]||[];return s&&a[i]?[...c,...a[i]]:c}}},So=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),n=a?So(e.slice(1),a):void 0;if(n)return n;if(t.validators.length===0)return;let r=e.join($t);return t.validators.find(({validator:i})=>i(r))?.classGroupId},Ro=/^\[(.+)\]$/,wi=e=>{if(Ro.test(e)){let t=Ro.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Ni=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return Pi(Object.entries(e.classGroups),o).forEach(([r,i])=>{qt(i,a,r,t)}),a},qt=(e,t,o,a)=>{e.forEach(n=>{if(typeof n=="string"){let r=n===""?t:Do(t,n);r.classGroupId=o;return}if(typeof n=="function"){if(ki(n)){qt(n(a),t,o,a);return}t.validators.push({validator:n,classGroupId:o});return}Object.entries(n).forEach(([r,i])=>{qt(i,Do(t,r),o,a)})})},Do=(e,t)=>{let o=e;return t.split($t).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},ki=e=>e.isThemeGetter,Pi=(e,t)=>t?e.map(([o,a])=>{let n=a.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([i,s])=>[t+i,s])):r);return[o,n]}):e,Ti=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,n=(r,i)=>{o.set(r,i),t++,t>e&&(t=0,a=o,o=new Map)};return{get(r){let i=o.get(r);if(i!==void 0)return i;if((i=a.get(r))!==void 0)return n(r,i),i},set(r,i){o.has(r)?o.set(r,i):n(r,i)}}},Ao="!",Ri=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,n=t[0],r=t.length,i=s=>{let c=[],m=0,b=0,v;for(let x=0;x<s.length;x++){let N=s[x];if(m===0){if(N===n&&(a||s.slice(x,x+r)===t)){c.push(s.slice(b,x)),b=x+r;continue}if(N==="/"){v=x;continue}}N==="["?m++:N==="]"&&m--}let f=c.length===0?s:s.substring(b),S=f.startsWith(Ao),R=S?f.substring(1):f,w=v&&v>b?v-b:void 0;return{modifiers:c,hasImportantModifier:S,baseClassName:R,maybePostfixModifierPosition:w}};return o?s=>o({className:s,parseClassName:i}):i},Di=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},Si=e=>({cache:Ti(e.cacheSize),parseClassName:Ri(e),...Ci(e)}),Ai=/\s+/,Ii=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:n}=t,r=[],i=e.trim().split(Ai),s="";for(let c=i.length-1;c>=0;c-=1){let m=i[c],{modifiers:b,hasImportantModifier:v,baseClassName:f,maybePostfixModifierPosition:S}=o(m),R=!!S,w=a(R?f.substring(0,S):f);if(!w){if(!R){s=m+(s.length>0?" "+s:s);continue}if(w=a(f),!w){s=m+(s.length>0?" "+s:s);continue}R=!1}let x=Di(b).join(":"),N=v?x+Ao:x,M=N+w;if(r.includes(M))continue;r.push(M);let K=n(w,R);for(let F=0;F<K.length;++F){let Y=K[F];r.push(N+Y)}s=m+(s.length>0?" "+s:s)}return s};function Mi(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Io(t))&&(a&&(a+=" "),a+=o);return a}var Io=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=Io(e[a]))&&(o&&(o+=" "),o+=t);return o};function Bi(e,...t){let o,a,n,r=i;function i(c){let m=t.reduce((b,v)=>v(b),e());return o=Si(m),a=o.cache.get,n=o.cache.set,r=s,s(c)}function s(c){let m=a(c);if(m)return m;let b=Ii(c,o);return n(c,b),b}return function(){return r(Mi.apply(null,arguments))}}var j=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Mo=/^\[(?:([a-Qe-]+):)?(.+)\]$/i,Li=/^\d+\/\d+$/,Ei=new Set(["px","full","screen"]),zi=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ui=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|Qe|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Hi=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ji=/^(inset_)?-?((\d+)?\.?(\d+)[a-Qe]+|0)Qe-?((\d+)?\.?(\d+)[a-Qe]+|0)/,Fi=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Me=e=>et(e)||Ei.has(e)||Li.test(e),He=e=>tt(e,"length",Ki),et=e=>!!e&&!Number.isNaN(Number(e)),Gt=e=>tt(e,"number",et),ut=e=>!!e&&Number.isInteger(Number(e)),Oi=e=>e.endsWith("%")&&et(e.slice(0,-1)),y=e=>Mo.test(e),je=e=>zi.test(e),Vi=new Set(["length","size","percentage"]),Wi=e=>tt(e,Vi,Bo),Gi=e=>tt(e,"position",Bo),qi=new Set(["image","url"]),$i=e=>tt(e,qi,Qi),_i=e=>tt(e,"",Ji),gt=()=>!0,tt=(e,t,o)=>{let a=Mo.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Ki=e=>Ui.test(e)&&!Hi.test(e),Bo=()=>!1,Ji=e=>ji.test(e),Qi=e=>Fi.test(e);var Xi=()=>{let e=j("colors"),t=j("spacing"),o=j("blur"),a=j("brightness"),n=j("borderColor"),r=j("borderRadius"),i=j("borderSpacing"),s=j("borderWidth"),c=j("contrast"),m=j("grayscale"),b=j("hueRotate"),v=j("invert"),f=j("gap"),S=j("gradientColorStops"),R=j("gradientColorStopPositions"),w=j("inset"),x=j("margin"),N=j("opacity"),M=j("padding"),K=j("saturate"),F=j("scale"),Y=j("sepia"),q=j("skew"),le=j("space"),oe=j("translate"),O=()=>["auto","contain","none"],J=()=>["auto","hidden","clip","visible","scroll"],ce=()=>["auto",y,t],A=()=>[y,t],Ke=()=>["",Me,He],ke=()=>["auto",et,y],d=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>["start","end","center","between","around","evenly","stretch"],W=()=>["","0",y],g=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[et,y];return{cacheSize:500,separator:":",theme:{colors:[gt],spacing:[Me,He],blur:["none","",je,y],brightness:L(),borderColor:[e],borderRadius:["none","","full",je,y],borderSpacing:A(),borderWidth:Ke(),contrast:L(),grayscale:W(),hueRotate:L(),invert:W(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[Oi,He],inset:ce(),margin:ce(),opacity:L(),padding:A(),saturate:L(),scale:L(),sepia:W(),skew:L(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",y]}],container:["container"],columns:[{columns:[je]}],"break-after":[{"break-after":g()}],"break-before":[{"break-before":g()}],"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(),y]}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],Qe:[{Qe:["auto",ut,y]}],basis:[{basis:ce()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",y]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",ut,y]}],"grid-cols":[{"grid-cols":[gt]}],"col-start-end":[{col:["auto",{span:["full",ut,y]},y]}],"col-start":[{"col-start":ke()}],"col-end":[{"col-end":ke()}],"grid-rows":[{"grid-rows":[gt]}],"row-start-end":[{row:["auto",{span:[ut,y]},y]}],"row-start":[{"row-start":ke()}],"row-end":[{"row-end":ke()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",y]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",y]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...de()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...de(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...de(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],Qe:[{Qe:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],pe:[{pe:[M]}],pt:[{pt:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],ot:[{ot:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[le]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[le]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",y,t]}],"min-w":[{"min-w":[y,t,"min","max","fit"]}],"max-w":[{"max-w":[y,t,"none","full","min","max","fit","prose",{screen:[je]},je]}],Qe:[{Qe:[y,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-Qe":[{"min-Qe":[y,t,"min","max","fit","svh","lvh","dvh"]}],"max-Qe":[{"max-Qe":[y,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[y,t,"auto","min","max","fit"]}],"font-size":[{text:["base",je,He]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Gt]}],"font-family":[{font:[gt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",y]}],"line-clamp":[{"line-clamp":["none",et,Gt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Me,y]}],"list-image":[{"list-image":["none",y]}],"list-style-type":[{list:["none","disc","decimal",y]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[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:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Me,He]}],"underline-offset":[{"underline-offset":["auto",Me,y]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",y]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...d(),Gi]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Wi]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},$i]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[R]}],"gradient-via-pos":[{via:[R]}],"gradient-to-pos":[{to:[R]}],"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-ot":[{"rounded-ot":[r]}],"rounded-Qe":[{"rounded-Qe":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...B(),"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":[N]}],"divide-style":[{divide:B()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-s":[{"border-s":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[Me,y]}],"outline-w":[{outline:[Me,He]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ke()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[Me,He]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",je,_i]}],"shadow-color":[{shadow:[gt]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",je,y]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[b]}],invert:[{invert:[v]}],saturate:[{saturate:[K]}],sepia:[{sepia:[Y]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[b]}],"backdrop-invert":[{"backdrop-invert":[v]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[K]}],"backdrop-sepia":[{"backdrop-sepia":[Y]}],"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",y]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",y]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[F]}],"scale-x":[{"scale-x":[F]}],"scale-y":[{"scale-y":[F]}],rotate:[{rotate:[ut,y]}],"translate-x":[{"translate-x":[oe]}],"translate-y":[{"translate-y":[oe]}],"skew-x":[{"skew-x":[q]}],"skew-y":[{"skew-y":[q]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",y]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","jo-resize","nw-resize","ot-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",y]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-ot":[{"scroll-ot":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-Qe":[{"scroll-Qe":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",y]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Me,He,Gt]}],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"],Qe:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","ot","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","Qe"],"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-ot","rounded-Qe","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-ot","rounded-Qe"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-ot","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-Qe":["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 Lo=Bi(Xi);function l(...e){return Lo((0,Eo.clsx)(e))}var Qe=require("react/jsx-runtime"),fe=Je.forwardRef(({className:e,...t},o)=>(0,Qe.jsx)("div",{ref:o,className:l("rounded-xl border bg-card text-card-foreground shadow",e),...t}));fe.displayName="Card";var Be=Je.forwardRef(({className:e,...t},o)=>(0,Qe.jsx)("div",{ref:o,className:l("flex flex-col space-y-1.5 Qe-6",e),...t}));Be.displayName="CardHeader";var Le=Je.forwardRef(({className:e,...t},o)=>(0,Qe.jsx)("div",{ref:o,className:l("font-semibold leading-none tracking-tight",e),...t}));Le.displayName="CardTitle";var _t=Je.forwardRef(({className:e,...t},o)=>(0,Qe.jsx)("div",{ref:o,className:l("text-sm text-muted-foreground",e),...t}));_t.displayName="CardDescription";var Pe=Je.forwardRef(({className:e,...t},o)=>(0,Qe.jsx)("div",{ref:o,className:l("Qe-6 pt-0",e),...t}));Pe.displayName="CardContent";var ft=Je.forwardRef(({className:e,...t},o)=>(0,Qe.jsx)("div",{ref:o,className:l("flex items-center Qe-6 pt-0",e),...t}));ft.displayName="CardFooter";var zo=require("class-variance-authority");var Yi=(0,zo.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 be({className:e,variant:t,...o}){return(0,Qe.jsx)("div",{className:l(Yi({variant:t}),e),...o})}var jo=require("lucide-react"),Fo=require("date-fns");var ot=require("react");function Ho({taskId:e,polling:t=!0,system:o="payload"}){let[a,n]=(0,ot.useState)(null),[r,i]=(0,ot.useState)(!1),[s,c]=(0,ot.useState)(null),m=async(v=!0)=>{if(e){v&&i(!0);try{let f=await fetch(`/api/tasks/${e}`);if(!f.ok)throw new Error(`Failed to fetch task: ${f.statusText}`);let S=await f.json();n(S)}catch(f){console.error("Error fetching task:",f),c(f instanceof Error?f:new Error("Unknown error occurred"))}finally{v&&i(!1)}}},b=()=>m(!1);return(0,ot.useEffect)(()=>{e&&m(!0);let v=null;return e&&t&&(v=setInterval(b,5e3)),()=>{v&&clearInterval(v)}},[e,t]),{task:a,loading:r,error:s}}var Zi=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"}},er=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Oo({data:e}){let{id:t,system:o,fetchLatest:a,taskData:n,error:r}=e||{};if(!t)return null;let i=null,s=!0,c=r,m=a!==void 0?a:!0;if(i=n||{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:m,taskData:i,error:c}),m){let{task:S,loading:R,error:w}=Ho({taskId:t,system:o});i=S,s=R,c=w}else s=!1;let b=Zi(i?.status||"todo"),v=er(i?.status||"todo"),f=i?.dateLogged||new Date().toISOString();try{let S=new Date(i?.dateLogged||"");isNaN(S.getTime())||(f=(0,Fo.formatDistanceToNow)(S,{addSuffix:!0}))}catch{}return(0,Qe.jsxs)(fe,{className:l("w-full max-w-md shadow-md",c&&"border border-destructive"),children:[(0,Qe.jsxs)(Be,{className:"pb-2",children:[(0,Qe.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Qe.jsx)(Le,{className:"text-lg font-semibold",children:s?"Loading...":i?.name||"Task"}),(0,Qe.jsx)(be,{className:`${b}`,children:v})]}),i?.project&&(0,Qe.jsxs)(_t,{className:"text-sm text-gray-500",children:["Project: ",i.project.name]})]}),(0,Qe.jsx)(Pe,{className:"pb-2",children:s?(0,Qe.jsx)("div",{className:"animate-pulse Qe-4 bg-gray-200 rounded w-3/4 mb-2"}):c?(0,Qe.jsx)("Qe",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Qe.jsx)("Qe",{className:"text-sm text-foreground",children:i?.description||"......."})}),(0,Qe.jsx)(ft,{className:"pt-2 flex items-center justify-between",children:(0,Qe.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Qe.jsx)(jo.Clock,{className:"Qe-3 w-3 mr-1"}),(0,Qe.jsxs)("span",{children:["Created ",f]}),(0,Qe.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Qe.jsxs)("span",{children:["Task #",t]})]})})]})}function Kt(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function Go({artefact:e,taskId:t,taskData:o,loading:a=!1,error:n=null}){let r=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},i=r.dateLogged;try{let s=new Date(r.dateLogged);isNaN(s.getTime())||(i=(0,Fo.formatDistanceToNow)(s,{addSuffix:!0}))}catch{}return(0,Qe.jsxs)(fe,{className:"w-full max-w-md shadow-md",children:[(0,Qe.jsx)(Be,{className:"pb-2",children:(0,Qe.jsx)("div",{className:"flex justify-between items-start",children:(0,Qe.jsx)(Le,{className:"text-lg font-semibold",children:a?"Loading...":r.name})})}),(0,Qe.jsx)(Pe,{className:"pb-2",children:a?(0,Qe.jsx)("div",{className:"animate-pulse Qe-4 bg-gray-200 rounded w-3/4 mb-2"}):n?(0,Qe.jsx)("Qe",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Qe.jsx)("Qe",{className:"text-sm text-foreground",children:e})}),(0,Qe.jsx)(ft,{className:"pt-2 flex items-center justify-between",children:(0,Qe.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Qe.jsx)(jo.Clock,{className:"Qe-3 w-3 mr-1"}),(0,Qe.jsxs)("span",{children:["Created ",i]}),(0,Qe.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Qe.jsxs)("span",{children:["Task #",r.id]})]})})]})}var Qa=require("@ai-sdk/react"),Vt=require("motion/react");var It=V(require("react")),Mt=V(require("next/link"));var qo=require("@radix-ui/react-slot"),_o=V(require("react")),tr=(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:"Qe-10 px-4 py-2",icon:"Qe-10 w-10",lg:"Qe-11 rounded px-8",sm:"Qe-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"}}}),P=_o.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...n},r)=>(0,Qe.jsx)(e?qo.Slot:"button",{className:l(tr({className:t,size:o,variant:a})),ref:r,...n}));P.displayName="Button";var Jo=V(require("react"));var bt=Jo.forwardRef(({className:e,type:t,...o},a)=>(0,Qe.jsx)("input",{type:t,className:l("flex Qe-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}));bt.displayName="Input";var Jt=V(require("react")),ve=V(require("@radix-ui/react-scroll-area"));var Oe=Jt.forwardRef(({className:e,children:t,...o},a)=>(0,Qe.jsxs)(ve.Root,{ref:a,className:l("relative overflow-hidden",e),...o,children:[(0,Qe.jsx)(ve.Viewport,{className:"Qe-full w-full rounded-[inherit]",children:t}),(0,Qe.jsx)(Xo,{}),(0,Qe.jsx)(ve.Corner,{})]}));Oe.displayName=ve.Root.displayName;var Xo=Jt.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,Qe.jsx)(ve.ScrollAreaScrollbar,{ref:a,orientation:t,className:l("flex touch-none select-none transition-colors",t==="vertical"&&"Qe-full w-2.5 border-l border-l-transparent Qe-[1px]",t==="horizontal"&&"Qe-2.5 flex-col border-t border-t-transparent Qe-[1px]",e),...o,children:(0,Qe.jsx)(ve.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Xo.displayName=ve.ScrollAreaScrollbar.displayName;var vt=V(require("react")),$=V(require("@radix-ui/react-dialog"));var Zo=$.Root;var or=$.Portal;var ea=vt.forwardRef(({className:e,...t},o)=>(0,Qe.jsx)($.Overlay,{ref:o,className:l("fixed inset-0 Qe-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}));ea.displayName=$.Overlay.displayName;var Qt=vt.forwardRef(({className:e,children:t,...o},a)=>(0,Qe.jsxs)(or,{children:[(0,Qe.jsx)(ea,{}),(0,Qe.jsxs)($.Content,{ref:a,className:l("fixed left-[50%] top-[50%] Qe-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background Qe-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,Qe.jsxs)($.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,Qe.jsx)(jo.Qe,{className:"Qe-4 w-4"}),(0,Qe.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Qt.displayName=$.Content.displayName;var Xt=({className:e,...t})=>(0,Qe.jsx)("div",{className:l("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Xt.displayName="DialogHeader";var ar=({className:e,...t})=>(0,Qe.jsx)("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ar.displayName="DialogFooter";var Yt=vt.forwardRef(({className:e,...t},o)=>(0,Qe.jsx)($.Title,{ref:o,className:l("text-lg font-semibold leading-none tracking-tight",e),...t}));Yt.displayName=$.Title.displayName;var ir=vt.forwardRef(({className:e,...t},o)=>(0,Qe.jsx)($.Description,{ref:o,className:l("text-sm text-muted-foreground",e),...t}));ir.displayName=$.Description.displayName;var ht=V(require("@radix-ui/react-checkbox")),oa=V(require("react")),Zt=oa.forwardRef(({className:e,...t},o)=>(0,Qe.jsx)(ht.Root,{className:l("peer Qe-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,Qe.jsx)(ht.Indicator,{className:l("flex items-center justify-center text-current"),children:(0,Qe.jsx)(jo.Check,{className:"Qe-4 w-4"})})}));Zt.displayName=ht.Root.displayName;var Te=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var ia=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Qe.jsx)(jo.Palette,{className:"Qe-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Qe.jsx)(jo.Code,{className:"Qe-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Qe.jsx)(jo.TrendingUp,{className:"Qe-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Qe.jsx)(jo.DollarSign,{className:"Qe-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,Qe.jsx)(jo.Users,{className:"Qe-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Qe.jsx)(jo.Wrench,{className:"Qe-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Qe.jsx)(jo.Scale,{className:"Qe-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Qe.jsx)(jo.Package,{className:"Qe-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Qe.jsx)(jo.Zap,{className:"Qe-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Qe.jsx)(jo.Building2,{className:"Qe-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Rt=[{id:"1",name:"jo-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 eo=[{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}],Pt=[{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}],St=[{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")}],rr=[...St,{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")}],nr=[...Rt,{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}],Tt={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:[]},aa={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:St.filter(e=>e.epicId==="1")};var hn={empty:{initialProjects:Tt.projects,initialEpics:Tt.epics,initialSprints:Tt.sprints,initialTasks:Tt.tasks},default:{initialProjects:Rt,initialEpics:eo,initialSprints:Pt,initialTasks:St},highDensity:{initialProjects:Rt,initialEpics:eo,initialSprints:Pt,initialTasks:rr},singleEpic:{initialProjects:Rt,initialEpics:aa.epics,initialSprints:Pt,initialTasks:aa.tasks},multipleProjects:{initialProjects:nr,initialEpics:eo,initialSprints:Pt,initialTasks:St}},Dt=[{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(Te),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Te),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(Te),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Te),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(Te),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Te),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(Te),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Te),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(Te),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Te),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],yn=[{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:Dt.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:Dt.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:Dt.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 xn=Dt.filter(e=>e.type==="digital");function ra(e,t){let[o,a]=(0,ot.useState)(()=>{if(typeof window>"Qe")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),n=r=>{try{a(r),typeof window<"Qe"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,ot.useEffect)(()=>{n(o)},[]),[o,n]}function to({items:e,isOpen:t,isMobile:o=!1,onClose:a,currentBusinessUnit:n=ia[0],onBusinessUnitChange:r,onSearch:i,className:s,logo:c="/headerlogo.png",logoLink:m="/teams",appName:b="Nuvia",tagline:v="Collaboration Platform"}){let[f,S]=It.useState({}),[R,w]=ra("sidebar-favorites",{}),[x,N]=It.useState(null),[M,K]=It.useState(""),F=d=>{S(B=>({...B,[d]:!B[d]}))},Y=d=>{r?.(d)},q=()=>{M.trim()&&i?.(M.trim())},le=d=>{d.key==="Enter"&&(d.preventDefault(),q())},oe=(d,B)=>{let D=R[d]||[],de=D.includes(B)?D.filter(W=>W!==B):D.concat(B);w({...R,[d]:de})},O=d=>{if(!d.items||!d.maxItems||d.items.length<=d.maxItems)return d.items||[];let B=R[d.id]||[],D=d.items.filter(W=>B.includes(W.id)),de=d.items.filter(W=>!B.includes(W.id));return[...D,...de].slice(0,d.maxItems)},J=d=>d.maxItems&&d.items&&d.items.length>d.maxItems,ce=e,A=d=>{let B=J(d),D=O(d),de=(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)("div",{className:"flex items-center gap-3",children:[d.icon,(0,Qe.jsx)("span",{children:d.title})]}),d.badge&&(0,Qe.jsx)(be,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:d.badge}),d.items&&(0,Qe.jsx)(jo.ChevronDown,{className:l("ml-2 Qe-4 w-4 transition-transform",f[d.title]?"rotate-180":"")})]}),W=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,Qe.jsx)(Mt.default,{href:d.url,className:W,onClick:o?a:void 0,children:de}):(0,Qe.jsx)("button",{className:W,onClick:()=>d.items&&F(d.title),children:de})},Ke=()=>{let d=e.find(D=>D.id===x);if(!d||!d.items||!d.maxItems)return null;let B=R[d.id]||[];return(0,Qe.jsx)(Zo,{open:!!x,onOpenChange:D=>!D&&N(null),children:(0,Qe.jsxs)(Qt,{className:"sm:max-w-md",children:[(0,Qe.jsxs)(Xt,{children:[(0,Qe.jsxs)(Yt,{children:["Manage ",d.title," Favorites"]}),(0,Qe.jsxs)("Qe",{className:"text-sm text-muted-foreground",children:["Select up to ",d.maxItems," items to show in ",d.title.toLowerCase(),"."]})]}),(0,Qe.jsx)(Oe,{className:"max-Qe-96 pr-4",children:(0,Qe.jsx)("div",{className:"space-y-4",children:d.items.map(D=>(0,Qe.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qe.jsx)(Zt,{id:D.id,checked:B.includes(D.id),onCheckedChange:()=>oe(d.id,D.id),disabled:!B.includes(D.id)&&B.length>=(d.maxItems||0)}),(0,Qe.jsxs)("label",{htmlFor:D.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:[D.title,D.badge&&(0,Qe.jsx)(be,{variant:"outline",className:"text-xs",children:D.badge})]})]},D.id))})})]})})},ke=(0,Qe.jsxs)("div",{className:"flex Qe-full flex-col bg-background",children:[(0,Qe.jsxs)("div",{className:"flex items-center justify-between Qe-4",children:[(0,Qe.jsxs)(Mt.default,{href:m,className:"flex items-center gap-3",children:[(0,Qe.jsx)("div",{className:"flex Qe-14 w-14 items-center justify-center",children:(0,Qe.jsx)("img",{src:c,alt:"Header Logo",className:"Qe-14 w-14 object-contain"})}),(0,Qe.jsxs)("div",{children:[(0,Qe.jsx)("h2",{className:"font-semibold",children:b}),(0,Qe.jsx)("Qe",{className:"text-xs text-muted-foreground",children:v})]})]}),o&&(0,Qe.jsx)(P,{variant:"ghost",size:"icon",onClick:a,children:(0,Qe.jsx)(jo.Qe,{className:"Qe-5 w-5"})})]}),(0,Qe.jsx)("div",{className:"px-3 py-2",children:(0,Qe.jsxs)("div",{className:"relative",children:[(0,Qe.jsx)(jo.Search,{className:"absolute left-3 top-3 Qe-4 w-4 text-muted-foreground"}),(0,Qe.jsx)(bt,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:M,onChange:d=>K(d.target.value),onKeyPress:le})]})}),(0,Qe.jsx)(Oe,{className:"flex-1 px-3 py-2",children:(0,Qe.jsx)("div",{className:"space-y-1",children:ce.map(d=>(0,Qe.jsxs)("div",{className:"mb-1",children:[A(d),d.items&&f[d.title]&&(0,Qe.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[O(d).map(B=>(0,Qe.jsxs)(Mt.default,{href:B.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:o?a:void 0,children:[B.title,B.badge&&(0,Qe.jsx)(be,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:B.badge})]},B.id)),J(d)&&d.items&&d.items.length>O(d).length&&(0,Qe.jsxs)("button",{onClick:()=>N(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-O(d).length," more available"]})]})]},d.id))})}),(0,Qe.jsx)("div",{className:"Qe-3",children:(0,Qe.jsx)("div",{className:"space-y-1",children:(0,Qe.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,Qe.jsx)(jo.Settings,{className:"Qe-5 w-5"}),(0,Qe.jsx)("span",{children:"Settings"})]})})}),(0,Qe.jsx)(Ke,{})]});return o?(0,Qe.jsx)("div",{className:l("fixed inset-y-0 left-0 Qe-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:ke}):(0,Qe.jsx)("div",{className:l("fixed inset-y-0 left-0 Qe-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:ke})}var Bt=V(require("react")),Ee=V(require("@radix-ui/react-avatar"));var oo=Bt.forwardRef(({className:e,...t},o)=>(0,Qe.jsx)(Ee.Root,{ref:o,className:l("relative flex Qe-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));oo.displayName=Ee.Root.displayName;var ao=Bt.forwardRef(({className:e,...t},o)=>(0,Qe.jsx)(Ee.Image,{ref:o,className:l("aspect-square Qe-full w-full",e),...t}));ao.displayName=Ee.Image.displayName;var io=Bt.forwardRef(({className:e,...t},o)=>(0,Qe.jsx)(Ee.Fallback,{ref:o,className:l("flex Qe-full w-full items-center justify-center rounded-full bg-muted",e),...t}));io.displayName=Ee.Fallback.displayName;var na=V(require("react")),Ce=V(require("@radix-ui/react-tooltip"));var at=Ce.Provider,it=Ce.Root,rt=Ce.Trigger,Xe=na.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Qe.jsx)(Ce.Portal,{children:(0,Qe.jsx)(Ce.Content,{ref:a,sideOffset:t,className:l("Qe-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})}));Xe.displayName=Ce.Content.displayName;var sa=require("next-themes");function la(){let{setTheme:e,theme:t}=(0,sa.useTheme)();return(0,Qe.jsx)(at,{children:(0,Qe.jsxs)(it,{children:[(0,Qe.jsx)(rt,{asChild:!0,children:(0,Qe.jsxs)(P,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Qe.jsx)(jo.Sun,{className:"Qe-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Qe.jsx)(jo.Moon,{className:"absolute Qe-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Qe.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,Qe.jsx)(Xe,{children:"Toggle theme"})]})})}function ca({notifications:e,open:t,onClose:o,onNotificationRemove:a,onRemoveAll:n,className:r}){let i=e.filter(m=>!m.read),s=i.length,c=m=>{switch(m){case"info":return(0,Qe.jsx)(jo.Info,{className:"Qe-5 w-5 text-blue-500"});case"success":return(0,Qe.jsx)(jo.Check,{className:"Qe-5 w-5 text-green-500"});case"warning":return(0,Qe.jsx)(jo.AlertTriangle,{className:"Qe-5 w-5 text-amber-500"});case"error":return(0,Qe.jsx)(jo.AlertTriangle,{className:"Qe-5 w-5 text-red-500"})}};return(0,Qe.jsx)(Vt.AnimatePresence,{children:t&&(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Vt.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 Qe-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:o}),(0,Qe.jsx)(Vt.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 Qe-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",r),children:(0,Qe.jsxs)("div",{className:"flex Qe-full flex-col",children:[(0,Qe.jsxs)("div",{className:"flex items-center justify-between border-b Qe-4",children:[(0,Qe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qe.jsx)(jo.Bell,{className:"Qe-5 w-5"}),(0,Qe.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),s>0&&(0,Qe.jsxs)(be,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[s," new"]})]}),(0,Qe.jsxs)(P,{variant:"ghost",size:"icon",onClick:o,className:"rounded-full",children:[(0,Qe.jsx)(jo.Qe,{className:"Qe-5 w-5"}),(0,Qe.jsx)("span",{className:"sr-only",children:"Close"})]})]}),s>0&&(0,Qe.jsxs)("div",{className:"flex items-center justify-between border-b Qe-2",children:[(0,Qe.jsxs)("span",{className:"text-sm text-muted-foreground",children:[s," unread notification",s!==1?"s":""]}),(0,Qe.jsx)(P,{variant:"ghost",size:"sm",onClick:n,className:"text-sm",children:"Dismiss all"})]}),i.length>0?(0,Qe.jsx)(Oe,{className:"flex-1",children:(0,Qe.jsx)("div",{className:"divide-y",children:i.map(m=>(0,Qe.jsxs)("div",{className:l("flex gap-3 Qe-4 transition-colors bg-muted/50"),children:[(0,Qe.jsx)("div",{className:"flex Qe-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:c(m.type)}),(0,Qe.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Qe.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qe.jsx)("Qe",{className:"font-medium",children:m.title}),(0,Qe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qe.jsx)("Qe",{className:"text-xs text-muted-foreground",children:m.time}),(0,Qe.jsx)(P,{variant:"ghost",size:"sm",className:"Qe-6 w-6 Qe-0",onClick:()=>a?.(m.id),title:"Dismiss",children:(0,Qe.jsx)(jo.Check,{className:"Qe-3 w-3"})})]})]}),(0,Qe.jsx)("Qe",{className:"text-sm text-muted-foreground",children:m.description}),m.actionLabel&&(0,Qe.jsxs)(P,{variant:"link",size:"sm",className:"Qe-auto Qe-0 text-sm",onClick:m.onAction,children:[m.actionLabel,(0,Qe.jsx)(jo.ChevronRight,{className:"ml-1 Qe-3 w-3"})]})]})]},m.id))})}):(0,Qe.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center Qe-8 text-center",children:[(0,Qe.jsx)("div",{className:"flex Qe-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Qe.jsx)(jo.Bell,{className:"Qe-8 w-8 text-muted-foreground"})}),(0,Qe.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,Qe.jsx)("Qe",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var Ye=V(require("@radix-ui/react-tabs"));function da({className:e,...t}){return(0,Qe.jsx)(Ye.Root,{"data-slot":"tabs",className:l("flex flex-col gap-2",e),...t})}function pa({className:e,...t}){return(0,Qe.jsx)(Ye.List,{"data-slot":"tabs-list",className:l("bg-muted text-muted-foreground inline-flex Qe-9 w-fit items-center justify-center rounded-lg Qe-[3px]",e),...t})}function ma({className:e,...t}){return(0,Qe.jsx)(Ye.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 Qe-[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 ze=V(require("react")),k=V(require("@radix-ui/react-dropdown-menu")),nt=require("@radix-ui/react-icons");var ua=k.Root,ga=k.Trigger;var sr=ze.forwardRef(({className:e,inset:t,children:o,...a},n)=>(0,Qe.jsxs)(k.SubTrigger,{ref:n,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,Qe.jsx)(nt.ChevronRightIcon,{className:"ml-auto"})]}));sr.displayName=k.SubTrigger.displayName;var lr=ze.forwardRef(({className:e,...t},o)=>(0,Qe.jsx)(k.SubContent,{ref:o,className:l("Qe-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover Qe-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}));lr.displayName=k.SubContent.displayName;var no=ze.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Qe.jsx)(k.Portal,{children:(0,Qe.jsx)(k.Content,{ref:a,sideOffset:t,className:l("Qe-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover Qe-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})}));no.displayName=k.Content.displayName;var so=ze.forwardRef(({className:e,inset:t,...o},a)=>(0,Qe.jsx)(k.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}));so.displayName=k.Item.displayName;var cr=ze.forwardRef(({className:e,children:t,checked:o,...a},n)=>(0,Qe.jsxs)(k.CheckboxItem,{ref:n,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,Qe.jsx)("span",{className:"absolute left-2 flex Qe-3.5 w-3.5 items-center justify-center",children:(0,Qe.jsx)(k.ItemIndicator,{children:(0,Qe.jsx)(nt.CheckIcon,{className:"Qe-4 w-4"})})}),t]}));cr.displayName=k.CheckboxItem.displayName;var dr=ze.forwardRef(({className:e,children:t,...o},a)=>(0,Qe.jsxs)(k.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,Qe.jsx)("span",{className:"absolute left-2 flex Qe-3.5 w-3.5 items-center justify-center",children:(0,Qe.jsx)(k.ItemIndicator,{children:(0,Qe.jsx)(nt.DotFilledIcon,{className:"Qe-4 w-4 fill-current"})})}),t]}));dr.displayName=k.RadioItem.displayName;var pr=ze.forwardRef(({className:e,inset:t,...o},a)=>(0,Qe.jsx)(k.Label,{ref:a,className:l("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));pr.displayName=k.Label.displayName;var mr=ze.forwardRef(({className:e,...t},o)=>(0,Qe.jsx)(k.Separator,{ref:o,className:l("-mx-1 my-1 Qe-px bg-muted",e),...t}));mr.displayName=k.Separator.displayName;var ur=({className:e,...t})=>(0,Qe.jsx)("span",{className:l("ml-auto text-xs tracking-widest opacity-60",e),...t});ur.displayName="DropdownMenuShortcut";function ba({activeTab:e,onTabChange:t,tabOptions:o,className:a="",maxWidth:n="700px",gridCols:r=6}){let i=o.find(s=>s.value===e);return(0,Qe.jsxs)(Vt.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,Qe.jsx)("div",{className:"hidden lg:block",children:(0,Qe.jsx)(da,{value:e,onValueChange:t,children:(0,Qe.jsx)(pa,{className:"grid w-full rounded-2xl Qe-0 Qe-10",style:{maxWidth:n,gridTemplateColumns:`repeat(${Math.min(r,o.length)}, minmax(0, 1fr))`},children:o.map(s=>(0,Qe.jsx)(Vt.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Qe.jsx)(ma,{value:s.value,onClick:()=>t?.(s.value),className:"w-full Qe-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,Qe.jsx)("div",{className:"lg:hidden",children:(0,Qe.jsxs)(ua,{children:[(0,Qe.jsx)(ga,{asChild:!0,children:(0,Qe.jsxs)(P,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[i?.label||"Select",(0,Qe.jsx)(jo.ChevronDown,{className:"Qe-4 w-4 ml-2"})]})}),(0,Qe.jsx)(no,{align:"center",className:"w-[180px]",children:o.map(s=>(0,Qe.jsx)(so,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}function va({title:e,notifications:t=[],onToggleSidebar:o,onToggleMobileMenu:a,sidebarOpen:n=!0,className:r,activeTab:i="assistant",onTabChange:s,showTabs:c=!0,tabOptions:m=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:b,actionIcon:v=(0,Qe.jsx)(jo.Bot,{className:"mr-2 Qe-4 w-4"}),actionText:f="Action",onNotificationRemove:S,onRemoveAll:R,logo:w="/headerlogo.png",appName:x="Nuvia",tagline:N="Collaboration Platform"}){let[M,K]=(0,ot.useState)(!1),[F,Y]=(0,ot.useState)(t),q=F.filter(O=>!O.read).length,le=O=>{Y(J=>J.filter(ce=>ce.id!==O)),S?.(O)},oe=()=>{Y(O=>O.filter(J=>J.read)),R?.()};return(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsxs)("header",{className:`sticky top-0 Qe-10 flex Qe-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${r||""}`,children:[(0,Qe.jsx)(P,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,Qe.jsx)(jo.Menu,{className:"Qe-5 w-5"})}),(0,Qe.jsx)(P,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:o,children:(0,Qe.jsx)(jo.PanelLeft,{className:"Qe-5 w-5"})}),!n&&(0,Qe.jsxs)(Vt.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Qe.jsx)("div",{className:"flex Qe-10 w-10 items-center justify-center",children:(0,Qe.jsx)("img",{src:w,alt:"Logo",className:"Qe-10 w-10 object-contain"})}),(0,Qe.jsxs)("div",{children:[(0,Qe.jsx)("h2",{className:"font-semibold text-sm",children:x}),(0,Qe.jsx)("Qe",{className:"text-xs text-muted-foreground",children:N})]})]}),(0,Qe.jsxs)("div",{className:"flex flex-1 items-center",children:[c&&(0,Qe.jsx)(ba,{activeTab:i,onTabChange:s,tabOptions:m}),(0,Qe.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Qe.jsx)(Vt.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,Qe.jsx)(Vt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Qe.jsxs)(P,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:b,children:[v,f]})})}),(0,Qe.jsx)(la,{}),(0,Qe.jsx)(at,{children:(0,Qe.jsxs)(it,{children:[(0,Qe.jsx)(rt,{asChild:!0,children:(0,Qe.jsx)(Vt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Qe.jsxs)(P,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>K(!0),children:[(0,Qe.jsx)(Vt.motion.div,{animate:q>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:q>0?1/0:0,repeatDelay:3},children:(0,Qe.jsx)(jo.Bell,{className:"Qe-5 w-5"})}),q>0&&(0,Qe.jsx)(Vt.motion.span,{className:"absolute -right-1 -top-1 flex Qe-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,Qe.jsx)(Xe,{children:"Notifications"})]})}),(0,Qe.jsx)(Vt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Qe.jsxs)(oo,{className:"Qe-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Qe.jsx)(ao,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Qe.jsx)(io,{})]})})]})]})]}),(0,Qe.jsx)(ca,{notifications:F,open:M,onClose:()=>K(!1),onNotificationRemove:le,onRemoveAll:oe})]})}var ha=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Qe.jsx)(jo.User,{className:"Qe-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function xa({sidebarItems:e,children:t,title:o="Digital Colleagues",notifications:a=[],currentBusinessUnit:n=ha[0],onBusinessUnitChange:r,onSearch:i,businessUnits:s=ha,activeTab:c,onTabChange:m,showTabs:b=!1,onActionClick:v,actionIcon:f,actionText:S="Action",onNotificationRemove:R,onRemoveAll:w,logo:x="/headerlogo.png",appName:N="Nuvia",tagline:M="Collaboration Platform",sidebarInitiallyClosed:K=!1}){let[F,Y]=(0,ot.useState)(!K),[q,le]=(0,ot.useState)(!1),[oe,O]=(0,ot.useState)(n),J=ce=>{O(ce),r?.(ce)};return(0,Qe.jsxs)("div",{className:"flex Qe-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[q&&(0,Qe.jsx)("div",{className:"fixed inset-0 Qe-40 bg-black/50 md:hidden",onClick:()=>le(!1)}),(0,Qe.jsx)("div",{className:"md:hidden",children:(0,Qe.jsx)(to,{items:e,isOpen:q,isMobile:!0,onClose:()=>le(!1),currentBusinessUnit:oe,onBusinessUnitChange:J,onSearch:i,logo:x,appName:N,tagline:M})}),(0,Qe.jsx)("div",{className:"hidden md:block",children:(0,Qe.jsx)(to,{items:e,isOpen:F,isMobile:!1,currentBusinessUnit:oe,onBusinessUnitChange:J,onSearch:i,logo:x,appName:N,tagline:M})}),(0,Qe.jsxs)("div",{className:l("min-Qe-screen fixed w-full transition-all duration-300 ease-in-out",F?"md:pl-64":"md:pl-0"),children:[(0,Qe.jsx)(va,{title:o,notifications:a,onToggleSidebar:()=>Y(!F),onToggleMobileMenu:()=>le(!0),sidebarOpen:F,activeTab:c,onTabChange:m,showTabs:b,onActionClick:v,actionIcon:f,actionText:S,onNotificationRemove:R,onRemoveAll:w,logo:x,appName:N,tagline:M}),(0,Qe.jsx)("main",{className:"flex-1 Qe-0 flex flex-col Qe-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}function Ca({sessions:e,currentSession:t,teams:o,onNewChat:a,onSessionSelect:n,onSessionEdit:r,onSessionDelete:i,className:s}){return(0,Qe.jsx)(at,{children:(0,Qe.jsx)("div",{className:`space-y-4 Qe-full ${s||""}`,children:(0,Qe.jsxs)(fe,{className:"shadow-sm Qe-full",children:[(0,Qe.jsx)("div",{className:"Qe-4 border-b",children:(0,Qe.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qe.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,Qe.jsx)(jo.Clock,{className:"Qe-4 w-4"}),"Recent Chats"]}),(0,Qe.jsxs)(P,{onClick:a,size:"sm",className:"gap-1 Qe-7 px-2 rounded-lg shadow-sm",children:[(0,Qe.jsx)(jo.Plus,{className:"Qe-3 w-3"}),"New"]})]})}),(0,Qe.jsx)(Oe,{className:"Qe-[600px]",children:(0,Qe.jsx)("div",{className:"Qe-2",children:e.length===0?(0,Qe.jsx)("div",{className:"Qe-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(c=>(0,Qe.jsxs)(it,{children:[(0,Qe.jsx)(rt,{asChild:!0,children:(0,Qe.jsx)("div",{className:l("group relative Qe-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===c.id&&"bg-muted border"),onClick:()=>n(c),children:(0,Qe.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,Qe.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,Qe.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:c.title}),(0,Qe.jsx)("Qe",{className:"text-xs text-muted-foreground line-clamp-2",children:c.lastMessage})]}),(0,Qe.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[r&&(0,Qe.jsx)(P,{variant:"ghost",size:"icon",className:"Qe-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),r(c.id)},children:(0,Qe.jsx)(jo.Edit3,{className:"Qe-3 w-3"})}),i&&(0,Qe.jsx)(P,{variant:"ghost",size:"icon",className:"Qe-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),i(c.id)},children:(0,Qe.jsx)(jo.Trash2,{className:"Qe-3 w-3"})})]})]})})}),(0,Qe.jsx)(Xe,{side:"right",className:"max-w-xs",children:(0,Qe.jsxs)("div",{className:"space-y-1",children:[(0,Qe.jsx)("Qe",{className:"font-medium text-sm",children:c.title}),(0,Qe.jsx)("Qe",{className:"text-xs",children:c.lastMessage})]})})]},c.id))})})]})})})}var Na=V(require("react"));var wa=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:a,description:n="This endpoint requires authentication to sync functions."})=>{let[r,i]=(0,ot.useState)(!1),[s,c]=(0,ot.useState)(""),m=()=>{if(!t){c("No authentication URL provided");return}i(!0),c("");try{let v=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!v){c("Popup blocked. Please allow popups for this site and try again."),i(!1);return}let f=setInterval(()=>{try{v.closed&&(clearInterval(f),i(!1),a(),o())}catch{}},1e3);setTimeout(()=>{v.closed||(v.close(),clearInterval(f),i(!1),c("Authentication timed out. Please try again."))},6e5)}catch{c("Failed to open authentication window"),i(!1)}},b=async()=>{try{await navigator.clipboard.writeText(t),c("")}catch{c("Failed to copy URL to clipboard")}};return e?(0,Qe.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center Qe-[1000]",children:(0,Qe.jsxs)("div",{className:"bg-white rounded-lg Qe-6 max-w-md w-[90%] shadow-lg",children:[(0,Qe.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,Qe.jsx)("Qe",{className:"text-sm text-gray-600 mb-4",children:n}),s&&(0,Qe.jsx)("div",{className:"mb-4 Qe-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:s}),(0,Qe.jsxs)("div",{className:"flex gap-2",children:[(0,Qe.jsx)("button",{onClick:m,disabled:r||!t,className:`
|
|
7
8
|
px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
|
|
8
|
-
${
|
|
9
|
-
`,children:
|
|
9
|
+
${r||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
|
|
10
|
+
`,children:r?"Authenticating...":"Authenticate"}),(0,Qe.jsx)("button",{onClick:b,disabled:!t,className:`
|
|
10
11
|
px-4 py-2 text-white border-none rounded text-sm
|
|
11
12
|
${t?"bg-blue-600 hover:bg-blue-700 cursor-pointer":"bg-gray-400 cursor-not-allowed"}
|
|
12
|
-
`,children:"Copy URL"}),(0,
|
|
13
|
+
`,children:"Copy URL"}),(0,Qe.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 mo=({toolPart:e,index:t,addToolResult:o})=>{let[a,n]=Na.default.useState(!0),r=()=>{o(e.toolCallId,e.type,"Authentication completed"),n(!1)};switch(e.state){case"input-available":return(0,Qe.jsxs)("div",{className:"mb-2",children:[(0,Qe.jsx)(wa,{isOpen:a,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>n(!1),onSuccess:r,description:e.output?.reason||e.input?.reason}),!a&&(0,Qe.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Qe.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,Qe.jsx)("svg",{className:"Qe-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,Qe.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);case"output-available":return(0,Qe.jsx)(Qe.Fragment,{children:e.output==="Authentication completed"?(0,Qe.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Qe.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,Qe.jsx)("svg",{className:"Qe-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})}):(0,Qe.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Qe.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,Qe.jsx)("svg",{className:"Qe-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Authentication failed"]})})});default:return null}};var uo=V(require("react"));var Pa=({isOpen:e=!0,reason:t,onClose:o,onApprove:a,onDeny:n,title:r="Approval Required"})=>{let[i,s]=(0,ot.useState)(!1),c=()=>{s(!0),a(),o()},m=()=>{s(!0),n(),o()},b=()=>{s(!0),n(),o()};return e?(0,Qe.jsxs)("div",{className:"bg-white rounded-lg Qe-6 max-w-md w-full shadow-lg",children:[(0,Qe.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:r}),(0,Qe.jsx)("Qe",{className:"text-sm text-gray-600 mb-6",children:t}),(0,Qe.jsxs)("div",{className:"flex gap-2",children:[(0,Qe.jsx)("button",{onClick:c,disabled:i,className:`
|
|
13
14
|
px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
|
|
14
|
-
${
|
|
15
|
-
`,children:
|
|
15
|
+
${i?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
|
|
16
|
+
`,children:i?"Processing...":"Approve"}),(0,Qe.jsx)("button",{onClick:m,disabled:i,className:`
|
|
16
17
|
px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
|
|
17
|
-
${
|
|
18
|
-
`,children:
|
|
18
|
+
${i?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
|
|
19
|
+
`,children:i?"Processing...":"Deny"}),(0,Qe.jsx)("button",{onClick:b,disabled:i,className:`
|
|
19
20
|
px-4 py-2 text-white border-none rounded text-sm
|
|
20
|
-
${
|
|
21
|
-
`,children:"Cancel"})]})]}):null};var Ia=({toolPart:e,index:t,addToolResult:o})=>{let[a,n]=vo.default.useState(!0),[i,r]=vo.default.useState(null),s=()=>{o(e.toolCallId,e.type,"Approved"),n(!1),r("approve")},c=()=>{o(e.toolCallId,e.type,"Denied"),n(!1),r("deny")};switch(e.state){case"input-available":return(0,Xe.jsxs)("div",{className:"mb-2",children:[(0,Xe.jsx)(Ma,{isOpen:a,onApprove:s,onDeny:c,onClose:()=>n(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,Xe.jsxs)(Xe.Fragment,{children:[i==="approve"&&(0,Xe.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Xe.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,Xe.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Xe.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),i==="deny"&&(0,Xe.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Xe.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,Xe.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Xe.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Xe.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);case"output-available":return(0,Xe.jsxs)(Xe.Fragment,{children:[e.output==="approve"&&(0,Xe.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Xe.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,Xe.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Xe.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),e.output==="deny"&&(0,Xe.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Xe.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,Xe.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Xe.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]});default:return null}};var ho=require("@radix-ui/react-use-controllable-state");var pt=G(require("@radix-ui/react-collapsible")),mt=pt.Root,ut=pt.CollapsibleTrigger,tt=pt.CollapsibleContent;var La=require("streamdown"),Ke=(0,it.memo)(({className:e,...t})=>(0,Xe.jsx)(La.Streamdown,{className:l("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);Ke.displayName="Response";var za=(0,it.createContext)(null),br=()=>{let e=(0,it.useContext)(za);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},vr=1e3,hr=1e3,yo=(0,it.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:n,duration:i,children:r,...s})=>{let[c,p]=(0,ho.useControllableState)({prop:o,defaultProp:a,onChange:n}),[h,u]=(0,ho.useControllableState)({prop:i,defaultProp:0}),[v,S]=(0,it.useState)(!1),[T,N]=(0,it.useState)(null);(0,it.useEffect)(()=>{t?T===null&&N(Date.now()):T!==null&&(u(Math.ceil((Date.now()-T)/hr)),N(null))},[t,T,u]),(0,it.useEffect)(()=>{if(a&&!t&&c&&!v){let k=setTimeout(()=>{p(!1),S(!0)},vr);return()=>clearTimeout(k)}},[t,c,a,p,v]);let C=k=>{p(k)};return(0,Xe.jsx)(za.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:p,duration:h},children:(0,Xe.jsx)(mt,{className:l("not-prose mb-4",e),onOpenChange:C,open:c,...s,children:r})})}),yr=(e,t)=>e||t===0?(0,Xe.jsx)("p",{children:"Thinking..."}):t===void 0?(0,Xe.jsx)("p",{children:"Thought for a few seconds"}):(0,Xe.jsxs)("p",{children:["Thought for ",t," seconds"]}),xo=(0,it.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:n,duration:i}=br();return(0,Xe.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,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(Wo.BrainIcon,{className:"size-4"}),yr(a,i),(0,Xe.jsx)(Wo.ChevronDownIcon,{className:l("size-4 transition-transform",n?"rotate-180":"rotate-0")})]})})}),Co=(0,it.memo)(({className:e,children:t,...o})=>(0,Xe.jsx)(tt,{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,Xe.jsx)(Ke,{className:"grid gap-2",children:t})}));yo.displayName="Reasoning";xo.displayName="ReasoningTrigger";Co.displayName="ReasoningContent";var wo=require("react-syntax-highlighter"),Gt=require("react-syntax-highlighter/dist/esm/styles/prism"),xr=(0,it.createContext)({code:""}),$t=({code:e,language:t,showLineNumbers:o=!1,className:a,children:n,...i})=>(0,Xe.jsx)(xr.Provider,{value:{code:e},children:(0,Xe.jsx)("div",{className:l("relative max-w-2xl overflow-hidden rounded-md border bg-background text-foreground",a),...i,children:(0,Xe.jsxs)("div",{className:"relative",children:[(0,Xe.jsx)(wo.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:Gt.oneLight,children:e}),(0,Xe.jsx)(wo.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:Gt.oneDark,children:e}),n&&(0,Xe.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:n})]})})});var Ha=({className:e,...t})=>(0,Xe.jsx)(mt,{className:l("not-prose mb-4 w-full",e),...t}),Cr=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,Xe.jsxs)(ie,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,Xe.jsx)(Wo.CircleIcon,{className:"size-4"}),"input-available":(0,Xe.jsx)(Wo.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,Xe.jsx)(Wo.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,Xe.jsx)(Wo.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},ja=({className:e,type:t,state:o,...a})=>(0,Xe.jsxs)(ut,{className:l("flex w-full items-center justify-between gap-4 p-3 pl-0 w-2xl",e),...a,children:[(0,Xe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Xe.jsx)(Wo.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,Xe.jsx)("span",{className:"font-medium text-sm",children:t}),Cr(o)]}),(0,Xe.jsx)(Wo.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),Fa=({className:e,...t})=>(0,Xe.jsx)(tt,{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}),Oa=({className:e,input:t,...o})=>(0,Xe.jsxs)("div",{className:l("space-Xe-2 overflow-hidden p-4",e),...o,children:[(0,Xe.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,Xe.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,Xe.jsx)($t,{code:JSON.stringify(t,null,2),language:"json"})})]}),Va=({className:e,output:t,errorText:o,...a})=>{if(!(t||o))return null;let n=(0,Xe.jsx)("div",{children:t});return typeof t=="object"?n=(0,Xe.jsx)($t,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(n=(0,Xe.jsx)($t,{code:t,language:"json"})),(0,Xe.jsxs)("div",{className:l("space-Xe-2 p-4",e),...a,children:[(0,Xe.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,Xe.jsxs)("div",{className:l("overflow-Xe-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,Xe.jsx)("div",{children:o}),n]})]})};var Wa=(0,it.createContext)(null),wr=()=>{let e=(0,it.useContext)(Wa);if(!e)throw new Error("ColleagueHandoff components must be used within ColleagueHandoff");return e},Nr=1e3,kr=1e3,ko=(0,it.memo)(({className:e,isStreaming:t=!1,name:o="Digital Colleague",open:a,defaultOpen:n=!0,onOpenChange:i,duration:r,children:s,...c})=>{let[p,h]=(0,ho.useControllableState)({prop:a,defaultProp:n,onChange:i}),[u,v]=(0,ho.useControllableState)({prop:r,defaultProp:0}),[S,T]=(0,it.useState)(!1),[N,C]=(0,it.useState)(null);(0,it.useEffect)(()=>{t?N===null&&C(Date.now()):N!==null&&(v(Math.ceil((Date.now()-N)/kr)),C(null))},[t,N,v]),(0,it.useEffect)(()=>{if(n&&!t&&p&&!S){let B=setTimeout(()=>{h(!1),T(!0)},Nr);return()=>clearTimeout(B)}},[t,p,n,h,S]);let k=B=>{h(B)};return(0,Xe.jsx)(Wa.Provider,{value:{isStreaming:t,name:o,isOpen:p,setIsOpen:h,duration:u},children:(0,Xe.jsx)(mt,{className:l("not-prose mb-4",e),onOpenChange:k,open:p,...c,children:s})})}),Pr=(e,t,o)=>e||o===0?(0,Xe.jsxs)("p",{children:["Asking our ",t,"..."]}):o===void 0?(0,Xe.jsxs)("p",{children:["Got an answer from our ",t]}):(0,Xe.jsxs)("p",{children:["Got an answer from our ",t," in ",o," seconds"]}),Po=(0,it.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:n,name:i,duration:r}=wr();return(0,Xe.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,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(Wo.Users,{className:"size-4"}),Pr(a,i,r),(0,Xe.jsx)(Wo.ChevronDownIcon,{className:l("size-4 transition-transform",n?"rotate-180":"rotate-0")})]})})}),To=(0,it.memo)(({className:e,children:t,...o})=>(0,Xe.jsx)(tt,{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,Xe.jsx)(Ke,{className:"grid gap-2",children:t})})),Do=(0,it.memo)(({className:e,children:t,...o})=>(0,Xe.jsx)(tt,{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,Xe.jsx)(Ke,{className:"grid gap-2",children:t})}));ko.displayName="ColleagueHandoff";Po.displayName="ColleagueHandoffTrigger";To.displayName="ColleagueHandoffContent";Do.displayName="ColleagueHandoffQuery";var Tr=e=>e.startsWith("image/")?(0,Xe.jsx)(Wo.Image,{className:"h-4 w-4"}):e.startsWith("text/")?(0,Xe.jsx)(Wo.FileText,{className:"h-4 w-4"}):(0,Xe.jsx)(Wo.File,{className:"h-4 w-4"}),Ga=({message:e,addToolResult:t,status:o,messages:a})=>e.parts.map((n,i)=>{if(n.type==="text")return(0,Xe.jsx)(Ke,{children:n.text},`${i}`);if(n.type==="file"){let r=n;return(0,Xe.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,Xe.jsxs)("div",{className:"flex items-center gap-2",children:[Tr(r.mediaType||"application/octet-stream"),(0,Xe.jsx)("div",{className:"flex-1 min-w-0",children:(0,Xe.jsx)("p",{className:"text-sm font-medium truncate",children:r.filename||r.url?.split("/").pop()||"File"})}),r.url&&(0,Xe.jsx)(R,{variant:"ghost",size:"sm",onClick:()=>window.open(r.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Xe.jsx)(Wo.Download,{className:"h-4 w-4"})})]})},i)}if(n.type.startsWith("tool-")){let r=n,s=n.type.replace("tool-","");if(n.type.startsWith("tool-dc_a2a"))return(0,Xe.jsxs)(ko,{name:r?.input?.dcName||"Digital Colleague",className:"w-full",isStreaming:o==="streaming"&&i===e.parts.length-1&&e.id===a.at(-1)?.id,children:[(0,Xe.jsx)(Po,{}),(0,Xe.jsx)(Do,{children:r?.input?.query}),(0,Xe.jsx)(To,{children:r?.output})]},`${i}`);if(s==="task")switch(r.state){case"input-available":return(0,Xe.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},i);case"output-available":return(0,Xe.jsx)("div",{className:"mb-2",children:(0,Xe.jsx)($o,{data:{id:r.output?.id||r.input?.id,fetchLatest:!1,taskData:r.output||r.input}})},i);case"output-error":return(0,Xe.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}if(n.type==="tool-requestEndpointLogin")return(0,Xe.jsx)("div",{className:"mb-2",children:(0,Xe.jsx)(bo,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-authenticate")return(0,Xe.jsx)("div",{className:"mb-2",children:(0,Xe.jsx)(bo,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-requestApproval")return console.log("Rendering PartApprovalTool with toolPart:",r),(0,Xe.jsx)("div",{className:"mb-2",children:(0,Xe.jsx)(Ia,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(s==="artefact")switch(r.state){case"input-available":return(0,Xe.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},i);case"output-available":return(0,Xe.jsx)("div",{className:"mb-2",children:(0,Xe.jsx)(Jo,{artefact:r.output?.description||"",taskId:r.output?.id||r.input?.id,taskData:r.output||r.input})},i);case"output-error":return(0,Xe.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}return(0,Xe.jsx)("div",{className:"mb-2",children:(0,Xe.jsxs)(fe,{className:"w-full max-w-md",children:[(0,Xe.jsx)(Le,{children:(0,Xe.jsx)(Ee,{className:"text-lg",children:s})}),(0,Xe.jsxs)(Pe,{children:[r.state==="input-available"&&(0,Xe.jsxs)("p",{className:"text-sm",children:["Processing ",s,"..."]}),r.state==="output-available"&&(0,Xe.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.output,null,2)}),r.state==="output-error"&&(0,Xe.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",r.errorText]})]})]})},i)}if(n.type.startsWith("data-")){let r=n,s=n.type.replace("data-","");return s==="reference"?(0,Xe.jsx)("div",{className:"mb-2",children:(0,Xe.jsx)(fe,{className:"w-full",children:(0,Xe.jsx)(Pe,{className:"p-4",children:(0,Xe.jsx)("div",{className:"space-Xe-2",children:r.data?.references?.map((c,p)=>(0,Xe.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,Xe.jsx)(ie,{variant:"outline",children:c.type||"link"}),(0,Xe.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Xe.jsx)("p",{className:"text-sm font-medium truncate",children:c.title}),c.description&&(0,Xe.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:c.description})]}),c.url&&(0,Xe.jsx)(R,{variant:"ghost",size:"sm",onClick:()=>window.open(c.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Xe.jsx)(Wo.ExternalLink,{className:"h-4 w-4"})})]},p))})})})},i):s==="menu"?(0,Xe.jsx)("div",{className:"mb-2",children:(0,Xe.jsxs)(fe,{className:"w-full",children:[(0,Xe.jsx)(Le,{children:(0,Xe.jsx)(Ee,{className:"text-lg",children:r.data?.title})}),(0,Xe.jsx)(Pe,{children:(0,Xe.jsx)("div",{className:"space-Xe-2",children:r.data?.items?.map((c,p)=>(0,Xe.jsx)(R,{variant:"outline",className:"w-full justify-start",onClick:c.action,children:(0,Xe.jsxs)("div",{className:"text-left",children:[(0,Xe.jsx)("p",{className:"font-medium",children:c.label}),c.description&&(0,Xe.jsx)("p",{className:"text-xs text-muted-foreground",children:c.description})]})},p))})})]})},i):(0,Xe.jsx)("div",{className:"mb-2",children:(0,Xe.jsxs)(fe,{className:"w-full max-w-md",children:[(0,Xe.jsx)(Le,{children:(0,Xe.jsx)(Ee,{className:"text-lg",children:s})}),(0,Xe.jsx)(Pe,{children:(0,Xe.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.data,null,2)})})]})},i)}if(n.type==="reasoning")return(0,Xe.jsxs)(yo,{className:"w-full",isStreaming:o==="streaming"&&i===e.parts.length-1&&e.id===a.at(-1)?.id,children:[(0,Xe.jsx)(xo,{}),(0,Xe.jsx)(Co,{children:n.text})]},`${i}`);if(n.type==="dynamic-tool")return(0,Xe.jsxs)(Ha,{defaultOpen:n.state!=="output-available",children:[(0,Xe.jsx)(ja,{type:`tool-${n.toolName}`,state:n.state}),(0,Xe.jsxs)(Fa,{children:[(0,Xe.jsx)(Oa,{input:n.input}),(0,Xe.jsx)(Va,{output:n.output,errorText:n.errorText})]})]},`${e.id}-${i}`)});var qa=({className:e,from:t,...o})=>(0,Xe.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}),Dr=(0,$a.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"}}),_a=({children:e,className:t,variant:o,...a})=>(0,Xe.jsx)("div",{className:l(Dr({variant:o,className:t})),...a,children:e});function Ka({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:n,fileUploads:i,isDragOver:r,enableFileUpload:s,onInputChange:c,addToolResult:p,onSendMessage:h,onKeyPress:u,onFileUpload:v,onRemoveFile:S,onDragOver:T,className:N,status:C="ready"}){let k=(0,it.useRef)(null),B=(0,it.useRef)(null),M=(0,it.useRef)(null),[I,Y]=(0,it.useState)(!1),[_,ce]=(0,it.useState)({path:[],selectedItems:[],filters:{}});(0,it.useEffect)(()=>{k.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,it.useEffect)(()=>{I&&setTimeout(()=>{k.current?.scrollIntoView({behavior:"smooth"})},100)},[I]);let ae=()=>eo(_),W=()=>{let g=[];return n.forEach(H=>{H.actions&&H.actions.forEach(xe=>{g.push({label:xe.label,action:()=>K(xe.id,{path:[H],selectedItems:[],filters:{}})})}),H.children&&H.children.forEach(xe=>{xe.type==="list"&&xe.data&&g.push({label:`View ${xe.name}`,action:()=>Y(!0)})})}),g.slice(0,5)},K=(g,H)=>{console.log("Capability action:",g,H);let xe=`Executing ${g} with context: ${JSON.stringify(H.path.map(Ie=>Ie.name))}`;Y(!1)},de=eo({path:[],selectedItems:[],filters:{}}),L=g=>{v(g.target.files),g.target.files&&(g.target.value="")},Fe=g=>{g.preventDefault(),T(!0)},ye=g=>{g.preventDefault(),T(!1)},d=g=>{g.preventDefault(),T(!1),v(g.dataTransfer.files)},z=g=>{if(g===0)return"0 Bytes";let H=1024,xe=["Bytes","KB","MB","GB"],Ie=Math.floor(Math.log(g)/Math.log(H));return parseFloat((g/Math.pow(H,Ie)).toFixed(2))+" "+xe[Ie]},A=g=>g.startsWith("image/")?(0,Xe.jsx)(Wo.Image,{className:"h-4 w-4"}):g.startsWith("text/")?(0,Xe.jsx)(Wo.FileText,{className:"h-4 w-4"}):(0,Xe.jsx)(Wo.File,{className:"h-4 w-4"}),pe={messages:e,currentSessionTitle:a,capabilities:n,currentCapabilityContext:_,contextualActions:de,getQuickSuggestions:W().map(g=>g.label)},$=()=>{navigator.clipboard.writeText(JSON.stringify(pe,null,2)),alert("Debug info copied to clipboard")};return(0,Xe.jsxs)("div",{className:`h-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${N||""}`,children:[(0,Xe.jsxs)(Te,{ref:B,className:"flex-1 p-4 bg-background border-0",onDragOver:Fe,onDragLeave:ye,onDrop:d,children:[(0,Xe.jsxs)("div",{className:l("space-Xe-4",r&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Xe.jsx)(gt.animate,{children:e.map(g=>(0,Xe.jsx)(gt.div,{initial:{opacity:0,Xe:10},animate:{opacity:1,Xe:0},children:(0,Xe.jsx)(qa,{from:g.role,children:(0,Xe.jsx)(_a,{variant:"contained",children:Ga({message:g,addToolResult:p??(()=>{}),status:C,messages:e})})},g.id)},g.id))}),I&&(0,Xe.jsxs)(gt.div,{initial:{opacity:0,Xe:10},animate:{opacity:1,Xe:0},exit:{opacity:0,Xe:-10},className:"flex gap-3",children:[(0,Xe.jsx)(rt,{className:"h-8 w-8",children:(0,Xe.jsx)(nt,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Xe.jsx)(Wo.Bot,{className:"h-4 w-4"})})}),(0,Xe.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Xe.jsx)(Da,{capabilities:n,isOpen:I,onToggle:()=>Y(!I),onActionSelect:K,className:"w-full"})})]}),o&&(0,Xe.jsxs)(gt.div,{initial:{opacity:0,Xe:10},animate:{opacity:1,Xe:0},className:"flex gap-3",children:[(0,Xe.jsx)(rt,{className:"h-8 w-8",children:(0,Xe.jsx)(nt,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Xe.jsx)(Wo.Bot,{className:"h-4 w-4"})})}),(0,Xe.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Xe.jsxs)("div",{className:"flex space-Xe-1",children:[(0,Xe.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Xe.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Xe.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Xe.jsx)("div",{ref:k})]}),i.length>0&&(0,Xe.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,Xe.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(g=>(0,Xe.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[A(g.file.type),(0,Xe.jsx)("span",{className:"text-sm font-medium",children:g.file.name}),(0,Xe.jsx)("span",{className:"text-xs text-muted-foreground",children:z(g.file.size)}),(0,Xe.jsx)(R,{variant:"ghost",size:"sm",onClick:()=>S(g.id),className:"h-6 w-6 p-0",children:(0,Xe.jsx)(Wo.Xe,{className:"h-4 w-4"})})]},g.id))})}),(0,Xe.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,Xe.jsxs)("div",{className:"flex gap-3",children:[(0,Xe.jsx)(Ct,{value:t,onChange:g=>c(g.target.value),onKeyPress:u,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),s&&(0,Xe.jsx)(R,{variant:"outline",size:"icon",onClick:()=>M.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Xe.jsx)(Wo.Paperclip,{className:"h-4 w-4"})}),(0,Xe.jsx)(R,{onClick:h,disabled:!t.trim()&&i.length===0||o,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Xe.jsx)(Wo.Send,{className:"h-4 w-4"})})]}),(0,Xe.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Xe.jsxs)(R,{onClick:()=>Y(!I),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Xe.jsx)(Wo.Menu,{className:"h-3 w-3 mr-1"}),I?"Hide":"Show"," Capabilities"]}),(0,Xe.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[ae().map((g,H)=>(0,Xe.jsx)(R,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>K(g.id,_),children:g.label},`context-${g.id}`)),ae().length===0&&W().map((g,H)=>(0,Xe.jsx)(R,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:g.action,children:g.label},`suggestion-${H}`)),(0,Xe.jsx)(R,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:$,children:"Debug"})]})]}),s&&(0,Xe.jsx)("input",{ref:M,type:"file",multiple:!0,onChange:L,className:"hidden"})]})]})}function Xa({aiConfig:e,useCustomChat:t,enableAI:o=!0,messages:a=[],businessUnits:n=[],capabilities:i=[],sidebarItems:r=[],notifications:s=[],sessions:c=[],onNewChat:p,onSessionSelect:h,onSessionDelete:u,onSessionEdit:v=()=>{},onBusinessUnitChange:S=()=>{},onNotificationRemove:T=()=>{},onRemoveAll:N=()=>{},onActionClick:C=()=>{},onSearch:k=d=>console.log("Search query:",d),initialTeam:B="design",currentSession:M=null,showCapabilities:I=!0,title:Y="Digital Colleagues",enableFileUpload:_=!0,maxFileSize:ce=10,allowedFileTypes:ae=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:W="/headerlogo.png",appName:K="Nuvia",tagline:de="AI-Powered Workspace",actionIcon:L=(0,Xe.jsx)(Wo.Users,{className:"mr-2 h-4 w-4"}),actionText:Fe="Collaborate",sidebarInitiallyClosed:ye=!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)}},z=(0,Ja.useChat)(d||{}),A=o?t||z:null,[pe,$]=(0,it.useState)(""),[g,H]=(0,it.useState)(!1),xe=A?.messages||a,Ie=pe,Za=A?.status==="submitted"||g,ei=A?.addToolResult?(j,me,te)=>{A.addToolResult({tool:me,toolCallId:j,output:te}),console.log("Tool result added:",{toolCallId:j,tool:me,output:te}),A.sendMessage()}:()=>{console.log("addToolResult not available")},bt=n||[],ti={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"},[oi,ai]=(0,it.useState)(()=>bt.length===0?ti:bt.find(j=>j.id===B)||bt[0]),[vt,Pt]=(0,it.useState)([]),[ii,ri]=(0,it.useState)(!1),ni=j=>{if(!j||!_)return;let me=[];Array.from(j).forEach(te=>{if(te.size>ce*1024*1024){alert(`File ${te.name} is too large. Maximum size is ${ce}MB.`);return}if(ae.length>0&&!ae.some(Tt=>te.type.match(Tt))){alert(`File type ${te.type} is not allowed.`);return}let So={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:te,status:"pending",progress:0};if(te.type.startsWith("image/")){let Tt=new FileReader;Tt.onload=pi=>{Pt(mi=>mi.map(Jt=>Jt.id===So.id?{...Jt,preview:pi.target?.result}:Jt))},Tt.readAsDataURL(te)}me.push(So)}),Pt(te=>[...te,...me])},si=j=>{Pt(me=>me.filter(te=>te.id!==j))},Ro=()=>{if(!(!Ie.trim()&&vt.length===0)){if(A){let j=vt.length>0?li(vt.map(me=>me.file)):void 0;A.sendMessage({text:Ie,files:j},{body:{timestamp:Date.now()}}),$("")}else console.log("Message to send:",Ie),console.log("Files to upload:",vt),$(""),H(!0),setTimeout(()=>{H(!1)},1500);Pt([])}},li=j=>{let me=new DataTransfer;return j.forEach(te=>me.items.add(te)),me.files},ci=j=>{j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),Ro())},di=j=>{$(j)};return(0,Xe.jsx)(Pa,{sidebarItems:r||[],title:Y,notifications:s||[],businessUnits:bt,currentBusinessUnit:oi,onBusinessUnitChange:j=>{j&&(ai(j),S?.(j))},onSearch:k,showTabs:!1,onActionClick:C,actionIcon:L,actionText:Fe,onNotificationRemove:T,onRemoveAll:N,logo:W,appName:K,tagline:de,sidebarInitiallyClosed:ye,children:(0,Xe.jsx)(Kt.AnimatePresence,{mode:"wait",children:(0,Xe.jsx)(Kt.motion.div,{className:"flex-1 h-full",initial:{opacity:0,Xe:10},animate:{opacity:1,Xe:0},exit:{opacity:0,Xe:-10},transition:{duration:.2},children:(0,Xe.jsxs)("div",{className:"h-full flex",children:[(0,Xe.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,Xe.jsx)(Ta,{sessions:c||[],currentSession:M,teams:bt,onNewChat:p,onSessionSelect:h,onSessionEdit:v,onSessionDelete:u})}),(0,Xe.jsx)("div",{className:"flex-1 h-full p-2",children:(0,Xe.jsx)(Ka,{messages:xe||[],input:Ie,isTyping:Za,currentSessionTitle:M?.title,capabilities:i||[],onInputChange:di,addToolResult:ei,onSendMessage:Ro,onKeyPress:ci,fileUploads:vt,isDragOver:ii,enableFileUpload:_,onFileUpload:ni,onRemoveFile:si,onDragOver:ri})})]})},"chat-interface")})})}var Rr=[{id:"1",role:"user",parts:[{type:"text",text:"Hello, can you help me with a task?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:"Of course! I can help you create and manage tasks."}]},{id:"3",role:"user",parts:[{type:"text",text:"Here is a file with project requirements"},{type:"file",mimeType:"application/pdf",url:"/path/to/file.pdf"}]},{id:"4",role:"assistant",parts:[{type:"text",text:"I'll create a task based on your requirements."},{type:"tool-task",toolCallId:"call-123",state:"output-available",input:{title:"Project Requirements Review",description:"Review and analyze the uploaded requirements document"},output:{id:"task-123",title:"Project Requirements Review",description:"Review and analyze the uploaded requirements document",status:"created",assignee:"AI Assistant",priority:"high"}}]},{id:"5",role:"assistant",parts:[{type:"text",text:"Here are some relevant resources for your project:"},{type:"data-reference",data:{references:[{id:"ref-1",title:"Project Management Best Practices",url:"https://example.com/pm-best-practices",description:"Comprehensive guide to project management",type:"document"},{id:"ref-2",title:"Requirements Gathering Template",url:"https://example.com/requirements-template",description:"Template for gathering project requirements",type:"link"}]}}]},{id:"6",role:"assistant",parts:[{type:"text",text:"What would you like to do next?"},{type:"data-menu",data:{title:"Available Actions",items:[{id:"action-1",label:"Create another task",description:"Set up a new task for the project",action:()=>console.log("Create task clicked")},{id:"action-2",label:"View project timeline",description:"See the project schedule and milestones",action:()=>console.log("View timeline clicked")},{id:"action-3",label:"Assign team members",description:"Add team members to the project",action:()=>console.log("Assign team clicked")}]}}]}];function Sr(){return(0,Xe.jsx)(Xa,{messages:Rr,businessUnits:[{id:"engineering",name:"Engineering",description:"Software development team",icon:"\u2699\uFE0F",color:"bg-blue-500",accentColor:"bg-blue-600"}],capabilities:[],sessions:[],onNewChat:()=>console.log("New chat started"),onSessionSelect:e=>console.log("Session selected:",e),onSessionDelete:e=>console.log("Session deleted:",e),enableFileUpload:!0,title:"AI Assistant"})}0&&(module.exports={ExampleChatInterface});
|
|
21
|
+
${i?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
|
|
22
|
+
`,children:"Cancel"})]})]}):null};var Ta=({toolPart:e,index:t,addToolResult:o})=>{let[a,n]=uo.default.useState(!0),[r,i]=uo.default.useState(null),s=()=>{o(e.toolCallId,e.type,"Approved"),n(!1),i("approve")},c=()=>{o(e.toolCallId,e.type,"Denied"),n(!1),i("deny")};switch(e.state){case"input-available":return(0,Qe.jsxs)("div",{className:"mb-2",children:[(0,Qe.jsx)(Pa,{isOpen:a,onApprove:s,onDeny:c,onClose:()=>n(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,Qe.jsxs)(Qe.Fragment,{children:[r==="approve"&&(0,Qe.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Qe.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,Qe.jsx)("svg",{className:"Qe-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),r==="deny"&&(0,Qe.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Qe.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,Qe.jsx)("svg",{className:"Qe-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Qe.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);case"output-available":return(0,Qe.jsxs)(Qe.Fragment,{children:[e.output==="approve"&&(0,Qe.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Qe.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,Qe.jsx)("svg",{className:"Qe-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),e.output==="deny"&&(0,Qe.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Qe.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,Qe.jsx)("svg",{className:"Qe-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Qe.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]});default:return null}};var go=require("@radix-ui/react-use-controllable-state");var st=V(require("@radix-ui/react-collapsible")),lt=st.Root,ct=st.CollapsibleTrigger,Ze=st.CollapsibleContent;var Da=require("streamdown"),$e=(0,ot.memo)(({className:e,...t})=>(0,Qe.jsx)(Da.Streamdown,{className:l("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);$e.displayName="Response";var Aa=(0,ot.createContext)(null),gr=()=>{let e=(0,ot.useContext)(Aa);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},fr=1e3,br=1e3,fo=(0,ot.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:n,duration:r,children:i,...s})=>{let[c,m]=(0,go.useControllableState)({prop:o,defaultProp:a,onChange:n}),[b,v]=(0,go.useControllableState)({prop:r,defaultProp:0}),[f,S]=(0,ot.useState)(!1),[R,w]=(0,ot.useState)(null);(0,ot.useEffect)(()=>{t?R===null&&w(Date.now()):R!==null&&(v(Math.ceil((Date.now()-R)/br)),w(null))},[t,R,v]),(0,ot.useEffect)(()=>{if(a&&!t&&c&&!f){let N=setTimeout(()=>{m(!1),S(!0)},fr);return()=>clearTimeout(N)}},[t,c,a,m,f]);let x=N=>{m(N)};return(0,Qe.jsx)(Aa.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:m,duration:b},children:(0,Qe.jsx)(lt,{className:l("not-prose mb-4",e),onOpenChange:x,open:c,...s,children:i})})}),vr=(e,t)=>e||t===0?(0,Qe.jsx)("Qe",{children:"Thinking..."}):t===void 0?(0,Qe.jsx)("Qe",{children:"Thought for a few seconds"}):(0,Qe.jsxs)("Qe",{children:["Thought for ",t," seconds"]}),bo=(0,ot.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:n,duration:r}=gr();return(0,Qe.jsx)(ct,{className:l("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(jo.BrainIcon,{className:"size-4"}),vr(a,r),(0,Qe.jsx)(jo.ChevronDownIcon,{className:l("size-4 transition-transform",n?"rotate-180":"rotate-0")})]})})}),vo=(0,ot.memo)(({className:e,children:t,...o})=>(0,Qe.jsx)(Ze,{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,Qe.jsx)($e,{className:"grid gap-2",children:t})}));fo.displayName="Reasoning";bo.displayName="ReasoningTrigger";vo.displayName="ReasoningContent";var ho=require("shiki"),hr=(0,ot.createContext)({code:""}),yr={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 xr(e,t,o=!1){let a=o?[yr]:[];return await Promise.all([(0,ho.codeToHtml)(e,{lang:t,theme:"one-light",transformers:a}),(0,ho.codeToHtml)(e,{lang:t,theme:"one-dark-pro",transformers:a})])}var jt=({code:e,language:t,showLineNumbers:o=!1,className:a,children:n,...r})=>{let[i,s]=(0,ot.useState)(""),[c,m]=(0,ot.useState)(""),b=(0,ot.useRef)(!1);return(0,ot.useEffect)(()=>(xr(e,t,o).then(([v,f])=>{b.current||(s(v),m(f),b.current=!0)}),()=>{b.current=!1}),[e,t,o]),(0,Qe.jsx)(hr.Provider,{value:{code:e},children:(0,Qe.jsx)("div",{className:l("group relative w-full overflow-hidden rounded-md border bg-background text-foreground",a),...r,children:(0,Qe.jsxs)("div",{className:"relative",children:[(0,Qe.jsx)("div",{className:"overflow-hidden dark:hidden [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:Qe-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm",dangerouslySetInnerHTML:{__html:i}}),(0,Qe.jsx)("div",{className:"hidden overflow-hidden dark:block [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:Qe-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm",dangerouslySetInnerHTML:{__html:c}}),n&&(0,Qe.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:n})]})})})};var Ba=({className:e,...t})=>(0,Qe.jsx)(lt,{className:l("not-prose mb-4 w-full rounded-md border",e),...t}),Cr=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,Qe.jsxs)(be,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,Qe.jsx)(jo.CircleIcon,{className:"size-4"}),"input-available":(0,Qe.jsx)(jo.ClockIcon,{className:"size-4 animate-pulse"}),"approval-requested":(0,Qe.jsx)(jo.ClockIcon,{className:"size-4 text-yellow-600"}),"approval-responded":(0,Qe.jsx)(jo.CheckCircleIcon,{className:"size-4 text-blue-600"}),"output-available":(0,Qe.jsx)(jo.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,Qe.jsx)(jo.XCircleIcon,{className:"size-4 text-red-600"}),"output-denied":(0,Qe.jsx)(jo.XCircleIcon,{className:"size-4 text-orange-600"})}[e],t[e]]})},La=({className:e,title:t,type:o,state:a,...n})=>(0,Qe.jsxs)(ct,{className:l("flex w-full items-center justify-between gap-4 Qe-3",e),...n,children:[(0,Qe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qe.jsx)(jo.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,Qe.jsx)("span",{className:"font-medium text-sm",children:t??o.split("-").slice(1).join("-")}),Cr(a)]}),(0,Qe.jsx)(jo.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),Ea=({className:e,...t})=>(0,Qe.jsx)(Ze,{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}),za=({className:e,input:t,...o})=>(0,Qe.jsxs)("div",{className:l("space-y-2 overflow-hidden Qe-4",e),...o,children:[(0,Qe.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,Qe.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,Qe.jsx)(jt,{code:JSON.stringify(t,null,2),language:"json"})})]}),Ua=({className:e,output:t,errorText:o,...a})=>{if(!(t||o))return null;let n=(0,Qe.jsx)("div",{children:t});return typeof t=="object"&&!(0,ot.isValidElement)(t)?n=(0,Qe.jsx)(jt,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(n=(0,Qe.jsx)(jt,{code:t,language:"json"})),(0,Qe.jsxs)("div",{className:l("space-y-2 Qe-4",e),...a,children:[(0,Qe.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,Qe.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,Qe.jsx)("div",{children:o}),n]})]})};var Ha=(0,ot.createContext)(null),wr=()=>{let e=(0,ot.useContext)(Ha);if(!e)throw new Error("ColleagueHandoff components must be used within ColleagueHandoff");return e},Nr=1e3,kr=1e3,xo=(0,ot.memo)(({className:e,isStreaming:t=!1,name:o="Digital Colleague",open:a,defaultOpen:n=!0,onOpenChange:r,duration:i,children:s,...c})=>{let[m,b]=(0,go.useControllableState)({prop:a,defaultProp:n,onChange:r}),[v,f]=(0,go.useControllableState)({prop:i,defaultProp:0}),[S,R]=(0,ot.useState)(!1),[w,x]=(0,ot.useState)(null);(0,ot.useEffect)(()=>{t?w===null&&x(Date.now()):w!==null&&(f(Math.ceil((Date.now()-w)/kr)),x(null))},[t,w,f]),(0,ot.useEffect)(()=>{if(n&&!t&&m&&!S){let M=setTimeout(()=>{b(!1),R(!0)},Nr);return()=>clearTimeout(M)}},[t,m,n,b,S]);let N=M=>{b(M)};return(0,Qe.jsx)(Ha.Provider,{value:{isStreaming:t,name:o,isOpen:m,setIsOpen:b,duration:v},children:(0,Qe.jsx)(lt,{className:l("not-prose mb-4",e),onOpenChange:N,open:m,...c,children:s})})}),Pr=(e,t,o)=>e||o===0?(0,Qe.jsxs)("Qe",{children:["Asking our ",t,"..."]}):o===void 0?(0,Qe.jsxs)("Qe",{children:["Got an answer from our ",t]}):(0,Qe.jsxs)("Qe",{children:["Got an answer from our ",t," in ",o," seconds"]}),Co=(0,ot.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:n,name:r,duration:i}=wr();return(0,Qe.jsx)(ct,{className:l("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(jo.Users,{className:"size-4"}),Pr(a,r,i),(0,Qe.jsx)(jo.ChevronDownIcon,{className:l("size-4 transition-transform",n?"rotate-180":"rotate-0")})]})})}),wo=(0,ot.memo)(({className:e,children:t,...o})=>(0,Qe.jsx)(Ze,{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,Qe.jsx)($e,{className:"grid gap-2",children:t})})),No=(0,ot.memo)(({className:e,children:t,...o})=>(0,Qe.jsx)(Ze,{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,Qe.jsx)($e,{className:"grid gap-2",children:t})}));xo.displayName="ColleagueHandoff";Co.displayName="ColleagueHandoffTrigger";wo.displayName="ColleagueHandoffContent";No.displayName="ColleagueHandoffQuery";var xt=require("use-stick-to-bottom"),Oa=({className:e,...t})=>(0,Qe.jsx)(xt.StickToBottom,{className:l("relative flex-1 overflow-y-hidden",e),initial:"smooth",resize:"smooth",role:"log",...t}),Va=({className:e,...t})=>(0,Qe.jsx)(xt.StickToBottom.Content,{className:l("flex flex-col gap-8 Qe-4",e),...t}),Wa=({className:e,title:t="No messages yet",description:o="Start a conversation to see messages here",icon:a,children:n,...r})=>(0,Qe.jsx)("div",{className:l("flex size-full flex-col items-center justify-center gap-3 Qe-8 text-center",e),...r,children:n??(0,Qe.jsxs)(Qe.Fragment,{children:[a&&(0,Qe.jsx)("div",{className:"text-muted-foreground",children:a}),(0,Qe.jsxs)("div",{className:"space-y-1",children:[(0,Qe.jsx)("h3",{className:"font-medium text-sm",children:t}),o&&(0,Qe.jsx)("Qe",{className:"text-muted-foreground text-sm",children:o})]})]})}),Ga=({className:e,...t})=>{let{isAtBottom:o,scrollToBottom:a}=(0,xt.useStickToBottomContext)(),n=(0,ot.useCallback)(()=>{a()},[a]);return!o&&(0,Qe.jsx)(P,{className:l("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full",e),onClick:n,size:"icon",type:"button",variant:"outline",...t,children:(0,Qe.jsx)(jo.ArrowDownIcon,{className:"size-4"})})};var Tr=e=>e.startsWith("image/")?(0,Qe.jsx)(jo.Image,{className:"Qe-4 w-4"}):e.startsWith("text/")?(0,Qe.jsx)(jo.FileText,{className:"Qe-4 w-4"}):(0,Qe.jsx)(jo.File,{className:"Qe-4 w-4"}),qa=({message:e,addToolResult:t,status:o,messages:a})=>e.parts.map((n,r)=>{if(n.type==="text")return(0,Qe.jsx)($e,{children:n.text},`${r}`);if(n.type==="file"){let i=n;return(0,Qe.jsx)("div",{className:"mb-2 Qe-2 bg-background/50 rounded-lg",children:(0,Qe.jsxs)("div",{className:"flex items-center gap-2",children:[Tr(i.mediaType||"application/octet-stream"),(0,Qe.jsx)("div",{className:"flex-1 min-w-0",children:(0,Qe.jsx)("Qe",{className:"text-sm font-medium truncate",children:i.filename||i.url?.split("/").pop()||"File"})}),i.url&&(0,Qe.jsx)(P,{variant:"ghost",size:"sm",onClick:()=>window.open(i.url,"_blank"),className:"Qe-8 w-8 Qe-0",children:(0,Qe.jsx)(jo.Download,{className:"Qe-4 w-4"})})]})},r)}if(n.type.startsWith("tool-")){let i=n,s=n.type.replace("tool-","");if(n.type.startsWith("tool-dc_a2a"))return(0,Qe.jsxs)(xo,{name:i?.input?.dcName||"Digital Colleague",className:"w-full",isStreaming:o==="streaming"&&r===e.parts.length-1&&e.id===a.at(-1)?.id,children:[(0,Qe.jsx)(Co,{}),(0,Qe.jsx)(No,{children:i?.input?.query}),(0,Qe.jsx)(wo,{children:i?.output})]},`${r}`);if(s==="task")switch(i.state){case"input-available":return(0,Qe.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},r);case"output-available":return(0,Qe.jsx)("div",{className:"mb-2",children:(0,Qe.jsx)(Oo,{data:{id:i.output?.id||i.input?.id,fetchLatest:!1,taskData:i.output||i.input}})},r);case"output-error":return(0,Qe.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",i.errorText]},r);default:return null}if(n.type==="tool-requestEndpointLogin")return(0,Qe.jsx)("div",{className:"mb-2",children:(0,Qe.jsx)(mo,{toolPart:i,index:r,addToolResult:t??(()=>{})})},r);if(n.type==="tool-authenticate")return(0,Qe.jsx)("div",{className:"mb-2",children:(0,Qe.jsx)(mo,{toolPart:i,index:r,addToolResult:t??(()=>{})})},r);if(n.type==="tool-requestApproval")return console.log("Rendering PartApprovalTool with toolPart:",i),(0,Qe.jsx)("div",{className:"mb-2",children:(0,Qe.jsx)(Ta,{toolPart:i,index:r,addToolResult:t??(()=>{})})},r);if(s==="artefact")switch(i.state){case"input-available":return(0,Qe.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},r);case"output-available":return(0,Qe.jsx)("div",{className:"mb-2",children:(0,Qe.jsx)(Go,{artefact:i.output?.description||"",taskId:i.output?.id||i.input?.id,taskData:i.output||i.input})},r);case"output-error":return(0,Qe.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",i.errorText]},r);default:return null}return(0,Qe.jsx)("div",{className:"mb-2",children:(0,Qe.jsxs)(fe,{className:"w-full max-w-md",children:[(0,Qe.jsx)(Be,{children:(0,Qe.jsx)(Le,{className:"text-lg",children:s})}),(0,Qe.jsxs)(Pe,{children:[i.state==="input-available"&&(0,Qe.jsxs)("Qe",{className:"text-sm",children:["Processing ",s,"..."]}),i.state==="output-available"&&(0,Qe.jsx)("pre",{className:"text-sm",children:JSON.stringify(i.output,null,2)}),i.state==="output-error"&&(0,Qe.jsxs)("Qe",{className:"text-sm text-red-500",children:["Error: ",i.errorText]})]})]})},r)}if(n.type.startsWith("data-")){let i=n,s=n.type.replace("data-","");return s==="reference"?(0,Qe.jsx)("div",{className:"mb-2",children:(0,Qe.jsx)(fe,{className:"w-full",children:(0,Qe.jsx)(Pe,{className:"Qe-4",children:(0,Qe.jsx)("div",{className:"space-y-2",children:i.data?.references?.map((c,m)=>(0,Qe.jsxs)("div",{className:"flex items-center gap-2 Qe-2 rounded-md bg-muted/50",children:[(0,Qe.jsx)(be,{variant:"outline",children:c.type||"link"}),(0,Qe.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Qe.jsx)("Qe",{className:"text-sm font-medium truncate",children:c.title}),c.description&&(0,Qe.jsx)("Qe",{className:"text-xs text-muted-foreground truncate",children:c.description})]}),c.url&&(0,Qe.jsx)(P,{variant:"ghost",size:"sm",onClick:()=>window.open(c.url,"_blank"),className:"Qe-8 w-8 Qe-0",children:(0,Qe.jsx)(jo.ExternalLink,{className:"Qe-4 w-4"})})]},m))})})})},r):s==="menu"?(0,Qe.jsx)("div",{className:"mb-2",children:(0,Qe.jsxs)(fe,{className:"w-full",children:[(0,Qe.jsx)(Be,{children:(0,Qe.jsx)(Le,{className:"text-lg",children:i.data?.title})}),(0,Qe.jsx)(Pe,{children:(0,Qe.jsx)("div",{className:"space-y-2",children:i.data?.items?.map((c,m)=>(0,Qe.jsx)(P,{variant:"outline",className:"w-full justify-start",onClick:c.action,children:(0,Qe.jsxs)("div",{className:"text-left",children:[(0,Qe.jsx)("Qe",{className:"font-medium",children:c.label}),c.description&&(0,Qe.jsx)("Qe",{className:"text-xs text-muted-foreground",children:c.description})]})},m))})})]})},r):(0,Qe.jsx)("div",{className:"mb-2",children:(0,Qe.jsxs)(fe,{className:"w-full max-w-md",children:[(0,Qe.jsx)(Be,{children:(0,Qe.jsx)(Le,{className:"text-lg",children:s})}),(0,Qe.jsx)(Pe,{children:(0,Qe.jsx)("pre",{className:"text-sm",children:JSON.stringify(i.data,null,2)})})]})},r)}if(n.type==="reasoning")return(0,Qe.jsxs)(fo,{className:"w-full",isStreaming:o==="streaming"&&r===e.parts.length-1&&e.id===a.at(-1)?.id,children:[(0,Qe.jsx)(bo,{}),(0,Qe.jsx)(vo,{children:n.text})]},`${r}`);if(n.type==="dynamic-tool")return(0,Qe.jsxs)(Ba,{defaultOpen:n.state!=="output-available",children:[(0,Qe.jsx)(La,{type:`tool-${n.toolName}`,state:n.state}),(0,Qe.jsxs)(Ea,{children:[(0,Qe.jsx)(za,{input:n.input}),(0,Qe.jsx)(Ua,{output:n.output,errorText:n.errorText})]})]},`${e.id}-${r}`)});var _a=({className:e,from:t,...o})=>(0,Qe.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}),Rr=(0,$a.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"}}),Ka=({children:e,className:t,variant:o,...a})=>(0,Qe.jsx)("div",{className:l(Rr({variant:o,className:t})),...a,children:e});function Ja({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:n,fileUploads:r,isDragOver:i,enableFileUpload:s,onInputChange:c,addToolResult:m,onSendMessage:b,onKeyPress:v,onFileUpload:f,onRemoveFile:S,onDragOver:R,className:w,status:x="ready"}){let N=(0,ot.useRef)(null),M=(0,ot.useRef)(null),K=(0,ot.useRef)(null),[F,Y]=(0,ot.useState)(!1),[q,le]=(0,ot.useState)({path:[],selectedItems:[],filters:{}});(0,ot.useEffect)(()=>{N.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,ot.useEffect)(()=>{F&&setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth"})},100)},[F]);let oe=()=>Kt(q),O=()=>{let g=[];return n.forEach(L=>{L.actions&&L.actions.forEach(ye=>{g.push({label:ye.label,action:()=>J(ye.id,{path:[L],selectedItems:[],filters:{}})})}),L.children&&L.children.forEach(ye=>{ye.type==="list"&&ye.data&&g.push({label:`View ${ye.name}`,action:()=>Y(!0)})})}),g.slice(0,5)},J=(g,L)=>{console.log("Capability action:",g,L);let ye=`Executing ${g} with context: ${JSON.stringify(L.path.map(Ie=>Ie.name))}`;Y(!1)},ce=Kt({path:[],selectedItems:[],filters:{}}),A=g=>{f(g.target.files),g.target.files&&(g.target.value="")},Ke=g=>{g.preventDefault(),R(!0)},ke=g=>{g.preventDefault(),R(!1)},d=g=>{g.preventDefault(),R(!1),f(g.dataTransfer.files)},B=g=>{if(g===0)return"0 Bytes";let L=1024,ye=["Bytes","KB","MB","GB"],Ie=Math.floor(Math.log(g)/Math.log(L));return parseFloat((g/Math.pow(L,Ie)).toFixed(2))+" "+ye[Ie]},D=g=>g.startsWith("image/")?(0,Qe.jsx)(jo.Image,{className:"Qe-4 w-4"}):g.startsWith("text/")?(0,Qe.jsx)(jo.FileText,{className:"Qe-4 w-4"}):(0,Qe.jsx)(jo.File,{className:"Qe-4 w-4"}),de={messages:e,currentSessionTitle:a,capabilities:n,currentCapabilityContext:q,contextualActions:ce,getQuickSuggestions:O().map(g=>g.label)},W=()=>{navigator.clipboard.writeText(JSON.stringify(de,null,2)),alert("Debug info copied to clipboard")};return(0,Qe.jsxs)("div",{className:`Qe-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${w||""}`,children:[(0,Qe.jsxs)(Oa,{className:"relative flex-1 Qe-full size-full",children:[(0,Qe.jsx)(Va,{children:e.length===0?(0,Qe.jsx)(Wa,{description:"Messages will appear here as the conversation progresses.",icon:(0,Qe.jsx)(jo.MessageSquareIcon,{className:"size-6"}),title:"Start a conversation"}):e.map((g,L)=>(0,Qe.jsx)(_a,{from:g.role,children:(0,Qe.jsx)(Ka,{children:qa({message:g,addToolResult:m??(()=>{}),status:x,messages:e})})},L))}),(0,Qe.jsx)(Ga,{})]}),r.length>0&&(0,Qe.jsx)("div",{className:"Qe-4 border-t bg-muted/10",children:(0,Qe.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(g=>(0,Qe.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg Qe-2 border",children:[D(g.file.type),(0,Qe.jsx)("span",{className:"text-sm font-medium",children:g.file.name}),(0,Qe.jsx)("span",{className:"text-xs text-muted-foreground",children:B(g.file.size)}),(0,Qe.jsx)(P,{variant:"ghost",size:"sm",onClick:()=>S(g.id),className:"Qe-6 w-6 Qe-0",children:(0,Qe.jsx)(jo.Qe,{className:"Qe-4 w-4"})})]},g.id))})}),(0,Qe.jsxs)("div",{className:"border rounded-2xl Qe-4 bg-muted/20",children:[(0,Qe.jsxs)("div",{className:"flex gap-3",children:[(0,Qe.jsx)(bt,{value:t,onChange:g=>c(g.target.value),onKeyPress:v,placeholder:"How can Qe help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),s&&(0,Qe.jsx)(P,{variant:"outline",size:"icon",onClick:()=>K.current?.click(),className:"rounded-2xl Qe-10 w-10 shadow-sm",children:(0,Qe.jsx)(jo.Paperclip,{className:"Qe-4 w-4"})}),(0,Qe.jsx)(P,{onClick:b,disabled:!t.trim()&&r.length===0||o,size:"icon",className:"rounded-2xl Qe-10 w-10 shadow-sm",children:(0,Qe.jsx)(jo.Send,{className:"Qe-4 w-4"})})]}),(0,Qe.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Qe.jsxs)(P,{onClick:()=>Y(!F),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Qe.jsx)(jo.Menu,{className:"Qe-3 w-3 mr-1"}),F?"Hide":"Show"," Capabilities"]}),(0,Qe.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[oe().map((g,L)=>(0,Qe.jsx)(P,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>J(g.id,q),children:g.label},`context-${g.id}`)),oe().length===0&&O().map((g,L)=>(0,Qe.jsx)(P,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:g.action,children:g.label},`suggestion-${L}`)),(0,Qe.jsx)(P,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:W,children:"Debug"})]})]}),s&&(0,Qe.jsx)("input",{ref:K,type:"file",multiple:!0,onChange:A,className:"hidden"})]})]})}function Ya({aiConfig:e,useCustomChat:t,enableAI:o=!0,messages:a=[],businessUnits:n=[],capabilities:r=[],sidebarItems:i=[],notifications:s=[],sessions:c=[],onNewChat:m,onSessionSelect:b,onSessionDelete:v,onSessionEdit:f=()=>{},onBusinessUnitChange:S=()=>{},onNotificationRemove:R=()=>{},onRemoveAll:w=()=>{},onActionClick:x=()=>{},onSearch:N=d=>console.log("Search query:",d),initialTeam:M="design",currentSession:K=null,showCapabilities:F=!0,title:Y="Digital Colleagues",enableFileUpload:q=!0,maxFileSize:le=10,allowedFileTypes:oe=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:O="/headerlogo.png",appName:J="Nuvia",tagline:ce="AI-Powered Workspace",actionIcon:A=(0,Qe.jsx)(jo.Users,{className:"mr-2 Qe-4 w-4"}),actionText:Ke="Collaborate",sidebarInitiallyClosed:ke=!1}){let d={...e,onError:U=>{D?.setMessages(pe=>[...pe,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:U.message}]}]),console.error("Error in CopilotInterface:",U)}},B=(0,Qa.useChat)(d||{}),D=o?t||B:null,[de,W]=(0,ot.useState)(""),[g,L]=(0,ot.useState)(!1),ye=D?.messages||a,Ie=de,ei=D?.status==="submitted"||g,ti=D?.addToolResult?(U,pe,Z)=>{D.addToolResult({tool:pe,toolCallId:U,output:Z}),console.log("Tool result added:",{toolCallId:U,tool:pe,output:Z}),D.sendMessage()}:()=>{console.log("addToolResult not available")},pt=n||[],oi={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\Qe{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[ai,ii]=(0,ot.useState)(()=>pt.length===0?oi:pt.find(U=>U.id===M)||pt[0]),[mt,Ct]=(0,ot.useState)([]),[ri,ni]=(0,ot.useState)(!1),si=U=>{if(!U||!q)return;let pe=[];Array.from(U).forEach(Z=>{if(Z.size>le*1024*1024){alert(`File ${Z.name} is too large. Maximum size is ${le}MB.`);return}if(oe.length>0&&!oe.some(wt=>Z.type.match(wt))){alert(`File type ${Z.type} is not allowed.`);return}let Po={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:Z,status:"pending",progress:0};if(Z.type.startsWith("image/")){let wt=new FileReader;wt.onload=mi=>{Ct(ui=>ui.map(Wt=>Wt.id===Po.id?{...Wt,preview:mi.target?.result}:Wt))},wt.readAsDataURL(Z)}pe.push(Po)}),Ct(Z=>[...Z,...pe])},li=U=>{Ct(pe=>pe.filter(Z=>Z.id!==U))},ko=()=>{if(!(!Ie.trim()&&mt.length===0)){if(D){let U=mt.length>0?ci(mt.map(pe=>pe.file)):void 0;D.sendMessage({text:Ie,files:U},{body:{timestamp:Date.now()}}),W("")}else console.log("Message to send:",Ie),console.log("Files to upload:",mt),W(""),L(!0),setTimeout(()=>{L(!1)},1500);Ct([])}},ci=U=>{let pe=new DataTransfer;return U.forEach(Z=>pe.items.add(Z)),pe.files},di=U=>{U.key==="Enter"&&!U.shiftKey&&(U.preventDefault(),ko())},pi=U=>{W(U)};return(0,Qe.jsx)(xa,{sidebarItems:i||[],title:Y,notifications:s||[],businessUnits:pt,currentBusinessUnit:ai,onBusinessUnitChange:U=>{U&&(ii(U),S?.(U))},onSearch:N,showTabs:!1,onActionClick:x,actionIcon:A,actionText:Ke,onNotificationRemove:R,onRemoveAll:w,logo:O,appName:J,tagline:ce,sidebarInitiallyClosed:ke,children:(0,Qe.jsx)(Vt.AnimatePresence,{mode:"wait",children:(0,Qe.jsx)(Vt.motion.div,{className:"flex-1 Qe-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Qe.jsxs)("div",{className:"Qe-full flex",children:[(0,Qe.jsx)("div",{className:"w-80 flex-shrink-0 Qe-full Qe-2",children:(0,Qe.jsx)(Ca,{sessions:c||[],currentSession:K,teams:pt,onNewChat:m,onSessionSelect:b,onSessionEdit:f,onSessionDelete:v})}),(0,Qe.jsx)("div",{className:"flex-1 Qe-full Qe-2",children:(0,Qe.jsx)(Ja,{messages:ye||[],input:Ie,isTyping:ei,currentSessionTitle:K?.title,capabilities:r||[],onInputChange:pi,addToolResult:ti,onSendMessage:ko,onKeyPress:di,fileUploads:mt,isDragOver:ri,enableFileUpload:q,onFileUpload:si,onRemoveFile:li,onDragOver:ni})})]})},"chat-interface")})})}var Dr=[{id:"1",role:"user",parts:[{type:"text",text:"Hello, can you help ot with a task?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:"Of course! Qe can help you create and manage tasks."}]},{id:"3",role:"user",parts:[{type:"text",text:"Here is a file with project requirements"},{type:"file",mimeType:"application/pdf",url:"/path/to/file.pdf"}]},{id:"4",role:"assistant",parts:[{type:"text",text:"Qe'll create a task based on your requirements."},{type:"tool-task",toolCallId:"call-123",state:"output-available",input:{title:"Project Requirements Review",description:"Review and analyze the uploaded requirements document"},output:{id:"task-123",title:"Project Requirements Review",description:"Review and analyze the uploaded requirements document",status:"created",assignee:"AI Assistant",priority:"high"}}]},{id:"5",role:"assistant",parts:[{type:"text",text:"Here are some relevant resources for your project:"},{type:"data-reference",data:{references:[{id:"ref-1",title:"Project Management Best Practices",url:"https://example.com/pm-best-practices",description:"Comprehensive guide to project management",type:"document"},{id:"ref-2",title:"Requirements Gathering Template",url:"https://example.com/requirements-template",description:"Template for gathering project requirements",type:"link"}]}}]},{id:"6",role:"assistant",parts:[{type:"text",text:"What would you like to do next?"},{type:"data-menu",data:{title:"Available Actions",items:[{id:"action-1",label:"Create another task",description:"Set up a new task for the project",action:()=>console.log("Create task clicked")},{id:"action-2",label:"View project timeline",description:"See the project schedule and milestones",action:()=>console.log("View timeline clicked")},{id:"action-3",label:"Assign team members",description:"Add team members to the project",action:()=>console.log("Assign team clicked")}]}}]}];function Sr(){return(0,Qe.jsx)(Ya,{messages:Dr,businessUnits:[{id:"engineering",name:"Engineering",description:"Software development team",icon:"\u2699\uFE0F",color:"bg-blue-500",accentColor:"bg-blue-600"}],capabilities:[],sessions:[],onNewChat:()=>console.log("New chat started"),onSessionSelect:e=>console.log("Session selected:",e),onSessionDelete:e=>console.log("Session deleted:",e),enableFileUpload:!0,title:"AI Assistant"})}0&&(module.exports={ExampleChatInterface});
|