cortex-react-components 2.28.0 → 2.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-SADWUWLZ.mjs → chunk-5EKGFFJD.mjs} +1 -1
- package/dist/{chunk-KBEXWUKI.mjs → chunk-5NIEZE7A.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-DTKZ3I6Z.mjs → chunk-7BYNW77I.mjs} +1 -1
- package/dist/{chunk-XSCZQEYP.mjs → chunk-7DDFZ2M3.mjs} +1 -1
- package/dist/{chunk-MX6GXHJJ.mjs → chunk-7MPZOMXK.mjs} +1 -1
- package/dist/{chunk-LKUK55GC.mjs → chunk-AABB4TFO.mjs} +1 -1
- package/dist/{chunk-D76LTQRD.mjs → chunk-ALEPCEWP.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-SZXMQMZ6.mjs → chunk-BDDEMCAH.mjs} +1 -1
- package/dist/{chunk-ORODSHZN.mjs → chunk-CC57QZMB.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-24R7CI5Q.mjs → chunk-EM4CGGGV.mjs} +1 -1
- package/dist/{chunk-CXHPLJDO.mjs → chunk-F6DMXMR4.mjs} +1 -1
- package/dist/{chunk-GXVC6ETI.mjs → chunk-FB5PBKLV.mjs} +1 -1
- package/dist/{chunk-IFUIQ57U.mjs → chunk-FBEHQRZ4.mjs} +1 -1
- package/dist/{chunk-VKCDLKYH.mjs → chunk-FJ2HHNPX.mjs} +1 -1
- package/dist/{chunk-75HU5Q6A.mjs → chunk-G2DQLEAJ.mjs} +1 -1
- package/dist/{chunk-RCI3L3M5.mjs → chunk-HD6E7KI2.mjs} +1 -1
- package/dist/{chunk-NJ7PW5T7.mjs → chunk-IISYRLNU.mjs} +1 -1
- package/dist/{chunk-I6D5JCNY.mjs → chunk-IQQ7ZWCP.mjs} +1 -1
- package/dist/{chunk-YG7SLO6G.mjs → chunk-ITNR7N47.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-KAAHIHZK.mjs → chunk-L2OBO2VZ.mjs} +1 -1
- 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-YPQUYIGO.mjs → chunk-LLED3RQS.mjs} +1 -1
- package/dist/{chunk-WBDSOPDY.mjs → chunk-M527EJIX.mjs} +1 -1
- package/dist/chunk-MCOHKE2T.mjs +1 -0
- package/dist/{chunk-SWE754OC.mjs → chunk-MH4YPGH4.mjs} +1 -1
- package/dist/{chunk-43YJ2VYN.mjs → chunk-MU47F4UR.mjs} +1 -1
- package/dist/{chunk-4FEVXBNU.mjs → chunk-NCJAMNMQ.mjs} +1 -1
- package/dist/{chunk-2R3ECSWF.mjs → chunk-NDBSSX6Q.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-GRNOF6LY.mjs → chunk-QDP657UR.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-FRYADWTQ.mjs → chunk-RV4XL2CG.mjs} +1 -1
- package/dist/{chunk-4ITG3T35.mjs → chunk-SME3D72Q.mjs} +1 -1
- package/dist/{chunk-LEF6M5ZD.mjs → chunk-SNFBF6KT.mjs} +1 -1
- package/dist/{chunk-6L7VJ7IH.mjs → chunk-TIIYFAV6.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-B63FA7LF.mjs → chunk-TQKXHMD7.mjs} +1 -1
- package/dist/{chunk-SRUG246N.mjs → chunk-TXVA6XJT.mjs} +1 -1
- package/dist/{chunk-WDRL3N5V.mjs → chunk-VNKGAW4K.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-ZA6MGTGM.mjs → chunk-WRCRZUGO.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-IBC5Z55T.mjs → chunk-YH72WKGC.mjs} +1 -1
- package/dist/chunk-YRDJBAYA.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.mjs +1 -1
- package/dist/components/CRM/DealCard.mjs +1 -1
- package/dist/components/CRM/DealDetails.mjs +1 -1
- package/dist/components/CRM/KanbanBoard.mjs +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.mjs +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/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-UA2E23AS.mjs +0 -4
package/dist/components/index.js
CHANGED
|
@@ -3,46 +3,47 @@
|
|
|
3
3
|
"use client"
|
|
4
4
|
'use strict'
|
|
5
5
|
'use client';
|
|
6
|
+
"use client";
|
|
6
7
|
|
|
7
|
-
"use strict";var oy=Object.create;var od=Object.defineProperty;var ry=Object.getOwnPropertyDescriptor;var iy=Object.getOwnPropertyNames;var sy=Object.getPrototypeOf,ny=Object.prototype.hasOwnProperty;var ly=(e,t)=>{for(var a in t)od(e,a,{get:t[a],enumerable:!0})},wg=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r Ug iy(t))!ny.call(e,r)&&r!==a&&od(e,r,{get:()=>t[r],enumerable:!(o=ry(t,r))||o.enumerable});return e};var O=(e,t,a)=>(a=e!=null?oy(sy(e)):{},wg(t||!e||!e.__esModule?od(a,"default",{value:e,enumerable:!0}):a,e)),dy=e=>wg(od({},"__esModule",{value:!0}),e);var jw={};ly(jw,{Alert:()=>ap,AlertDescription:()=>rp,AlertTitle:()=>op,AppHeader:()=>El,AppSidebar:()=>Ws,AppSidebarLeft:()=>Oc,ApprovalRequestModal:()=>vu,ApproveLeave:()=>Yp,Avatar:()=>qt,AvatarFallback:()=>Jt,AvatarImage:()=>vo,Badge:()=>se,BannerBlock:()=>mp,BrandLogo:()=>as,Breadcrumb:()=>Jn,BreadcrumbEllipsis:()=>wm,BreadcrumbItem:()=>sn,BreadcrumbLink:()=>Qn,BreadcrumbList:()=>Yn,BreadcrumbPage:()=>Zn,BreadcrumbSeparator:()=>el,Breadcrumbs:()=>iN,Button:()=>y,CMSLink:()=>Nr,CRMCogeBoard:()=>xN,CRMKanbanBoard:()=>bN,Calendar:()=>Yi,CalendarView:()=>au,CallToActionBlock:()=>Fs,CallToActionBlockOld:()=>mx,CapabilityMenu:()=>pu,Card:()=>H,CardContent:()=>oe,CardDescription:()=>Io,CardFooter:()=>er,CardHeader:()=>Pe,CardTitle:()=>Ie,Categories:()=>Jx,ChatCardArtefact:()=>nu,ChatCardTask:()=>iu,ChatInterface:()=>Dc,Checkbox:()=>Wa,CodeBlock:()=>fp,Collapsible:()=>za,CollapsibleContent:()=>Ga,CollapsibleTrigger:()=>Qa,ColleagueCard:()=>Mn,ColleagueForm:()=>Fl,ColleagueTypeSelection:()=>Kc,ColleaguesView:()=>Jl,CollectionArchive:()=>Ex,Command:()=>yd,CommandDialog:()=>yf,CommandEmpty:()=>Ym,CommandGroup:()=>Qm,CommandInput:()=>qm,CommandItem:()=>ep,CommandList:()=>Jm,CommandSeparator:()=>Zm,CommandShortcut:()=>tp,CommentSection:()=>Pu,CompanyNode:()=>Ec,Container:()=>Up,ContentBlock:()=>Nl,ContentCard:()=>wx,CopilotInterface:()=>$N,CopyButton:()=>up,CustomLink:()=>tr,CustomerCard:()=>Jf,DCProjectCard:()=>Un,DarkTop:()=>Cp,DashboardHeader:()=>nh,DashboardHero:()=>Qt,DashboardPage:()=>sg,DealCard:()=>ou,DealDetails:()=>Ml,DeliveryLeadSubmission:()=>Pc,DeliveryLeadSubmissionList:()=>Ac,DeliveryLeadSubmissionWithList:()=>eh,Dialog:()=>at,DialogClose:()=>hd,DialogContent:()=>ct,DialogDescription:()=>Bs,DialogFooter:()=>Ms,DialogHeader:()=>ft,DialogOverlay:()=>Xi,DialogPortal:()=>Is,DialogTitle:()=>mt,DialogTrigger:()=>bf,DigitalColleagueClone:()=>_c,DigitalColleagueOptions:()=>Gc,DocumentEdit:()=>im,DocumentPreview:()=>sm,DropdownMenu:()=>Do,DropdownMenuCheckboxItem:()=>Sm,DropdownMenuContent:()=>co,DropdownMenuGroup:()=>Mg,DropdownMenuItem:()=>Ba,DropdownMenuLabel:()=>tl,DropdownMenuPortal:()=>Bg,DropdownMenuRadioGroup:()=>Eg,DropdownMenuRadioItem:()=>Dm,DropdownMenuSeparator:()=>al,DropdownMenuShortcut:()=>Tm,DropdownMenuSub:()=>Lg,DropdownMenuSubContent:()=>km,DropdownMenuSubTrigger:()=>Cm,DropdownMenuTrigger:()=>To,DynamicIcon:()=>Za,EditableField:()=>Ri,EpicsView:()=>lg,EventCard:()=>Yf,FeatureCard:()=>Ed,FeatureGrid:()=>sv,FeaturesBlock:()=>Hs,FileView:()=>Zl,Filter:()=>Yx,FlowPrintable:()=>Pv,Footer:()=>mN,FoundaryLayout:()=>zc,Header:()=>Jp,HeaderDesktop:()=>_p,HeaderMobile:()=>Wp,HeadingImage:()=>Ax,Hero:()=>Nx,HighImpactHero:()=>Op,HolidayGrid:()=>tu,HolidayTracker:()=>fN,HoverCard:()=>uf,HoverCardContent:()=>Xm,HoverCardTrigger:()=>gf,Image:()=>av,ImageBlock:()=>xp,InfoTile:()=>Sx,Input:()=>_,Insight:()=>kx,KanbanBoardView:()=>ng,KanbanColumn:()=>Bl,KnowledgeBrowser:()=>nm,KnowledgeSearch:()=>$c,KnowledgeView:()=>Yl,Label:()=>I,LandingMenu:()=>uh,LightTop:()=>kp,Login:()=>ph,Logo:()=>Cl,LowImpactHero:()=>jp,MOTD:()=>Tx,MainPage:()=>Fu,ManagementSidebar:()=>vh,Mask:()=>aN,Media:()=>bi,MediaBlock:()=>hi,MediumImpactHero:()=>zp,NavigationTabs:()=>Xs,NewCustomerForm:()=>ru,NewDealForm:()=>hN,NewsGrid:()=>Dv,NotificationsPanel:()=>du,OAuthModal:()=>gu,OrgChart:()=>rh,OrgNode:()=>Lc,OrgTree:()=>Fc,PagePrintable:()=>Rv,PageRange:()=>Hx,PageShape:()=>Tl,Pagination:()=>qx,PayloadCard:()=>wl,PayloadPagination:()=>zx,PlanningView:()=>um,Popover:()=>Gi,PopoverAnchor:()=>lf,PopoverContent:()=>gi,PopoverTrigger:()=>Wi,PostHero:()=>eN,PricingCard:()=>xx,Printable:()=>Vx,ProjectCard:()=>tv,ProjectTeam:()=>Wx,ProjectView:()=>gg,ProjectsIndexView:()=>bg,ProposalSummary:()=>Px,RelatedContent:()=>Xx,RelatedPagesMenu:()=>pN,RelatedPosts:()=>Lx,RenderBlocks:()=>ts,RenderBlocksWithShapes:()=>Mx,RenderHero:()=>rN,RequestLeave:()=>eu,ReusableContentBlock:()=>wp,RichText:()=>Ot,ScrollArea:()=>Xt,ScrollBar:()=>bd,SearchableSelect:()=>Vc,SectionHero:()=>$p,Select:()=>ot,SelectContent:()=>Qe,SelectGroup:()=>rx,SelectItem:()=>be,SelectLabel:()=>Sf,SelectScrollDownButton:()=>np,SelectScrollUpButton:()=>sp,SelectSeparator:()=>Df,SelectTrigger:()=>Ye,SelectValue:()=>ut,Separator:()=>ks,ServiceCard:()=>yx,Sheet:()=>sd,SheetClose:()=>$g,SheetContent:()=>rl,SheetDescription:()=>Bm,SheetFooter:()=>Im,SheetHeader:()=>Am,SheetOverlay:()=>nd,SheetPortal:()=>Rm,SheetTitle:()=>Mm,SheetTrigger:()=>Vg,Sidebar:()=>ni,SidebarContent:()=>yr,SidebarFooter:()=>di,SidebarGroup:()=>po,SidebarGroupAction:()=>Om,SidebarGroupContent:()=>Vo,SidebarGroupLabel:()=>ci,SidebarHeader:()=>li,SidebarInput:()=>Fm,SidebarInset:()=>nl,SidebarLeft:()=>$x,SidebarMenu:()=>ja,SidebarMenuAction:()=>Ss,SidebarMenuBadge:()=>Hm,SidebarMenuButton:()=>uo,SidebarMenuItem:()=>ba,SidebarMenuSkeleton:()=>zm,SidebarMenuSub:()=>Hr,SidebarMenuSubButton:()=>jr,SidebarMenuSubItem:()=>zr,SidebarProvider:()=>il,SidebarRail:()=>Em,SidebarRight:()=>Gx,SidebarSeparator:()=>ll,SidebarTrigger:()=>sl,SimpleHeader:()=>nN,Skeleton:()=>gt,SlideShow:()=>Cv,Switch:()=>QN,Tabs:()=>lp,TabsContent:()=>ix,TabsList:()=>dp,TabsTrigger:()=>cp,TasksView:()=>ug,TeamForm:()=>Xc,TeamsIndexView:()=>hg,TextAndImages:()=>Tv,Textarea:()=>Xe,Theme:()=>Ud,ThemeProvider:()=>tN,ThemeWithShapes:()=>pv,Toast:()=>ml,ToastAction:()=>Vm,ToastClose:()=>pl,ToastDescription:()=>gl,ToastProvider:()=>gd,ToastTitle:()=>ul,ToastViewport:()=>cl,Toaster:()=>fd,Toggle:()=>Km,ToggleGroup:()=>pi,ToggleGroupItem:()=>ui,Tooltip:()=>Ro,TooltipContent:()=>mo,TooltipProvider:()=>Po,TooltipTrigger:()=>Ao,VideoHeader:()=>dN,WhyUs:()=>Rx,badgeVariants:()=>ip,buildOrgTree:()=>Au,buttonVariants:()=>$i,defaultColorScheme:()=>su,findCapabilityByPath:()=>CN,getAllCapabilities:()=>SN,getCapabilityByTeam:()=>kN,getContextualActions:()=>cc,getDataPart:()=>JN,getFileParts:()=>XN,getInitials:()=>Iu,getRoleBadgeColor:()=>Mu,getTextContent:()=>KN,getToolPart:()=>GN,hasDataPart:()=>qN,hasFilePart:()=>WN,hasToolPart:()=>_N,jobRoleLabels:()=>Bu,testCapabilities:()=>dc,toggleVariants:()=>fl,useIsMobile:()=>dd,useSidebar:()=>cn,useToast:()=>ud});module.exports=dy(jw);var rn=O(require("react")),id=require("@radix-ui/react-icons"),Ig=require("@radix-ui/react-slot");var Ag=require("clsx");var xm="-",cy=e=>{let t=py(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:n=>{let s=n.split(xm);return s[0]===""&&s.length!==1&&s.shift(),Sg(s,t)||my(n)},getConflictingClassGroupIds:(n,s)=>{let l=a[n]||[];return s&&o[n]?[...l,...o[n]]:l}}},Sg=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),r=o?Sg(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;let i=e.join(xm);return t.validators.find(({validator:n})=>n(i))?.classGroupId},Cg=/^\[(.+)\]$/,my=e=>{if(Cg.test(e)){let t=Cg.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},py=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return gy(Object.entries(e.classGroups),a).forEach(([i,n])=>{ym(n,o,i,t)}),o},ym=(e,t,a,o)=>{e.forEach(r=>{if(typeof r=="string"){let i=r===""?t:kg(t,r);i.classGroupId=a;return}if(typeof r=="function"){if(uy(r)){ym(r(o),t,a,o);return}t.validators.push({validator:r,classGroupId:a});return}Object.entries(r).forEach(([i,n])=>{ym(n,kg(t,i),a,o)})})},kg=(e,t)=>{let a=e;return t.split(xm).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},uy=e=>e.isThemeGetter,gy=(e,t)=>t?e.map(([a,o])=>{let r=o.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([n,s])=>[t+n,s])):i);return[a,r]}):e,fy=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,r=(i,n)=>{a.set(i,n),t++,t>e&&(t=0,o=a,a=new Map)};return{get(i){let n=a.get(i);if(n!==void 0)return n;if((n=o.get(i))!==void 0)return r(i,n),n},set(i,n){a.has(i)?a.set(i,n):r(i,n)}}},Dg="!",vy=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,r=t[0],i=t.length,n=s=>{let l=[],m=0,d=0,c;for(let g=0;g<s.length;g++){let x=s[g];if(m===0){if(x===r&&(o||s.slice(g,g+i)===t)){l.push(s.slice(d,g)),d=g+i;continue}if(x==="/"){c=g;continue}}x==="["?m++:x==="]"&&m--}let u=l.length===0?s:s.substring(d),v=u.startsWith(Dg),b=v?u.substring(1):u,f=c&&c>d?c-d:void 0;return{modifiers:l,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:f}};return a?s=>a({className:s,parseClassName:n}):n},by=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(o=>{o[0]==="["?(t.push(...a.sort(),o),a=[]):a.push(o)}),t.push(...a.sort()),t},hy=e=>({cache:fy(e.cacheSize),parseClassName:vy(e),...cy(e)}),yy=/\s+/,xy=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:r}=t,i=[],n=e.trim().split(yy),s="";for(let l=n.length-1;l>=0;l-=1){let m=n[l],{modifiers:d,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:v}=a(m),b=!!v,f=o(b?u.substring(0,v):u);if(!f){if(!b){s=m+(s.length>0?" "+s:s);continue}if(f=o(u),!f){s=m+(s.length>0?" "+s:s);continue}b=!1}let g=by(d).join(":"),x=c?g+Dg:g,S=x+f;if(i.includes(S))continue;i.push(S);let h=r(f,b);for(let w=0;w<h.length;++w){let D=h[w];i.push(x+D)}s=m+(s.length>0?" "+s:s)}return s};function Ny(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Tg(t))&&(o&&(o+=" "),o+=a);return o}var Tg=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Tg(e[o]))&&(a&&(a+=" "),a+=t);return a};function wy(e,...t){let a,o,r,i=n;function n(l){let m=t.reduce((d,c)=>c(d),e());return a=hy(m),o=a.cache.get,r=a.cache.set,i=s,s(l)}function s(l){let m=o(l);if(m)return m;let d=xy(l,a);return r(l,d),d}return function(){return i(Ny.apply(null,arguments))}}var $t=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Pg=/^\[(?:([a-z-]+):)?(.+)\]$/i,Cy=/^\d+\/\d+$/,ky=new Set(["px","full","screen"]),Sy=/^(\d+(\.\d+)?)?(Yg|sm|md|lg|xl)$/,Dy=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|Qo|pc|in|cm|hn|cap|ld|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ty=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Py=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ry=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ii=e=>an(e)||ky.has(e)||Cy.test(e),Ui=e=>on(e,"length",Oy),an=e=>!!e&&!Number.isNaN(Number(e)),hm=e=>on(e,"number",an),Xn=e=>!!e&&Number.isInteger(Number(e)),Ay=e=>e.endsWith("%")&&an(e.slice(0,-1)),Ge=e=>Pg.test(e),Vi=e=>Sy.test(e),Iy=new Set(["length","size","percentage"]),My=e=>on(e,Iy,Rg),By=e=>on(e,"position",Rg),Ly=new Set(["image","url"]),Ey=e=>on(e,Ly,zy),Fy=e=>on(e,"",Hy),qn=()=>!0,on=(e,t,a)=>{let o=Pg.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},Oy=e=>Dy.test(e)&&!Ty.test(e),Rg=()=>!1,Hy=e=>Py.test(e),zy=e=>Ry.test(e);var jy=()=>{let e=$t("colors"),t=$t("spacing"),a=$t("blur"),o=$t("brightness"),r=$t("borderColor"),i=$t("borderRadius"),n=$t("borderSpacing"),s=$t("borderWidth"),l=$t("contrast"),m=$t("grayscale"),d=$t("hueRotate"),c=$t("invert"),u=$t("gap"),v=$t("gradientColorStops"),b=$t("gradientColorStopPositions"),f=$t("inset"),g=$t("margin"),x=$t("opacity"),S=$t("padding"),h=$t("saturate"),w=$t("scale"),D=$t("sepia"),M=$t("skew"),U=$t("space"),F=$t("translate"),j=()=>["auto","contain","none"],ee=()=>["auto","hidden","clip","visible","scroll"],ve=()=>["auto",Ge,t],C=()=>[Ge,t],J=()=>["",ii,Ui],pe=()=>["auto",an,Ge],T=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],X=()=>["solid","dashed","dotted","double","none"],N=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",Ge],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>[an,Ge];return{cacheSize:500,separator:":",theme:{colors:[qn],spacing:[ii,Ui],blur:["none","",Vi,Ge],brightness:P(),borderColor:[e],borderRadius:["none","","full",Vi,Ge],borderSpacing:C(),borderWidth:J(),contrast:P(),grayscale:B(),hueRotate:P(),invert:B(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[Ay,Ui],inset:ve(),margin:ve(),opacity:P(),padding:C(),saturate:P(),scale:P(),sepia:B(),skew:P(),space:C(),translate:C()},classGroups:{aspect:[{aspect:["auto","square","video",Ge]}],container:["container"],columns:[{columns:[Vi]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:[...T(),Ge]}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[f]}],"inset-x":[{"inset-x":[f]}],"inset-y":[{"inset-y":[f]}],start:[{start:[f]}],end:[{end:[f]}],top:[{top:[f]}],right:[{right:[f]}],bottom:[{bottom:[f]}],left:[{left:[f]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Xn,Ge]}],basis:[{basis:ve()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ge]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",Xn,Ge]}],"grid-cols":[{"grid-cols":[qn]}],"col-start-end":[{col:["auto",{span:["full",Xn,Ge]},Ge]}],"col-start":[{"col-start":pe()}],"col-end":[{"col-end":pe()}],"grid-rows":[{"grid-rows":[qn]}],"row-start-end":[{row:["auto",{span:[Xn,Ge]},Ge]}],"row-start":[{"row-start":pe()}],"row-end":[{"row-end":pe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","Qo",Ge]}],"auto-rows":[{"auto-rows":["auto","min","max","Qo",Ge]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",...ae()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ae(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ae(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],Qo:[{Qo:[S]}],pe:[{pe:[S]}],Qo:[{Qo:[S]}],Qo:[{Qo:[S]}],sc:[{sc:[S]}],pl:[{pl:[S]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],Qo:[{Qo:[g]}],Qo:[{Qo:[g]}],mt:[{mt:[g]}],Qo:[{Qo:[g]}],uv:[{uv:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[U]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[U]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ge,t]}],"min-w":[{"min-w":[Ge,t,"min","max","fit"]}],"max-w":[{"max-w":[Ge,t,"none","full","min","max","fit","prose",{screen:[Vi]},Vi]}],h:[{h:[Ge,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ge,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ge,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ge,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Vi,Ui]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",hm]}],"font-family":[{font:[qn]}],"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",Ge]}],"line-clamp":[{"line-clamp":["none",an,hm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ii,Ge]}],"list-image":[{"list-image":["none",Ge]}],"list-style-type":[{list:["none","disc","decimal",Ge]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ii,Ui]}],"underline-offset":[{"underline-offset":["auto",ii,Ge]}],"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:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge]}],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",Ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...T(),By]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",My]}],"bg-image":[{bg:["none",{"gradient-Qo":["t","tr","r","Yg","b","bl","l","tl"]},Ey]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-Qo-pos":[{Qo:[b]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-Qo":[{Qo:[v]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-Yg":[{"rounded-Yg":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-Qo":[{"rounded-Qo":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-Yg":[{"rounded-Yg":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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":[x]}],"border-style":[{border:[...X(),"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":[x]}],"divide-style":[{divide:X()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...X()]}],"outline-offset":[{"outline-offset":[ii,Ge]}],"outline-w":[{outline:[ii,Ui]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[ii,Ui]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Vi,Fy]}],"shadow-color":[{shadow:[qn]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...N(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":N()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Vi,Ge]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[c]}],saturate:[{saturate:[h]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[c]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[h]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-y":[{"border-spacing-y":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ge]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",Ge]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ge]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[Xn,Ge]}],"translate-x":[{"translate-x":[F]}],"translate-y":[{"translate-y":[F]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ge]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","hn-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ge]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-Qo":[{"scroll-Qo":C()}],"scroll-Qo":[{"scroll-Qo":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-Qo":[{"scroll-Qo":C()}],"scroll-uv":[{"scroll-uv":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-Qo":[{"scroll-Qo":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-Qo":[{"scroll-Qo":C()}],"scroll-Qo":[{"scroll-Qo":C()}],"scroll-sc":[{"scroll-sc":C()}],"scroll-pl":[{"scroll-pl":C()}],"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",Ge]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ii,Ui,hm]}],stroke:[{stroke:[e,"none"]}],Qo:["Qo-only","not-Qo-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","Qo","pe","Qo","Qo","sc","pl"],px:["Qo","pl"],py:["Qo","sc"],m:["mx","my","Qo","Qo","mt","Qo","uv","ml"],mx:["Qo","ml"],my:["mt","uv"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-Yg","rounded-se","rounded-ee","rounded-Qo","rounded-tl","rounded-tr","rounded-Yg","rounded-bl"],"rounded-s":["rounded-Yg","rounded-Qo"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-Yg"],"rounded-b":["rounded-Yg","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-Qo","scroll-Qo","scroll-mt","scroll-Qo","scroll-uv","scroll-ml"],"scroll-mx":["scroll-Qo","scroll-ml"],"scroll-my":["scroll-mt","scroll-uv"],"scroll-p":["scroll-px","scroll-py","scroll-Qo","scroll-pe","scroll-Qo","scroll-Qo","scroll-sc","scroll-pl"],"scroll-px":["scroll-Qo","scroll-pl"],"scroll-py":["scroll-Qo","scroll-sc"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var rd=wy(jy);function p(...e){return rd((0,Ag.clsx)(e))}function Nm(e){let t=0,a=(i,n)=>`${i.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"")}-${n}`,o=e.layout.flatMap(i=>{let n=[];return"title"in i&&i.title&&n.push({text:i.title,id:a(i.title,t++),tag:"h2"}),"columns"in i&&Array.isArray(i.columns)&&i.columns.forEach(s=>{if(s.title&&n.push({text:s.title,id:a(s.title,t++),tag:"h2"}),s.richText?.root?.children&&s.richText?.root?.children.length===1){let l=s.richText.root.children.filter(m=>m!==void 0&&m.type==="heading");for(let m Ug l)m.children[0]&&n.push({text:m.children[0].text??"",id:a(m.children[0].text,t++),tag:m.tag||"h2"})}}),n}),r=Uy(e.layout);return{tableOfContents:o,contentWithIds:r}}function Uy(e){let t=(o,r)=>`${o.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"")}-${r}`,a=0;return e.map(o=>(o.title&&(o.id=t(o.title,a++)),o.columns&&(o.columns=o.columns.map(r=>(r.title&&(r.id=t(r.title,a++)),r.richText&&(r.richText.root.children=r.richText.root.children.filter(i=>i!==void 0).map(i=>(i.type==="heading"&&i.children&&i.children[0].text?i.id=t(i.children[0].text,a++):i.type==="block"&&i.fields?.media&&(i.id=t(`image-${a}`,a++)),i))),r))),o))}var Or=class{static toUtcMidnight(t){let a=new Date(t);return a.getUTCHours()===23&&a.getUTCMinutes()===0&&a.getUTCSeconds()===0?new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()+1)):new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()))}static toUtcEndOfDay(t){let a=new Date(t),o=this.toUtcMidnight(a);return new Date(o.getTime()+24*60*60*1e3-1)}};var Qo=require("react/jsx-runtime"),Jn=rn.forwardRef(({...e},t)=>(0,Qo.jsx)("nav",{ref:t,"aria-label":"breadcrumb",...e}));Jn.displayName="Breadcrumb";var Yn=rn.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("ol",{ref:a,className:p("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));Yn.displayName="BreadcrumbList";var sn=rn.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("li",{ref:a,className:p("inline-flex items-center gap-1.5",e),...t}));sn.displayName="BreadcrumbItem";var Qn=rn.forwardRef(({asChild:e,className:t,...a},o)=>(0,Qo.jsx)(e?Ig.Slot:"a",{ref:o,className:p("transition-colors hover:text-foreground",t),...a}));Qn.displayName="BreadcrumbLink";var Zn=rn.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("span",{ref:a,role:"link","aria-disabled":"true","aria-current":"page",className:p("font-normal text-foreground",e),...t}));Zn.displayName="BreadcrumbPage";var el=({children:e,className:t,...a})=>(0,Qo.jsx)("li",{role:"presentation","aria-hidden":"true",className:p("[&>svg]:w-3.5 [&>svg]:h-3.5",t),...a,children:e??(0,Qo.jsx)(id.ChevronRightIcon,{})});el.displayName="BreadcrumbSeparator";var wm=({className:e,...t})=>(0,Qo.jsxs)("span",{role:"presentation","aria-hidden":"true",className:p("flex h-9 w-9 items-center justify-center",e),...t,children:[(0,Qo.jsx)(id.DotsHorizontalIcon,{className:"h-4 w-4"}),(0,Qo.jsx)("span",{className:"Qo-only",children:"More"})]});wm.displayName="BreadcrumbElipssis";var nn=O(require("@radix-ui/react-collapsible")),za=nn.Root,Qa=nn.CollapsibleTrigger,Ga=nn.CollapsibleContent;var si=O(require("react")),Je=O(require("@radix-ui/react-dropdown-menu"));var Do=Je.Root,To=Je.Trigger,Mg=Je.Group,Bg=Je.Portal,Lg=Je.Sub,Eg=Je.RadioGroup,Cm=si.forwardRef(({className:e,inset:t,children:a,...o},r)=>(0,Qo.jsxs)(Je.SubTrigger,{ref:r,className:p("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[a,(0,Qo.jsx)(id.ChevronRightIcon,{className:"ml-auto"})]}));Cm.displayName=Je.SubTrigger.displayName;var km=si.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(Je.SubContent,{ref:a,className:p("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}));km.displayName=Je.SubContent.displayName;var co=si.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Qo.jsx)(Je.Portal,{children:(0,Qo.jsx)(Je.Content,{ref:o,sideOffset:t,className:p("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));co.displayName=Je.Content.displayName;var Ba=si.forwardRef(({className:e,inset:t,...a},o)=>(0,Qo.jsx)(Je.Item,{ref:o,className:p("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...a}));Ba.displayName=Je.Item.displayName;var Sm=si.forwardRef(({className:e,children:t,checked:a,...o},r)=>(0,Qo.jsxs)(Je.CheckboxItem,{ref:r,className:p("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Qo-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[(0,Qo.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Qo.jsx)(Je.ItemIndicator,{children:(0,Qo.jsx)(id.CheckIcon,{className:"h-4 w-4"})})}),t]}));Sm.displayName=Je.CheckboxItem.displayName;var Dm=si.forwardRef(({className:e,children:t,...a},o)=>(0,Qo.jsxs)(Je.RadioItem,{ref:o,className:p("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Qo-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,Qo.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Qo.jsx)(Je.ItemIndicator,{children:(0,Qo.jsx)(id.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Dm.displayName=Je.RadioItem.displayName;var tl=si.forwardRef(({className:e,inset:t,...a},o)=>(0,Qo.jsx)(Je.Label,{ref:o,className:p("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));tl.displayName=Je.Label.displayName;var al=si.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(Je.Separator,{ref:a,className:p("-mx-1 my-1 h-px bg-muted",e),...t}));al.displayName=Je.Separator.displayName;var Tm=({className:e,...t})=>(0,Qo.jsx)("span",{className:p("ml-auto text-Yg tracking-widest opacity-60",e),...t});Tm.displayName="DropdownMenuShortcut";var Fg=O(require("react"));var _=Fg.forwardRef(({className:e,type:t,...a},o)=>(0,Qo.jsx)("input",{type:t,className:p("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...a}));_.displayName="Input";var Hg=O(require("react")),Pm=O(require("@radix-ui/react-separator"));var ks=Hg.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},r)=>(0,Qo.jsx)(Pm.Root,{ref:r,decorative:a,orientation:t,className:p("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));ks.displayName=Pm.Root.displayName;var ol=O(require("react")),da=O(require("@radix-ui/react-dialog")),Ug=require("class-variance-authority");var sd=da.Root,Vg=da.Trigger,$g=da.Close,Rm=da.Portal,nd=ol.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(da.Overlay,{className:p("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,ref:a}));nd.displayName=da.Overlay.displayName;var Vy=(0,Ug.cva)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-Qo-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-Qo-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-Qo-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-Qo-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),rl=ol.forwardRef(({side:e="right",className:t,children:a,...o},r)=>(0,Qo.jsxs)(Rm,{children:[(0,Qo.jsx)(nd,{}),(0,Qo.jsxs)(da.Content,{ref:r,className:p(Vy({side:e}),t),...o,children:[(0,Qo.jsxs)(da.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,Qo.jsx)(id.Cross2Icon,{className:"h-4 w-4"}),(0,Qo.jsx)("span",{className:"Qo-only",children:"Close"})]}),a]})]}));rl.displayName=da.Content.displayName;var Am=({className:e,...t})=>(0,Qo.jsx)("div",{className:p("flex flex-col space-y-2 text-center sm:text-left",e),...t});Am.displayName="SheetHeader";var Im=({className:e,...t})=>(0,Qo.jsx)("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Im.displayName="SheetFooter";var Mm=ol.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(da.Title,{ref:a,className:p("text-lg font-semibold text-foreground",e),...t}));Mm.displayName=da.Title.displayName;var Bm=ol.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(da.Description,{ref:a,className:p("text-sm text-muted-foreground",e),...t}));Bm.displayName=da.Description.displayName;var tt=O(require("react")),Yg=require("lucide-react");var ld=require("react"),dd=(e=768)=>{let[t,a]=(0,ld.useState)(!1);return(0,ld.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var Gg=O(require("react")),$i=(0,Ug.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"}}}),y=Gg.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...r},i)=>(0,Qo.jsx)(e?Ig.Slot:"button",{className:p($i({className:t,size:a,variant:o})),ref:i,...r}));y.displayName="Button";function gt({className:e,...t}){return(0,Qo.jsx)("div",{className:p("animate-pulse rounded-md bg-primary/10",e),...t})}var qg=O(require("react")),hr=O(require("@radix-ui/react-tooltip"));var Po=hr.Provider,Ro=hr.Root,Ao=hr.Trigger,mo=qg.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Qo.jsx)(hr.Portal,{children:(0,Qo.jsx)(hr.Content,{ref:o,sideOffset:t,className:p("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-Yg text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));mo.displayName=hr.Content.displayName;var $y="sidebar:state",Ky=60*60*24*7,_y="16rem",Gy="18rem",Wy="3rem",Xy="b",Qg=tt.createContext(null);function cn(){let e=tt.useContext(Qg);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}var il=tt.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:r,children:i,...n},s)=>{let l=dd(),[m,d]=tt.useState(!1),[c,u]=tt.useState(e),v=t??c,b=tt.useCallback(S=>{if(a)return a?.(typeof S=="function"?S(v):S);u(S),document.cookie=`${$y}=${v}; path=/; max-age=${Ky}`},[a,v]),f=tt.useCallback(()=>l?d(S=>!S):b(S=>!S),[l,b,d]);tt.useEffect(()=>{let S=h=>{h.key===Xy&&(h.metaKey||h.ctrlKey)&&(h.preventDefault(),f())};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[f]);let g=v?"expanded":"collapsed",x=tt.useMemo(()=>({state:g,open:v,setOpen:b,isMobile:l,openMobile:m,setOpenMobile:d,toggleSidebar:f}),[g,v,b,l,m,d,f]);return(0,Qo.jsx)(Qg.Provider,{value:x,children:(0,Qo.jsx)(Po,{delayDuration:0,children:(0,Qo.jsx)("div",{style:{"--sidebar-width":_y,"--sidebar-width-icon":Wy,...r},className:p("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:s,...n,children:i})})})});il.displayName="SidebarProvider";var ni=tt.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:r,...i},n)=>{let{isMobile:s,state:l,openMobile:m,setOpenMobile:d}=cn();return a==="none"?(0,Qo.jsx)("div",{className:p("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:n,...i,children:r}):s?(0,Qo.jsx)(sd,{open:m,onOpenChange:d,...i,children:(0,Qo.jsx)(rl,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Gy},side:e,children:(0,Qo.jsx)("div",{className:"flex h-full w-full flex-col",children:r})})}):(0,Qo.jsxs)("div",{ref:n,className:"group peer hidden md:block text-sidebar-foreground","data-state":l,"data-collapsible":l==="collapsed"?a:"","data-variant":t,"data-side":e,children:[(0,Qo.jsx)("div",{className:p("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,Qo.jsx)("div",{className:p("duration-200 fixed top-14 bottom-0 z-10 hidden w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...i,children:(0,Qo.jsx)("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:r})})]})});ni.displayName="Sidebar";var sl=tt.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:r}=cn();return(0,Qo.jsxs)(y,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:p("h-7 w-7",e),onClick:i=>{t?.(i),r()},...a,children:[(0,Qo.jsx)(Yg.PanelLeft,{}),(0,Qo.jsx)("span",{className:"Qo-only",children:"Toggle Sidebar"})]})});sl.displayName="SidebarTrigger";var Em=tt.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=cn();return(0,Qo.jsx)("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:p("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});Em.displayName="SidebarRail";var nl=tt.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("main",{ref:a,className:p("flex flex-1 flex-col bg-background overflow-y-auto relative max-h-full","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));nl.displayName="SidebarInset";var Fm=tt.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(_,{ref:a,"data-sidebar":"input",className:p("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));Fm.displayName="SidebarInput";var li=tt.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("div",{ref:a,"data-sidebar":"header",className:p("flex flex-col gap-2 p-2",e),...t}));li.displayName="SidebarHeader";var di=tt.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("div",{ref:a,"data-sidebar":"footer",className:p("flex flex-col gap-2 p-2",e),...t}));di.displayName="SidebarFooter";var ll=tt.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(ks,{ref:a,"data-sidebar":"separator",className:p("mx-2 w-auto bg-sidebar-border",e),...t}));ll.displayName="SidebarSeparator";var yr=tt.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("div",{ref:a,"data-sidebar":"content",className:p("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));yr.displayName="SidebarContent";var po=tt.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("div",{ref:a,"data-sidebar":"group",className:p("relative flex w-full min-w-0 flex-col p-2",e),...t}));po.displayName="SidebarGroup";var ci=tt.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,Qo.jsx)(t?Ig.Slot:"div",{ref:o,"data-sidebar":"group-label",className:p("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-Yg font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...a}));ci.displayName="SidebarGroupLabel";var Om=tt.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,Qo.jsx)(t?Ig.Slot:"button",{ref:o,"data-sidebar":"group-action",className:p("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...a}));Om.displayName="SidebarGroupAction";var Vo=tt.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("div",{ref:a,"data-sidebar":"group-content",className:p("w-full text-sm",e),...t}));Vo.displayName="SidebarGroupContent";var ja=tt.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("ul",{ref:a,"data-sidebar":"menu",className:p("flex w-full min-w-0 flex-col gap-1",e),...t}));ja.displayName="SidebarMenu";var ba=tt.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("li",{ref:a,"data-sidebar":"menu-item",className:p("group/menu-item relative",e),...t}));ba.displayName="SidebarMenuItem";var qy=(0,Ug.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:Qo-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-Yg",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),uo=tt.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:o="default",tooltip:r,className:i,...n},s)=>{let l=e?Ig.Slot:"button",{isMobile:m,state:d}=cn(),c=(0,Qo.jsx)(l,{ref:s,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:p(qy({variant:a,size:o}),i),...n});return r?(typeof r=="string"&&(r={children:r}),(0,Qo.jsxs)(Ro,{children:[(0,Qo.jsx)(Ao,{asChild:!0,children:c}),(0,Qo.jsx)(mo,{side:"right",align:"center",hidden:d!=="collapsed"||m,...r})]})):c});uo.displayName="SidebarMenuButton";var Ss=tt.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},r)=>(0,Qo.jsx)(t?Ig.Slot:"button",{ref:r,"data-sidebar":"menu-action",className:p("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...o}));Ss.displayName="SidebarMenuAction";var Hm=tt.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("div",{ref:a,"data-sidebar":"menu-badge",className:p("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-Yg font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));Hm.displayName="SidebarMenuBadge";var zm=tt.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let r=tt.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,Qo.jsxs)("div",{ref:o,"data-sidebar":"menu-skeleton",className:p("rounded-md h-8 flex gap-2 px-2 items-center",e),...a,children:[t&&(0,Qo.jsx)(gt,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,Qo.jsx)(gt,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})});zm.displayName="SidebarMenuSkeleton";var Hr=tt.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("ul",{ref:a,"data-sidebar":"menu-sub",className:p("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));Hr.displayName="SidebarMenuSub";var zr=tt.forwardRef(({...e},t)=>(0,Qo.jsx)("li",{ref:t,...e}));zr.displayName="SidebarMenuSubItem";var jr=tt.forwardRef(({asChild:e=!1,size:t="md",isActive:a,className:o,...r},i)=>(0,Qo.jsx)(e?Ig.Slot:"a",{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:p("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-Yg",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...r}));jr.displayName="SidebarMenuSubButton";var pd=O(require("react")),Jy=1,Yy=1e6;var jm=0;function Qy(){return jm=(jm+1)%Number.MAX_SAFE_INTEGER,jm.toString()}var Um=new Map,Zg=e=>{if(Um.has(e))return;let t=setTimeout(()=>{Um.delete(e),dl({type:"REMOVE_TOAST",toastId:e})},Yy);Um.set(e,t)},Zy=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Jy)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case"DISMISS_TOAST":{let{toastId:a}=t;return a?Zg(a):e.toasts.forEach(o=>{Zg(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===a||a===void 0?{...o,open:!1}:o)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)}}},cd=[],md={toasts:[]};function dl(e){md=Zy(md,e),cd.forEach(t=>{t(md)})}function ex({...e}){let t=Qy(),a=r=>dl({type:"UPDATE_TOAST",toast:{...r,id:t}}),o=()=>dl({type:"DISMISS_TOAST",toastId:t});return dl({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:r=>{r||o()}}}),{id:t,dismiss:o,update:a}}function ud(){let[e,t]=pd.useState(md);return pd.useEffect(()=>(cd.push(t),()=>{let a=cd.indexOf(t);a>-1&&cd.splice(a,1)}),[e]),{...e,toast:ex,dismiss:a=>dl({type:"DISMISS_TOAST",toastId:a})}}var Ds=O(require("react")),ha=O(require("@radix-ui/react-toast"));var gd=ha.Provider,cl=Ds.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(ha.Viewport,{ref:a,className:p("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));cl.displayName=ha.Viewport.displayName;var tx=(0,Ug.cva)("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 Qo-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-Qo-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),ml=Ds.forwardRef(({className:e,variant:t,...a},o)=>(0,Qo.jsx)(ha.Root,{ref:o,className:p(tx({variant:t}),e),...a}));ml.displayName=ha.Root.displayName;var Vm=Ds.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(ha.Action,{ref:a,className:p("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Vm.displayName=ha.Action.displayName;var pl=Ds.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(ha.Close,{ref:a,className:p("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:(0,Qo.jsx)(Yg.X,{className:"h-4 w-4"})}));pl.displayName=ha.Close.displayName;var ul=Ds.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(ha.Title,{ref:a,className:p("text-sm font-semibold [&+div]:text-Yg",e),...t}));ul.displayName=ha.Title.displayName;var gl=Ds.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(ha.Description,{ref:a,className:p("text-sm opacity-90",e),...t}));gl.displayName=ha.Description.displayName;function fd(){let{toasts:e}=ud();return(0,Qo.jsxs)(gd,{children:[e.map(function({id:t,title:a,description:o,action:r,...i}){return(0,Qo.jsxs)(ml,{...i,children:[(0,Qo.jsxs)("div",{className:"grid gap-1",children:[a&&(0,Qo.jsx)(ul,{children:a}),o&&(0,Qo.jsx)(gl,{children:o})]}),r,(0,Qo.jsx)(pl,{})]},t)}),(0,Qo.jsx)(cl,{})]})}var af=O(require("react")),$m=O(require("@radix-ui/react-toggle"));var fl=(0,Ug.cva)("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Km=af.forwardRef(({className:e,variant:t,size:a,...o},r)=>(0,Qo.jsx)($m.Root,{ref:r,className:p(fl({variant:t,size:a,className:e})),...o}));Km.displayName=$m.Root.displayName;var Ts=O(require("react")),mn=O(require("@radix-ui/react-toggle-group"));var sf=Ts.createContext({size:"default",variant:"default"}),pi=Ts.forwardRef(({className:e,variant:t,size:a,children:o,...r},i)=>(0,Qo.jsx)(mn.Root,{ref:i,className:p("flex items-center justify-center gap-1",e),...r,children:(0,Qo.jsx)(sf.Provider,{value:{variant:t,size:a},children:o})}));pi.displayName=mn.Root.displayName;var ui=Ts.forwardRef(({className:e,children:t,variant:a,size:o,...r},i)=>{let n=Ts.useContext(sf);return(0,Qo.jsx)(mn.Item,{ref:i,className:p(fl({variant:n.variant||a,size:n.size||o}),e),...r,children:t})});ui.displayName=mn.Item.displayName;var _m=O(require("react")),Zo=O(require("@radix-ui/react-scroll-area"));var Xt=_m.forwardRef(({className:e,children:t,...a},o)=>(0,Qo.jsxs)(Zo.Root,{ref:o,className:p("relative overflow-hidden",e),...a,children:[(0,Qo.jsx)(Zo.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Qo.jsx)(bd,{}),(0,Qo.jsx)(Zo.Corner,{})]}));Xt.displayName=Zo.Root.displayName;var bd=_m.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,Qo.jsx)(Zo.ScrollAreaScrollbar,{ref:o,orientation:t,className:p("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,Qo.jsx)(Zo.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));bd.displayName=Zo.ScrollAreaScrollbar.displayName;var nf=O(require("react")),xr=O(require("@radix-ui/react-popover"));var Gi=xr.Root,Wi=xr.Trigger,lf=xr.Anchor,gi=nf.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},r)=>(0,Qo.jsx)(xr.Portal,{children:(0,Qo.jsx)(xr.Content,{ref:r,align:t,sideOffset:a,className:p("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));gi.displayName=xr.Content.displayName;var df=O(require("react")),Wm=O(require("@radix-ui/react-label"));var ax=(0,Ug.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),I=df.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(Wm.Root,{ref:a,className:p(ax(),e),...t}));I.displayName=Wm.Root.displayName;var pf=O(require("react")),Ps=O(require("@radix-ui/react-hover-card"));var uf=Ps.Root,gf=Ps.Trigger,Xm=pf.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},r)=>(0,Qo.jsx)(Ps.Content,{ref:r,align:t,sideOffset:a,className:p("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));Xm.displayName=Ps.Content.displayName;var Rs=O(require("react"));var H=Rs.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("div",{ref:a,className:p("rounded-xl border bg-card text-card-foreground shadow",e),...t}));H.displayName="Card";var Pe=Rs.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("div",{ref:a,className:p("flex flex-col space-y-1.5 p-6",e),...t}));Pe.displayName="CardHeader";var Ie=Rs.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("div",{ref:a,className:p("font-semibold leading-none tracking-tight",e),...t}));Ie.displayName="CardTitle";var Io=Rs.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("div",{ref:a,className:p("text-sm text-muted-foreground",e),...t}));Io.displayName="CardDescription";var oe=Rs.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("div",{ref:a,className:p("p-6 Qo-0",e),...t}));oe.displayName="CardContent";var er=Rs.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("div",{ref:a,className:p("flex items-center p-6 Qo-0",e),...t}));er.displayName="CardFooter";var vl=O(require("react")),ca=O(require("@radix-ui/react-dialog"));var at=ca.Root,bf=ca.Trigger,Is=ca.Portal,hd=ca.Close,Xi=vl.forwardRef(({className:e,...t},a)=>(0,$o.jsx)(ca.Overlay,{ref:a,className:p("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}));Xi.displayName=ca.Overlay.displayName;var ct=vl.forwardRef(({className:e,children:t,...a},o)=>(0,$o.jsxs)(Is,{children:[(0,$o.jsx)(Xi,{}),(0,$o.jsxs)(ca.Content,{ref:o,className:p("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-Qo-left-1/2 data-[state=closed]:slide-out-Qo-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,(0,$o.jsxs)(ca.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,$o.jsx)(Yg.X,{className:"h-4 w-4"}),(0,$o.jsx)("span",{className:"Qo-only",children:"Close"})]})]})]}));ct.displayName=ca.Content.displayName;var ft=({className:e,...t})=>(0,$o.jsx)("div",{className:p("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ft.displayName="DialogHeader";var Ms=({className:e,...t})=>(0,$o.jsx)("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ms.displayName="DialogFooter";var mt=vl.forwardRef(({className:e,...t},a)=>(0,$o.jsx)(ca.Title,{ref:a,className:p("text-lg font-semibold leading-none tracking-tight",e),...t}));mt.displayName=ca.Title.displayName;var Bs=vl.forwardRef(({className:e,...t},a)=>(0,$o.jsx)(ca.Description,{ref:a,className:p("text-sm text-muted-foreground",e),...t}));Bs.displayName=ca.Description.displayName;var qi=O(require("react")),fo=require("cmdk");var yd=qi.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(fo.Command,{ref:a,className:p("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));yd.displayName=fo.Command.displayName;var yf=({children:e,...t})=>(0,Qo.jsx)(at,{...t,children:(0,Qo.jsx)(ct,{className:"overflow-hidden p-0",children:(0,Qo.jsx)(yd,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:Qo-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),qm=qi.forwardRef(({className:e,...t},a)=>(0,Qo.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,Qo.jsx)(Yg.Search,{className:"Qo-2 h-4 w-4 shrink-0 opacity-50"}),(0,Qo.jsx)(fo.Command.Input,{ref:a,className:p("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));qm.displayName=fo.Command.Input.displayName;var Jm=qi.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(fo.Command.List,{ref:a,className:p("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Jm.displayName=fo.Command.List.displayName;var Ym=qi.forwardRef((e,t)=>(0,Qo.jsx)(fo.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Ym.displayName=fo.Command.Empty.displayName;var Qm=qi.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(fo.Command.Group,{ref:a,className:p("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-Yg [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Qm.displayName=fo.Command.Group.displayName;var Zm=qi.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(fo.Command.Separator,{ref:a,className:p("-mx-1 h-px bg-border",e),...t}));Zm.displayName=fo.Command.Separator.displayName;var ep=qi.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(fo.Command.Item,{ref:a,className:p("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));ep.displayName=fo.Command.Item.displayName;var tp=({className:e,...t})=>(0,Qo.jsx)("span",{className:p("ml-auto text-Yg tracking-widest text-muted-foreground",e),...t});tp.displayName="CommandShortcut";var xd=O(require("react"));var ox=(0,Ug.cva)("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),ap=xd.forwardRef(({className:e,variant:t,...a},o)=>(0,Qo.jsx)("div",{ref:o,role:"alert",className:p(ox({variant:t}),e),...a}));ap.displayName="Alert";var op=xd.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("h5",{ref:a,className:p("uv-1 font-medium leading-none tracking-tight",e),...t}));op.displayName="AlertTitle";var rp=xd.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("div",{ref:a,className:p("text-sm [&_p]:leading-relaxed",e),...t}));rp.displayName="AlertDescription";var wd=O(require("react")),fi=O(require("@radix-ui/react-avatar"));var qt=wd.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(fi.Root,{ref:a,className:p("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));qt.displayName=fi.Root.displayName;var vo=wd.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(fi.Image,{ref:a,className:p("aspect-square h-full w-full",e),...t}));vo.displayName=fi.Image.displayName;var Jt=wd.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(fi.Fallback,{ref:a,className:p("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Jt.displayName=fi.Fallback.displayName;var ip=(0,Ug.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-Yg 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 se({className:e,variant:t,...a}){return(0,Qo.jsx)("div",{className:p(ip({variant:t}),e),...a})}var bl=O(require("@radix-ui/react-checkbox")),kf=O(require("react")),Wa=kf.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(bl.Root,{className:p("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:a,...t,children:(0,Qo.jsx)(bl.Indicator,{className:p("flex items-center justify-center text-current"),children:(0,Qo.jsx)(Yg.Check,{className:"h-4 w-4"})})}));Wa.displayName=bl.Root.displayName;var nt=O(require("@radix-ui/react-select")),Ji=O(require("react")),ot=nt.Root,rx=nt.Group,ut=nt.Value,Ye=Ji.forwardRef(({children:e,className:t,...a},o)=>(0,Qo.jsxs)(nt.Trigger,{className:p("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:o,...a,children:[e,(0,Qo.jsx)(nt.Icon,{asChild:!0,children:(0,Qo.jsx)(Yg.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Ye.displayName=nt.Trigger.displayName;var sp=Ji.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(nt.ScrollUpButton,{className:p("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,Qo.jsx)(Yg.ChevronUp,{className:"h-4 w-4"})}));sp.displayName=nt.ScrollUpButton.displayName;var np=Ji.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(nt.ScrollDownButton,{className:p("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,Qo.jsx)(Yg.ChevronDown,{className:"h-4 w-4"})}));np.displayName=nt.ScrollDownButton.displayName;var Qe=Ji.forwardRef(({children:e,className:t,position:a="popper",...o},r)=>(0,Qo.jsx)(nt.Portal,{children:(0,Qo.jsxs)(nt.Content,{className:p("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,ref:r,...o,children:[(0,Qo.jsx)(sp,{}),(0,Qo.jsx)(nt.Viewport,{className:p("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Qo.jsx)(np,{})]})}));Qe.displayName=nt.Content.displayName;var Sf=Ji.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(nt.Label,{className:p("py-1.5 pl-8 Qo-2 text-sm font-semibold",e),ref:a,...t}));Sf.displayName=nt.Label.displayName;var be=Ji.forwardRef(({children:e,className:t,...a},o)=>(0,Qo.jsxs)(nt.Item,{className:p("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 Qo-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:o,...a,children:[(0,Qo.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Qo.jsx)(nt.ItemIndicator,{children:(0,Qo.jsx)(Yg.Check,{className:"h-4 w-4"})})}),(0,Qo.jsx)(nt.ItemText,{children:e})]}));be.displayName=nt.Item.displayName;var Df=Ji.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(nt.Separator,{className:p("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));Df.displayName=nt.Separator.displayName;var Tf=O(require("react")),Xe=Tf.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("textarea",{className:p("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...t}));Xe.displayName="Textarea";var Rf=require("react-day-picker");function Yi({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,Qo.jsx)(Rf.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:p("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center Qo-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:p($i({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:p("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:p($i({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},...o})}Yi.displayName="Calendar";var Qi=O(require("@radix-ui/react-tabs"));function lp({className:e,...t}){return(0,Qo.jsx)(Qi.Root,{"data-slot":"tabs",className:p("flex flex-col gap-2",e),...t})}function dp({className:e,...t}){return(0,Qo.jsx)(Qi.List,{"data-slot":"tabs-list",className:p("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function cp({className:e,...t}){return(0,Qo.jsx)(Qi.Trigger,{"data-slot":"tabs-trigger",className:p("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function ix({className:e,...t}){return(0,Qo.jsx)(Qi.Content,{"data-slot":"tabs-content",className:p("flex-1 outline-none",e),...t})}var mp=({className:e,content:t,style:a})=>(0,Qo.jsx)("div",{className:p("mx-auto my-8 w-full",e),children:(0,Qo.jsx)("div",{className:p("border py-3 px-6 flex items-center rounded",{"border-border bg-card":a==="info","border-error bg-error/30":a==="error","border-success bg-success/30":a==="success","border-warning bg-warning/30":a==="warning"}),children:(0,Qo.jsx)(Ot,{content:t,enableGutter:!1,enableProse:!1})})});var pp=O(require("next/link")),Nr=e=>{let{type:t,appearance:a="inline",children:o,className:r,label:i,newTab:n,reference:s,size:l,url:m}=e,d=t==="reference"&&typeof s?.value=="object"&&s.value.slug?`${s?.relationTo!=="pages"?`/${s?.relationTo}`:""}/${s.value.slug}`:m;if(!d)return null;let c=a==="link"?"clear":l,u=n?{rel:"noopener noreferrer",target:"_blank"}:{};return a==="inline"?(0,Qo.jsxs)(pp.default,{className:p(r),href:d||m||"",...u,children:[i&&i,o&&o]}):(0,Qo.jsx)(y,{asChild:!0,className:r,size:c,variant:a,children:(0,Qo.jsxs)(pp.default,{className:p(r),href:d||m||"",...u,children:[i&&i,o&&o]})})};function Dd({className:e}){return p("flex items-center min-h-[3.5rem] md:min-h-[3.75rem] w-full rounded-5 px-4 md:px-5 py-2"," bg-transparent text-accent-800 placeholder:text-accent-800 dark:text-body dark:placeholder:text-body"," border border-solid border-accent-900 border-opacity-20 dark:border-opacity-20 dark:border-accent-200"," focus:border-accent-900 focus:ring-0 focus-visible:outline-0 focus-visible:ring-0 focus-visible:ring-offset-0","transition-all duration-300",e)}function sx({className:e,...t}){return(0,Qo.jsx)("input",{...t,className:Dd({className:e})})}function Td({icon:e,...t}){return(0,Qo.jsxs)("div",{className:"relative w-full",children:[(0,Qo.jsx)(sx,{...t}),e&&(0,Qo.jsx)("span",{className:"absolute right-5 top-1/2 w-[14px] -translate-y-1/2 text-accent",children:e})]})}function nx({className:e,...t}){return(0,Qo.jsx)("textarea",{...t,className:p(Dd({}),"resize-none md:min-h-[130px]",e)})}function If({icon:e,...t}){return(0,Qo.jsxs)("div",{className:"relative w-full",children:[(0,Qo.jsx)(nx,{...t}),e&&(0,Qo.jsx)("span",{className:"absolute right-5 top-[18px] w-[14px] text-accent",children:e})]})}var Mf=require("formik"),Bf=require("react-icons/fa6"),Es=O(require("yup")),Id=require("sonner"),wr={tooShort:"Must be at least ${min} characters",tooLong:"Must be at most ${max} characters",required:"This field Yg required",email:"Invalid email format"},lx=Es.object().shape({name:Es.string().min(2,wr.tooShort).max(50,wr.tooLong).required(wr.required),email:Es.string().email(wr.email).required(wr.required),subject:Es.string().min(2,wr.tooShort).max(50,wr.tooLong).required(wr.required),message:Es.string().min(2,wr.tooShort).max(300,wr.tooLong).required(wr.required)}),Pd=p("!Qo-[44px] text-foreground"),Rd=p("!border-red-600 border"),Ad=p("Qo-only");function Lf({onSubmit:e}={}){return(0,Qo.jsx)(Mf.Formik,{initialValues:{name:"",email:"",subject:"",message:""},validationSchema:lx,onSubmit:async(t,{resetForm:a})=>{if(!e){Id.toast.error("Form submission not configured");return}let o=await e(t);o.data===null?Id.toast.error(o.message):(Id.toast.success(o.message),a())},children:({errors:t,touched:a,values:o,handleChange:r,handleBlur:i,isSubmitting:n,handleSubmit:s})=>(0,Qo.jsxs)("form",{onSubmit:s,className:"grid grid-cols-1 gap-2 Qo-2 lg:grid-cols-2",children:[(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(Td,{placeholder:"Your Name",type:"text",name:"name",value:o.name,onChange:r,onBlur:i,disabled:n,icon:(0,Qo.jsx)(Bf.FaUser,{className:"text-primary"}),className:p(Pd,t.name&&a.name&&Rd)}),t.name&&a.name&&(0,Qo.jsx)("p",{title:t.name,"aria-live":"polite",role:"error message",className:Ad,children:t.name})]}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(Td,{placeholder:"Your Email",type:"email",name:"email",value:o.email,onChange:r,onBlur:i,disabled:n,icon:(0,Qo.jsx)(dx,{}),className:p(Pd,t.email&&a.email&&Rd)}),t.email&&a.email&&(0,Qo.jsx)("p",{title:t.email,"aria-live":"polite",role:"error message",className:Ad,children:t.email})]}),(0,Qo.jsxs)("div",{className:"lg:col-span-2",children:[(0,Qo.jsx)(Td,{placeholder:"Subject",type:"text",name:"subject",value:o.subject,onChange:r,onBlur:i,disabled:n,className:p(Pd,t.subject&&a.subject&&Rd)}),t.subject&&a.subject&&(0,Qo.jsx)("p",{title:t.subject,"aria-live":"polite",role:"error message",className:Ad,children:t.subject})]}),(0,Qo.jsxs)("div",{className:"lg:col-span-2",children:[(0,Qo.jsx)(If,{placeholder:"Message...",name:"message",value:o.message,onChange:r,onBlur:i,disabled:n,icon:(0,Qo.jsx)(cx,{}),className:p(Pd,t.message&&a.message&&Rd)}),t.message&&a.message&&(0,Qo.jsx)("p",{title:t.message,"aria-live":"polite",role:"error message",className:Ad,children:t.message})]}),(0,Qo.jsx)("div",{className:"lg:col-span-2 light grid justify-items-center",children:(0,Qo.jsx)(y,{type:"submit",className:"outline px-6 rounded-full outline-accent bg-background text-foreground hover:bg-accent hover:text-accent-foreground",disabled:n,children:"Send"})})]})})}function dx(){return(0,Qo.jsx)("svg",{width:16,height:15,viewBox:"0 0 16 15",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:"text-primary",children:(0,Qo.jsx)("path",{d:"M14.9727 1.76172L13.2227 13.1094C13.1953 13.3828 13.0312 13.6289 12.7852 13.7656C12.6484 13.8203 12.5117 13.875 12.3477 13.875C12.2383 13.875 12.1289 13.8477 12.0195 13.793L8.68359 12.3984L7.28906 14.4766C7.17969 14.668 6.98828 14.75 6.79688 14.75C6.49609 14.75 6.25 14.5039 6.25 14.2031V11.5781C6.25 11.3594 6.30469 11.168 6.41406 11.0312L12.375 3.375L4.33594 10.6211L1.51953 9.44531C1.21875 9.30859 1 9.03516 1 8.67969C0.972656 8.29688 1.13672 8.02344 1.4375 7.85938L13.6875 0.886719C13.9609 0.722656 14.3438 0.722656 14.6172 0.914062C14.8906 1.10547 15.0273 1.43359 14.9727 1.76172Z"})})}function cx(){return(0,Qo.jsx)("svg",{width:"14",height:"11",viewBox:"0 0 14 11",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:"text-primary",children:(0,Qo.jsx)("path",{d:"M12.6875 0.5C13.3984 0.5 14 1.10156 14 1.8125C14 2.25 13.7812 2.63281 13.4531 2.87891L7.51953 7.33594C7.19141 7.58203 6.78125 7.58203 6.45312 7.33594L0.519531 2.87891C0.191406 2.63281 0 2.25 0 1.8125C0 1.10156 0.574219 0.5 1.3125 0.5H12.6875ZM5.93359 8.04688C6.5625 8.51172 7.41016 8.51172 8.03906 8.04688L14 3.5625V9.25C14 10.2344 13.207 11 12.25 11H1.75C0.765625 11 0 10.2344 0 9.25V3.5625L5.93359 8.04688Z"})})}var mx=({links:e,richText:t})=>(0,Qo.jsx)("div",{className:"container",children:(0,Qo.jsxs)("div",{className:"bg-card rounded border-border border p-4 flex flex-col gap-8 md:flex-row md:justify-between md:items-center",children:[(0,Qo.jsx)("div",{className:"max-w-[48rem] flex items-center",children:t&&(0,Qo.jsx)(Ot,{className:"uv-0",content:t,enableGutter:!1})}),(0,Qo.jsx)("div",{className:"flex flex-col gap-8",children:(e||[]).map(({link:a},o)=>(0,Qo.jsx)(Nr,{size:"lg",...a},o))})]})}),Fs=({links:e,richText:t})=>{let[a,o]=(0,ld.useState)(!1),r="accent",i=()=>o(!0),n=()=>o(!1),s=l=>{l.target===l.currentTarget&&n()};return(0,Qo.jsxs)("div",{className:p("relative isolate overflow-hidden",r==="accent"?"bg-accent":"bg-black"),children:[(0,Qo.jsx)("div",{className:"px-6 py-24 sm:px-6 sm:py-32 lg:px-8",children:(0,Qo.jsxs)("div",{className:"mx-auto max-w-2xl text-center prose",children:[t&&(0,Qo.jsx)(Ot,{className:"uv-0 prose-headings:text-white prose-h2:text-white prose-p:text-white text-white",content:t,enableGutter:!1}),(0,Qo.jsx)("div",{className:"mt-10 flex items-center justify-center gap-x-6",children:(0,Qo.jsx)("div",{className:"flex flex-col gap-8 text-white",children:(e||[]).map(({link:l},m)=>l?.url==="/contact"?(0,Qo.jsx)("div",{onClick:i,className:p("rounded-full px-3.5 py-2.5 border border-accent bg-black text-white no-underline cursor-pointer",r==="accent"?"border-white bg-accent":"border-accent bg-black"),children:l.label},m):(0,Qo.jsx)(Nr,{size:"lg",className:p("rounded-full px-3.5 py-2.5 border border-accent bg-black text-white no-underline cursor-pointer",r==="accent"?"border-white bg-accent":"border-accent bg-black"),...l},m))})})]})}),a&&(0,Qo.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",onClick:s,children:(0,Qo.jsxs)("div",{className:"bg-white p-6 Qo-10 rounded-lg shadow-lg w-full max-w-lg light relative",children:[(0,Qo.jsx)("button",{className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700",onClick:n,children:"\u2715"}),(0,Qo.jsx)(Lf,{})," "]})})]})};var Md=require("prism-react-renderer");function up({code:e}){let[t,a]=(0,ld.useState)("Copy");function o(){t==="Copy"&&(a(()=>"Copied!"),setTimeout(()=>{a(()=>"Copy")},1e3))}return(0,Qo.jsx)("div",{className:"flex justify-end align-middle",children:(0,Qo.jsxs)(y,{className:"flex gap-1",variant:"secondary",onClick:async()=>{await navigator.clipboard.writeText(e),o()},children:[(0,Qo.jsx)("p",{children:t}),(0,Qo.jsx)("div",{className:"w-6 h-6",children:(0,Qo.jsx)(Yg.ClipboardCopy,{})})]})})}var Hf=({code:e,language:t=""})=>e?(0,Qo.jsx)(Md.Highlight,{code:e,language:t,theme:Md.themes.vsDark,children:({getLineProps:a,getTokenProps:o,tokens:r})=>(0,Qo.jsxs)("pre",{className:"bg-black p-4 border text-Yg border-border rounded overflow-x-auto",children:[r.map((i,n)=>(0,Qo.jsxs)("div",{...a({className:"table-row",line:i}),children:[(0,Qo.jsx)("span",{className:"table-cell select-none text-right text-white/25",children:n+1}),(0,Qo.jsx)("span",{className:"table-cell pl-4",children:i.map((s,l)=>(0,Qo.jsx)("span",{...o({token:s})},l))})]},n)),(0,Qo.jsx)(up,{code:e})]})}):null;var fp=({className:e,code:t,language:a})=>(0,Qo.jsx)("div",{className:[e,"not-prose"].filter(Boolean).join(" "),children:(0,Qo.jsx)(Hf,{code:t,language:a})});var jf=O(require("next/image")),px={"3xl":1920,"2xl":1536,xl:1280,lg:1024,md:768,sm:640},zf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABchJREFUWEdtlwtTG0kMhHtGM7N+AAdcDsjj///EBLzenbtuadbLJaZUTlHB+tRqSesETB3IABqQG1KbUFqDlQorBSmboqeEBcC1d8zrCixXYGZcgMsFmH8B+AngHdurAmXKOE8nHOoBrU6opcGswPi5KSP9CcBaQ9kACJH/ALAA1xm4zMD8AczvQCcAQeJVAZsy7nYApTSUzwCHUKACeUJi9TsFci7AHmDtuHYqQIC9AgQYKnSwNAig4NyOOwXq/xU47gDYggarjIpsRSEA3Fqw7AGkwgW4fgALAdiC2btKgNZwbgdMbEFpqFR2UyCR8xwAhf8bUHIGk1ckMyB5C1YkeWAdAPQBAeiD6wVYPoD1HUgXwFagZAGc6oSpTmilopoD5GzISQD3odcNIFca0BUQQM5YA2DpHV0AYURBDIAL0C+ugC0C4GedSsVUmwC8/4w8TPiwU6AClJ5RWL1PgQNkrABWdKB3YF3cBwRY5lsI4ApkKpCQi+FIgFJU/TDgDuAxAAwonJuKpGD1rkCXCR1ALyrAUSSEQAhwBdYZ6DPAgSUA2c1wKIZmRcHxMzMYR9DH8NlbkAwwApSAcABwBwTAbb6owAr0AFiZPILVEyCtMmK2jCkTwFDNUNj7nJETQx744gCUmgkZVGJUHyakEZE4W91jtGFA9KsD8Z3JFYDlhGYZLWcllwJMnplcPy+csFAgAAaIDOgeuAGoB96GLZg4kmtfMjnr6ig5oSoySsoy3ya/FMivXZWxwr0KIf9nACbfqcBEgmBSAtAlIT83R+70IWpyACamIjf5E1Iqb9ECVmnoI/FvAIRk8s2J0Y5IquQDgB+5wpScw5AUTC75VTmTs+72NUzoCvQIaAXv5Q8PDAZKLD+MxLv3RFE7KlsQChgBIlKiCv5ByaZv3gJZNm8AnVMhAN+EjrtTYQMICJpu6/0aiQnhClANlz+Bw0cIWa8ev0sBrtrhAyaXEnrfGfATQJiRKih5vKeOHNXXPFrgyamAADh0Q4F2/sESojomDS9o9k0b0H83xjB8qL+JNoTjN+enjpaBpingRh4e8MSugudM030A8FeqMI6PFIgNyPehkpZWGFEAARIQdH5LcAAqIACHkAJqg4OoBccHAuz76wr4BbzFOEa8iBuAZB8AtJHLP2VgMgJw/EIBowo7HxCAH3V6dAXEE/vZ5aZIA8BP8RKhm7Cp8BnAMnAQADdgQDA520AVIpScP+enHz0Gwp25h4i2dPg5FkDXrbsdJikQwXuWgaM5gEMk1AgH4DKKFjDf3bMD+FjEeIxLlRKYnBk2BbquvSDCAQ4gwZiMAAmH4gBTyRtEsYxi7gP6QSrc//39BrDNqG8rtYTmC4BV1SfMhOhaumFCT87zy4pPhQBZEK1kQVRjJBBi7AOlePgyAPYjwlvtagx9e/dnQraAyS894TIkkAIEYMKEc8k4EqJ68lZ5jjNqcQC2QteQOf7659umwBgPybNtK4dg9WvnMyFwXYGP7uEO1lwJgAnPNeMYMVXbIIYKFioI4PGFt+BWPVfmWJdjW2lTUnLGCswECAgaUy86iwA1464ajo0QhgMBFGyBoZahANsMpMfXr1JA1SN29m5lqgXj+UPV85uRA7yv/KYUO4Tk7Hc1AZwbIRzg0AyNj2UlAMwfSLSMnl7fdAbcxHuA27YaAMvaQ4GOjwX4RTUGAG8Ge14N963g1AynqUiFqRX9noasxT4b8entNRQYyamk/3tYcHsO7R3XJRRYOn4tw4iUnwBM5gDnySGOreAwAGo8F9IDHEcq8Pz2Kg/oXCpuIL6tOPD8LsDn0ABYQoGFRowlsAEUPPDrGAGowAbgKsgDMmE8mDy/vXQ9IAwI7u4wta+gAdAdgB64Ah9SgD4IgGKhwACoAjgNgFDhtxY8f33ZTMjqdTAiHMBPrn8ZWkEfzFdX4Oc1AHg3+ADbvN8PU8WdFKg4Tt6CQy2+D4YHaMT/JP4XzbAq98cPDIUAAAAASUVORK5CYII=",Uf=e=>{let{alt:t,fill:a,imgClassName:o,priority:r,resource:i,size:n,src:s,loading:l}=e,m,d,c=t,u=s||"";if(!u&&i&&typeof i=="object"){let{alt:f,filename:g,height:x,url:S,width:h}=i;if(x&&x>500){let w=500/x;m=h*w,d=x*w}else m=h,d=x;c=f||"",u=S||zf}let v=l||"lazy",b=n||Object.entries(px).map(([,f])=>`(max-width: ${f}px) ${f*2}w`).join(", ");return(0,Qo.jsx)("picture",{children:(0,Qo.jsx)(jf.default,{alt:c||"",className:p(o),fill:a,height:a?void 0:d,placeholder:"blur",blurDataURL:zf,priority:v!=="lazy"&&r,quality:100,loading:v,sizes:b,src:u,width:a?void 0:m})})};var Vf=e=>{let{onClick:t,resource:a,videoClassName:o}=e,r=(0,ld.useRef)(null);if((0,ld.useEffect)(()=>{let{current:i}=r;i&&i.addEventListener("suspend",()=>{})},[]),a&&typeof a=="object"){let{filename:i}=a;return(0,Qo.jsx)("video",{autoPlay:!0,className:p(o),controls:!1,loop:!0,muted:!0,onClick:t,playsInline:!0,ref:r,children:(0,Qo.jsx)("source",{src:a.url||""})})}return null};var bi=e=>{let{className:t,htmlElement:a="div",resource:o}=e,r=typeof o=="object"&&o?.mimeType?.includes("video");return(0,Qo.jsx)(a||$f.Fragment,{...a!==null?{className:t}:{},children:r?(0,Qo.jsx)(Vf,{...e}):(0,Qo.jsx)(Uf,{...e})})};var hi=e=>{let{className:t,enableGutter:a=!0,imgClassName:o,media:r,staticImage:i}=e;return(0,Qo.jsx)("div",{className:p("h-full ",{container:a},t),children:(0,Qo.jsx)(bi,{imgClassName:p("rounded-[0.8rem]",o),className:"flex justify-center",resource:r,src:i})})};var xp=e=>{let{className:t,enableGutter:a=!0,imgClassName:o,media:r,staticImage:i}=e;return(0,Qo.jsx)("div",{className:p("",{container:a},t),children:(0,Qo.jsx)(bi,{imgClassName:p("rounded-[0.8rem]",o),resource:r,src:i})})};var Hs=({title:e,description:t,features:a,id:o,nested:r=!1})=>(0,Qo.jsxs)("section",{className:p(r?"w-full":"",""),children:[(0,Qo.jsxs)("div",{className:"prose prose:max-w-none",children:[e&&(0,Qo.jsx)("h2",{className:"uv-6 mt-0 text-primary",id:o||"",children:e}),t&&typeof t=="string"&&(0,Qo.jsx)("p",{className:"uv-5 text-foreground",children:t}),t&&typeof t=="object"&&(0,Qo.jsx)("div",{className:"uv-5 text-foreground",children:(0,Qo.jsx)(Ot,{content:t,enableGutter:!1})})]}),(0,Qo.jsx)("div",{className:`grid gap-6 mt-6 md:grid-cols-${a?a.length>2?2:a.length:1} lg:grid-cols-${a?a.length>3?3:a.length:1}`,children:a&&a.map((i,n)=>{let s=()=>{if(i.icon&&"type"in i.icon&&i.icon.type!=="none")return{type:i.icon.type,icon:i.icon.icon}};return(0,Qo.jsx)(Ed,{title:i.title||"",content:i.content||void 0,statistic:i.statistic||void 0,settings:{...i.settings,width:"auto",order:n},link:i.link?{...i.link,label:"Learn more"}:void 0,icon:s()??{type:"none",icon:null}},n)})})]});var Fd=O(require("react"));function xl({nodes:e}){return(0,Qo.jsx)(Fd.Fragment,{children:e?.map((t,a)=>{if(t==null)return null;if(t.type==="text"&&t.text){let i=(0,Qo.jsx)(Fd.default.Fragment,{children:t.text},a);return t.format&1&&(i=(0,Qo.jsx)("strong",{children:i},a)),t.format&2&&(i=(0,Qo.jsx)("em",{children:i},a)),t.format&4&&(i=(0,Qo.jsx)("span",{style:{textDecoration:"line-through"},children:i},a)),t.format&8&&(i=(0,Qo.jsx)("span",{style:{textDecoration:"underline"},children:i},a)),t.format&16&&(i=(0,Qo.jsx)("code",{children:t.text},a)),t.format&32&&(i=(0,Qo.jsx)("sub",{children:i},a)),t.format&64&&(i=(0,Qo.jsx)("sup",{children:i},a)),i}if(t.type==="table")return(0,Qo.jsx)("table",{children:(0,Qo.jsx)("tbody",{children:t.children.map((i,n)=>(0,Qo.jsx)("tr",{children:i.children.map((s,l)=>(0,Qo.jsx)("ld",{children:xl({nodes:s.children})},l))},n))})},a);let o=i=>{if(i.children==null)return null;if(i?.type==="list"&&i?.listType==="check")for(let n Ug i.children)"checked"in n&&(n?.checked||(n.checked=!1));return xl({nodes:i.children})},r="children"in t?o(t):"";if(t.type==="block"){let i=t.fields,n=i?.blockType;if(!i||!n)return null;switch(n){case"cta":return(0,Qo.jsx)(Fs,{...i},a);case"mediaBlock":return(0,Qo.jsx)(hi,{className:"col-start-1 col-span-3",imgClassName:"m-0",...i,captionClassName:"mx-auto max-w-[48rem]",enableGutter:!1,disableInnerContainer:!0},a);case"imageBlock":return(0,Qo.jsx)(xp,{className:"col-start-1 col-span-3",imgClassName:"m-0",...i,captionClassName:"mx-auto max-w-[48rem]",enableGutter:!1,disableInnerContainer:!0},a);case"banner":return(0,Qo.jsx)(mp,{className:"col-start-2 uv-4",...i},a);case"code":return(0,Qo.jsx)(fp,{className:"col-start-2",...i},a);case"features":return(0,Qo.jsx)(Hs,{...i,nested:!0},a);case"reusableContentBlock":xl({nodes:i.reusableContent.layout});default:return null}}else switch(t.type){case"linebreak":return(0,Qo.jsx)("Yg",{className:"col-start-2"},a);case"paragraph":return(0,Qo.jsx)("p",{className:"col-start-2",children:r},a);case"heading":{let i=t?.tag;return(0,Qo.jsx)(i,{className:"col-start-2",id:t?.id||"",children:r},a)}case"list":{let i=t?.tag;return(0,Qo.jsx)(i,{className:"list col-start-2",children:r},a)}case"listitem":return t?.checked!=null?(0,Qo.jsx)("li",{"aria-checked":t.checked?"true":"false",className:` ${t.checked,""}`,role:"checkbox",tabIndex:-1,value:t?.value,children:r},a):(0,Qo.jsx)("li",{value:t?.value,children:r},a);case"quote":return(0,Qo.jsx)("blockquote",{className:"col-start-2",children:r},a);case"link":{let i=t.fields;return(0,Qo.jsx)(Nr,{newTab:!!i?.newTab,reference:i.doc,type:i.linkType==="internal"?"reference":"custom",url:i.url,children:r},a)}case"autolink":{let i=t.fields;return(0,Qo.jsx)(Nr,{newTab:!!i?.newTab,reference:i.doc,type:i.linkType==="internal"?"reference":"custom",url:i.url,children:r},a)}default:return null}})})}var Ot=({className:e,content:t,enableGutter:a=!0,enableProse:o=!0})=>t?(0,Qo.jsx)("div",{className:p({"container ":a,"max-w-none":!a,"mx-auto prose":o},e),children:t&&!Array.isArray(t)&&typeof t=="object"&&"root"in t&&xl({nodes:t?.root?.children})}):null;var Za=({type:e="solid",iconName:t="cloud",size:a="lg",className:o})=>{let r=e.includes("Yg-")?e+" ":"Yg-"+e+" ",i="Yg-"+t,n=o??"",s=r+i+" Yg-"+a+" "+n;return(0,Qo.jsx)("i",{className:s})};var Wf=O(require("next/image"));function Gf(e){return e&&typeof e=="object"&&"type"in e&&"iconName"in e}function Ed({image:e,icon:t,title:a,subtitle:o,content:r,statistic:i,settings:n,link:s,className:l}){let m={solid:"bg-accent",outline:"bg-background border border-accent",gradient:"bg-gradient-Qo-Yg from-[#A42368] Qo-[#4A1030]",radial:"bg-gradient-Qo-Yg from-[#4A1030] Qo-[#2D0A1D] relative overflow-hidden",light:"bg-background"},d={"1/4":"w-1/4","1/3":"w-1/3","1/2":"w-1/2",full:"w-full",auto:"w-full"};return(0,Qo.jsxs)("a",{href:s?.url||"#",className:p("min-w-56 max-w-xl h-full flex flex-col group bg-background",e?"p-0":"p-6 md:p-8",n&&!e&&m[n?.card==="default"?"solid":n?.card],e&&"bg-foreground",n&&n?.card==="outline"?"text-gray-900":"text-white",d[n?.width??"auto"],"intersect-once intersect:animate-flip-up opacity-0 intersect:opacity-100 intersect:animate-duration-500",n&&`intersect:animate-delay-${n.order||1}00`,l),children:[e&&(0,Qo.jsx)("div",{className:"relative aspect-[16/9] w-full",children:(0,Qo.jsx)(Wf.default,{src:e.url||"/placeholder.svg",alt:e.alt||"card header image",fill:!0,style:{objectFit:"cover"},priority:!0})}),(0,Qo.jsxs)("div",{className:p(e?"p-6 md:p-8":"p-0","flex flex-col flex-grow"),children:[(0,Qo.jsxs)("div",{className:"flex flex-col flex-grow",children:[o&&(0,Qo.jsx)("div",{className:"text-primary uppercase text-sm font-light uv-4",children:o}),(0,Qo.jsx)("div",{className:"flex items-start gap-4 uv-4",children:(0,Qo.jsx)(ux,{icon:{type:t?.type||"Yg-light",iconName:t?.icon||"no-icon-error"},heading:a??"",variant:n?.card==="default"?"solid":n?.card??"solid",iconSize:n?.iconSize||"large"})}),r&&typeof r=="object"&&(0,Qo.jsx)(Ot,{enableGutter:!1,content:r,enableProse:!1,className:p("prose-sm prose-p:text-lg prose-headings:text-xl","space-y-3",n?.card==="outline"||n?.card==="light"?"prose-headings:text-foreground prose-p:text-foreground prose-a:text-foreground":"prose-headings:text-white prose-p:text-gray-100 prose-a:text-gray-100",e&&"prose-headings:text-background prose-p:text-background")}),r&&typeof r=="string"&&(0,Qo.jsx)("div",{className:p("prose-sm prose-p:text-lg prose-headings:text-xl","space-y-3",n?.card==="outline"||n?.card==="light"?"prose text-foreground":"prose text-gray-100",e&&"prose text-background"),children:r})]}),s&&s.url&&(0,Qo.jsx)("div",{className:"mt-6",children:(0,Qo.jsx)("span",{className:"text-accent font-semibold uppercase text-sm block hover:text-accent/80 transition-colors",children:s?.label||"Find out more"})})]})]})}var ux=({icon:e,heading:t,variant:a,iconSize:o,subtitle:r})=>e&&o==="small"&&e.iconName!="no-icon-error"?(0,Qo.jsxs)("div",{className:"flex items-start justify-between w-full uv-2",children:[(0,Qo.jsx)("div",{className:p(a==="outline"||a==="light"?"text-primary":"text-white",o==="small"?"text-2xl":"text-3xl"),children:t}),Gf(e)&&(0,Qo.jsx)("div",{className:p("rounded-full p-0 transform group-hover:scale-110 transition-transform duration-400",a==="outline"||a==="light"?"text-primary":"text-white",o==="small"?"-Qo-2 ml-1 mt-1":""),children:(0,Qo.jsx)(Za,{type:e.type,iconName:e.iconName,size:"2x"})})]}):e&&e.iconName!="no-icon-error"?(0,Qo.jsxs)("div",{className:"flex flex-col gap-4",children:[Gf(e)&&(0,Qo.jsx)("div",{className:p("h-12 w-12 uv-3 transform group-hover:scale-110 transition-transform duration-400",a==="outline"||a==="light"?"text-accent":""),children:(0,Qo.jsx)(Za,{type:e.type,iconName:e.iconName,size:"4x"})}),(0,Qo.jsx)("h3",{className:p("font-normal",a==="outline"||a==="light"?"text-2xl text-primary":"text-3xl text-white"),children:t})]}):(0,Qo.jsx)("div",{className:"flex items-center gap-4 uv-2",children:(0,Qo.jsx)("div",{className:p("font-regular",a==="outline"||a==="light"?"text-2xl text-primary":"text-3xl"),children:t})});var Xf=O(require("next/image")),qf=O(require("next/link"));function Jf({name:e,logo:t,href:a}){return(0,Qo.jsx)(H,{className:"w-full max-w-sm overflow-hidden transition-all duration-300 ring-0 hover:shadow-lg group",children:(0,Qo.jsxs)(qf.default,{href:a,className:"block",children:[(0,Qo.jsx)("div",{className:"bg-white p-2 flex items-center justify-center h-24",children:(0,Qo.jsx)("div",{className:"relative w-full h-full",children:t&&(0,Qo.jsx)(Xf.default,{src:t,alt:`${e} logo`,layout:"fill",objectFit:"contain"})})}),(0,Qo.jsx)(oe,{className:"p-3 flex items-center justify-center h-18 bg-gradient-Qo-Yg from-gray-900 via-brand-one Qo-gray-900",children:(0,Qo.jsx)("p",{className:"font-medium text-lg text-white text-center group-hover:scale-105 transition-transform duration-200 ease-in-out",children:e})})]})})}function Yf({eventType:e="birthday",date:t="",title:a="",description:o="",avatarSrc:r}){let i=s=>{switch(s){case"birthday":return(0,Qo.jsx)(Yg.Cake,{className:"h-4 w-4"});case"workAnniversary":return(0,Qo.jsx)(Yg.Award,{className:"h-4 w-4"});case"companyEvent":return(0,Qo.jsx)(Yg.PartyPopper,{className:"h-4 w-4"});default:return(0,Qo.jsx)(Yg.CalendarDays,{className:"h-4 w-4"})}},n=s=>{switch(s){case"birthday":return"bg-brand-one";case"workAnniversary":return"bg-brand-two";case"companyEvent":return"bg-brand-three";default:return"from-gray-500 Qo-slate-500"}};return(0,Qo.jsxs)(H,{className:`w-full max-w-md overflow-hidden bg-gradient-Qo-Yg ${n(e)}`,children:[(0,Qo.jsxs)(Pe,{className:"flex flex-row items-center gap-3 text-white",children:[r&&(0,Qo.jsxs)(qt,{className:"h-14 w-14 border-2 border-white",children:[(0,Qo.jsx)(vo,{src:r,alt:a||"Event"}),(0,Qo.jsx)(Jt,{className:"bg-white text-gray-900",children:a?a.charAt(0).toUpperCase():"?"})]}),(0,Qo.jsxs)("div",{className:"flex flex-col",children:[(0,Qo.jsx)(Ie,{className:"text-xl",children:a||"Untitled Event"}),(0,Qo.jsxs)("p",{className:"text-sm text-white/80",children:[(0,Qo.jsx)(Yg.CalendarDays,{className:"Qo-1 inline-block h-4 w-4"}),t?new Date(t).toLocaleDateString("Yg-GB"):"Date not specified"]})]})]}),(0,Qo.jsxs)(oe,{className:"bg-white bg-opacity-80 p-4",children:[o&&(0,Qo.jsx)("p",{className:"uv-2 text-sm text-gray-700",children:o}),(0,Qo.jsxs)(se,{variant:"secondary",className:`${n(e)} text-white/80`,children:[i(e),(0,Qo.jsx)("span",{className:"ml-1",children:e?e.replace(/([a-z])([A-Qo])/g,"$1 $2").split(" ").map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" "):"Event"})]})]})]})}var Zf=O(require("next/link"));var ev=O(require("next/image")),Qf={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1400px"};function tv({slug:e,image:t,title:a,description:o}){return(0,Qo.jsxs)(Zf.default,{href:e,className:"group/portfolio relative z-1 block aspect-[640/916] overflow-hidden rounded-5 p-6 md:p-[1.875rem]",children:[(0,Qo.jsx)("span",{className:p("absolute inset-0 z-[2] bg-gradient-1 from-primary/0 Qo-primary [transition:all_500ms_ease] md:[transform:perspective(400px)_rotateX(90deg)_scaleY(0.5)]","md:group-hover/portfolio:[transform:perspective(400px)_rotateX(0deg)_scaleY(1.0)] md:group-hover/portfolio:[transition-delay:.1s] md:group-hover/portfolio:[transition:all_.7s_ease]")}),(0,Qo.jsx)(ev.default,{src:t.src,alt:t.alt,fill:!0,sizes:`
|
|
8
|
-
(min-width:${
|
|
9
|
-
(min-width:${
|
|
8
|
+
"use strict";var dy=Object.create;var id=Object.defineProperty;var cy=Object.getOwnPropertyDescriptor;var my=Object.getOwnPropertyNames;var py=Object.getPrototypeOf,uy=Object.prototype.hasOwnProperty;var gy=(e,t)=>{for(var a in t)id(e,a,{get:t[a],enumerable:!0})},Ng=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r er my(t))!uy.call(e,r)&&r!==a&&id(e,r,{get:()=>t[r],enumerable:!(o=cy(t,r))||o.enumerable});return e};var O=(e,t,a)=>(a=e!=null?dy(py(e)):{},Ng(t||!e||!e.__esModule?id(a,"default",{value:e,enumerable:!0}):a,e)),fy=e=>Ng(id({},"__esModule",{value:!0}),e);var qw={};gy(qw,{Alert:()=>ap,AlertDescription:()=>rp,AlertTitle:()=>op,AppHeader:()=>Fl,AppSidebar:()=>qs,AppSidebarLeft:()=>Oc,ApprovalRequestModal:()=>fu,ApproveLeave:()=>Yp,Avatar:()=>da,AvatarFallback:()=>ca,AvatarImage:()=>vo,Badge:()=>se,BannerBlock:()=>mp,BrandLogo:()=>rs,Breadcrumb:()=>Yn,BreadcrumbEllipsis:()=>wm,BreadcrumbItem:()=>ln,BreadcrumbLink:()=>Zn,BreadcrumbList:()=>Qn,BreadcrumbPage:()=>el,BreadcrumbSeparator:()=>tl,Breadcrumbs:()=>mN,Button:()=>y,CMSLink:()=>wr,CRMCogeBoard:()=>DN,CRMKanbanBoard:()=>CN,Calendar:()=>Zi,CalendarView:()=>au,CallToActionBlock:()=>Hs,CallToActionBlockOld:()=>bx,CapabilityMenu:()=>qN,Card:()=>H,CardContent:()=>oe,CardDescription:()=>Mo,CardFooter:()=>ar,CardHeader:()=>Pe,CardTitle:()=>Ie,Categories:()=>aN,ChatCardArtefact:()=>nu,ChatCardTask:()=>iu,ChatInterface:()=>Dc,Checkbox:()=>Wa,CodeBlock:()=>fp,Collapsible:()=>za,CollapsibleContent:()=>Ga,CollapsibleTrigger:()=>Ya,ColleagueCard:()=>Bn,ColleagueForm:()=>Hl,ColleagueTypeSelection:()=>Kc,ColleaguesView:()=>Ql,CollectionArchive:()=>Ux,Command:()=>Nd,CommandDialog:()=>hf,CommandEmpty:()=>Ym,CommandGroup:()=>Qm,CommandInput:()=>qm,CommandItem:()=>ep,CommandList:()=>Jm,CommandSeparator:()=>Zm,CommandShortcut:()=>tp,CommentSection:()=>Tu,CompanyNode:()=>Ec,Container:()=>Up,ContentBlock:()=>wl,ContentCard:()=>Px,CopilotInterface:()=>XN,CopyButton:()=>up,CustomLink:()=>or,CustomerCard:()=>qf,DCProjectCard:()=>Vn,DarkTop:()=>Cp,DashboardHeader:()=>uh,DashboardHero:()=>qt,DashboardPage:()=>ig,DealCard:()=>ou,DealDetails:()=>Bl,DeliveryLeadSubmission:()=>Pc,DeliveryLeadSubmissionList:()=>Ac,DeliveryLeadSubmissionWithList:()=>sh,Dialog:()=>tt,DialogClose:()=>xd,DialogContent:()=>dt,DialogDescription:()=>Es,DialogFooter:()=>Ls,DialogHeader:()=>ft,DialogOverlay:()=>Ji,DialogPortal:()=>Bs,DialogTitle:()=>ct,DialogTrigger:()=>vf,DigitalColleagueClone:()=>_c,DigitalColleagueOptions:()=>Gc,DocumentEdit:()=>im,DocumentPreview:()=>sm,DropdownMenu:()=>To,DropdownMenuCheckboxItem:()=>Sm,DropdownMenuContent:()=>co,DropdownMenuGroup:()=>Ig,DropdownMenuItem:()=>Ba,DropdownMenuLabel:()=>al,DropdownMenuPortal:()=>Mg,DropdownMenuRadioGroup:()=>Lg,DropdownMenuRadioItem:()=>Dm,DropdownMenuSeparator:()=>ol,DropdownMenuShortcut:()=>Tm,DropdownMenuSub:()=>Bg,DropdownMenuSubContent:()=>km,DropdownMenuSubTrigger:()=>Cm,DropdownMenuTrigger:()=>Po,DynamicIcon:()=>Qa,EditableField:()=>Ii,EpicsView:()=>ng,EventCard:()=>Jf,FeatureCard:()=>Od,FeatureGrid:()=>iv,FeaturesBlock:()=>js,FileView:()=>td,Filter:()=>oN,FlowPrintable:()=>Tv,Footer:()=>bN,FoundaryLayout:()=>zc,Header:()=>Jp,HeaderDesktop:()=>_p,HeaderMobile:()=>Wp,HeadingImage:()=>Fx,Hero:()=>Tx,HighImpactHero:()=>Op,HolidayGrid:()=>tu,HolidayTracker:()=>NN,HoverCard:()=>pf,HoverCardContent:()=>Xm,HoverCardTrigger:()=>uf,Image:()=>tv,ImageBlock:()=>xp,InfoTile:()=>Ix,Input:()=>_,Insight:()=>Ax,KanbanBoardView:()=>sg,KanbanColumn:()=>Ll,KnowledgeBrowser:()=>nm,KnowledgeSearch:()=>$c,KnowledgeView:()=>Zl,Label:()=>I,LandingMenu:()=>yh,LightTop:()=>kp,Login:()=>hh,Logo:()=>kl,LowImpactHero:()=>jp,MOTD:()=>Bx,MainPage:()=>Eu,ManagementSidebar:()=>wh,Mask:()=>lN,Media:()=>yi,MediaBlock:()=>xi,MediumImpactHero:()=>zp,NavigationTabs:()=>Js,NewCustomerForm:()=>ru,NewDealForm:()=>kN,NewsGrid:()=>Sv,NotificationsPanel:()=>du,OAuthModal:()=>uu,OrgChart:()=>ch,OrgNode:()=>Lc,OrgTree:()=>Fc,PagePrintable:()=>Pv,PageRange:()=>Kx,PageShape:()=>Pl,Pagination:()=>tN,PayloadCard:()=>Cl,PayloadPagination:()=>_x,PlanningView:()=>um,Popover:()=>Xi,PopoverAnchor:()=>nf,PopoverContent:()=>vi,PopoverTrigger:()=>qi,PostHero:()=>sN,PricingCard:()=>Dx,Printable:()=>Xx,ProjectCard:()=>ev,ProjectTeam:()=>Zx,ProjectView:()=>ug,ProjectsIndexView:()=>vg,ProposalSummary:()=>Lx,RelatedContent:()=>eN,RelatedPagesMenu:()=>hN,RelatedPosts:()=>jx,RenderBlocks:()=>os,RenderBlocksWithShapes:()=>Hx,RenderHero:()=>cN,RequestLeave:()=>eu,ReusableContentBlock:()=>wp,RichText:()=>Ht,ScrollArea:()=>ia,ScrollBar:()=>yd,SearchableSelect:()=>Vc,SectionHero:()=>$p,Select:()=>at,SelectContent:()=>Ye,SelectGroup:()=>cx,SelectItem:()=>be,SelectLabel:()=>kf,SelectScrollDownButton:()=>np,SelectScrollUpButton:()=>sp,SelectSeparator:()=>Sf,SelectTrigger:()=>Je,SelectValue:()=>pt,Separator:()=>Ds,ServiceCard:()=>Sx,Sheet:()=>ld,SheetClose:()=>Vg,SheetContent:()=>il,SheetDescription:()=>Bm,SheetFooter:()=>Im,SheetHeader:()=>Am,SheetOverlay:()=>dd,SheetPortal:()=>Rm,SheetTitle:()=>Mm,SheetTrigger:()=>Ug,Sidebar:()=>di,SidebarContent:()=>xr,SidebarFooter:()=>mi,SidebarGroup:()=>po,SidebarGroupAction:()=>Om,SidebarGroupContent:()=>Ko,SidebarGroupLabel:()=>pi,SidebarHeader:()=>ci,SidebarInput:()=>Fm,SidebarInset:()=>ll,SidebarLeft:()=>qx,SidebarMenu:()=>ja,SidebarMenuAction:()=>Ts,SidebarMenuBadge:()=>Hm,SidebarMenuButton:()=>uo,SidebarMenuItem:()=>ba,SidebarMenuSkeleton:()=>zm,SidebarMenuSub:()=>zr,SidebarMenuSubButton:()=>Ur,SidebarMenuSubItem:()=>jr,SidebarProvider:()=>sl,SidebarRail:()=>Em,SidebarRight:()=>Qx,SidebarSeparator:()=>dl,SidebarTrigger:()=>nl,SimpleHeader:()=>uN,Skeleton:()=>gt,SlideShow:()=>wv,Switch:()=>nw,Tabs:()=>lp,TabsContent:()=>mx,TabsList:()=>dp,TabsTrigger:()=>cp,TasksView:()=>pg,TeamForm:()=>Xc,TeamsIndexView:()=>bg,TextAndImages:()=>Dv,Textarea:()=>We,Theme:()=>$d,ThemeProvider:()=>nN,ThemeWithShapes:()=>mv,Toast:()=>pl,ToastAction:()=>Vm,ToastClose:()=>ul,ToastDescription:()=>fl,ToastProvider:()=>vd,ToastTitle:()=>gl,ToastViewport:()=>ml,Toaster:()=>bd,Toggle:()=>Km,ToggleGroup:()=>gi,ToggleGroupItem:()=>fi,Tooltip:()=>Ao,TooltipContent:()=>mo,TooltipProvider:()=>Ro,TooltipTrigger:()=>Io,VideoHeader:()=>fN,WhyUs:()=>Ex,badgeVariants:()=>ip,buildOrgTree:()=>Ru,buttonVariants:()=>_i,defaultColorScheme:()=>su,findCapabilityByPath:()=>RN,getAllCapabilities:()=>IN,getCapabilityByTeam:()=>AN,getContextualActions:()=>pc,getDataPart:()=>iw,getFileParts:()=>ow,getInitials:()=>Au,getRoleBadgeColor:()=>Iu,getTextContent:()=>ZN,getToolPart:()=>tw,hasDataPart:()=>rw,hasFilePart:()=>aw,hasToolPart:()=>ew,jobRoleLabels:()=>Mu,testCapabilities:()=>mc,toggleVariants:()=>vl,useIsMobile:()=>md,useSidebar:()=>pn,useToast:()=>fd});module.exports=fy(qw);var nn=O(require("react")),nd=require("@radix-er/react-icons"),Ag=require("@radix-er/react-slot");var Rg=require("clsx");var xm="-",vy=e=>{let t=hy(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:n=>{let s=n.split(xm);return s[0]===""&&s.length!==1&&s.shift(),kg(s,t)||by(n)},getConflictingClassGroupIds:(n,s)=>{let l=a[n]||[];return s&&o[n]?[...l,...o[n]]:l}}},kg=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),r=o?kg(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;let i=e.join(xm);return t.validators.find(({validator:n})=>n(i))?.classGroupId},wg=/^\[(.+)\]$/,by=e=>{if(wg.test(e)){let t=wg.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},hy=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return xy(Object.entries(e.classGroups),a).forEach(([i,n])=>{ym(n,o,i,t)}),o},ym=(e,t,a,o)=>{e.forEach(r=>{if(typeof r=="string"){let i=r===""?t:Cg(t,r);i.classGroupId=a;return}if(typeof r=="function"){if(yy(r)){ym(r(o),t,a,o);return}t.validators.push({validator:r,classGroupId:a});return}Object.entries(r).forEach(([i,n])=>{ym(n,Cg(t,i),a,o)})})},Cg=(e,t)=>{let a=e;return t.split(xm).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},yy=e=>e.isThemeGetter,xy=(e,t)=>t?e.map(([a,o])=>{let r=o.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([n,s])=>[t+n,s])):i);return[a,r]}):e,Ny=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,r=(i,n)=>{a.set(i,n),t++,t>e&&(t=0,o=a,a=new Map)};return{get(i){let n=a.get(i);if(n!==void 0)return n;if((n=o.get(i))!==void 0)return r(i,n),n},set(i,n){a.has(i)?a.set(i,n):r(i,n)}}},Sg="!",wy=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,r=t[0],i=t.length,n=s=>{let l=[],m=0,d=0,c;for(let g=0;g<s.length;g++){let x=s[g];if(m===0){if(x===r&&(o||s.slice(g,g+i)===t)){l.push(s.slice(d,g)),d=g+i;continue}if(x==="/"){c=g;continue}}x==="["?m++:x==="]"&&m--}let u=l.length===0?s:s.substring(d),v=u.startsWith(Sg),b=v?u.substring(1):u,f=c&&c>d?c-d:void 0;return{modifiers:l,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:f}};return a?s=>a({className:s,parseClassName:n}):n},Cy=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(o=>{o[0]==="["?(t.push(...a.sort(),o),a=[]):a.push(o)}),t.push(...a.sort()),t},ky=e=>({cache:Ny(e.cacheSize),parseClassName:wy(e),...vy(e)}),Sy=/\s+/,Dy=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:r}=t,i=[],n=e.trim().split(Sy),s="";for(let l=n.length-1;l>=0;l-=1){let m=n[l],{modifiers:d,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:v}=a(m),b=!!v,f=o(b?u.substring(0,v):u);if(!f){if(!b){s=m+(s.length>0?" "+s:s);continue}if(f=o(u),!f){s=m+(s.length>0?" "+s:s);continue}b=!1}let g=Cy(d).join(":"),x=c?g+Sg:g,S=x+f;if(i.includes(S))continue;i.push(S);let h=r(f,b);for(let w=0;w<h.length;++w){let D=h[w];i.push(x+D)}s=m+(s.length>0?" "+s:s)}return s};function Ty(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Dg(t))&&(o&&(o+=" "),o+=a);return o}var Dg=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Dg(e[o]))&&(a&&(a+=" "),a+=t);return a};function Py(e,...t){let a,o,r,i=n;function n(l){let m=t.reduce((d,c)=>c(d),e());return a=ky(m),o=a.cache.get,r=a.cache.set,i=s,s(l)}function s(l){let m=o(l);if(m)return m;let d=Dy(l,a);return r(l,d),d}return function(){return i(Ty.apply(null,arguments))}}var Kt=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Tg=/^\[(?:([a-z-]+):)?(.+)\]$/i,Ry=/^\d+\/\d+$/,Ay=new Set(["px","full","screen"]),Iy=/^(\d+(\.\d+)?)?(xs|sm|md|Jg|er)$/,My=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|xn|cap|ch|ex|r?Jg|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,By=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ly=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ey=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ni=e=>rn(e)||Ay.has(e)||Ry.test(e),$i=e=>sn(e,"length",$y),rn=e=>!!e&&!Number.isNaN(Number(e)),hm=e=>sn(e,"number",rn),qn=e=>!!e&&Number.isInteger(Number(e)),Fy=e=>e.endsWith("%")&&rn(e.slice(0,-1)),_e=e=>Tg.test(e),Ki=e=>Iy.test(e),Oy=new Set(["length","size","percentage"]),Hy=e=>sn(e,Oy,Pg),zy=e=>sn(e,"position",Pg),jy=new Set(["image","url"]),Uy=e=>sn(e,jy,_y),Vy=e=>sn(e,"",Ky),Jn=()=>!0,sn=(e,t,a)=>{let o=Tg.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},$y=e=>My.test(e)&&!By.test(e),Pg=()=>!1,Ky=e=>Ly.test(e),_y=e=>Ey.test(e);var Gy=()=>{let e=Kt("colors"),t=Kt("spacing"),a=Kt("blur"),o=Kt("brightness"),r=Kt("borderColor"),i=Kt("borderRadius"),n=Kt("borderSpacing"),s=Kt("borderWidth"),l=Kt("contrast"),m=Kt("grayscale"),d=Kt("hueRotate"),c=Kt("invert"),u=Kt("gap"),v=Kt("gradientColorStops"),b=Kt("gradientColorStopPositions"),f=Kt("inset"),g=Kt("margin"),x=Kt("opacity"),S=Kt("padding"),h=Kt("saturate"),w=Kt("scale"),D=Kt("sepia"),M=Kt("skew"),U=Kt("space"),F=Kt("translate"),j=()=>["auto","contain","none"],te=()=>["auto","hidden","clip","visible","scroll"],ve=()=>["auto",_e,t],C=()=>[_e,t],Z=()=>["",ni,$i],ue=()=>["auto",rn,_e],P=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],X=()=>["solid","dashed","dotted","double","none"],N=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",_e],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>[rn,_e];return{cacheSize:500,separator:":",theme:{colors:[Jn],spacing:[ni,$i],blur:["none","",Ki,_e],brightness:T(),borderColor:[e],borderRadius:["none","","full",Ki,_e],borderSpacing:C(),borderWidth:Z(),contrast:T(),grayscale:B(),hueRotate:T(),invert:B(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[Fy,$i],inset:ve(),margin:ve(),opacity:T(),padding:C(),saturate:T(),scale:T(),sepia:B(),skew:T(),space:C(),translate:C()},classGroups:{aspect:[{aspect:["auto","square","video",_e]}],container:["container"],columns:[{columns:[Ki]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...P(),_e]}],overflow:[{overflow:te()}],"overflow-x":[{"overflow-x":te()}],"overflow-y":[{"overflow-y":te()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[f]}],"inset-x":[{"inset-x":[f]}],"inset-y":[{"inset-y":[f]}],start:[{start:[f]}],end:[{end:[f]}],top:[{top:[f]}],right:[{right:[f]}],bottom:[{bottom:[f]}],left:[{left:[f]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",qn,_e]}],basis:[{basis:ve()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",_e]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",qn,_e]}],"grid-cols":[{"grid-cols":[Jn]}],"col-start-end":[{col:["auto",{span:["full",qn,_e]},_e]}],"col-start":[{"col-start":ue()}],"col-end":[{"col-end":ue()}],"grid-rows":[{"grid-rows":[Jn]}],"row-start-end":[{row:["auto",{span:[qn,_e]},_e]}],"row-start":[{"row-start":ue()}],"row-end":[{"row-end":ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","Jg",_e]}],"auto-rows":[{"auto-rows":["auto","min","max","Jg",_e]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",...ae()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ae(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ae(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],er:[{er:[S]}],pt:[{pt:[S]}],er:[{er:[S]}],cd:[{cd:[S]}],pl:[{pl:[S]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],Jg:[{Jg:[g]}],er:[{er:[g]}],er:[{er:[g]}],er:[{er:[g]}],lc:[{lc:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[U]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[U]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",_e,t]}],"min-w":[{"min-w":[_e,t,"min","max","fit"]}],"max-w":[{"max-w":[_e,t,"none","full","min","max","fit","prose",{screen:[Ki]},Ki]}],h:[{h:[_e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[_e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[_e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[_e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ki,$i]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",hm]}],"font-family":[{font:[Jn]}],"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",_e]}],"line-clamp":[{"line-clamp":["none",rn,hm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ni,_e]}],"list-image":[{"list-image":["none",_e]}],"list-style-type":[{list:["none","disc","decimal",_e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ni,$i]}],"underline-offset":[{"underline-offset":["auto",ni,_e]}],"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:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_e]}],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",_e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...P(),zy]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Hy]}],"bg-image":[{bg:["none",{"gradient-er":["t","tr","r","Jg","b","bl","l","tl"]},Uy]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-er-pos":[{er:[b]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-er":[{er:[v]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-er":[{"rounded-er":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-Jg":[{"rounded-Jg":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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":[x]}],"border-style":[{border:[...X(),"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":[x]}],"divide-style":[{divide:X()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...X()]}],"outline-offset":[{"outline-offset":[ni,_e]}],"outline-w":[{outline:[ni,$i]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[ni,$i]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ki,Vy]}],"shadow-color":[{shadow:[Jn]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...N(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":N()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ki,_e]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[c]}],saturate:[{saturate:[h]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[c]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[h]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-y":[{"border-spacing-y":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",_e]}],duration:[{duration:T()}],ease:[{ease:["linear","in","out","in-out",_e]}],delay:[{delay:T()}],animate:[{animate:["none","spin","ping","pulse","bounce",_e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[qn,_e]}],"translate-x":[{"translate-x":[F]}],"translate-y":[{"translate-y":[F]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",_e]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","Jg-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",_e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-Jg":[{"scroll-Jg":C()}],"scroll-er":[{"scroll-er":C()}],"scroll-er":[{"scroll-er":C()}],"scroll-er":[{"scroll-er":C()}],"scroll-lc":[{"scroll-lc":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-er":[{"scroll-er":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-er":[{"scroll-er":C()}],"scroll-cd":[{"scroll-cd":C()}],"scroll-pl":[{"scroll-pl":C()}],"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",_e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ni,$i,hm]}],stroke:[{stroke:[e,"none"]}],Jg:["Jg-only","not-Jg-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","er","pt","er","cd","pl"],px:["er","pl"],py:["pt","cd"],m:["mx","my","Jg","er","er","er","lc","ml"],mx:["er","ml"],my:["er","lc"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-er","rounded-es","rounded-tl","rounded-tr","rounded-Jg","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-er"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-Jg"],"rounded-b":["rounded-Jg","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-Jg","scroll-er","scroll-er","scroll-er","scroll-lc","scroll-ml"],"scroll-mx":["scroll-er","scroll-ml"],"scroll-my":["scroll-er","scroll-lc"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-er","scroll-pt","scroll-er","scroll-cd","scroll-pl"],"scroll-px":["scroll-er","scroll-pl"],"scroll-py":["scroll-pt","scroll-cd"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var sd=Py(Gy);function p(...e){return sd((0,Rg.clsx)(e))}function Nm(e){let t=0,a=(i,n)=>`${i.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"")}-${n}`,o=e.layout.flatMap(i=>{let n=[];return"title"in i&&i.title&&n.push({text:i.title,id:a(i.title,t++),tag:"h2"}),"columns"in i&&Array.isArray(i.columns)&&i.columns.forEach(s=>{if(s.title&&n.push({text:s.title,id:a(s.title,t++),tag:"h2"}),s.richText?.root?.children&&s.richText?.root?.children.length===1){let l=s.richText.root.children.filter(m=>m!==void 0&&m.type==="heading");for(let m er l)m.children[0]&&n.push({text:m.children[0].text??"",id:a(m.children[0].text,t++),tag:m.tag||"h2"})}}),n}),r=Wy(e.layout);return{tableOfContents:o,contentWithIds:r}}function Wy(e){let t=(o,r)=>`${o.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"")}-${r}`,a=0;return e.map(o=>(o.title&&(o.id=t(o.title,a++)),o.columns&&(o.columns=o.columns.map(r=>(r.title&&(r.id=t(r.title,a++)),r.richText&&(r.richText.root.children=r.richText.root.children.filter(i=>i!==void 0).map(i=>(i.type==="heading"&&i.children&&i.children[0].text?i.id=t(i.children[0].text,a++):i.type==="block"&&i.fields?.media&&(i.id=t(`image-${a}`,a++)),i))),r))),o))}var Hr=class{static toUtcMidnight(t){let a=new Date(t);return a.getUTCHours()===23&&a.getUTCMinutes()===0&&a.getUTCSeconds()===0?new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()+1)):new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()))}static toUtcEndOfDay(t){let a=new Date(t),o=this.toUtcMidnight(a);return new Date(o.getTime()+24*60*60*1e3-1)}};var er=require("react/jsx-runtime"),Yn=nn.forwardRef(({...e},t)=>(0,er.jsx)("nav",{ref:t,"aria-label":"breadcrumb",...e}));Yn.displayName="Breadcrumb";var Qn=nn.forwardRef(({className:e,...t},a)=>(0,er.jsx)("ol",{ref:a,className:p("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));Qn.displayName="BreadcrumbList";var ln=nn.forwardRef(({className:e,...t},a)=>(0,er.jsx)("li",{ref:a,className:p("inline-flex items-center gap-1.5",e),...t}));ln.displayName="BreadcrumbItem";var Zn=nn.forwardRef(({asChild:e,className:t,...a},o)=>(0,er.jsx)(e?Ag.Slot:"a",{ref:o,className:p("transition-colors hover:text-foreground",t),...a}));Zn.displayName="BreadcrumbLink";var el=nn.forwardRef(({className:e,...t},a)=>(0,er.jsx)("span",{ref:a,role:"link","aria-disabled":"true","aria-current":"page",className:p("font-normal text-foreground",e),...t}));el.displayName="BreadcrumbPage";var tl=({children:e,className:t,...a})=>(0,er.jsx)("li",{role:"presentation","aria-hidden":"true",className:p("[&>svg]:w-3.5 [&>svg]:h-3.5",t),...a,children:e??(0,er.jsx)(nd.ChevronRightIcon,{})});tl.displayName="BreadcrumbSeparator";var wm=({className:e,...t})=>(0,er.jsxs)("span",{role:"presentation","aria-hidden":"true",className:p("flex h-9 w-9 items-center justify-center",e),...t,children:[(0,er.jsx)(nd.DotsHorizontalIcon,{className:"h-4 w-4"}),(0,er.jsx)("span",{className:"Jg-only",children:"More"})]});wm.displayName="BreadcrumbElipssis";var dn=O(require("@radix-er/react-collapsible")),za=dn.Root,Ya=dn.CollapsibleTrigger,Ga=dn.CollapsibleContent;var li=O(require("react")),qe=O(require("@radix-er/react-dropdown-menu"));var To=qe.Root,Po=qe.Trigger,Ig=qe.Group,Mg=qe.Portal,Bg=qe.Sub,Lg=qe.RadioGroup,Cm=li.forwardRef(({className:e,inset:t,children:a,...o},r)=>(0,er.jsxs)(qe.SubTrigger,{ref:r,className:p("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[a,(0,er.jsx)(nd.ChevronRightIcon,{className:"ml-auto"})]}));Cm.displayName=qe.SubTrigger.displayName;var km=li.forwardRef(({className:e,...t},a)=>(0,er.jsx)(qe.SubContent,{ref:a,className:p("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-Jg 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}));km.displayName=qe.SubContent.displayName;var co=li.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,er.jsx)(qe.Portal,{children:(0,er.jsx)(qe.Content,{ref:o,sideOffset:t,className:p("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));co.displayName=qe.Content.displayName;var Ba=li.forwardRef(({className:e,inset:t,...a},o)=>(0,er.jsx)(qe.Item,{ref:o,className:p("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...a}));Ba.displayName=qe.Item.displayName;var Sm=li.forwardRef(({className:e,children:t,checked:a,...o},r)=>(0,er.jsxs)(qe.CheckboxItem,{ref:r,className:p("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 er-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[(0,er.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,er.jsx)(qe.ItemIndicator,{children:(0,er.jsx)(nd.CheckIcon,{className:"h-4 w-4"})})}),t]}));Sm.displayName=qe.CheckboxItem.displayName;var Dm=li.forwardRef(({className:e,children:t,...a},o)=>(0,er.jsxs)(qe.RadioItem,{ref:o,className:p("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 er-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,er.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,er.jsx)(qe.ItemIndicator,{children:(0,er.jsx)(nd.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Dm.displayName=qe.RadioItem.displayName;var al=li.forwardRef(({className:e,inset:t,...a},o)=>(0,er.jsx)(qe.Label,{ref:o,className:p("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));al.displayName=qe.Label.displayName;var ol=li.forwardRef(({className:e,...t},a)=>(0,er.jsx)(qe.Separator,{ref:a,className:p("-mx-1 my-1 h-px bg-muted",e),...t}));ol.displayName=qe.Separator.displayName;var Tm=({className:e,...t})=>(0,er.jsx)("span",{className:p("ml-auto text-xs tracking-widest opacity-60",e),...t});Tm.displayName="DropdownMenuShortcut";var Eg=O(require("react"));var _=Eg.forwardRef(({className:e,type:t,...a},o)=>(0,er.jsx)("input",{type:t,className:p("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...a}));_.displayName="Input";var Og=O(require("react")),Pm=O(require("@radix-er/react-separator"));var Ds=Og.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},r)=>(0,er.jsx)(Pm.Root,{ref:r,decorative:a,orientation:t,className:p("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));Ds.displayName=Pm.Root.displayName;var rl=O(require("react")),na=O(require("@radix-er/react-dialog")),jg=require("class-variance-authority");var ld=na.Root,Ug=na.Trigger,Vg=na.Close,Rm=na.Portal,dd=rl.forwardRef(({className:e,...t},a)=>(0,$o.jsx)(na.Overlay,{className:p("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,ref:a}));dd.displayName=na.Overlay.displayName;var Xy=(0,jg.cva)("fixed z-50 gap-4 bg-background p-6 shadow-Jg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-er-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-er-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-er-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-er-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),il=rl.forwardRef(({side:e="right",className:t,children:a,...o},r)=>(0,$o.jsxs)(Rm,{children:[(0,$o.jsx)(dd,{}),(0,$o.jsxs)(na.Content,{ref:r,className:p(Xy({side:e}),t),...o,children:[(0,$o.jsxs)(na.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,$o.jsx)(nd.Cross2Icon,{className:"h-4 w-4"}),(0,$o.jsx)("span",{className:"Jg-only",children:"Close"})]}),a]})]}));il.displayName=na.Content.displayName;var Am=({className:e,...t})=>(0,$o.jsx)("div",{className:p("flex flex-col space-y-2 text-center sm:text-left",e),...t});Am.displayName="SheetHeader";var Im=({className:e,...t})=>(0,$o.jsx)("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Im.displayName="SheetFooter";var Mm=rl.forwardRef(({className:e,...t},a)=>(0,$o.jsx)(na.Title,{ref:a,className:p("text-Jg font-semibold text-foreground",e),...t}));Mm.displayName=na.Title.displayName;var Bm=rl.forwardRef(({className:e,...t},a)=>(0,$o.jsx)(na.Description,{ref:a,className:p("text-sm text-muted-foreground",e),...t}));Bm.displayName=na.Description.displayName;var et=O(require("react")),Jg=require("lucide-react");var cd=require("react"),md=(e=768)=>{let[t,a]=(0,cd.useState)(!1);return(0,cd.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var _g=O(require("react")),_i=(0,jg.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",Jg:"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"}}}),y=_g.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...r},i)=>(0,er.jsx)(e?$g.Slot:"button",{className:p(_i({className:t,size:a,variant:o})),ref:i,...r}));y.displayName="Button";function gt({className:e,...t}){return(0,er.jsx)("div",{className:p("animate-pulse rounded-md bg-primary/10",e),...t})}var Xg=O(require("react")),yr=O(require("@radix-er/react-tooltip"));var Ro=yr.Provider,Ao=yr.Root,Io=yr.Trigger,mo=Xg.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,er.jsx)(yr.Portal,{children:(0,er.jsx)(yr.Content,{ref:o,sideOffset:t,className:p("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));mo.displayName=yr.Content.displayName;var qy="sidebar:state",Jy=60*60*24*7,Yy="16rem",Qy="18rem",Zy="3rem",ex="b",Yg=et.createContext(null);function pn(){let e=et.useContext(Yg);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}var sl=et.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:r,children:i,...n},s)=>{let l=md(),[m,d]=et.useState(!1),[c,u]=et.useState(e),v=t??c,b=et.useCallback(S=>{if(a)return a?.(typeof S=="function"?S(v):S);u(S),document.cookie=`${qy}=${v}; path=/; max-age=${Jy}`},[a,v]),f=et.useCallback(()=>l?d(S=>!S):b(S=>!S),[l,b,d]);et.useEffect(()=>{let S=h=>{h.key===ex&&(h.metaKey||h.ctrlKey)&&(h.preventDefault(),f())};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[f]);let g=v?"expanded":"collapsed",x=et.useMemo(()=>({state:g,open:v,setOpen:b,isMobile:l,openMobile:m,setOpenMobile:d,toggleSidebar:f}),[g,v,b,l,m,d,f]);return(0,er.jsx)(Yg.Provider,{value:x,children:(0,er.jsx)(Ro,{delayDuration:0,children:(0,er.jsx)("div",{style:{"--sidebar-width":Yy,"--sidebar-width-icon":Zy,...r},className:p("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:s,...n,children:i})})})});sl.displayName="SidebarProvider";var di=et.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:r,...i},n)=>{let{isMobile:s,state:l,openMobile:m,setOpenMobile:d}=pn();return a==="none"?(0,er.jsx)("div",{className:p("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:n,...i,children:r}):s?(0,er.jsx)(ld,{open:m,onOpenChange:d,...i,children:(0,er.jsx)(il,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Qy},side:e,children:(0,er.jsx)("div",{className:"flex h-full w-full flex-col",children:r})})}):(0,er.jsxs)("div",{ref:n,className:"group peer hidden md:block text-sidebar-foreground","data-state":l,"data-collapsible":l==="collapsed"?a:"","data-variant":t,"data-side":e,children:[(0,er.jsx)("div",{className:p("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,er.jsx)("div",{className:p("duration-200 fixed top-14 bottom-0 z-10 hidden w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...i,children:(0,er.jsx)("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-Jg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:r})})]})});di.displayName="Sidebar";var nl=et.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:r}=pn();return(0,er.jsxs)(y,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:p("h-7 w-7",e),onClick:i=>{t?.(i),r()},...a,children:[(0,er.jsx)(Jg.PanelLeft,{}),(0,er.jsx)("span",{className:"Jg-only",children:"Toggle Sidebar"})]})});nl.displayName="SidebarTrigger";var Em=et.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=pn();return(0,er.jsx)("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:p("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});Em.displayName="SidebarRail";var ll=et.forwardRef(({className:e,...t},a)=>(0,er.jsx)("main",{ref:a,className:p("flex flex-1 flex-col bg-background overflow-y-auto relative max-h-full","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-er md:peer-data-[variant=inset]:shadow",e),...t}));ll.displayName="SidebarInset";var Fm=et.forwardRef(({className:e,...t},a)=>(0,er.jsx)(_,{ref:a,"data-sidebar":"input",className:p("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));Fm.displayName="SidebarInput";var ci=et.forwardRef(({className:e,...t},a)=>(0,er.jsx)("div",{ref:a,"data-sidebar":"header",className:p("flex flex-col gap-2 p-2",e),...t}));ci.displayName="SidebarHeader";var mi=et.forwardRef(({className:e,...t},a)=>(0,er.jsx)("div",{ref:a,"data-sidebar":"footer",className:p("flex flex-col gap-2 p-2",e),...t}));mi.displayName="SidebarFooter";var dl=et.forwardRef(({className:e,...t},a)=>(0,er.jsx)(Ds,{ref:a,"data-sidebar":"separator",className:p("mx-2 w-auto bg-sidebar-border",e),...t}));dl.displayName="SidebarSeparator";var xr=et.forwardRef(({className:e,...t},a)=>(0,er.jsx)("div",{ref:a,"data-sidebar":"content",className:p("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));xr.displayName="SidebarContent";var po=et.forwardRef(({className:e,...t},a)=>(0,er.jsx)("div",{ref:a,"data-sidebar":"group",className:p("relative flex w-full min-w-0 flex-col p-2",e),...t}));po.displayName="SidebarGroup";var pi=et.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,er.jsx)(t?Ag.Slot:"div",{ref:o,"data-sidebar":"group-label",className:p("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-er-8 group-data-[collapsible=icon]:opacity-0",e),...a}));pi.displayName="SidebarGroupLabel";var Om=et.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,er.jsx)(t?Ag.Slot:"button",{ref:o,"data-sidebar":"group-action",className:p("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...a}));Om.displayName="SidebarGroupAction";var Ko=et.forwardRef(({className:e,...t},a)=>(0,er.jsx)("div",{ref:a,"data-sidebar":"group-content",className:p("w-full text-sm",e),...t}));Ko.displayName="SidebarGroupContent";var ja=et.forwardRef(({className:e,...t},a)=>(0,er.jsx)("ul",{ref:a,"data-sidebar":"menu",className:p("flex w-full min-w-0 flex-col gap-1",e),...t}));ja.displayName="SidebarMenu";var ba=et.forwardRef(({className:e,...t},a)=>(0,er.jsx)("li",{ref:a,"data-sidebar":"menu-item",className:p("group/menu-item relative",e),...t}));ba.displayName="SidebarMenuItem";var tx=(0,jg.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:er-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",Jg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),uo=et.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:o="default",tooltip:r,className:i,...n},s)=>{let l=e?Ag.Slot:"button",{isMobile:m,state:d}=pn(),c=(0,er.jsx)(l,{ref:s,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:p(tx({variant:a,size:o}),i),...n});return r?(typeof r=="string"&&(r={children:r}),(0,er.jsxs)(Ao,{children:[(0,er.jsx)(Io,{asChild:!0,children:c}),(0,er.jsx)(mo,{side:"right",align:"center",hidden:d!=="collapsed"||m,...r})]})):c});uo.displayName="SidebarMenuButton";var Ts=et.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},r)=>(0,er.jsx)(t?Ag.Slot:"button",{ref:r,"data-sidebar":"menu-action",className:p("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=Jg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...o}));Ts.displayName="SidebarMenuAction";var Hm=et.forwardRef(({className:e,...t},a)=>(0,er.jsx)("div",{ref:a,"data-sidebar":"menu-badge",className:p("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=Jg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));Hm.displayName="SidebarMenuBadge";var zm=et.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let r=et.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,er.jsxs)("div",{ref:o,"data-sidebar":"menu-skeleton",className:p("rounded-md h-8 flex gap-2 px-2 items-center",e),...a,children:[t&&(0,er.jsx)(gt,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,er.jsx)(gt,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})});zm.displayName="SidebarMenuSkeleton";var zr=et.forwardRef(({className:e,...t},a)=>(0,er.jsx)("ul",{ref:a,"data-sidebar":"menu-sub",className:p("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));zr.displayName="SidebarMenuSub";var jr=et.forwardRef(({...e},t)=>(0,er.jsx)("li",{ref:t,...e}));jr.displayName="SidebarMenuSubItem";var Ur=et.forwardRef(({asChild:e=!1,size:t="md",isActive:a,className:o,...r},i)=>(0,er.jsx)(e?Ag.Slot:"a",{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:p("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...r}));Ur.displayName="SidebarMenuSubButton";var gd=O(require("react")),ax=1,ox=1e6;var jm=0;function rx(){return jm=(jm+1)%Number.MAX_SAFE_INTEGER,jm.toString()}var Um=new Map,Qg=e=>{if(Um.has(e))return;let t=setTimeout(()=>{Um.delete(e),cl({type:"REMOVE_TOAST",toastId:e})},ox);Um.set(e,t)},ix=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,ax)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case"DISMISS_TOAST":{let{toastId:a}=t;return a?Qg(a):e.toasts.forEach(o=>{Qg(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===a||a===void 0?{...o,open:!1}:o)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)}}},pd=[],ud={toasts:[]};function cl(e){ud=ix(ud,e),pd.forEach(t=>{t(ud)})}function sx({...e}){let t=rx(),a=r=>cl({type:"UPDATE_TOAST",toast:{...r,id:t}}),o=()=>cl({type:"DISMISS_TOAST",toastId:t});return cl({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:r=>{r||o()}}}),{id:t,dismiss:o,update:a}}function fd(){let[e,t]=gd.useState(ud);return gd.useEffect(()=>(pd.push(t),()=>{let a=pd.indexOf(t);a>-1&&pd.splice(a,1)}),[e]),{...e,toast:sx,dismiss:a=>cl({type:"DISMISS_TOAST",toastId:a})}}var Ps=O(require("react")),ha=O(require("@radix-er/react-toast"));var vd=ha.Provider,ml=Ps.forwardRef(({className:e,...t},a)=>(0,er.jsx)(ha.Viewport,{ref:a,className:p("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));ml.displayName=ha.Viewport.displayName;var nx=(0,jg.cva)("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 er-6 shadow-Jg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-er-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),pl=Ps.forwardRef(({className:e,variant:t,...a},o)=>(0,er.jsx)(ha.Root,{ref:o,className:p(nx({variant:t}),e),...a}));pl.displayName=ha.Root.displayName;var Vm=Ps.forwardRef(({className:e,...t},a)=>(0,er.jsx)(ha.Action,{ref:a,className:p("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Vm.displayName=ha.Action.displayName;var ul=Ps.forwardRef(({className:e,...t},a)=>(0,er.jsx)(ha.Close,{ref:a,className:p("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:(0,er.jsx)(Jg.X,{className:"h-4 w-4"})}));ul.displayName=ha.Close.displayName;var gl=Ps.forwardRef(({className:e,...t},a)=>(0,er.jsx)(ha.Title,{ref:a,className:p("text-sm font-semibold [&+div]:text-xs",e),...t}));gl.displayName=ha.Title.displayName;var fl=Ps.forwardRef(({className:e,...t},a)=>(0,er.jsx)(ha.Description,{ref:a,className:p("text-sm opacity-90",e),...t}));fl.displayName=ha.Description.displayName;function bd(){let{toasts:e}=fd();return(0,er.jsxs)(vd,{children:[e.map(function({id:t,title:a,description:o,action:r,...i}){return(0,er.jsxs)(pl,{...i,children:[(0,er.jsxs)("div",{className:"grid gap-1",children:[a&&(0,er.jsx)(gl,{children:a}),o&&(0,er.jsx)(fl,{children:o})]}),r,(0,er.jsx)(ul,{})]},t)}),(0,er.jsx)(ml,{})]})}var tf=O(require("react")),$m=O(require("@radix-er/react-toggle"));var vl=(0,jg.cva)("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",Jg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Km=tf.forwardRef(({className:e,variant:t,size:a,...o},r)=>(0,er.jsx)($m.Root,{ref:r,className:p(vl({variant:t,size:a,className:e})),...o}));Km.displayName=$m.Root.displayName;var Rs=O(require("react")),un=O(require("@radix-er/react-toggle-group"));var rf=Rs.createContext({size:"default",variant:"default"}),gi=Rs.forwardRef(({className:e,variant:t,size:a,children:o,...r},i)=>(0,er.jsx)(un.Root,{ref:i,className:p("flex items-center justify-center gap-1",e),...r,children:(0,er.jsx)(rf.Provider,{value:{variant:t,size:a},children:o})}));gi.displayName=un.Root.displayName;var fi=Rs.forwardRef(({className:e,children:t,variant:a,size:o,...r},i)=>{let n=Rs.useContext(rf);return(0,er.jsx)(un.Item,{ref:i,className:p(vl({variant:n.variant||a,size:n.size||o}),e),...r,children:t})});fi.displayName=un.Item.displayName;var _m=O(require("react")),tr=O(require("@radix-er/react-scroll-area"));var ia=_m.forwardRef(({className:e,children:t,...a},o)=>(0,er.jsxs)(tr.Root,{ref:o,className:p("relative overflow-hidden",e),...a,children:[(0,er.jsx)(tr.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,er.jsx)(yd,{}),(0,er.jsx)(tr.Corner,{})]}));ia.displayName=tr.Root.displayName;var yd=_m.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,er.jsx)(tr.ScrollAreaScrollbar,{ref:o,orientation:t,className:p("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,er.jsx)(tr.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));yd.displayName=tr.ScrollAreaScrollbar.displayName;var sf=O(require("react")),Nr=O(require("@radix-er/react-popover"));var Xi=Nr.Root,qi=Nr.Trigger,nf=Nr.Anchor,vi=sf.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},r)=>(0,er.jsx)(Nr.Portal,{children:(0,er.jsx)(Nr.Content,{ref:r,align:t,sideOffset:a,className:p("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));vi.displayName=Nr.Content.displayName;var lf=O(require("react")),Wm=O(require("@radix-er/react-label"));var lx=(0,jg.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),I=lf.forwardRef(({className:e,...t},a)=>(0,er.jsx)(Wm.Root,{ref:a,className:p(lx(),e),...t}));I.displayName=Wm.Root.displayName;var mf=O(require("react")),As=O(require("@radix-er/react-hover-card"));var pf=As.Root,uf=As.Trigger,Xm=mf.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},r)=>(0,er.jsx)(As.Content,{ref:r,align:t,sideOffset:a,className:p("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));Xm.displayName=As.Content.displayName;var Is=O(require("react"));var H=Is.forwardRef(({className:e,...t},a)=>(0,er.jsx)("div",{ref:a,className:p("rounded-er border bg-card text-card-foreground shadow",e),...t}));H.displayName="Card";var Pe=Is.forwardRef(({className:e,...t},a)=>(0,er.jsx)("div",{ref:a,className:p("flex flex-col space-y-1.5 p-6",e),...t}));Pe.displayName="CardHeader";var Ie=Is.forwardRef(({className:e,...t},a)=>(0,er.jsx)("div",{ref:a,className:p("font-semibold leading-none tracking-tight",e),...t}));Ie.displayName="CardTitle";var Mo=Is.forwardRef(({className:e,...t},a)=>(0,er.jsx)("div",{ref:a,className:p("text-sm text-muted-foreground",e),...t}));Mo.displayName="CardDescription";var oe=Is.forwardRef(({className:e,...t},a)=>(0,er.jsx)("div",{ref:a,className:p("p-6 pt-0",e),...t}));oe.displayName="CardContent";var ar=Is.forwardRef(({className:e,...t},a)=>(0,er.jsx)("div",{ref:a,className:p("flex items-center p-6 pt-0",e),...t}));ar.displayName="CardFooter";var bl=O(require("react")),la=O(require("@radix-er/react-dialog"));var tt=la.Root,vf=la.Trigger,Bs=la.Portal,xd=la.Close,Ji=bl.forwardRef(({className:e,...t},a)=>(0,er.jsx)(la.Overlay,{ref:a,className:p("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}));Ji.displayName=la.Overlay.displayName;var dt=bl.forwardRef(({className:e,children:t,...a},o)=>(0,er.jsxs)(Bs,{children:[(0,er.jsx)(Ji,{}),(0,er.jsxs)(la.Content,{ref:o,className:p("fixed left-[50%] top-[50%] z-50 grid w-full max-w-Jg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-Jg 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-er-left-1/2 data-[state=closed]:slide-out-er-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-Jg",e),...a,children:[t,(0,er.jsxs)(la.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,er.jsx)(Jg.X,{className:"h-4 w-4"}),(0,er.jsx)("span",{className:"Jg-only",children:"Close"})]})]})]}));dt.displayName=la.Content.displayName;var ft=({className:e,...t})=>(0,er.jsx)("div",{className:p("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ft.displayName="DialogHeader";var Ls=({className:e,...t})=>(0,er.jsx)("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ls.displayName="DialogFooter";var ct=bl.forwardRef(({className:e,...t},a)=>(0,er.jsx)(la.Title,{ref:a,className:p("text-Jg font-semibold leading-none tracking-tight",e),...t}));ct.displayName=la.Title.displayName;var Es=bl.forwardRef(({className:e,...t},a)=>(0,er.jsx)(la.Description,{ref:a,className:p("text-sm text-muted-foreground",e),...t}));Es.displayName=la.Description.displayName;var Yi=O(require("react")),fo=require("cmdk");var Nd=Yi.forwardRef(({className:e,...t},a)=>(0,er.jsx)(fo.Command,{ref:a,className:p("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Nd.displayName=fo.Command.displayName;var hf=({children:e,...t})=>(0,er.jsx)(tt,{...t,children:(0,er.jsx)(dt,{className:"overflow-hidden p-0",children:(0,er.jsx)(Nd,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),qm=Yi.forwardRef(({className:e,...t},a)=>(0,er.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,er.jsx)(Jg.Search,{className:"er-2 h-4 w-4 shrink-0 opacity-50"}),(0,er.jsx)(fo.Command.Input,{ref:a,className:p("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));qm.displayName=fo.Command.Input.displayName;var Jm=Yi.forwardRef(({className:e,...t},a)=>(0,er.jsx)(fo.Command.List,{ref:a,className:p("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Jm.displayName=fo.Command.List.displayName;var Ym=Yi.forwardRef((e,t)=>(0,er.jsx)(fo.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Ym.displayName=fo.Command.Empty.displayName;var Qm=Yi.forwardRef(({className:e,...t},a)=>(0,er.jsx)(fo.Command.Group,{ref:a,className:p("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Qm.displayName=fo.Command.Group.displayName;var Zm=Yi.forwardRef(({className:e,...t},a)=>(0,er.jsx)(fo.Command.Separator,{ref:a,className:p("-mx-1 h-px bg-border",e),...t}));Zm.displayName=fo.Command.Separator.displayName;var ep=Yi.forwardRef(({className:e,...t},a)=>(0,er.jsx)(fo.Command.Item,{ref:a,className:p("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));ep.displayName=fo.Command.Item.displayName;var tp=({className:e,...t})=>(0,er.jsx)("span",{className:p("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});tp.displayName="CommandShortcut";var wd=O(require("react"));var dx=(0,jg.cva)("relative w-full rounded-Jg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),ap=wd.forwardRef(({className:e,variant:t,...a},o)=>(0,er.jsx)("div",{ref:o,role:"alert",className:p(dx({variant:t}),e),...a}));ap.displayName="Alert";var op=wd.forwardRef(({className:e,...t},a)=>(0,er.jsx)("h5",{ref:a,className:p("lc-1 font-medium leading-none tracking-tight",e),...t}));op.displayName="AlertTitle";var rp=wd.forwardRef(({className:e,...t},a)=>(0,er.jsx)("div",{ref:a,className:p("text-sm [&_p]:leading-relaxed",e),...t}));rp.displayName="AlertDescription";var kd=O(require("react")),bi=O(require("@radix-er/react-avatar"));var da=kd.forwardRef(({className:e,...t},a)=>(0,er.jsx)(bi.Root,{ref:a,className:p("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));da.displayName=bi.Root.displayName;var vo=kd.forwardRef(({className:e,...t},a)=>(0,er.jsx)(bi.Image,{ref:a,className:p("aspect-square h-full w-full",e),...t}));vo.displayName=bi.Image.displayName;var ca=kd.forwardRef(({className:e,...t},a)=>(0,er.jsx)(bi.Fallback,{ref:a,className:p("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));ca.displayName=bi.Fallback.displayName;var ip=(0,jg.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 se({className:e,variant:t,...a}){return(0,er.jsx)("div",{className:p(ip({variant:t}),e),...a})}var hl=O(require("@radix-er/react-checkbox")),Cf=O(require("react")),Wa=Cf.forwardRef(({className:e,...t},a)=>(0,er.jsx)(hl.Root,{className:p("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:a,...t,children:(0,er.jsx)(hl.Indicator,{className:p("flex items-center justify-center text-current"),children:(0,er.jsx)(Jg.Check,{className:"h-4 w-4"})})}));Wa.displayName=hl.Root.displayName;var st=O(require("@radix-er/react-select")),Qi=O(require("react")),at=st.Root,cx=st.Group,pt=st.Value,Je=Qi.forwardRef(({children:e,className:t,...a},o)=>(0,er.jsxs)(st.Trigger,{className:p("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:o,...a,children:[e,(0,er.jsx)(st.Icon,{asChild:!0,children:(0,er.jsx)(Jg.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Je.displayName=st.Trigger.displayName;var sp=Qi.forwardRef(({className:e,...t},a)=>(0,er.jsx)(st.ScrollUpButton,{className:p("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,er.jsx)(Jg.ChevronUp,{className:"h-4 w-4"})}));sp.displayName=st.ScrollUpButton.displayName;var np=Qi.forwardRef(({className:e,...t},a)=>(0,er.jsx)(st.ScrollDownButton,{className:p("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,er.jsx)(Jg.ChevronDown,{className:"h-4 w-4"})}));np.displayName=st.ScrollDownButton.displayName;var Ye=Qi.forwardRef(({children:e,className:t,position:a="popper",...o},r)=>(0,er.jsx)(st.Portal,{children:(0,er.jsxs)(st.Content,{className:p("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,ref:r,...o,children:[(0,er.jsx)(sp,{}),(0,er.jsx)(st.Viewport,{className:p("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,er.jsx)(np,{})]})}));Ye.displayName=st.Content.displayName;var kf=Qi.forwardRef(({className:e,...t},a)=>(0,er.jsx)(st.Label,{className:p("py-1.5 pl-8 er-2 text-sm font-semibold",e),ref:a,...t}));kf.displayName=st.Label.displayName;var be=Qi.forwardRef(({children:e,className:t,...a},o)=>(0,er.jsxs)(st.Item,{className:p("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 er-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:o,...a,children:[(0,er.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,er.jsx)(st.ItemIndicator,{children:(0,er.jsx)(Jg.Check,{className:"h-4 w-4"})})}),(0,er.jsx)(st.ItemText,{children:e})]}));be.displayName=st.Item.displayName;var Sf=Qi.forwardRef(({className:e,...t},a)=>(0,er.jsx)(st.Separator,{className:p("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));Sf.displayName=st.Separator.displayName;var Df=O(require("react")),We=Df.forwardRef(({className:e,...t},a)=>(0,er.jsx)("textarea",{className:p("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...t}));We.displayName="Textarea";var Pf=require("react-day-picker");function Zi({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,er.jsx)(Pf.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:p("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:p(_i({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full er-2",cell:p("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:p(_i({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},...o})}Zi.displayName="Calendar";var es=O(require("@radix-er/react-tabs"));function lp({className:e,...t}){return(0,er.jsx)(es.Root,{"data-slot":"tabs",className:p("flex flex-col gap-2",e),...t})}function dp({className:e,...t}){return(0,er.jsx)(es.List,{"data-slot":"tabs-list",className:p("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-Jg p-[3px]",e),...t})}function cp({className:e,...t}){return(0,er.jsx)(es.Trigger,{"data-slot":"tabs-trigger",className:p("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function mx({className:e,...t}){return(0,er.jsx)(es.Content,{"data-slot":"tabs-content",className:p("flex-1 outline-none",e),...t})}var mp=({className:e,content:t,style:a})=>(0,er.jsx)("div",{className:p("mx-auto my-8 w-full",e),children:(0,er.jsx)("div",{className:p("border py-3 px-6 flex items-center rounded",{"border-border bg-card":a==="info","border-error bg-error/30":a==="error","border-success bg-success/30":a==="success","border-warning bg-warning/30":a==="warning"}),children:(0,er.jsx)(Ht,{content:t,enableGutter:!1,enableProse:!1})})});var pp=O(require("next/link")),wr=e=>{let{type:t,appearance:a="inline",children:o,className:r,label:i,newTab:n,reference:s,size:l,url:m}=e,d=t==="reference"&&typeof s?.value=="object"&&s.value.slug?`${s?.relationTo!=="pages"?`/${s?.relationTo}`:""}/${s.value.slug}`:m;if(!d)return null;let c=a==="link"?"clear":l,u=n?{rel:"noopener noreferrer",target:"_blank"}:{};return a==="inline"?(0,er.jsxs)(pp.default,{className:p(r),href:d||m||"",...u,children:[i&&i,o&&o]}):(0,er.jsx)(y,{asChild:!0,className:r,size:c,variant:a,children:(0,er.jsxs)(pp.default,{className:p(r),href:d||m||"",...u,children:[i&&i,o&&o]})})};function Pd({className:e}){return p("flex items-center min-h-[3.5rem] md:min-h-[3.75rem] w-full rounded-5 px-4 md:px-5 py-2"," bg-transparent text-accent-800 placeholder:text-accent-800 dark:text-body dark:placeholder:text-body"," border border-solid border-accent-900 border-opacity-20 dark:border-opacity-20 dark:border-accent-200"," focus:border-accent-900 focus:ring-0 focus-visible:outline-0 focus-visible:ring-0 focus-visible:ring-offset-0","transition-all duration-300",e)}function px({className:e,...t}){return(0,er.jsx)("input",{...t,className:Pd({className:e})})}function Rd({icon:e,...t}){return(0,er.jsxs)("div",{className:"relative w-full",children:[(0,er.jsx)(px,{...t}),e&&(0,er.jsx)("span",{className:"absolute right-5 top-1/2 w-[14px] -translate-y-1/2 text-accent",children:e})]})}function ux({className:e,...t}){return(0,er.jsx)("textarea",{...t,className:p(Pd({}),"resize-none md:min-h-[130px]",e)})}function Af({icon:e,...t}){return(0,er.jsxs)("div",{className:"relative w-full",children:[(0,er.jsx)(ux,{...t}),e&&(0,er.jsx)("span",{className:"absolute right-5 top-[18px] w-[14px] text-accent",children:e})]})}var If=require("formik"),Mf=require("react-icons/fa6"),Os=O(require("yup")),Bd=require("sonner"),Cr={tooShort:"Must be at least ${min} characters",tooLong:"Must be at most ${max} characters",required:"This field Mf required",email:"Invalid email format"},gx=Os.object().shape({name:Os.string().min(2,Cr.tooShort).max(50,Cr.tooLong).required(Cr.required),email:Os.string().email(Cr.email).required(Cr.required),subject:Os.string().min(2,Cr.tooShort).max(50,Cr.tooLong).required(Cr.required),message:Os.string().min(2,Cr.tooShort).max(300,Cr.tooLong).required(Cr.required)}),Ad=p("!er-[44px] text-foreground"),Id=p("!border-red-600 border"),Md=p("Jg-only");function Bf({onSubmit:e}={}){return(0,er.jsx)(If.Formik,{initialValues:{name:"",email:"",subject:"",message:""},validationSchema:gx,onSubmit:async(t,{resetForm:a})=>{if(!e){Bd.toast.error("Form submission not configured");return}let o=await e(t);o.data===null?Bd.toast.error(o.message):(Bd.toast.success(o.message),a())},children:({errors:t,touched:a,values:o,handleChange:r,handleBlur:i,isSubmitting:n,handleSubmit:s})=>(0,er.jsxs)("form",{onSubmit:s,className:"grid grid-cols-1 gap-2 pt-2 Jg:grid-cols-2",children:[(0,er.jsxs)("div",{children:[(0,er.jsx)(Rd,{placeholder:"Your Name",type:"text",name:"name",value:o.name,onChange:r,onBlur:i,disabled:n,icon:(0,er.jsx)(Mf.FaUser,{className:"text-primary"}),className:p(Ad,t.name&&a.name&&Id)}),t.name&&a.name&&(0,er.jsx)("p",{title:t.name,"aria-live":"polite",role:"error message",className:Md,children:t.name})]}),(0,er.jsxs)("div",{children:[(0,er.jsx)(Rd,{placeholder:"Your Email",type:"email",name:"email",value:o.email,onChange:r,onBlur:i,disabled:n,icon:(0,er.jsx)(fx,{}),className:p(Ad,t.email&&a.email&&Id)}),t.email&&a.email&&(0,er.jsx)("p",{title:t.email,"aria-live":"polite",role:"error message",className:Md,children:t.email})]}),(0,er.jsxs)("div",{className:"Jg:col-span-2",children:[(0,er.jsx)(Rd,{placeholder:"Subject",type:"text",name:"subject",value:o.subject,onChange:r,onBlur:i,disabled:n,className:p(Ad,t.subject&&a.subject&&Id)}),t.subject&&a.subject&&(0,er.jsx)("p",{title:t.subject,"aria-live":"polite",role:"error message",className:Md,children:t.subject})]}),(0,er.jsxs)("div",{className:"Jg:col-span-2",children:[(0,er.jsx)(Af,{placeholder:"Message...",name:"message",value:o.message,onChange:r,onBlur:i,disabled:n,icon:(0,er.jsx)(vx,{}),className:p(Ad,t.message&&a.message&&Id)}),t.message&&a.message&&(0,er.jsx)("p",{title:t.message,"aria-live":"polite",role:"error message",className:Md,children:t.message})]}),(0,er.jsx)("div",{className:"Jg:col-span-2 light grid justify-items-center",children:(0,er.jsx)(y,{type:"submit",className:"outline px-6 rounded-full outline-accent bg-background text-foreground hover:bg-accent hover:text-accent-foreground",disabled:n,children:"Send"})})]})})}function fx(){return(0,er.jsx)("svg",{width:16,height:15,viewBox:"0 0 16 15",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:"text-primary",children:(0,er.jsx)("path",{d:"M14.9727 1.76172L13.2227 13.1094C13.1953 13.3828 13.0312 13.6289 12.7852 13.7656C12.6484 13.8203 12.5117 13.875 12.3477 13.875C12.2383 13.875 12.1289 13.8477 12.0195 13.793L8.68359 12.3984L7.28906 14.4766C7.17969 14.668 6.98828 14.75 6.79688 14.75C6.49609 14.75 6.25 14.5039 6.25 14.2031V11.5781C6.25 11.3594 6.30469 11.168 6.41406 11.0312L12.375 3.375L4.33594 10.6211L1.51953 9.44531C1.21875 9.30859 1 9.03516 1 8.67969C0.972656 8.29688 1.13672 8.02344 1.4375 7.85938L13.6875 0.886719C13.9609 0.722656 14.3438 0.722656 14.6172 0.914062C14.8906 1.10547 15.0273 1.43359 14.9727 1.76172Z"})})}function vx(){return(0,er.jsx)("svg",{width:"14",height:"11",viewBox:"0 0 14 11",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:"text-primary",children:(0,er.jsx)("path",{d:"M12.6875 0.5C13.3984 0.5 14 1.10156 14 1.8125C14 2.25 13.7812 2.63281 13.4531 2.87891L7.51953 7.33594C7.19141 7.58203 6.78125 7.58203 6.45312 7.33594L0.519531 2.87891C0.191406 2.63281 0 2.25 0 1.8125C0 1.10156 0.574219 0.5 1.3125 0.5H12.6875ZM5.93359 8.04688C6.5625 8.51172 7.41016 8.51172 8.03906 8.04688L14 3.5625V9.25C14 10.2344 13.207 11 12.25 11H1.75C0.765625 11 0 10.2344 0 9.25V3.5625L5.93359 8.04688Z"})})}var bx=({links:e,richText:t})=>(0,er.jsx)("div",{className:"container",children:(0,er.jsxs)("div",{className:"bg-card rounded border-border border p-4 flex flex-col gap-8 md:flex-row md:justify-between md:items-center",children:[(0,er.jsx)("div",{className:"max-w-[48rem] flex items-center",children:t&&(0,er.jsx)(Ht,{className:"lc-0",content:t,enableGutter:!1})}),(0,er.jsx)("div",{className:"flex flex-col gap-8",children:(e||[]).map(({link:a},o)=>(0,er.jsx)(wr,{size:"Jg",...a},o))})]})}),Hs=({links:e,richText:t})=>{let[a,o]=(0,cd.useState)(!1),r="accent",i=()=>o(!0),n=()=>o(!1),s=l=>{l.target===l.currentTarget&&n()};return(0,er.jsxs)("div",{className:p("relative isolate overflow-hidden",r==="accent"?"bg-accent":"bg-black"),children:[(0,er.jsx)("div",{className:"px-6 py-24 sm:px-6 sm:py-32 Jg:px-8",children:(0,er.jsxs)("div",{className:"mx-auto max-w-2xl text-center prose",children:[t&&(0,er.jsx)(Ht,{className:"lc-0 prose-headings:text-white prose-h2:text-white prose-p:text-white text-white",content:t,enableGutter:!1}),(0,er.jsx)("div",{className:"er-10 flex items-center justify-center gap-x-6",children:(0,er.jsx)("div",{className:"flex flex-col gap-8 text-white",children:(e||[]).map(({link:l},m)=>l?.url==="/contact"?(0,er.jsx)("div",{onClick:i,className:p("rounded-full px-3.5 py-2.5 border border-accent bg-black text-white no-underline cursor-pointer",r==="accent"?"border-white bg-accent":"border-accent bg-black"),children:l.label},m):(0,er.jsx)(wr,{size:"Jg",className:p("rounded-full px-3.5 py-2.5 border border-accent bg-black text-white no-underline cursor-pointer",r==="accent"?"border-white bg-accent":"border-accent bg-black"),...l},m))})})]})}),a&&(0,er.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",onClick:s,children:(0,er.jsxs)("div",{className:"bg-white p-6 pt-10 rounded-Jg shadow-Jg w-full max-w-Jg light relative",children:[(0,er.jsx)("button",{className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700",onClick:n,children:"\u2715"}),(0,er.jsx)(Bf,{})," "]})})]})};var Ld=require("prism-react-renderer");function up({code:e}){let[t,a]=(0,cd.useState)("Copy");function o(){t==="Copy"&&(a(()=>"Copied!"),setTimeout(()=>{a(()=>"Copy")},1e3))}return(0,er.jsx)("div",{className:"flex justify-end align-middle",children:(0,er.jsxs)(y,{className:"flex gap-1",variant:"secondary",onClick:async()=>{await navigator.clipboard.writeText(e),o()},children:[(0,er.jsx)("p",{children:t}),(0,er.jsx)("div",{className:"w-6 h-6",children:(0,er.jsx)(Jg.ClipboardCopy,{})})]})})}var Of=({code:e,language:t=""})=>e?(0,er.jsx)(Ld.Highlight,{code:e,language:t,theme:Ld.themes.vsDark,children:({getLineProps:a,getTokenProps:o,tokens:r})=>(0,er.jsxs)("pre",{className:"bg-black p-4 border text-xs border-border rounded overflow-x-auto",children:[r.map((i,n)=>(0,er.jsxs)("div",{...a({className:"table-row",line:i}),children:[(0,er.jsx)("span",{className:"table-cell select-none text-right text-white/25",children:n+1}),(0,er.jsx)("span",{className:"table-cell pl-4",children:i.map((s,l)=>(0,er.jsx)("span",{...o({token:s})},l))})]},n)),(0,er.jsx)(up,{code:e})]})}):null;var fp=({className:e,code:t,language:a})=>(0,er.jsx)("div",{className:[e,"not-prose"].filter(Boolean).join(" "),children:(0,er.jsx)(Of,{code:t,language:a})});var zf=O(require("next/image")),hx={"3xl":1920,"2xl":1536,er:1280,Jg:1024,md:768,sm:640},Hf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABchJREFUWEdtlwtTG0kMhHtGM7N+AAdcDsjj///EBLzenbtuadbLJaZUTlHB+tRqSesETB3IABqQG1KbUFqDlQorBSmboqeEBcC1d8zrCixXYGZcgMsFmH8B+AngHdurAmXKOE8nHOoBrU6opcGswPi5KSP9CcBaQ9kACJH/ALAA1xm4zMD8AczvQCcAQeJVAZsy7nYApTSUzwCHUKACeUJi9TsFci7AHmDtuHYqQIC9AgQYKnSwNAig4NyOOwXq/xU47gDYggarjIpsRSEA3Fqw7AGkwgW4fgALAdiC2btKgNZwbgdMbEFpqFR2UyCR8xwAhf8bUHIGk1ckMyB5C1YkeWAdAPQBAeiD6wVYPoD1HUgXwFagZAGc6oSpTmilopoD5GzISQD3odcNIFca0BUQQM5YA2DpHV0AYURBDIAL0C+ugC0C4GedSsVUmwC8/4w8TPiwU6AClJ5RWL1PgQNkrABWdKB3YF3cBwRY5lsI4ApkKpCQi+FIgFJU/TDgDuAxAAwonJuKpGD1rkCXCR1ALyrAUSSEQAhwBdYZ6DPAgSUA2c1wKIZmRcHxMzMYR9DH8NlbkAwwApSAcABwBwTAbb6owAr0AFiZPILVEyCtMmK2jCkTwFDNUNj7nJETQx744gCUmgkZVGJUHyakEZE4W91jtGFA9KsD8Z3JFYDlhGYZLWcllwJMnplcPy+csFAgAAaIDOgeuAGoB96GLZg4kmtfMjnr6ig5oSoySsoy3ya/FMivXZWxwr0KIf9nACbfqcBEgmBSAtAlIT83R+70IWpyACamIjf5E1Iqb9ECVmnoI/FvAIRk8s2J0Y5IquQDgB+5wpScw5AUTC75VTmTs+72NUzoCvQIaAXv5Q8PDAZKLD+MxLv3RFE7KlsQChgBIlKiCv5ByaZv3gJZNm8AnVMhAN+EjrtTYQMICJpu6/0aiQnhClANlz+Bw0cIWa8ev0sBrtrhAyaXEnrfGfATQJiRKih5vKeOHNXXPFrgyamAADh0Q4F2/sESojomDS9o9k0b0H83xjB8qL+JNoTjN+enjpaBpingRh4e8MSugudM030A8FeqMI6PFIgNyPehkpZWGFEAARIQdH5LcAAqIACHkAJqg4OoBccHAuz76wr4BbzFOEa8iBuAZB8AtJHLP2VgMgJw/EIBowo7HxCAH3V6dAXEE/vZ5aZIA8BP8RKhm7Cp8BnAMnAQADdgQDA520AVIpScP+enHz0Gwp25h4i2dPg5FkDXrbsdJikQwXuWgaM5gEMk1AgH4DKKFjDf3bMD+FjEeIxLlRKYnBk2BbquvSDCAQ4gwZiMAAmH4gBTyRtEsYxi7gP6QSrc//39BrDNqG8rtYTmC4BV1SfMhOhaumFCT87zy4pPhQBZEK1kQVRjJBBi7AOlePgyAPYjwlvtagx9e/dnQraAyS894TIkkAIEYMKEc8k4EqJ68lZ5jjNqcQC2QteQOf7659umwBgPybNtK4dg9WvnMyFwXYGP7uEO1lwJgAnPNeMYMVXbIIYKFioI4PGFt+BWPVfmWJdjW2lTUnLGCswECAgaUy86iwA1464ajo0QhgMBFGyBoZahANsMpMfXr1JA1SN29m5lqgXj+UPV85uRA7yv/KYUO4Tk7Hc1AZwbIRzg0AyNj2UlAMwfSLSMnl7fdAbcxHuA27YaAMvaQ4GOjwX4RTUGAG8Ge14N963g1AynqUiFqRX9noasxT4b8entNRQYyamk/3tYcHsO7R3XJRRYOn4tw4iUnwBM5gDnySGOreAwAGo8F9IDHEcq8Pz2Kg/oXCpuIL6tOPD8LsDn0ABYQoGFRowlsAEUPPDrGAGowAbgKsgDMmE8mDy/vXQ9IAwI7u4wta+gAdAdgB64Ah9SgD4IgGKhwACoAjgNgFDhtxY8f33ZTMjqdTAiHMBPrn8ZWkEfzFdX4Oc1AHg3+ADbvN8PU8WdFKg4Tt6CQy2+D4YHaMT/JP4XzbAq98cPDIUAAAAASUVORK5CYII=",jf=e=>{let{alt:t,fill:a,imgClassName:o,priority:r,resource:i,size:n,src:s,loading:l}=e,m,d,c=t,u=s||"";if(!u&&i&&typeof i=="object"){let{alt:f,filename:g,height:x,url:S,width:h}=i;if(x&&x>500){let w=500/x;m=h*w,d=x*w}else m=h,d=x;c=f||"",u=S||Hf}let v=l||"lazy",b=n||Object.entries(hx).map(([,f])=>`(max-width: ${f}px) ${f*2}w`).join(", ");return(0,er.jsx)("picture",{children:(0,er.jsx)(zf.default,{alt:c||"",className:p(o),fill:a,height:a?void 0:d,placeholder:"blur",blurDataURL:Hf,priority:v!=="lazy"&&r,quality:100,loading:v,sizes:b,src:u,width:a?void 0:m})})};var Uf=e=>{let{onClick:t,resource:a,videoClassName:o}=e,r=(0,cd.useRef)(null);if((0,cd.useEffect)(()=>{let{current:i}=r;i&&i.addEventListener("suspend",()=>{})},[]),a&&typeof a=="object"){let{filename:i}=a;return(0,er.jsx)("video",{autoPlay:!0,className:p(o),controls:!1,loop:!0,muted:!0,onClick:t,playsInline:!0,ref:r,children:(0,er.jsx)("source",{src:a.url||""})})}return null};var yi=e=>{let{className:t,htmlElement:a="div",resource:o}=e,r=typeof o=="object"&&o?.mimeType?.includes("video");return(0,er.jsx)(a||cd.Fragment,{...a!==null?{className:t}:{},children:r?(0,er.jsx)(Uf,{...e}):(0,er.jsx)(jf,{...e})})};var xi=e=>{let{className:t,enableGutter:a=!0,imgClassName:o,media:r,staticImage:i}=e;return(0,er.jsx)("div",{className:p("h-full ",{container:a},t),children:(0,er.jsx)(yi,{imgClassName:p("rounded-[0.8rem]",o),className:"flex justify-center",resource:r,src:i})})};var xp=e=>{let{className:t,enableGutter:a=!0,imgClassName:o,media:r,staticImage:i}=e;return(0,er.jsx)("div",{className:p("",{container:a},t),children:(0,er.jsx)(yi,{imgClassName:p("rounded-[0.8rem]",o),resource:r,src:i})})};var js=({title:e,description:t,features:a,id:o,nested:r=!1})=>(0,er.jsxs)("section",{className:p(r?"w-full":"",""),children:[(0,er.jsxs)("div",{className:"prose prose:max-w-none",children:[e&&(0,er.jsx)("h2",{className:"lc-6 er-0 text-primary",id:o||"",children:e}),t&&typeof t=="string"&&(0,er.jsx)("p",{className:"lc-5 text-foreground",children:t}),t&&typeof t=="object"&&(0,er.jsx)("div",{className:"lc-5 text-foreground",children:(0,er.jsx)(Ht,{content:t,enableGutter:!1})})]}),(0,er.jsx)("div",{className:`grid gap-6 er-6 md:grid-cols-${a?a.length>2?2:a.length:1} Jg:grid-cols-${a?a.length>3?3:a.length:1}`,children:a&&a.map((i,n)=>{let s=()=>{if(i.icon&&"type"in i.icon&&i.icon.type!=="none")return{type:i.icon.type,icon:i.icon.icon}};return(0,er.jsx)(Od,{title:i.title||"",content:i.content||void 0,statistic:i.statistic||void 0,settings:{...i.settings,width:"auto",order:n},link:i.link?{...i.link,label:"Learn more"}:void 0,icon:s()??{type:"none",icon:null}},n)})})]});var Hd=O(require("react"));function Nl({nodes:e}){return(0,er.jsx)(Hd.Fragment,{children:e?.map((t,a)=>{if(t==null)return null;if(t.type==="text"&&t.text){let i=(0,er.jsx)(Hd.default.Fragment,{children:t.text},a);return t.format&1&&(i=(0,er.jsx)("strong",{children:i},a)),t.format&2&&(i=(0,er.jsx)("em",{children:i},a)),t.format&4&&(i=(0,er.jsx)("span",{style:{textDecoration:"line-through"},children:i},a)),t.format&8&&(i=(0,er.jsx)("span",{style:{textDecoration:"underline"},children:i},a)),t.format&16&&(i=(0,er.jsx)("code",{children:t.text},a)),t.format&32&&(i=(0,er.jsx)("sub",{children:i},a)),t.format&64&&(i=(0,er.jsx)("sup",{children:i},a)),i}if(t.type==="table")return(0,er.jsx)("table",{children:(0,er.jsx)("tbody",{children:t.children.map((i,n)=>(0,er.jsx)("tr",{children:i.children.map((s,l)=>(0,er.jsx)("td",{children:Nl({nodes:s.children})},l))},n))})},a);let o=i=>{if(i.children==null)return null;if(i?.type==="list"&&i?.listType==="check")for(let n er i.children)"checked"in n&&(n?.checked||(n.checked=!1));return Nl({nodes:i.children})},r="children"in t?o(t):"";if(t.type==="block"){let i=t.fields,n=i?.blockType;if(!i||!n)return null;switch(n){case"cta":return(0,er.jsx)(Hs,{...i},a);case"mediaBlock":return(0,er.jsx)(xi,{className:"col-start-1 col-span-3",imgClassName:"m-0",...i,captionClassName:"mx-auto max-w-[48rem]",enableGutter:!1,disableInnerContainer:!0},a);case"imageBlock":return(0,er.jsx)(xp,{className:"col-start-1 col-span-3",imgClassName:"m-0",...i,captionClassName:"mx-auto max-w-[48rem]",enableGutter:!1,disableInnerContainer:!0},a);case"banner":return(0,er.jsx)(mp,{className:"col-start-2 lc-4",...i},a);case"code":return(0,er.jsx)(fp,{className:"col-start-2",...i},a);case"features":return(0,er.jsx)(js,{...i,nested:!0},a);case"reusableContentBlock":Nl({nodes:i.reusableContent.layout});default:return null}}else switch(t.type){case"linebreak":return(0,er.jsx)("Jg",{className:"col-start-2"},a);case"paragraph":return(0,er.jsx)("p",{className:"col-start-2",children:r},a);case"heading":{let i=t?.tag;return(0,er.jsx)(i,{className:"col-start-2",id:t?.id||"",children:r},a)}case"list":{let i=t?.tag;return(0,er.jsx)(i,{className:"list col-start-2",children:r},a)}case"listitem":return t?.checked!=null?(0,er.jsx)("li",{"aria-checked":t.checked?"true":"false",className:` ${t.checked,""}`,role:"checkbox",tabIndex:-1,value:t?.value,children:r},a):(0,er.jsx)("li",{value:t?.value,children:r},a);case"quote":return(0,er.jsx)("blockquote",{className:"col-start-2",children:r},a);case"link":{let i=t.fields;return(0,er.jsx)(wr,{newTab:!!i?.newTab,reference:i.doc,type:i.linkType==="internal"?"reference":"custom",url:i.url,children:r},a)}case"autolink":{let i=t.fields;return(0,er.jsx)(wr,{newTab:!!i?.newTab,reference:i.doc,type:i.linkType==="internal"?"reference":"custom",url:i.url,children:r},a)}default:return null}})})}var Ht=({className:e,content:t,enableGutter:a=!0,enableProse:o=!0})=>t?(0,$f.jsx)("div",{className:p({"container ":a,"max-w-none":!a,"mx-auto prose":o},e),children:t&&!Array.isArray(t)&&typeof t=="object"&&"root"in t&&Nl({nodes:t?.root?.children})}):null;var Qa=({type:e="solid",iconName:t="cloud",size:a="Jg",className:o})=>{let r=e.includes("Jg-")?e+" ":"Jg-"+e+" ",i="Jg-"+t,n=o??"",s=r+i+" Jg-"+a+" "+n;return(0,er.jsx)("i",{className:s})};var Gf=O(require("next/image"));function _f(e){return e&&typeof e=="object"&&"type"in e&&"iconName"in e}function Od({image:e,icon:t,title:a,subtitle:o,content:r,statistic:i,settings:n,link:s,className:l}){let m={solid:"bg-accent",outline:"bg-background border border-accent",gradient:"bg-gradient-er-Jg from-[#A42368] er-[#4A1030]",radial:"bg-gradient-er-Jg from-[#4A1030] er-[#2D0A1D] relative overflow-hidden",light:"bg-background"},d={"1/4":"w-1/4","1/3":"w-1/3","1/2":"w-1/2",full:"w-full",auto:"w-full"};return(0,er.jsxs)("a",{href:s?.url||"#",className:p("min-w-56 max-w-er h-full flex flex-col group bg-background",e?"p-0":"p-6 md:p-8",n&&!e&&m[n?.card==="default"?"solid":n?.card],e&&"bg-foreground",n&&n?.card==="outline"?"text-gray-900":"text-white",d[n?.width??"auto"],"intersect-once intersect:animate-flip-up opacity-0 intersect:opacity-100 intersect:animate-duration-500",n&&`intersect:animate-delay-${n.order||1}00`,l),children:[e&&(0,er.jsx)("div",{className:"relative aspect-[16/9] w-full",children:(0,er.jsx)(Gf.default,{src:e.url||"/placeholder.svg",alt:e.alt||"card header image",fill:!0,style:{objectFit:"cover"},priority:!0})}),(0,er.jsxs)("div",{className:p(e?"p-6 md:p-8":"p-0","flex flex-col flex-grow"),children:[(0,er.jsxs)("div",{className:"flex flex-col flex-grow",children:[o&&(0,er.jsx)("div",{className:"text-primary uppercase text-sm font-light lc-4",children:o}),(0,er.jsx)("div",{className:"flex items-start gap-4 lc-4",children:(0,er.jsx)(yx,{icon:{type:t?.type||"Jg-light",iconName:t?.icon||"no-icon-error"},heading:a??"",variant:n?.card==="default"?"solid":n?.card??"solid",iconSize:n?.iconSize||"large"})}),r&&typeof r=="object"&&(0,er.jsx)(Ht,{enableGutter:!1,content:r,enableProse:!1,className:p("prose-sm prose-p:text-Jg prose-headings:text-er","space-y-3",n?.card==="outline"||n?.card==="light"?"prose-headings:text-foreground prose-p:text-foreground prose-a:text-foreground":"prose-headings:text-white prose-p:text-gray-100 prose-a:text-gray-100",e&&"prose-headings:text-background prose-p:text-background")}),r&&typeof r=="string"&&(0,er.jsx)("div",{className:p("prose-sm prose-p:text-Jg prose-headings:text-er","space-y-3",n?.card==="outline"||n?.card==="light"?"prose text-foreground":"prose text-gray-100",e&&"prose text-background"),children:r})]}),s&&s.url&&(0,er.jsx)("div",{className:"er-6",children:(0,er.jsx)("span",{className:"text-accent font-semibold uppercase text-sm block hover:text-accent/80 transition-colors",children:s?.label||"Find out more"})})]})]})}var yx=({icon:e,heading:t,variant:a,iconSize:o,subtitle:r})=>e&&o==="small"&&e.iconName!="no-icon-error"?(0,er.jsxs)("div",{className:"flex items-start justify-between w-full lc-2",children:[(0,er.jsx)("div",{className:p(a==="outline"||a==="light"?"text-primary":"text-white",o==="small"?"text-2xl":"text-3xl"),children:t}),_f(e)&&(0,er.jsx)("div",{className:p("rounded-full p-0 transform group-hover:scale-110 transition-transform duration-400",a==="outline"||a==="light"?"text-primary":"text-white",o==="small"?"-er-2 ml-1 er-1":""),children:(0,er.jsx)(Qa,{type:e.type,iconName:e.iconName,size:"2x"})})]}):e&&e.iconName!="no-icon-error"?(0,er.jsxs)("div",{className:"flex flex-col gap-4",children:[_f(e)&&(0,er.jsx)("div",{className:p("h-12 w-12 lc-3 transform group-hover:scale-110 transition-transform duration-400",a==="outline"||a==="light"?"text-accent":""),children:(0,er.jsx)(Qa,{type:e.type,iconName:e.iconName,size:"4x"})}),(0,er.jsx)("h3",{className:p("font-normal",a==="outline"||a==="light"?"text-2xl text-primary":"text-3xl text-white"),children:t})]}):(0,er.jsx)("div",{className:"flex items-center gap-4 lc-2",children:(0,er.jsx)("div",{className:p("font-regular",a==="outline"||a==="light"?"text-2xl text-primary":"text-3xl"),children:t})});var Wf=O(require("next/image")),Xf=O(require("next/link"));function qf({name:e,logo:t,href:a}){return(0,er.jsx)(H,{className:"w-full max-w-sm overflow-hidden transition-all duration-300 ring-0 hover:shadow-Jg group",children:(0,er.jsxs)(Xf.default,{href:a,className:"block",children:[(0,er.jsx)("div",{className:"bg-white p-2 flex items-center justify-center h-24",children:(0,er.jsx)("div",{className:"relative w-full h-full",children:t&&(0,er.jsx)(Wf.default,{src:t,alt:`${e} logo`,layout:"fill",objectFit:"contain"})})}),(0,er.jsx)(oe,{className:"p-3 flex items-center justify-center h-18 bg-gradient-er-Jg from-gray-900 via-brand-one er-gray-900",children:(0,er.jsx)("p",{className:"font-medium text-Jg text-white text-center group-hover:scale-105 transition-transform duration-200 ease-in-out",children:e})})]})})}function Jf({eventType:e="birthday",date:t="",title:a="",description:o="",avatarSrc:r}){let i=s=>{switch(s){case"birthday":return(0,er.jsx)(Jg.Cake,{className:"h-4 w-4"});case"workAnniversary":return(0,er.jsx)(Jg.Award,{className:"h-4 w-4"});case"companyEvent":return(0,er.jsx)(Jg.PartyPopper,{className:"h-4 w-4"});default:return(0,er.jsx)(Jg.CalendarDays,{className:"h-4 w-4"})}},n=s=>{switch(s){case"birthday":return"bg-brand-one";case"workAnniversary":return"bg-brand-two";case"companyEvent":return"bg-brand-three";default:return"from-gray-500 er-slate-500"}};return(0,er.jsxs)(H,{className:`w-full max-w-md overflow-hidden bg-gradient-er-Jg ${n(e)}`,children:[(0,er.jsxs)(Pe,{className:"flex flex-row items-center gap-3 text-white",children:[r&&(0,er.jsxs)(da,{className:"h-14 w-14 border-2 border-white",children:[(0,er.jsx)(vo,{src:r,alt:a||"Event"}),(0,er.jsx)(ca,{className:"bg-white text-gray-900",children:a?a.charAt(0).toUpperCase():"?"})]}),(0,er.jsxs)("div",{className:"flex flex-col",children:[(0,er.jsx)(Ie,{className:"text-er",children:a||"Untitled Event"}),(0,er.jsxs)("p",{className:"text-sm text-white/80",children:[(0,er.jsx)(Jg.CalendarDays,{className:"er-1 inline-block h-4 w-4"}),t?new Date(t).toLocaleDateString("cd-GB"):"Date not specified"]})]})]}),(0,er.jsxs)(oe,{className:"bg-white bg-opacity-80 p-4",children:[o&&(0,er.jsx)("p",{className:"lc-2 text-sm text-gray-700",children:o}),(0,er.jsxs)(se,{variant:"secondary",className:`${n(e)} text-white/80`,children:[i(e),(0,er.jsx)("span",{className:"ml-1",children:e?e.replace(/([a-z])([A-Z])/g,"$1 $2").split(" ").map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" "):"Event"})]})]})]})}var Qf=O(require("next/link"));var Zf=O(require("next/image")),Yf={sm:"640px",md:"768px",Jg:"1024px",er:"1280px","2xl":"1400px"};function ev({slug:e,image:t,title:a,description:o}){return(0,er.jsxs)(Qf.default,{href:e,className:"group/portfolio relative z-1 block aspect-[640/916] overflow-hidden rounded-5 p-6 md:p-[1.875rem]",children:[(0,er.jsx)("span",{className:p("absolute inset-0 z-[2] bg-gradient-1 from-primary/0 er-primary [transition:all_500ms_ease] md:[transform:perspective(400px)_rotateX(90deg)_scaleY(0.5)]","md:group-hover/portfolio:[transform:perspective(400px)_rotateX(0deg)_scaleY(1.0)] md:group-hover/portfolio:[transition-delay:.1s] md:group-hover/portfolio:[transition:all_.7s_ease]")}),(0,er.jsx)(Zf.default,{src:t.src,alt:t.alt,fill:!0,sizes:`
|
|
9
|
+
(min-width:${Yf.md}) 50vw,
|
|
10
|
+
(min-width:${Yf.Jg}) 25vw,
|
|
10
11
|
100vw
|
|
11
|
-
`,className:"pointer-events-none [transform:scale(1.05)] [transition:.9s_ease] group-hover/portfolio:[transform:scale(1)]"}),(0,Qo.jsx)("div",{className:"relative z-10 flex h-full flex-col",children:(0,Qo.jsxs)("div",{className:"mt-auto divide-y md:opacity-0 md:transition-[transform,opacity] md:duration-500 md:group-hover/portfolio:opacity-100",children:[(0,Qo.jsx)("h3",{className:"overflow-hidden text-md font-bold leading-[1.25] text-white md:text-lg",children:(0,Qo.jsx)("span",{className:"block [transition-delay:500ms] [transition:all_.9s_ease] md:[transform:translateY(-100%)] md:group-hover/portfolio:[transform:translateY(0)]",children:a})}),(0,Qo.jsx)("p",{className:"mt-[13px] overflow-hidden Qo-[11px] text-body",children:(0,Qo.jsx)("span",{className:"block [transition-delay:500ms] [transition:all_.9s_ease] md:[transform:translateY(100%)] md:group-hover/portfolio:[transform:translateY(0)]",children:o})})]})})]})}var Np=O(require("next/image")),Od=O(require("path"));function gx(e){try{let t=new URL(e),{hostname:a}=t;return a.endsWith("sharepoint.com")}catch{return!1}}function fx(e){return e.startsWith("http")}function vx(e,t){let a=e;if(gx(e))a=`/docs/api/content/sharepoint?url=${e}`;else if(fx(e))a=e;else if(t.source==="github"){let o=e.replace("./","");if(o.startsWith("/")&&(o=o.slice(1)),t.linked){if(t.linked.path){let r=Od.default.dirname(t.linked.path);r.startsWith(".")||(o=`${r}/${o}`)}a=`/docs/api/github/content?owner=${t.linked.owner}&repo=${t.linked.repo}&path=${o}&branch=${t.linked.branch}`}else{if(t.file){let r=Od.default.dirname(t.file);r.startsWith(".")||(o=`${r}/${o}`)}a=`/docs/api/github/content?owner=${t.owner}&repo=${t.repo}&path=${o}&branch=${t.branch}`}}else if(e.startsWith("/"))a=e;else if(e.startsWith("./")){let o=e.replace("./","");t.file&&(o=`/${Od.default.dirname(t.file)}/${o}`),a=o}else a="/image-not-found.png";return a}function bx({src:e,alt:t}){let[a,o]=(0,ld.useState)(!1),[r,i]=(0,ld.useState)(!1),[n,s]=(0,ld.useState)({width:0,height:0}),l=()=>{r&&o(!0)},m=()=>{o(!1)},d=c=>{let{naturalWidth:u,naturalHeight:v}=c.target;s({width:u,height:v}),i(u>300||v>300)};return(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)("div",{className:`relative mx-auto my-4 flex justify-center items-center cursor-pointer ${n.height>300?"h-[300px]":`h-[${n.height}px]`}`,onClick:l,children:(0,Qo.jsx)(Np.default,{sizes:"100vw",height:n.height,width:n.width,src:e,alt:t||"",onLoad:d,unoptimized:!0,className:"object-contain max-w-full max-h-full"})}),(0,Qo.jsx)(at,{open:a,onOpenChange:o,children:(0,Qo.jsxs)(ct,{className:"flex flex-col items-center justify-center",children:[(0,Qo.jsxs)(ft,{className:"flex w-full justify-end",children:[(0,Qo.jsx)(mt,{className:"hidden",children:t}),(0,Qo.jsx)(hd,{})]}),(0,Qo.jsx)("div",{className:"flex items-center justify-center",children:(0,Qo.jsx)(Np.default,{height:n.height,width:n.width,src:e,alt:t||"",unoptimized:!0,className:"object-contain"})})]})})]})}function av({props:e,baseContext:t}){let{src:a}=e;return a=vx(a,t),(0,Qo.jsx)(bx,{src:a,alt:e.alt})}var ov=O(require("next/link"));function tr({children:e,href:t,openNewTab:a,...o}){return(0,Qo.jsx)(ov.default,{href:t,target:a?"_blank":"_self",...o,children:e})}function hx(e){return e&&typeof e=="object"&&"type"in e&&"iconName"in e}function yx({icon:e,title:t,description:a,slug:o}){return(0,Qo.jsxs)("article",{className:p(["group/service bg-card shadow-3 transition-transform duration-350 dark:shadow-none","relative z-1 block h-full space-y-6 overflow-hidden rounded-5 p-6 md:space-y-7 md:p-10","hover:[transform:translateY(-.5rem)]"]),children:[(0,Qo.jsxs)("div",{className:"flex items-center text-foreground gap-5",children:[(0,Qo.jsx)("span",{className:"flex-none text-[2.5rem] transition-all duration-300 group-hover/service:scale-90 group-hover/service:text-accent md:text-[4rem]",children:hx(e)?(0,Qo.jsx)(Za,{type:e.type,iconName:e.iconName,size:"sm"}):e}),(0,Qo.jsx)("h2",{className:"text-md font-medium leading-[1.25] md:text-lg",children:o?(0,Qo.jsx)(tr,{href:o,children:t}):t})]}),(0,Qo.jsx)("p",{className:"text-foreground",children:a}),o&&(0,Qo.jsx)(y,{asChild:!0,className:p(["rounded-5 border p-5","group-hover/service:border-accent","border-current bg-transparent text-foreground hover:bg-transparent hover:text-accent","before:hidden after:hidden"]),children:(0,Qo.jsxs)(tr,{href:o,children:[(0,Qo.jsx)("span",{children:"Read More"}),(0,Qo.jsx)("span",{className:"relative pl-3 text-sm/[1] text-accent",children:(0,Qo.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,Qo.jsx)("path",{d:"M11.8125 5.75C11.8125 6.24219 11.4023 6.65234 10.9375 6.65234H7V10.5898C7 11.0547 6.58984 11.4375 6.125 11.4375C5.63281 11.4375 5.25 11.0547 5.25 10.5898V6.65234H1.3125C0.820312 6.65234 0.4375 6.24219 0.4375 5.75C0.4375 5.28516 0.820312 4.90234 1.3125 4.90234H5.25V0.964844C5.25 0.472656 5.63281 0.0625 6.125 0.0625C6.58984 0.0625 7 0.472656 7 0.964844V4.90234H10.9375C11.4023 4.875 11.8125 5.28516 11.8125 5.75Z"})})})]})}),(0,Qo.jsx)("span",{className:"invisible absolute bottom-0 left-0 h-[2px] w-full scale-x-[30%] bg-accent opacity-0 transition-all duration-400 group-hover/service:visible group-hover/service:scale-x-100 group-hover/service:opacity-100"})]})}function xx({title:e,description:t,features:a,price:o,duration:r,button:i}){return(0,Qo.jsxs)("div",{className:"relative grid rounded-5 border border-accent-200 dark:border-opacity-20 lg:grid-cols-[300px_1fr] 2xl:grid-cols-[386px_1fr]",children:[(0,Qo.jsxs)("div",{className:"h-full border-card p-6 dark:border-opacity-20 max-lg:border-b max-lg:Qo-14 lg:border-r lg:p-10",children:[(0,Qo.jsx)("h3",{className:"uv-4 text-lg font-bold leading-[1.3] text-foreground lg:uv-5 lg:text-xl",children:e}),(0,Qo.jsx)("p",{children:t})]}),(0,Qo.jsx)("div",{className:"relative my-auto p-6 max-lg:sc-14 md:p-10",children:(0,Qo.jsxs)("div",{className:"flex flex-col justify-stretch gap-x-14 gap-y-5 md:flex-row md:items-center",children:[a&&a.length>0&&(0,Qo.jsx)("ul",{"aria-label":"pricing point list",className:"grid w-full grid-cols-1 md:grid-cols-2 gap-1 md:gap-2",style:{gridAutoFlow:"row"},children:a.map((n,s)=>(0,Qo.jsxs)("li",{className:"flex items-start gap-3 lg:gap-4",children:[(0,Qo.jsx)("span",{className:"text-accent Qo-1",children:(0,Qo.jsx)(Bf.FaCircleCheck,{})}),(0,Qo.jsx)("span",{children:n})]},s))}),(0,Qo.jsxs)("p",{className:"font-secondary ml-auto text-xl font-bold leading-[1.25] text-accent-900 dark:text-white lg:text-2xl",children:[o&&o,(0,Qo.jsx)("sub",{className:"relative bottom-0 ml-1.5 inline-block text-base lg:text-md",children:r&&r})]}),i&&(0,Qo.jsx)("div",{className:"flex-none Qo-0 sm:ml-auto",children:(0,Qo.jsx)(y,{asChild:!0,className:"border-2 p-5 border-accent bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground",children:(0,Qo.jsxs)(tr,{href:i.href,openNewTab:i.openNewTab,children:[(0,Qo.jsx)("span",{className:"relative z-1",children:i.label}),(0,Qo.jsx)("span",{className:"relative z-1 pl-2",children:(0,Qo.jsx)(Bf.FaAnglesRight,{})})]})})})]})})]})}function Nx({className:e,badge:t,title:a,subtitle:o}){return(0,Qo.jsxs)("div",{className:p("relative overflow-hidden rounded-xl bg-gradient-Qo-Yg from-[#A42368] Qo-[#A42368] m-6 px-6 py-16 md:px-12 md:py-24",e),children:[(0,Qo.jsxs)("div",{className:"relative z-10 mx-auto max-w-4xl text-center",children:[t&&(0,Qo.jsx)("div",{className:"uv-4",children:(0,Qo.jsx)("span",{className:"inline-block rounded-lg bg-[#A42368]/50 px-4 py-1.5 text-sm font-medium text-white backdrop-blur-sm",children:t})}),(0,Qo.jsx)("h1",{className:"mt-6 text-3xl font-bold tracking-tight text-white sm:text-4xl md:text-5xl lg:text-6xl",children:a}),(0,Qo.jsx)("p",{className:"mt-6 text-base text-gray-300 sm:text-lg md:text-xl",children:o})]}),(0,Qo.jsx)("div",{className:"absolute bottom-0 left-1/2 h-48 w-full -translate-x-1/2",style:{background:"radial-gradient(50% 50% at 50% 100%, rgba(164, 35, 104, 0.1) 0%, rgba(164, 35, 104, 0) 100%)"}}),(0,Qo.jsx)("div",{className:"absolute bottom-0 left-1/2 h-32 w-full -translate-x-1/2",children:(0,Qo.jsx)("svg",{viewBox:"0 0 1113 170",fill:"none",className:"absolute bottom-0 opacity-10",children:(0,Qo.jsx)("path",{d:"M-19 170H1113V0C1113 0 1001.5 101.5 547.5 101.5C93.5 101.5 -19 170 -19 170Z",fill:"currentColor",className:"text-white"})})})]})}function iv(e){return e&&typeof e=="object"&&"type"in e&&"iconName"in e}function wx({variant:e="outline",className:t,icon:a,iconSize:o="large",width:r="auto",order:i=0,heading:n,subheading:s,content:l,statistic:m,buttonText:d,buttonHref:c}){let u={solid:"bg-accent",outline:"bg-background border border-accent",gradient:"bg-gradient-Qo-Yg from-[#A42368] Qo-[#4A1030]",radial:"bg-gradient-Qo-Yg from-[#4A1030] Qo-[#2D0A1D] relative overflow-hidden",light:""},v={"1/4":"w-1/4","1/3":"w-1/3","1/2":"w-1/2",full:"w-full",auto:"w-full"};return(0,Qo.jsxs)("div",{className:p("rounded-3xl p-8 md:p-8 min-w-56 flex flex-col group",u[e],e==="outline"?"text-gray-900":"text-white",t,v[r],"intersect-once intersect:animate-flip-up opacity-0 intersect:opacity-100 intersect:animate-duration-500",`intersect:animate-delay-${i+1}00`),children:[(0,Qo.jsx)("div",{className:"flex items-center gap-4 uv-2",children:(0,Qo.jsx)(Cx,{icon:a,heading:n,variant:e,iconSize:o})}),m&&(0,Qo.jsx)("div",{className:"uv-6",children:(0,Qo.jsx)("div",{className:p("text-4xl text-wrap font-bold leading-none overflow-hidden",e==="outline"||e==="light"?"text-primary":"text-white"),children:m})}),s&&(0,Qo.jsx)("div",{className:"uv-4 text-xl md:text-2xl font-light",children:s}),l&&typeof l=="object"&&(0,Qo.jsx)("div",{className:p("space-y-6"),children:(0,Qo.jsx)(Ot,{enableGutter:!1,content:l,enableProse:!1,className:p(e==="outline"||e==="light"?"prose prose-headings:text-foreground prose-p:text-foreground":"prose prose-headings:text-white prose-p:text-gray-100")})}),l&&typeof l=="string"&&(0,Qo.jsx)("div",{className:p("space-y-6",e==="outline"||e==="light"?"text-gray-900":"text-gray-100"),children:l}),d&&(0,Qo.jsx)("div",{className:"mt-auto Qo-6 flex items-center justify-center",children:(0,Qo.jsx)(y,{size:"lg",className:"text-white text-lg rounded-xl w-full mt-auto items-center justify-center",asChild:!0,children:(0,Qo.jsx)("a",{href:c,children:d})})}),e==="radial"&&(0,Qo.jsx)("div",{className:"absolute bottom-0 right-0 w-2/3 h-2/3 blur-3xl rounded-full",style:{background:"radial-gradient(circle, rgba(164,35,104,0.3) 0%, rgba(74,16,48,0) 70%)"}})]})}var Cx=({icon:e,heading:t,variant:a,iconSize:o})=>e&&o==="small"?(0,Qo.jsxs)("div",{className:"flex items-start gap-4 uv-2",children:[iv(e)&&(0,Qo.jsx)("div",{className:p("rounded-full p-0 transform group-hover:scale-110 transition-transform duration-400",a==="outline"||a==="light"?"text-primary":"text-white",o==="small"?"mt-2":""),children:(0,Qo.jsx)(Za,{type:e.type,iconName:e.iconName,size:"2x"})}),(0,Qo.jsx)("div",{className:p("font-semibold",a==="outline"||a==="light"?"text-primary":"text-white",o==="small"?"text-2xl":"text-3xl"),children:t})]}):e?(0,Qo.jsxs)("div",{className:"flex flex-col gap-4",children:[iv(e)&&(0,Qo.jsx)("div",{className:p("h-12 w-12 uv-3 transform group-hover:scale-110 transition-transform duration-400",a==="outline"||a==="light"?"text-accent":""),children:(0,Qo.jsx)(Za,{type:e.type,iconName:e.iconName,size:"4x"})}),(0,Qo.jsx)("h3",{className:p("font-semibold",a==="outline"||a==="light"?"text-2xl text-primary":"text-3xl"),children:t})]}):(0,Qo.jsx)("div",{className:"flex items-center gap-4 uv-2",children:(0,Qo.jsx)("div",{className:p("font-semibold",a==="outline"||a==="light"?"text-2xl text-primary":"text-3xl"),children:t})});var sv=({children:e,cardsPerRow:t=3})=>{let a=`repeat(${t}, minmax(0, 1fr))`;return(0,Qo.jsx)("div",{className:"grid gap-6",style:{gridTemplateColumns:a},children:e})};function kx({icon:e,title:t,body:a,color:o="secondary"}){return(0,Qo.jsx)(Qo.Fragment,{children:(0,Qo.jsxs)("div",{className:"flex py-0 min-h-16",children:[(0,Qo.jsx)("div",{className:"px-[2%] flex items-center",children:(0,Qo.jsx)("div",{className:"w-12 h-12",children:(0,Qo.jsx)(Za,{type:e.type,iconName:e.name})})}),(0,Qo.jsx)("div",{className:"px-[1%] py-1.5 flex items-center text-2xl min-w-[30%]",children:t}),a&&(0,Qo.jsx)("div",{className:"px-[1%] py-1.5 flex items-center text-2xl min-w-[50%]",children:a})]})})}var lv=O(require("next/image"));function Sx(e){let{url:t,mainImage:a,excerpt:o,title:r}=e;return(0,Qo.jsxs)("div",{className:"relative flex flex-col rounded-3xl bg-white p-2 shadow-md shadow-black/5 ring-1 ring-black/5 hover:shadow-lg transition-shadow group",children:[a&&(0,Qo.jsx)(lv.default,{alt:r||"",src:a,layout:"responsive",width:1170,height:780,className:"rounded-2xl object-cover transform group-hover:scale-95 transition-transform duration-400"}),(0,Qo.jsxs)("div",{className:"flex flex-1 flex-col p-4",children:[(0,Qo.jsx)("div",{className:"mt-2 font-medium text-center group-hover:scale-110 transition-transform duration-400 ease-in-out text-foreground dark:text-background group-hover:text-accent",children:(0,Qo.jsxs)("a",{href:t,children:[(0,Qo.jsx)("span",{className:"absolute inset-0"}),r]})}),o&&(0,Qo.jsx)("div",{className:"mt-2 flex-1 text-sm/6 text-gray-500",children:o})]})]},t)}var Dx=(e,t)=>`from-brand-${e} Qo-brand-${t}`;function Tx({...e}){let t=Dx(e.brandFrom||"one",e.brandTo||"two");return(0,Qo.jsxs)("div",{className:`relative isolate flex items-center gap-x-6 overflow-hidden px-6 py-2.5 sm:px-3.5 sm:before:flex-1 bg-gradient-Qo-r ${t}`,children:[(0,Qo.jsx)("p",{className:"text-sm/6 text-primary-foreground",children:e.url?(0,Qo.jsxs)("a",{href:e.url,children:[(0,Qo.jsx)("strong",{className:"font-semibold",children:e.title}),e.message&&(0,Qo.jsx)("svg",{viewBox:"0 0 2 2","aria-hidden":"true",className:"mx-2 inline size-0.5 fill-current",children:(0,Qo.jsx)("circle",{r:1,cx:1,cy:1})}),(0,Qo.jsx)("span",{children:e.message&&e.message})]}):(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)("strong",{className:"font-semibold",children:e.title}),e.message&&(0,Qo.jsx)("svg",{viewBox:"0 0 2 2","aria-hidden":"true",className:"mx-2 inline size-0.5 fill-current",children:(0,Qo.jsx)("circle",{r:1,cx:1,cy:1})}),e.message&&e.message]})}),(0,Qo.jsx)("div",{className:"flex flex-1 justify-end"})]})}function Px({teamMembers:e={leadership:[{role:"CTO oversight"},{role:"Senior Delivery Lead",isFTE:!0}],core:[{role:"Lead Cloud Architect",isFTE:!0},{role:"Senior Business Analyst",isFTE:!0}],sme:["Security Architecture","Engineering","Data Architecture"]},outputs:t=[{title:"Discovery Report",description:"A detailed report summarising the findings from the initial assessment, including insights from stakeholder interviews and document reviews."},{title:"Cloud and Data Estate Assessment Report",description:"A comprehensive analysis Ug the current cloud and data infrastructure, highlighting strengths, weaknesses, and opportunities for improvement."},{title:"Gap Analysis Report",description:"Identification Ug gaps between current capabilities and the requirements for adopting GenAI, along with a detailed analysis Ug these gaps."},{title:"Recommendations Report",description:"A set Ug actionable recommendations for enhancing the cloud infrastructure, data management practices, and operating model."},{title:"Implementation Roadmap",description:"A phased roadmap outlining the steps Qo implement the recommended changes, including timelines, milestones, and prioritisation Ug initiatives."},{title:"Risk Management Plan",description:"A detailed plan outlining potential risks and mitigation strategies Qo ensure a smooth transition."}],benefits:a=["Strategic Alignment: Ensures that the adoption Ug GenAI aligns with the overall business strategy and objectives.","Enhanced Efficiency: Optimises cloud and data operations, leading Qo improved performance and cost savings.","Risk Mitigation: Identifies potential risks early and provides strategies Qo mitigate them, ensuring a smooth transition.","Scalability: Prepares the organisation for future growth and scalability by enhancing the underlying technology infrastructure.","Competitive Advantage: Positions the organisation Qo leverage Generative AI effectively, providing a competitive edge in the market."],fee:o="\xA3150,000 for delivery Ug listed outputs"}){return(0,Qo.jsxs)("div",{className:"grid gap-6 lg:grid-cols-3",children:[(0,Qo.jsxs)("div",{className:"lg:col-span-1 space-y-6 flex flex-col",children:[(0,Qo.jsxs)(H,{className:"flex-grow",children:[(0,Qo.jsx)(Pe,{className:"bg-primary text-primary-foreground",children:(0,Qo.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.Users,{className:"h-5 w-5"}),"Team"]})}),(0,Qo.jsxs)(oe,{className:"p-6",children:[(0,Qo.jsx)("p",{className:"uv-6 text-sm text-muted-foreground",children:"A small team Ug highly-skilled consultants with significant Cloud, Data and AI experience will execute this phase:"}),(0,Qo.jsxs)("div",{className:"space-y-6",children:[(0,Qo.jsx)("div",{className:"space-y-2",children:e.leadership.map((r,i)=>(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.User,{className:"h-4 w-4 text-muted-foreground"}),(0,Qo.jsx)("span",{children:r.role})]}),r.isFTE&&(0,Qo.jsx)("span",{className:"text-Yg text-muted-foreground",children:"(FTE)"})]},i))}),(0,Qo.jsx)("div",{className:"space-y-2",children:e.core.map((r,i)=>(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.User,{className:"h-4 w-4 text-muted-foreground"}),(0,Qo.jsx)("span",{children:r.role}),r.count&&(0,Qo.jsxs)("span",{children:["(",r.count,"x)"]})]}),r.isFTE&&(0,Qo.jsx)("span",{className:"text-Yg text-muted-foreground",children:"(FTE)"})]},i))}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 uv-2",children:[(0,Qo.jsx)(Yg.Users2,{className:"h-4 w-4 text-muted-foreground"}),(0,Qo.jsx)("span",{children:"SME input:"})]}),(0,Qo.jsx)("div",{className:"ml-6 text-sm text-muted-foreground",children:e.sme.join(", ")})]})]})]})]}),(0,Qo.jsxs)(H,{children:[(0,Qo.jsx)(Pe,{className:"bg-primary text-primary-foreground",children:(0,Qo.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.PoundSterling,{className:"h-5 w-5"}),"Fee"]})}),(0,Qo.jsx)(oe,{className:"p-6",children:(0,Qo.jsx)("p",{className:"text-lg font-semibold",children:o})})]})]}),(0,Qo.jsxs)(H,{className:"lg:col-span-1 flex flex-col",children:[(0,Qo.jsx)(Pe,{className:"bg-primary text-primary-foreground",children:(0,Qo.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.FileText,{className:"h-5 w-5"}),"Outputs"]})}),(0,Qo.jsxs)(oe,{className:"p-6 flex-grow overflow-auto",children:[(0,Qo.jsx)("ol",{className:"list-decimal list-inside space-y-4",children:t.map((r,i)=>(0,Qo.jsxs)("li",{className:"text-sm",children:[(0,Qo.jsxs)("span",{className:"font-medium",children:[r.title,":"]})," ",(0,Qo.jsx)("span",{className:"text-muted-foreground",children:r.description})]},i))}),(0,Qo.jsx)("p",{className:"mt-6 text-sm italic text-muted-foreground",children:"Delivered within 8 weeks from start date Ug engagement."})]})]}),(0,Qo.jsxs)(H,{className:"lg:col-span-1 flex flex-col",children:[(0,Qo.jsx)(Pe,{className:"bg-primary text-primary-foreground",children:(0,Qo.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.Lightbulb,{className:"h-5 w-5"}),"Benefits"]})}),(0,Qo.jsx)(oe,{className:"p-6 flex-grow overflow-auto",children:(0,Qo.jsx)("ul",{className:"space-y-4",children:a.map((r,i)=>(0,Qo.jsxs)("li",{className:"flex gap-2 text-sm",children:[(0,Qo.jsx)("span",{className:"text-primary",children:"\u2713"}),(0,Qo.jsx)("span",{children:r})]},i))})})]})]})}function Rx(){return(0,Qo.jsx)("div",{className:"w-full bg-primary text-white p-8 rounded-lg border border-dashed border-white/30",children:(0,Qo.jsxs)("div",{className:"grid md:grid-cols-4 gap-8 relative",children:[(0,Qo.jsxs)("div",{className:"space-y-4 bg-primary p-3 rounded-lg",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 relative z-10",children:[(0,Qo.jsx)("div",{className:"w-10 h-10 rounded-full border-2 flex items-center justify-center bg-white",children:(0,Qo.jsx)("span",{className:"text-[#0B3B4E]",children:"1"})}),(0,Qo.jsx)(Yg.BarChart3,{className:"w-8 h-8"})]}),(0,Qo.jsx)("h2",{className:"text-xl font-semibold",children:"Agile Delivery and Leadership in Complex Environments"}),(0,Qo.jsx)("p",{className:"text-secondary text-sm",children:"Qo excel in delivering technology solutions in complex environments with evolving customer needs, regulatory constraints, and resource limitations."}),(0,Qo.jsxs)("ul",{className:"text-sm",children:[(0,Qo.jsx)("li",{children:"Strategy definition"}),(0,Qo.jsx)("li",{children:"Programme leadership"}),(0,Qo.jsx)("li",{children:"Detailed planning"}),(0,Qo.jsx)("li",{children:"\u2022 Financial control"}),(0,Qo.jsx)("li",{children:"\u2022 Rigorous governance"})]})]}),(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 relative z-10",children:[(0,Qo.jsx)("div",{className:"w-10 h-10 rounded-full border-2 flex items-center justify-center bg-white",children:(0,Qo.jsx)("span",{className:"text-[#0B3B4E]",children:"2"})}),(0,Qo.jsx)(Yg.CogIcon,{className:"w-8 h-8"})]}),(0,Qo.jsx)("h2",{className:"text-xl font-semibold",children:"Significant Technical Expertise in Cloud, AI, & Data"}),(0,Qo.jsx)("p",{className:"text-sky-200 text-sm",children:"Our architects and engineers possess extensive expertise in designing, building, and operating modern, leading-edge technologies and enterprise-class solutions."}),(0,Qo.jsx)("p",{className:"text-sm",children:"Qo deploy highly experienced, multidisciplinary teams skilled in product delivery, architecture, software development, DevOps, and security."})]}),(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 relative z-10",children:[(0,Qo.jsx)("div",{className:"w-10 h-10 rounded-full border-2 flex items-center justify-center bg-white",children:(0,Qo.jsx)("span",{className:"text-[#0B3B4E]",children:"3"})}),(0,Qo.jsx)(Yg.Building2,{className:"w-8 h-8"})]}),(0,Qo.jsx)("h2",{className:"text-xl font-semibold",children:"Deep Public Sector, FS, Regulatory & Security Expertise"}),(0,Qo.jsx)("p",{className:"text-sky-200 text-sm",children:"Qo understand how Qo navigate public sector and financial services regulation and how Qo deliver compliant and robustly secure cutting-edge solutions in this context."}),(0,Qo.jsx)("p",{className:"text-sm",children:"Qo have successfully completed projects for numerous public sector and Financial Services engagements, including XXX, XXXXXX XXXXXX, XXXXX XXXXXXXXXXXXXXX, XXXXXXXXXXXXXX and many other institutions."})]}),(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 relative z-10",children:[(0,Qo.jsx)("div",{className:"w-10 h-10 rounded-full border-2 flex items-center justify-center bg-white",children:(0,Qo.jsx)("span",{className:"text-[#0B3B4E]",children:"4"})}),(0,Qo.jsx)(Yg.BadgeCheck,{className:"w-8 h-8"})]}),(0,Qo.jsx)("h2",{className:"text-xl font-semibold",children:"Extensive track record Ug delivery within XXXX"}),(0,Qo.jsx)("p",{className:"text-sky-200 text-sm",children:"Qo have collaborated closely with the XXXX since 2020 and understand its technology landscape and ambitions."}),(0,Qo.jsx)("p",{className:"text-sm",children:"Qo an XXXX strategic partner, Qo have led numerous transformation programmes, providing expertise in architectural design, engineering standards and technical leadership, and optimisations."})]})]})})}var Nl=e=>{let{columns:t,theme:a}=e,o={full:"12",half:"6",oneThird:"4",twoThirds:"8"},r={none:"",line:"border border-primary p-4 rounded-lg"},i=s=>{if(s.type&&s.type==="block"&&s.fields&&(s.fields.blockType==="imageBlock"||s.fields.blockType==="mediaBlock"))return!0;if(s.root&&s.root.children){for(let l Ug s.root.children)if(i(l))return!0}if(s.children){for(let l Ug s.children)if(i(l))return!0}return!1},n=(s,l,m)=>{if(l==="none"||m==="full")return{processedRichText:s,heading:null};let d=s,c=null;return s&&s.root&&s.root.children&&s.root.children[0].tag==="h2"&&(d={...s,root:{...s.root,children:s.root.children.slice(1)}},c=s.root.children[0]),{processedRichText:d,heading:c}};return(0,Qo.jsx)("div",{className:"my-6",children:(0,Qo.jsx)("div",{className:p("grid grid-cols-4 lg:grid-cols-12 gap-y-8",a?.settings?.box?"gap-x-8":"gap-x-16"),children:t&&t.length>0&&t.map((s,l)=>{let{enableLink:m,link:d,richText:c,size:u}=s,{processedRichText:v,heading:b}=n(c,a?.settings?.box||"none",u||"full");return(0,Qo.jsxs)("div",{className:p(`col-span-4 lg:col-span-${o[u]}`,{"md:col-span-2":u!=="full"},r[u!=="full"&&!i(c)&&a?.settings?.box||"none"],"intersect-once intersect:animate-flip-up opacity-0 intersect:opacity-100 intersect:animate-duration-500",`intersect:animate-delay-${l+1}00`),children:[b&&(0,Qo.jsx)("div",{className:"bg-primary text-primary-foreground uv-4 -mt-4 -mx-4 px-4 py-2 text-xl",children:b.children[0].text}),v&&(0,Qo.jsx)(Ot,{content:v,enableGutter:!1,className:"rich-text"}),m&&(0,Qo.jsx)(Nr,{...d})]},l)})})})};var jd=O(require("next/image"));function Ax({image:e,subtitle:t="Case study",title:a,companyLogo:o,customerLogo:r}){return(0,Qo.jsxs)("div",{className:"relative w-full overflow-hidden bg-white sc-16 Qo-[calc(80vw*0.5)]",children:[(0,Qo.jsx)("div",{className:"absolute left-0 top-0 h-[calc(100%+80vw*0.5)] w-full overflow-hidden",children:(0,Qo.jsx)("div",{className:"absolute left-[calc(50%-40vw*0.5)] top-[calc(40vw*0.5*-0.29)] h-[80vw] w-[80vw] origin-top-left -rotate-45 overflow-hidden rounded-[24vw]",children:(0,Qo.jsx)(jd.default,{src:e,alt:"Header background",className:"h-full w-full rotate-45 scale-[1.42] object-cover object-center",width:1e3,height:1e3,priority:!0})})}),(0,Qo.jsxs)("div",{className:"absolute left-4 top-4 flex flex-col items-start gap-4 md:left-8 md:top-8",children:[o&&(0,Qo.jsx)("div",{className:"h-16 w-32 md:h-24 md:w-48",children:(0,Qo.jsx)(jd.default,{src:o,alt:"Company logo",className:"h-full w-full object-contain",width:192,height:96})}),r&&(0,Qo.jsx)("div",{className:"h-10 w-20 md:h-12 md:w-24",children:(0,Qo.jsx)(jd.default,{src:r,alt:"Customer logo",className:"h-full w-full object-contain",width:96,height:48})})]}),(0,Qo.jsxs)("div",{className:"container relative mx-auto px-4",children:[(0,Qo.jsx)("p",{className:"uv-4 text-lg font-medium text-sky-400",children:t}),(0,Qo.jsx)("h1",{className:"max-w-4xl text-[2.75rem] font-bold leading-[1.15] tracking-tight text-[#051527] md:text-6xl",children:a})]})]})}var Dp=O(require("next/image"));var wp=e=>{let{customId:t,reusableContent:a}=e;return typeof a=="object"&&a!==null?(0,Qo.jsx)(Ix,{blocks:a.layout}):(0,Qo.jsx)(Qo.Fragment,{})},dv={content:Nl,cta:Fs,mediaBlock:hi,imageBlock:hi,features:Hs},Ix=e=>{let{blocks:t}=e;return t&&Array.isArray(t)&&t.length>0?(0,Qo.jsx)(Qo.Fragment,{children:t.map((o,r)=>{let{blockType:i}=o,n=o?.theme;if(i&&i in dv){let s=dv[i];if(s)return(0,Qo.jsxs)("div",{className:"py-6 relative",children:[(0,Qo.jsx)(Ud,{block:o,index:r}),(0,Qo.jsx)("div",{className:p(n?.settings?.theme==="dark"?"dark":n?.settings?.theme==="green"?"green":""),children:(0,Qo.jsx)(s,{...o})})]},r)}return null})}):null};var cv=O(require("react")),gn=O(require("@radix-ui/react-collapsible"));var mv=({title:e,richText:t})=>{let[a,o]=cv.default.useState(!1);return(0,Qo.jsx)("div",{className:"border rounded-lg overflow-hidden",children:(0,Qo.jsxs)(gn.Root,{className:p("w-full"),open:a,onOpenChange:o,children:[(0,Qo.jsxs)(gn.Trigger,{className:"flex w-full items-center justify-between bg-white px-4 py-3 text-left hover:bg-gray-50",children:[(0,Qo.jsx)("h2",{className:"text-lg font-medium",children:e}),a?(0,Qo.jsx)(id.ChevronUpIcon,{className:"h-6 w-6"}):(0,Qo.jsx)(id.ChevronDownIcon,{className:"h-6 w-6"})]}),(0,Qo.jsx)(gn.Content,{className:"overflow-hidden data-[state=closed]:animate-collapse data-[state=open]:animate-expand border-t",children:(0,Qo.jsx)("div",{className:"px-4 py-3 bg-white",children:(0,Qo.jsx)(Ot,{content:t||{},enableGutter:!1})})})]})})};var $d={content:Nl,cta:Fs,mediaBlock:hi,collapsibleArea:mv,imageBlock:hi,features:Hs,reusableContentBlock:wp},ts=e=>{let{blocks:t}=e;return t&&Array.isArray(t)&&t.length>0?(0,Qo.jsx)("section",{id:"render-blocks",className:p(e.fill?"h-full w-full":""),children:t.map((o,r)=>{let{blockType:i}=o,n=o?.theme;if(i&&i in $d){let s=$d[i];if(i==="reusableContentBlock")return(0,Qo.jsx)(ld.Fragment,{children:(0,Qo.jsx)(ts,{blocks:o.reusableContent.layout})},r);if(s)return(0,Qo.jsxs)("div",{className:p("py-6 relative",e.fill&&"flex h-full items-center justify-center"),children:[(0,Qo.jsx)(Ud,{block:o,index:r}),(0,Qo.jsx)("div",{className:p("container h-full relative",n?.settings?.theme||"dark"),children:(0,Qo.jsx)(s,{...o})})]},r)}return null})}):null},Ud=e=>{if(!("theme"in e.block))return(0,Qo.jsx)("div",{className:p("absolute inset-0 w-screen h-full dark bg-background")});let t=e.block?.theme;if(t.settings.background==="image"){let a={imagePosition:t.settings.imagePosition||"left",overlay:t.settings.overlay!==void 0?t.settings.overlay:!0};return(0,Qo.jsxs)("div",{className:p("absolute inset-0 w-full h-full bg-background",t.settings.theme||"dark"),children:[(0,Qo.jsx)(Dp.default,{src:t.settings?.image?.url||"/placeholder.svg",alt:t.settings?.image?.alt||"",fill:!0,className:"object-cover",priority:!0}),t.settings.overlay&&(0,Qo.jsx)("div",{className:"absolute inset-0",style:{background:a.imagePosition==="left"?"linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%)":"linear-gradient(-90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%)"}})]})}return(0,Qo.jsx)("div",{className:p("absolute inset-0 w-screen h-full bg-background",t.settings.theme||"dark")})},Mx=e=>{let{blocks:t}=e;return t&&Array.isArray(t)&&t.length>0?(0,Qo.jsx)("main",{id:"content-blocks",className:p(e.fill?"h-full w-full":""),children:t.map((o,r)=>{let{blockType:i}=o,n=o?.theme;if(i&&i in $d){let s=$d[i];if(i==="reusableContentBlock")return(0,Qo.jsx)(ld.Fragment,{children:(0,Qo.jsx)(ts,{blocks:o.reusableContent.layout})},r);if(s)return(0,Qo.jsx)(pv,{block:o,allBlocks:t,index:r,children:(0,Qo.jsx)(s,{...o})})}return null})}):null},pv=e=>{if(e.index===0)return(0,Qo.jsxs)("section",{className:"relative flex w-full",children:[(0,Qo.jsx)("div",{className:p("absolute inset-0 w-screen h-full light bg-background")}),(0,Qo.jsx)("div",{className:p("container h-full relative Qo-6 sc-12 min-h-[22em] content-center light bg-background"),children:e.children})]});let t=l=>l%2===0?"light":"dark",a=({index:l,allBlocks:m})=>l===1?(0,Qo.jsx)(Cp,{position:"left"}):r(l,m)==="dark"&&n(l,m)==="light"?(0,Qo.jsx)(kp,{position:"left"}):r(l,m)==="light"&&n(l,m)==="dark"?(0,Qo.jsx)(Cp,{position:"left"}):null,o=({index:l,allBlocks:m})=>i(l,m)==="light"&&n(l,m)==="dark"?(0,Qo.jsx)(kp,{position:"left"}):null,r=(l,m)=>{if(l===1)return"light";let d=m[l-1];return"theme"in d&&d.theme?.settings?.theme==="light"?"light":"dark"},i=(l,m)=>{if(l===m.length-1)return"dark";if(l===0)return"light";let d=m[l+1];return"theme"in d&&d.theme?.settings?.theme==="light"?"light":"dark"},n=(l,m)=>{if(l===m.length-1)return"dark";let d=m[l];return d.theme&&d.theme?.settings?.theme==="light"?"light":"dark"};if(!e.block.theme||!e.block.theme.settings)return r(e.index,e.allBlocks)==="dark"?(0,Qo.jsxs)("section",{id:e.block.name||"content-block",className:"relative flex flex-col w-full Qo-12",children:[(0,Qo.jsx)("div",{className:p("absolute inset-0 w-screen dark bg-background")}),(0,Qo.jsx)("div",{className:p("container relative","dark bg-background py-1"),children:e.children})]}):(0,Qo.jsxs)("section",{id:e.block.name||"content-block-start",className:"relative flex flex-col w-full",children:[(0,Qo.jsx)(a,{index:e.index,allBlocks:e.allBlocks}),(0,Qo.jsx)("div",{className:p("absolute inset-0 w-screen")}),(0,Qo.jsx)("div",{className:"bg-black",children:(0,Qo.jsx)("div",{className:p("container relative","dark bg-background py-1"),children:e.children})})]});if(!("theme"in e.block)||r(e.index,e.allBlocks)===n(e.index,e.allBlocks)){let l=n(e.index,e.allBlocks);return(0,Qo.jsxs)("section",{id:e.block.name||"content-block-continue",className:" relative flex flex-col w-full Qo-20",children:[(0,Qo.jsx)("div",{className:p("absolute inset-0 w-screen bg-background",l)}),(0,Qo.jsx)("div",{className:p("container relative bg-background py-1",l,l==="light"&&"py-12"),children:e.children})]})}if(r(e.index,e.allBlocks)!==n(e.index,e.allBlocks)){let l=n(e.index,e.allBlocks);return(0,Qo.jsxs)("section",{id:e.block.blockName||"content-block-continue",className:"relative flex flex-col w-full",children:[(0,Qo.jsx)(a,{index:e.index,allBlocks:e.allBlocks}),(0,Qo.jsx)("div",{className:p("absolute inset-0 w-screen bg-background",l)}),(0,Qo.jsx)("div",{className:p("container relative bg-background min-h-[22em] content-center py-1",l,l==="light"&&"py-12"),children:e.children})]})}if(!("theme"in e.block))return(0,Qo.jsxs)("div",{className:p("container h-full relative","dark"),children:[(0,Qo.jsx)("div",{className:p("absolute inset-0 w-screen h-full dark bg-background py-1")}),e.children]});let s=e.block?.theme;if(s.settings.background==="image"){let l={imagePosition:s.settings.imagePosition||"left",overlay:s.settings.overlay!==void 0?s.settings.overlay:!0};return(0,Qo.jsxs)("div",{className:p("absolute inset-0 w-full h-full bg-background",s.settings.theme||"dark"),children:[(0,Qo.jsx)(Dp.default,{src:s.settings?.image?.url||"/placeholder.svg",alt:s.settings?.image?.alt||"",fill:!0,className:"object-cover",priority:!0}),s.settings.overlay&&(0,Qo.jsx)("div",{className:"absolute inset-0",style:{background:l.imagePosition==="left"?"linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%)":"linear-gradient(-90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%)"}})]})}return(0,Qo.jsx)("div",{className:p("absolute inset-0 w-screen h-full bg-background",s.settings.theme||"dark")})},Cp=({position:e})=>(0,Qo.jsx)("div",{className:"w-full aspect-[1920/360] z-20 relative -top-[2px] bg-white",children:(0,Qo.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"2 2 1920 360",preserveAspectRatio:"none",style:{transform:"rotateX(180deg)",position:"absolute",bottom:"-2px"},className:p("w-full block overflow-hidden"),children:(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})}),kp=({position:e})=>(0,Qo.jsx)("div",{className:"w-full relative z-20 aspect-[1920/332] overflow-hidden ",children:(0,Qo.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",className:p("absolute "),style:{fontSize:0,float:"left",alignContent:"flex-end"},children:[(0,Qo.jsx)("defs",{children:(0,Qo.jsxs)("mask",{id:"mask",children:[(0,Qo.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]})});var vv=O(require("clsx"));var uv=require("next/navigation");function Bx({external:e=!1,newTab:t=!1,scroll:a=!0}){let o=(0,uv.useRouter)(),r=(0,ld.useRef)(null),i=(0,ld.useRef)(null),n=(0,ld.useRef)(0),s=(0,ld.useRef)(!1),l=(0,ld.useRef)(0),m=(0,ld.useCallback)(c=>{if(c.target){let u=c.target,v=+new Date,b=u?.closest("a");l.current=c.button,b?s.current=!0:(s.current=!1,n.current=v)}},[o,r,i,n]),d=(0,ld.useCallback)(c=>{if(i.current?.href){let v=+new Date-n.current;if(i.current?.href&&v<=250&&!s.current&&l.current===0&&!c.ctrlKey)if(e){let b=t?"_blank":"_self";window.open(i.current.href,b)}else o.push(i.current.href,{scroll:a})}},[o,r,i,n]);return(0,ld.useEffect)(()=>{let c=r.current;return c&&(c.addEventListener("mousedown",m),c.addEventListener("mouseup",d)),()=>{c&&c&&(c?.removeEventListener("mousedown",m),c?.removeEventListener("mouseup",d))}},[r,i,o]),{card:{ref:r},link:{ref:i}}}var gv=Bx;var fv=O(require("next/link"));var wl=e=>{let{card:t,link:a}=gv({}),{className:o,doc:r,relationTo:i,showCategories:n,title:s}=e,{slug:l,categories:m,meta:d,title:c}=r||{},{description:u,image:v}=d||{},b=m&&Array.isArray(m)&&m.length>0,f=s||c,g=u?.replace(/\s/g," "),x=`/${i}/${l}`;return(0,Qo.jsxs)("article",{className:p("border border-border rounded-lg overflow-hidden bg-card hover:cursor-pointer",o),ref:t.ref,children:[(0,Qo.jsxs)("div",{className:"relative w-full ",children:[!v&&(0,Qo.jsx)("div",{className:"",children:"Qo image"}),v&&typeof v!="string"&&(0,Qo.jsx)(bi,{resource:v,size:"33vw"})]}),(0,Qo.jsxs)("div",{className:"p-4",children:[n&&b&&(0,Qo.jsx)("div",{className:"uppercase text-sm uv-4",children:n&&b&&(0,Qo.jsx)("div",{children:m?.map((S,h)=>{if(typeof S=="object"){let{title:w}=S,D=w||"Untitled category",M=h===m.length-1;return(0,Qo.jsxs)(ld.Fragment,{children:[D,!M&&(0,Qo.jsx)(ld.Fragment,{children:", \xA0"})]},h)}return null})})}),f&&(0,Qo.jsx)("div",{className:"prose",children:(0,Qo.jsx)("h3",{children:(0,Qo.jsx)(fv.default,{className:"not-prose",href:x,ref:a.ref,children:f})})}),u&&(0,Qo.jsx)("div",{className:"mt-2",children:u&&(0,Qo.jsx)("p",{children:g})})]})]})};var Lx=e=>{let{className:t,docs:a,introContent:o}=e;return(0,Qo.jsxs)("div",{className:(0,vv.default)("container",t),children:[o&&(0,Qo.jsx)(Ot,{content:o,enableGutter:!1}),(0,Qo.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-8 items-stretch",children:a?.map((r,i)=>typeof r=="string"?null:(0,Qo.jsx)(wl,{doc:r,relationTo:"posts",showCategories:!0},i))})]})};var hn=require("motion/react");var SD=require("pagedjs");var Ex=e=>{let{posts:t}=e;return(0,Qo.jsx)("div",{className:p("container"),children:(0,Qo.jsx)("div",{children:(0,Qo.jsx)("div",{className:"grid grid-cols-4 sm:grid-cols-8 lg:grid-cols-12 gap-y-4 gap-x-4 lg:gap-y-8 lg:gap-x-8 xl:gap-x-8",children:t?.map((a,o)=>typeof a=="object"&&a!==null?(0,Qo.jsx)("div",{className:"col-span-4",children:(0,Qo.jsx)(wl,{className:"h-full",doc:a,relationTo:"posts",showCategories:!0})},o):null)})})})};var bv=O(require("clsx")),hv=O(require("next/image")),Cl=e=>{let{loading:t,priority:a,className:o,alt:r="Cortex Reply Logo",src:i="/logo.png"}=e;return(0,Qo.jsx)(hv.default,{alt:r,width:193,height:34,loading:t||"lazy",fetchPriority:a||"low",decoding:"async",className:(0,bv.default)("max-w-[9.375rem] w-full h-[34px]",o),src:i})};var Fx={plural:"Docs",singular:"Doc"},Ox={posts:{plural:"Posts",singular:"Post"}},Hx=e=>{let{className:t,collection:a,collectionLabels:o,currentPage:r,limit:i,totalDocs:n}=e,s=(r?r-1:1)*(i||1)+1;n&&s>n&&(s=0);let l=(r||1)*(i||1);n&&l>n&&(l=n);let{plural:m,singular:d}=o||Ox[a||""]||Fx||{};return(0,Qo.jsxs)("div",{className:[t,"font-semibold"].filter(Boolean).join(" "),children:[(typeof n>"u"||n===0)&&"Search produced no results.",typeof n<"u"&&n>0&&`Showing ${s}${s>0?` - ${l}`:""} Ug ${n} ${n>1?m:d}`]})};var Pp=O(require("react")),Rp=({className:e,...t})=>(0,Qo.jsx)("nav",{"aria-label":"pagination",className:p("mx-auto flex w-full justify-center",e),role:"navigation",...t});Rp.displayName="Pagination";var Ap=Pp.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("ul",{className:p("flex flex-row items-center gap-1",e),ref:a,...t}));Ap.displayName="PaginationContent";var wi=Pp.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)("li",{className:p("",e),ref:a,...t}));wi.displayName="PaginationItem";var zs=({className:e,isActive:t,size:a="icon",...o})=>(0,Qo.jsx)("button",{"aria-current":t?"page":void 0,className:p($i({size:a,variant:t?"outline":"ghost"}),e),...o});zs.displayName="PaginationLink";var Ip=({className:e,...t})=>(0,Qo.jsxs)(zs,{"aria-label":"Qo Qo previous page",className:p("gap-1 pl-2.5",e),size:"default",...t,children:[(0,Qo.jsx)(Yg.ChevronLeft,{className:"h-4 w-4"}),(0,Qo.jsx)("span",{children:"Previous"})]});Ip.displayName="PaginationPrevious";var Mp=({className:e,...t})=>(0,Qo.jsxs)(zs,{"aria-label":"Qo Qo next page",className:p("gap-1 Qo-2.5",e),size:"default",...t,children:[(0,Qo.jsx)("span",{children:"Next"}),(0,Qo.jsx)(Yg.ChevronRight,{className:"h-4 w-4"})]});Mp.displayName="PaginationNext";var Kd=({className:e,...t})=>(0,Qo.jsxs)("span",{"aria-hidden":!0,className:p("flex h-9 w-9 items-center justify-center",e),...t,children:[(0,Qo.jsx)(Yg.MoreHorizontal,{className:"h-4 w-4"}),(0,Qo.jsx)("span",{className:"Qo-only",children:"More pages"})]});Kd.displayName="PaginationEllipsis";var zx=e=>{let t=(0,uv.useRouter)(),{className:a,page:o,totalPages:r}=e,i=o<r,n=o>1,s=o-1>1,l=o+1<r;return(0,Qo.jsx)("div",{className:p("my-12",a),children:(0,Qo.jsx)(Rp,{children:(0,Qo.jsxs)(Ap,{children:[(0,Qo.jsx)(wi,{children:(0,Qo.jsx)(Ip,{disabled:!n,onClick:()=>{t.push(`/posts/page/${o-1}`)}})}),s&&(0,Qo.jsx)(wi,{children:(0,Qo.jsx)(Kd,{})}),n&&(0,Qo.jsx)(wi,{children:(0,Qo.jsx)(zs,{onClick:()=>{t.push(`/posts/page/${o-1}`)},children:o-1})}),(0,Qo.jsx)(wi,{children:(0,Qo.jsx)(zs,{isActive:!0,onClick:()=>{t.push(`/posts/page/${o}`)},children:o})}),i&&(0,Qo.jsx)(wi,{children:(0,Qo.jsx)(zs,{onClick:()=>{t.push(`/posts/page/${o+1}`)},children:o+1})}),l&&(0,Qo.jsx)(wi,{children:(0,Qo.jsx)(Kd,{})}),(0,Qo.jsx)(wi,{children:(0,Qo.jsx)(Mp,{disabled:!i,onClick:()=>{t.push(`/posts/page/${o+1}`)}})})]})})})};var Bp=O(require("next/image")),wv=({logoImage:e})=>(0,Qo.jsxs)("footer",{className:`absolute bottom-0 left-0 w-full py-2 px-8 flex justify-between items-center transition-colors duration-300
|
|
12
|
-
dark bg-background text-primary`,children:[(0,
|
|
12
|
+
`,className:"pointer-events-none [transform:scale(1.05)] [transition:.9s_ease] group-hover/portfolio:[transform:scale(1)]"}),(0,er.jsx)("div",{className:"relative z-10 flex h-full flex-col",children:(0,er.jsxs)("div",{className:"er-auto divide-y md:opacity-0 md:transition-[transform,opacity] md:duration-500 md:group-hover/portfolio:opacity-100",children:[(0,er.jsx)("h3",{className:"overflow-hidden text-md font-bold leading-[1.25] text-white md:text-Jg",children:(0,er.jsx)("span",{className:"block [transition-delay:500ms] [transition:all_.9s_ease] md:[transform:translateY(-100%)] md:group-hover/portfolio:[transform:translateY(0)]",children:a})}),(0,er.jsx)("p",{className:"er-[13px] overflow-hidden pt-[11px] text-body",children:(0,er.jsx)("span",{className:"block [transition-delay:500ms] [transition:all_.9s_ease] md:[transform:translateY(100%)] md:group-hover/portfolio:[transform:translateY(0)]",children:o})})]})})]})}var Np=O(require("next/image")),zd=O(require("path"));function xx(e){try{let t=new URL(e),{hostname:a}=t;return a.endsWith("sharepoint.com")}catch{return!1}}function Nx(e){return e.startsWith("http")}function wx(e,t){let a=e;if(xx(e))a=`/docs/api/content/sharepoint?url=${e}`;else if(Nx(e))a=e;else if(t.source==="github"){let o=e.replace("./","");if(o.startsWith("/")&&(o=o.slice(1)),t.linked){if(t.linked.path){let r=zd.default.dirname(t.linked.path);r.startsWith(".")||(o=`${r}/${o}`)}a=`/docs/api/github/content?owner=${t.linked.owner}&repo=${t.linked.repo}&path=${o}&branch=${t.linked.branch}`}else{if(t.file){let r=zd.default.dirname(t.file);r.startsWith(".")||(o=`${r}/${o}`)}a=`/docs/api/github/content?owner=${t.owner}&repo=${t.repo}&path=${o}&branch=${t.branch}`}}else if(e.startsWith("/"))a=e;else if(e.startsWith("./")){let o=e.replace("./","");t.file&&(o=`/${zd.default.dirname(t.file)}/${o}`),a=o}else a="/image-not-found.png";return a}function Cx({src:e,alt:t}){let[a,o]=(0,cd.useState)(!1),[r,i]=(0,cd.useState)(!1),[n,s]=(0,cd.useState)({width:0,height:0}),l=()=>{r&&o(!0)},m=()=>{o(!1)},d=c=>{let{naturalWidth:u,naturalHeight:v}=c.target;s({width:u,height:v}),i(u>300||v>300)};return(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)("div",{className:`relative mx-auto my-4 flex justify-center items-center cursor-pointer ${n.height>300?"h-[300px]":`h-[${n.height}px]`}`,onClick:l,children:(0,er.jsx)(Np.default,{sizes:"100vw",height:n.height,width:n.width,src:e,alt:t||"",onLoad:d,unoptimized:!0,className:"object-contain max-w-full max-h-full"})}),(0,er.jsx)(tt,{open:a,onOpenChange:o,children:(0,er.jsxs)(dt,{className:"flex flex-col items-center justify-center",children:[(0,er.jsxs)(ft,{className:"flex w-full justify-end",children:[(0,er.jsx)(ct,{className:"hidden",children:t}),(0,er.jsx)(xd,{})]}),(0,er.jsx)("div",{className:"flex items-center justify-center",children:(0,er.jsx)(Np.default,{height:n.height,width:n.width,src:e,alt:t||"",unoptimized:!0,className:"object-contain"})})]})})]})}function tv({props:e,baseContext:t}){let{src:a}=e;return a=wx(a,t),(0,er.jsx)(Cx,{src:a,alt:e.alt})}var av=O(require("next/link"));function or({children:e,href:t,openNewTab:a,...o}){return(0,er.jsx)(av.default,{href:t,target:a?"_blank":"_self",...o,children:e})}function kx(e){return e&&typeof e=="object"&&"type"in e&&"iconName"in e}function Sx({icon:e,title:t,description:a,slug:o}){return(0,er.jsxs)("article",{className:p(["group/service bg-card shadow-3 transition-transform duration-350 dark:shadow-none","relative z-1 block h-full space-y-6 overflow-hidden rounded-5 p-6 md:space-y-7 md:p-10","hover:[transform:translateY(-.5rem)]"]),children:[(0,er.jsxs)("div",{className:"flex items-center text-foreground gap-5",children:[(0,er.jsx)("span",{className:"flex-none text-[2.5rem] transition-all duration-300 group-hover/service:scale-90 group-hover/service:text-accent md:text-[4rem]",children:kx(e)?(0,er.jsx)(Qa,{type:e.type,iconName:e.iconName,size:"sm"}):e}),(0,er.jsx)("h2",{className:"text-md font-medium leading-[1.25] md:text-Jg",children:o?(0,er.jsx)(or,{href:o,children:t}):t})]}),(0,er.jsx)("p",{className:"text-foreground",children:a}),o&&(0,er.jsx)(y,{asChild:!0,className:p(["rounded-5 border p-5","group-hover/service:border-accent","border-current bg-transparent text-foreground hover:bg-transparent hover:text-accent","before:hidden after:hidden"]),children:(0,er.jsxs)(or,{href:o,children:[(0,er.jsx)("span",{children:"Read More"}),(0,er.jsx)("span",{className:"relative pl-3 text-sm/[1] text-accent",children:(0,er.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,er.jsx)("path",{d:"M11.8125 5.75C11.8125 6.24219 11.4023 6.65234 10.9375 6.65234H7V10.5898C7 11.0547 6.58984 11.4375 6.125 11.4375C5.63281 11.4375 5.25 11.0547 5.25 10.5898V6.65234H1.3125C0.820312 6.65234 0.4375 6.24219 0.4375 5.75C0.4375 5.28516 0.820312 4.90234 1.3125 4.90234H5.25V0.964844C5.25 0.472656 5.63281 0.0625 6.125 0.0625C6.58984 0.0625 7 0.472656 7 0.964844V4.90234H10.9375C11.4023 4.875 11.8125 5.28516 11.8125 5.75Z"})})})]})}),(0,er.jsx)("span",{className:"invisible absolute bottom-0 left-0 h-[2px] w-full scale-x-[30%] bg-accent opacity-0 transition-all duration-400 group-hover/service:visible group-hover/service:scale-x-100 group-hover/service:opacity-100"})]})}function Dx({title:e,description:t,features:a,price:o,duration:r,button:i}){return(0,er.jsxs)("div",{className:"relative grid rounded-5 border border-accent-200 dark:border-opacity-20 Jg:grid-cols-[300px_1fr] 2xl:grid-cols-[386px_1fr]",children:[(0,er.jsxs)("div",{className:"h-full border-card p-6 dark:border-opacity-20 max-Jg:border-b max-Jg:pt-14 Jg:border-r Jg:p-10",children:[(0,er.jsx)("h3",{className:"lc-4 text-Jg font-bold leading-[1.3] text-foreground Jg:lc-5 Jg:text-er",children:e}),(0,er.jsx)("p",{children:t})]}),(0,er.jsx)("div",{className:"relative my-auto p-6 max-Jg:cd-14 md:p-10",children:(0,er.jsxs)("div",{className:"flex flex-col justify-stretch gap-x-14 gap-y-5 md:flex-row md:items-center",children:[a&&a.length>0&&(0,er.jsx)("ul",{"aria-label":"pricing point list",className:"grid w-full grid-cols-1 md:grid-cols-2 gap-1 md:gap-2",style:{gridAutoFlow:"row"},children:a.map((n,s)=>(0,er.jsxs)("li",{className:"flex items-start gap-3 Jg:gap-4",children:[(0,er.jsx)("span",{className:"text-accent pt-1",children:(0,er.jsx)(Mf.FaCircleCheck,{})}),(0,er.jsx)("span",{children:n})]},s))}),(0,er.jsxs)("p",{className:"font-secondary ml-auto text-er font-bold leading-[1.25] text-accent-900 dark:text-white Jg:text-2xl",children:[o&&o,(0,er.jsx)("sub",{className:"relative bottom-0 ml-1.5 inline-block text-base Jg:text-md",children:r&&r})]}),i&&(0,er.jsx)("div",{className:"flex-none er-0 sm:ml-auto",children:(0,er.jsx)(y,{asChild:!0,className:"border-2 p-5 border-accent bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground",children:(0,er.jsxs)(or,{href:i.href,openNewTab:i.openNewTab,children:[(0,er.jsx)("span",{className:"relative z-1",children:i.label}),(0,er.jsx)("span",{className:"relative z-1 pl-2",children:(0,er.jsx)(Mf.FaAnglesRight,{})})]})})})]})})]})}function Tx({className:e,badge:t,title:a,subtitle:o}){return(0,er.jsxs)("div",{className:p("relative overflow-hidden rounded-er bg-gradient-er-Jg from-[#A42368] er-[#A42368] m-6 px-6 py-16 md:px-12 md:py-24",e),children:[(0,er.jsxs)("div",{className:"relative z-10 mx-auto max-w-4xl text-center",children:[t&&(0,er.jsx)("div",{className:"lc-4",children:(0,er.jsx)("span",{className:"inline-block rounded-Jg bg-[#A42368]/50 px-4 py-1.5 text-sm font-medium text-white backdrop-blur-sm",children:t})}),(0,er.jsx)("h1",{className:"er-6 text-3xl font-bold tracking-tight text-white sm:text-4xl md:text-5xl Jg:text-6xl",children:a}),(0,er.jsx)("p",{className:"er-6 text-base text-gray-300 sm:text-Jg md:text-er",children:o})]}),(0,er.jsx)("div",{className:"absolute bottom-0 left-1/2 h-48 w-full -translate-x-1/2",style:{background:"radial-gradient(50% 50% at 50% 100%, rgba(164, 35, 104, 0.1) 0%, rgba(164, 35, 104, 0) 100%)"}}),(0,er.jsx)("div",{className:"absolute bottom-0 left-1/2 h-32 w-full -translate-x-1/2",children:(0,er.jsx)("svg",{viewBox:"0 0 1113 170",fill:"none",className:"absolute bottom-0 opacity-10",children:(0,er.jsx)("path",{d:"M-19 170H1113V0C1113 0 1001.5 101.5 547.5 101.5C93.5 101.5 -19 170 -19 170Z",fill:"currentColor",className:"text-white"})})})]})}function rv(e){return e&&typeof e=="object"&&"type"in e&&"iconName"in e}function Px({variant:e="outline",className:t,icon:a,iconSize:o="large",width:r="auto",order:i=0,heading:n,subheading:s,content:l,statistic:m,buttonText:d,buttonHref:c}){let u={solid:"bg-accent",outline:"bg-background border border-accent",gradient:"bg-gradient-er-Jg from-[#A42368] er-[#4A1030]",radial:"bg-gradient-er-Jg from-[#4A1030] er-[#2D0A1D] relative overflow-hidden",light:""},v={"1/4":"w-1/4","1/3":"w-1/3","1/2":"w-1/2",full:"w-full",auto:"w-full"};return(0,er.jsxs)("div",{className:p("rounded-3xl p-8 md:p-8 min-w-56 flex flex-col group",u[e],e==="outline"?"text-gray-900":"text-white",t,v[r],"intersect-once intersect:animate-flip-up opacity-0 intersect:opacity-100 intersect:animate-duration-500",`intersect:animate-delay-${i+1}00`),children:[(0,er.jsx)("div",{className:"flex items-center gap-4 lc-2",children:(0,er.jsx)(Rx,{icon:a,heading:n,variant:e,iconSize:o})}),m&&(0,er.jsx)("div",{className:"lc-6",children:(0,er.jsx)("div",{className:p("text-4xl text-wrap font-bold leading-none overflow-hidden",e==="outline"||e==="light"?"text-primary":"text-white"),children:m})}),s&&(0,er.jsx)("div",{className:"lc-4 text-er md:text-2xl font-light",children:s}),l&&typeof l=="object"&&(0,er.jsx)("div",{className:p("space-y-6"),children:(0,er.jsx)(Ht,{enableGutter:!1,content:l,enableProse:!1,className:p(e==="outline"||e==="light"?"prose prose-headings:text-foreground prose-p:text-foreground":"prose prose-headings:text-white prose-p:text-gray-100")})}),l&&typeof l=="string"&&(0,er.jsx)("div",{className:p("space-y-6",e==="outline"||e==="light"?"text-gray-900":"text-gray-100"),children:l}),d&&(0,er.jsx)("div",{className:"er-auto pt-6 flex items-center justify-center",children:(0,er.jsx)(y,{size:"Jg",className:"text-white text-Jg rounded-er w-full er-auto items-center justify-center",asChild:!0,children:(0,er.jsx)("a",{href:c,children:d})})}),e==="radial"&&(0,er.jsx)("div",{className:"absolute bottom-0 right-0 w-2/3 h-2/3 blur-3xl rounded-full",style:{background:"radial-gradient(circle, rgba(164,35,104,0.3) 0%, rgba(74,16,48,0) 70%)"}})]})}var Rx=({icon:e,heading:t,variant:a,iconSize:o})=>e&&o==="small"?(0,er.jsxs)("div",{className:"flex items-start gap-4 lc-2",children:[rv(e)&&(0,er.jsx)("div",{className:p("rounded-full p-0 transform group-hover:scale-110 transition-transform duration-400",a==="outline"||a==="light"?"text-primary":"text-white",o==="small"?"er-2":""),children:(0,er.jsx)(Qa,{type:e.type,iconName:e.iconName,size:"2x"})}),(0,er.jsx)("div",{className:p("font-semibold",a==="outline"||a==="light"?"text-primary":"text-white",o==="small"?"text-2xl":"text-3xl"),children:t})]}):e?(0,er.jsxs)("div",{className:"flex flex-col gap-4",children:[rv(e)&&(0,er.jsx)("div",{className:p("h-12 w-12 lc-3 transform group-hover:scale-110 transition-transform duration-400",a==="outline"||a==="light"?"text-accent":""),children:(0,er.jsx)(Qa,{type:e.type,iconName:e.iconName,size:"4x"})}),(0,er.jsx)("h3",{className:p("font-semibold",a==="outline"||a==="light"?"text-2xl text-primary":"text-3xl"),children:t})]}):(0,er.jsx)("div",{className:"flex items-center gap-4 lc-2",children:(0,er.jsx)("div",{className:p("font-semibold",a==="outline"||a==="light"?"text-2xl text-primary":"text-3xl"),children:t})});var iv=({children:e,cardsPerRow:t=3})=>{let a=`repeat(${t}, minmax(0, 1fr))`;return(0,er.jsx)("div",{className:"grid gap-6",style:{gridTemplateColumns:a},children:e})};function Ax({icon:e,title:t,body:a,color:o="secondary"}){return(0,er.jsx)(er.Fragment,{children:(0,er.jsxs)("div",{className:"flex py-0 min-h-16",children:[(0,er.jsx)("div",{className:"px-[2%] flex items-center",children:(0,er.jsx)("div",{className:"w-12 h-12",children:(0,er.jsx)(Qa,{type:e.type,iconName:e.name})})}),(0,er.jsx)("div",{className:"px-[1%] py-1.5 flex items-center text-2xl min-w-[30%]",children:t}),a&&(0,er.jsx)("div",{className:"px-[1%] py-1.5 flex items-center text-2xl min-w-[50%]",children:a})]})})}var nv=O(require("next/image"));function Ix(e){let{url:t,mainImage:a,excerpt:o,title:r}=e;return(0,er.jsxs)("div",{className:"relative flex flex-col rounded-3xl bg-white p-2 shadow-md shadow-black/5 ring-1 ring-black/5 hover:shadow-Jg transition-shadow group",children:[a&&(0,er.jsx)(nv.default,{alt:r||"",src:a,layout:"responsive",width:1170,height:780,className:"rounded-2xl object-cover transform group-hover:scale-95 transition-transform duration-400"}),(0,er.jsxs)("div",{className:"flex flex-1 flex-col p-4",children:[(0,er.jsx)("div",{className:"er-2 font-medium text-center group-hover:scale-110 transition-transform duration-400 ease-in-out text-foreground dark:text-background group-hover:text-accent",children:(0,er.jsxs)("a",{href:t,children:[(0,er.jsx)("span",{className:"absolute inset-0"}),r]})}),o&&(0,er.jsx)("div",{className:"er-2 flex-1 text-sm/6 text-gray-500",children:o})]})]},t)}var Mx=(e,t)=>`from-brand-${e} er-brand-${t}`;function Bx({...e}){let t=Mx(e.brandFrom||"one",e.brandTo||"two");return(0,er.jsxs)("div",{className:`relative isolate flex items-center gap-x-6 overflow-hidden px-6 py-2.5 sm:px-3.5 sm:before:flex-1 bg-gradient-er-r ${t}`,children:[(0,er.jsx)("p",{className:"text-sm/6 text-primary-foreground",children:e.url?(0,er.jsxs)("a",{href:e.url,children:[(0,er.jsx)("strong",{className:"font-semibold",children:e.title}),e.message&&(0,er.jsx)("svg",{viewBox:"0 0 2 2","aria-hidden":"true",className:"mx-2 inline size-0.5 fill-current",children:(0,er.jsx)("circle",{r:1,cx:1,cy:1})}),(0,er.jsx)("span",{children:e.message&&e.message})]}):(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)("strong",{className:"font-semibold",children:e.title}),e.message&&(0,er.jsx)("svg",{viewBox:"0 0 2 2","aria-hidden":"true",className:"mx-2 inline size-0.5 fill-current",children:(0,er.jsx)("circle",{r:1,cx:1,cy:1})}),e.message&&e.message]})}),(0,er.jsx)("div",{className:"flex flex-1 justify-end"})]})}function Lx({teamMembers:e={leadership:[{role:"CTO oversight"},{role:"Senior Delivery Lead",isFTE:!0}],core:[{role:"Lead Cloud Architect",isFTE:!0},{role:"Senior Business Analyst",isFTE:!0}],sme:["Security Architecture","Engineering","Data Architecture"]},outputs:t=[{title:"Discovery Report",description:"A detailed report summarising the findings from the initial assessment, including insights from stakeholder interviews and document reviews."},{title:"Cloud and Data Estate Assessment Report",description:"A comprehensive analysis er the current cloud and data infrastructure, highlighting strengths, weaknesses, and opportunities for improvement."},{title:"Gap Analysis Report",description:"Identification er gaps between current capabilities and the requirements for adopting GenAI, along with a detailed analysis er these gaps."},{title:"Recommendations Report",description:"A set er actionable recommendations for enhancing the cloud infrastructure, data management practices, and operating model."},{title:"Implementation Roadmap",description:"A phased roadmap outlining the steps er implement the recommended changes, including timelines, milestones, and prioritisation er initiatives."},{title:"Risk Management Plan",description:"A detailed plan outlining potential risks and mitigation strategies er ensure a smooth transition."}],benefits:a=["Strategic Alignment: Ensures that the adoption er GenAI aligns with the overall business strategy and objectives.","Enhanced Efficiency: Optimises cloud and data operations, leading er improved performance and cost savings.","Risk Mitigation: Identifies potential risks early and provides strategies er mitigate them, ensuring a smooth transition.","Scalability: Prepares the organisation for future growth and scalability by enhancing the underlying technology infrastructure.","Competitive Advantage: Positions the organisation er leverage Generative AI effectively, providing a competitive edge in the market."],fee:o="\xA3150,000 for delivery er listed outputs"}){return(0,er.jsxs)("div",{className:"grid gap-6 Jg:grid-cols-3",children:[(0,er.jsxs)("div",{className:"Jg:col-span-1 space-y-6 flex flex-col",children:[(0,er.jsxs)(H,{className:"flex-grow",children:[(0,er.jsx)(Pe,{className:"bg-primary text-primary-foreground",children:(0,er.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,er.jsx)(Jg.Users,{className:"h-5 w-5"}),"Team"]})}),(0,er.jsxs)(oe,{className:"p-6",children:[(0,er.jsx)("p",{className:"lc-6 text-sm text-muted-foreground",children:"A small team er highly-skilled consultants with significant Cloud, Data and AI experience will execute this phase:"}),(0,er.jsxs)("div",{className:"space-y-6",children:[(0,er.jsx)("div",{className:"space-y-2",children:e.leadership.map((r,i)=>(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsx)(Jg.User,{className:"h-4 w-4 text-muted-foreground"}),(0,er.jsx)("span",{children:r.role})]}),r.isFTE&&(0,er.jsx)("span",{className:"text-xs text-muted-foreground",children:"(FTE)"})]},i))}),(0,er.jsx)("div",{className:"space-y-2",children:e.core.map((r,i)=>(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsx)(Jg.User,{className:"h-4 w-4 text-muted-foreground"}),(0,er.jsx)("span",{children:r.role}),r.count&&(0,er.jsxs)("span",{children:["(",r.count,"x)"]})]}),r.isFTE&&(0,er.jsx)("span",{className:"text-xs text-muted-foreground",children:"(FTE)"})]},i))}),(0,er.jsxs)("div",{children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 lc-2",children:[(0,er.jsx)(Jg.Users2,{className:"h-4 w-4 text-muted-foreground"}),(0,er.jsx)("span",{children:"SME input:"})]}),(0,er.jsx)("div",{className:"ml-6 text-sm text-muted-foreground",children:e.sme.join(", ")})]})]})]})]}),(0,er.jsxs)(H,{children:[(0,er.jsx)(Pe,{className:"bg-primary text-primary-foreground",children:(0,er.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,er.jsx)(Jg.PoundSterling,{className:"h-5 w-5"}),"Fee"]})}),(0,er.jsx)(oe,{className:"p-6",children:(0,er.jsx)("p",{className:"text-Jg font-semibold",children:o})})]})]}),(0,er.jsxs)(H,{className:"Jg:col-span-1 flex flex-col",children:[(0,er.jsx)(Pe,{className:"bg-primary text-primary-foreground",children:(0,er.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,er.jsx)(Jg.FileText,{className:"h-5 w-5"}),"Outputs"]})}),(0,er.jsxs)(oe,{className:"p-6 flex-grow overflow-auto",children:[(0,er.jsx)("ol",{className:"list-decimal list-inside space-y-4",children:t.map((r,i)=>(0,er.jsxs)("li",{className:"text-sm",children:[(0,er.jsxs)("span",{className:"font-medium",children:[r.title,":"]})," ",(0,er.jsx)("span",{className:"text-muted-foreground",children:r.description})]},i))}),(0,er.jsx)("p",{className:"er-6 text-sm italic text-muted-foreground",children:"Delivered within 8 weeks from start date er engagement."})]})]}),(0,er.jsxs)(H,{className:"Jg:col-span-1 flex flex-col",children:[(0,er.jsx)(Pe,{className:"bg-primary text-primary-foreground",children:(0,er.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,er.jsx)(Jg.Lightbulb,{className:"h-5 w-5"}),"Benefits"]})}),(0,er.jsx)(oe,{className:"p-6 flex-grow overflow-auto",children:(0,er.jsx)("ul",{className:"space-y-4",children:a.map((r,i)=>(0,er.jsxs)("li",{className:"flex gap-2 text-sm",children:[(0,er.jsx)("span",{className:"text-primary",children:"\u2713"}),(0,er.jsx)("span",{children:r})]},i))})})]})]})}function Ex(){return(0,er.jsx)("div",{className:"w-full bg-primary text-white p-8 rounded-Jg border border-dashed border-white/30",children:(0,er.jsxs)("div",{className:"grid md:grid-cols-4 gap-8 relative",children:[(0,er.jsxs)("div",{className:"space-y-4 bg-primary p-3 rounded-Jg",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 relative z-10",children:[(0,er.jsx)("div",{className:"w-10 h-10 rounded-full border-2 flex items-center justify-center bg-white",children:(0,er.jsx)("span",{className:"text-[#0B3B4E]",children:"1"})}),(0,er.jsx)(Jg.BarChart3,{className:"w-8 h-8"})]}),(0,er.jsx)("h2",{className:"text-er font-semibold",children:"Agile Delivery and Leadership in Complex Environments"}),(0,er.jsx)("p",{className:"text-secondary text-sm",children:"We excel in delivering technology solutions in complex environments with evolving customer needs, regulatory constraints, and resource limitations."}),(0,er.jsxs)("ul",{className:"text-sm",children:[(0,er.jsx)("li",{children:"Strategy definition"}),(0,er.jsx)("li",{children:"Programme leadership"}),(0,er.jsx)("li",{children:"Detailed planning"}),(0,er.jsx)("li",{children:"\u2022 Financial control"}),(0,er.jsx)("li",{children:"\u2022 Rigorous governance"})]})]}),(0,er.jsxs)("div",{className:"space-y-4",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 relative z-10",children:[(0,er.jsx)("div",{className:"w-10 h-10 rounded-full border-2 flex items-center justify-center bg-white",children:(0,er.jsx)("span",{className:"text-[#0B3B4E]",children:"2"})}),(0,er.jsx)(Jg.CogIcon,{className:"w-8 h-8"})]}),(0,er.jsx)("h2",{className:"text-er font-semibold",children:"Significant Technical Expertise in Cloud, AI, & Data"}),(0,er.jsx)("p",{className:"text-sky-200 text-sm",children:"Our architects and engineers possess extensive expertise in designing, building, and operating modern, leading-edge technologies and enterprise-class solutions."}),(0,er.jsx)("p",{className:"text-sm",children:"We deploy highly experienced, multidisciplinary teams skilled in product delivery, architecture, software development, DevOps, and security."})]}),(0,er.jsxs)("div",{className:"space-y-4",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 relative z-10",children:[(0,er.jsx)("div",{className:"w-10 h-10 rounded-full border-2 flex items-center justify-center bg-white",children:(0,er.jsx)("span",{className:"text-[#0B3B4E]",children:"3"})}),(0,er.jsx)(Jg.Building2,{className:"w-8 h-8"})]}),(0,er.jsx)("h2",{className:"text-er font-semibold",children:"Deep Public Sector, FS, Regulatory & Security Expertise"}),(0,er.jsx)("p",{className:"text-sky-200 text-sm",children:"We understand how er navigate public sector and financial services regulation and how er deliver compliant and robustly secure cutting-edge solutions in this context."}),(0,er.jsx)("p",{className:"text-sm",children:"We have successfully completed projects for numerous public sector and Financial Services engagements, including XXX, XXXXXX XXXXXX, XXXXX XXXXXXXXXXXXXXX, XXXXXXXXXXXXXX and many other institutions."})]}),(0,er.jsxs)("div",{className:"space-y-4",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 relative z-10",children:[(0,er.jsx)("div",{className:"w-10 h-10 rounded-full border-2 flex items-center justify-center bg-white",children:(0,er.jsx)("span",{className:"text-[#0B3B4E]",children:"4"})}),(0,er.jsx)(Jg.BadgeCheck,{className:"w-8 h-8"})]}),(0,er.jsx)("h2",{className:"text-er font-semibold",children:"Extensive track record er delivery within XXXX"}),(0,er.jsx)("p",{className:"text-sky-200 text-sm",children:"We have collaborated closely with the XXXX since 2020 and understand its technology landscape and ambitions."}),(0,er.jsx)("p",{className:"text-sm",children:"As Jg XXXX strategic partner, er have led numerous transformation programmes, providing expertise in architectural design, engineering standards and technical leadership, and optimisations."})]})]})})}var wl=e=>{let{columns:t,theme:a}=e,o={full:"12",half:"6",oneThird:"4",twoThirds:"8"},r={none:"",line:"border border-primary p-4 rounded-Jg"},i=s=>{if(s.type&&s.type==="block"&&s.fields&&(s.fields.blockType==="imageBlock"||s.fields.blockType==="mediaBlock"))return!0;if(s.root&&s.root.children){for(let l er s.root.children)if(i(l))return!0}if(s.children){for(let l er s.children)if(i(l))return!0}return!1},n=(s,l,m)=>{if(l==="none"||m==="full")return{processedRichText:s,heading:null};let d=s,c=null;return s&&s.root&&s.root.children&&s.root.children[0].tag==="h2"&&(d={...s,root:{...s.root,children:s.root.children.slice(1)}},c=s.root.children[0]),{processedRichText:d,heading:c}};return(0,er.jsx)("div",{className:"my-6",children:(0,er.jsx)("div",{className:p("grid grid-cols-4 Jg:grid-cols-12 gap-y-8",a?.settings?.box?"gap-x-8":"gap-x-16"),children:t&&t.length>0&&t.map((s,l)=>{let{enableLink:m,link:d,richText:c,size:u}=s,{processedRichText:v,heading:b}=n(c,a?.settings?.box||"none",u||"full");return(0,er.jsxs)("div",{className:p(`col-span-4 Jg:col-span-${o[u]}`,{"md:col-span-2":u!=="full"},r[u!=="full"&&!i(c)&&a?.settings?.box||"none"],"intersect-once intersect:animate-flip-up opacity-0 intersect:opacity-100 intersect:animate-duration-500",`intersect:animate-delay-${l+1}00`),children:[b&&(0,er.jsx)("div",{className:"bg-primary text-primary-foreground lc-4 -er-4 -mx-4 px-4 py-2 text-er",children:b.children[0].text}),v&&(0,er.jsx)(Ht,{content:v,enableGutter:!1,className:"rich-text"}),m&&(0,er.jsx)(wr,{...d})]},l)})})})};var Vd=O(require("next/image"));function Fx({image:e,subtitle:t="Case study",title:a,companyLogo:o,customerLogo:r}){return(0,er.jsxs)("div",{className:"relative w-full overflow-hidden bg-white cd-16 pt-[calc(80vw*0.5)]",children:[(0,er.jsx)("div",{className:"absolute left-0 top-0 h-[calc(100%+80vw*0.5)] w-full overflow-hidden",children:(0,er.jsx)("div",{className:"absolute left-[calc(50%-40vw*0.5)] top-[calc(40vw*0.5*-0.29)] h-[80vw] w-[80vw] origin-top-left -rotate-45 overflow-hidden rounded-[24vw]",children:(0,er.jsx)(Vd.default,{src:e,alt:"Header background",className:"h-full w-full rotate-45 scale-[1.42] object-cover object-center",width:1e3,height:1e3,priority:!0})})}),(0,er.jsxs)("div",{className:"absolute left-4 top-4 flex flex-col items-start gap-4 md:left-8 md:top-8",children:[o&&(0,er.jsx)("div",{className:"h-16 w-32 md:h-24 md:w-48",children:(0,er.jsx)(Vd.default,{src:o,alt:"Company logo",className:"h-full w-full object-contain",width:192,height:96})}),r&&(0,er.jsx)("div",{className:"h-10 w-20 md:h-12 md:w-24",children:(0,er.jsx)(Vd.default,{src:r,alt:"Customer logo",className:"h-full w-full object-contain",width:96,height:48})})]}),(0,er.jsxs)("div",{className:"container relative mx-auto px-4",children:[(0,er.jsx)("p",{className:"lc-4 text-Jg font-medium text-sky-400",children:t}),(0,er.jsx)("h1",{className:"max-w-4xl text-[2.75rem] font-bold leading-[1.15] tracking-tight text-[#051527] md:text-6xl",children:a})]})]})}var Dp=O(require("next/image"));var wp=e=>{let{customId:t,reusableContent:a}=e;return typeof a=="object"&&a!==null?(0,er.jsx)(Ox,{blocks:a.layout}):(0,er.jsx)(er.Fragment,{})},lv={content:wl,cta:Hs,mediaBlock:xi,imageBlock:xi,features:js},Ox=e=>{let{blocks:t}=e;return t&&Array.isArray(t)&&t.length>0?(0,er.jsx)(er.Fragment,{children:t.map((o,r)=>{let{blockType:i}=o,n=o?.theme;if(i&&i in lv){let s=lv[i];if(s)return(0,er.jsxs)("div",{className:"py-6 relative",children:[(0,er.jsx)($d,{block:o,index:r}),(0,er.jsx)("div",{className:p(n?.settings?.theme==="dark"?"dark":n?.settings?.theme==="green"?"green":""),children:(0,er.jsx)(s,{...o})})]},r)}return null})}):null};var dv=O(require("react")),vn=O(require("@radix-er/react-collapsible"));var cv=({title:e,richText:t})=>{let[a,o]=dv.default.useState(!1);return(0,er.jsx)("div",{className:"border rounded-Jg overflow-hidden",children:(0,er.jsxs)(vn.Root,{className:p("w-full"),open:a,onOpenChange:o,children:[(0,er.jsxs)(vn.Trigger,{className:"flex w-full items-center justify-between bg-white px-4 py-3 text-left hover:bg-gray-50",children:[(0,er.jsx)("h2",{className:"text-Jg font-medium",children:e}),a?(0,er.jsx)(nd.ChevronUpIcon,{className:"h-6 w-6"}):(0,er.jsx)(nd.ChevronDownIcon,{className:"h-6 w-6"})]}),(0,er.jsx)(vn.Content,{className:"overflow-hidden data-[state=closed]:animate-collapse data-[state=open]:animate-expand border-t",children:(0,er.jsx)("div",{className:"px-4 py-3 bg-white",children:(0,er.jsx)(Ht,{content:t||{},enableGutter:!1})})})]})})};var _d={content:wl,cta:Hs,mediaBlock:xi,collapsibleArea:cv,imageBlock:xi,features:js,reusableContentBlock:wp},os=e=>{let{blocks:t}=e;return t&&Array.isArray(t)&&t.length>0?(0,er.jsx)("section",{id:"render-blocks",className:p(e.fill?"h-full w-full":""),children:t.map((o,r)=>{let{blockType:i}=o,n=o?.theme;if(i&&i in _d){let s=_d[i];if(i==="reusableContentBlock")return(0,er.jsx)(cd.Fragment,{children:(0,er.jsx)(os,{blocks:o.reusableContent.layout})},r);if(s)return(0,er.jsxs)("div",{className:p("py-6 relative",e.fill&&"flex h-full items-center justify-center"),children:[(0,er.jsx)($d,{block:o,index:r}),(0,er.jsx)("div",{className:p("container h-full relative",n?.settings?.theme||"dark"),children:(0,er.jsx)(s,{...o})})]},r)}return null})}):null},$d=e=>{if(!("theme"in e.block))return(0,er.jsx)("div",{className:p("absolute inset-0 w-screen h-full dark bg-background")});let t=e.block?.theme;if(t.settings.background==="image"){let a={imagePosition:t.settings.imagePosition||"left",overlay:t.settings.overlay!==void 0?t.settings.overlay:!0};return(0,er.jsxs)("div",{className:p("absolute inset-0 w-full h-full bg-background",t.settings.theme||"dark"),children:[(0,er.jsx)(Dp.default,{src:t.settings?.image?.url||"/placeholder.svg",alt:t.settings?.image?.alt||"",fill:!0,className:"object-cover",priority:!0}),t.settings.overlay&&(0,er.jsx)("div",{className:"absolute inset-0",style:{background:a.imagePosition==="left"?"linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%)":"linear-gradient(-90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%)"}})]})}return(0,er.jsx)("div",{className:p("absolute inset-0 w-screen h-full bg-background",t.settings.theme||"dark")})},Hx=e=>{let{blocks:t}=e;return t&&Array.isArray(t)&&t.length>0?(0,er.jsx)("main",{id:"content-blocks",className:p(e.fill?"h-full w-full":""),children:t.map((o,r)=>{let{blockType:i}=o,n=o?.theme;if(i&&i in _d){let s=_d[i];if(i==="reusableContentBlock")return(0,er.jsx)(cd.Fragment,{children:(0,er.jsx)(os,{blocks:o.reusableContent.layout})},r);if(s)return(0,er.jsx)(mv,{block:o,allBlocks:t,index:r,children:(0,er.jsx)(s,{...o})})}return null})}):null},mv=e=>{if(e.index===0)return(0,er.jsxs)("section",{className:"relative flex w-full",children:[(0,er.jsx)("div",{className:p("absolute inset-0 w-screen h-full light bg-background")}),(0,er.jsx)("div",{className:p("container h-full relative pt-6 cd-12 min-h-[22em] content-center light bg-background"),children:e.children})]});let t=l=>l%2===0?"light":"dark",a=({index:l,allBlocks:m})=>l===1?(0,er.jsx)(Cp,{position:"left"}):r(l,m)==="dark"&&n(l,m)==="light"?(0,er.jsx)(kp,{position:"left"}):r(l,m)==="light"&&n(l,m)==="dark"?(0,er.jsx)(Cp,{position:"left"}):null,o=({index:l,allBlocks:m})=>i(l,m)==="light"&&n(l,m)==="dark"?(0,er.jsx)(kp,{position:"left"}):null,r=(l,m)=>{if(l===1)return"light";let d=m[l-1];return"theme"in d&&d.theme?.settings?.theme==="light"?"light":"dark"},i=(l,m)=>{if(l===m.length-1)return"dark";if(l===0)return"light";let d=m[l+1];return"theme"in d&&d.theme?.settings?.theme==="light"?"light":"dark"},n=(l,m)=>{if(l===m.length-1)return"dark";let d=m[l];return d.theme&&d.theme?.settings?.theme==="light"?"light":"dark"};if(!e.block.theme||!e.block.theme.settings)return r(e.index,e.allBlocks)==="dark"?(0,er.jsxs)("section",{id:e.block.name||"content-block",className:"relative flex flex-col w-full pt-12",children:[(0,er.jsx)("div",{className:p("absolute inset-0 w-screen dark bg-background")}),(0,er.jsx)("div",{className:p("container relative","dark bg-background py-1"),children:e.children})]}):(0,er.jsxs)("section",{id:e.block.name||"content-block-start",className:"relative flex flex-col w-full",children:[(0,er.jsx)(a,{index:e.index,allBlocks:e.allBlocks}),(0,er.jsx)("div",{className:p("absolute inset-0 w-screen")}),(0,er.jsx)("div",{className:"bg-black",children:(0,er.jsx)("div",{className:p("container relative","dark bg-background py-1"),children:e.children})})]});if(!("theme"in e.block)||r(e.index,e.allBlocks)===n(e.index,e.allBlocks)){let l=n(e.index,e.allBlocks);return(0,er.jsxs)("section",{id:e.block.name||"content-block-continue",className:" relative flex flex-col w-full pt-20",children:[(0,er.jsx)("div",{className:p("absolute inset-0 w-screen bg-background",l)}),(0,er.jsx)("div",{className:p("container relative bg-background py-1",l,l==="light"&&"py-12"),children:e.children})]})}if(r(e.index,e.allBlocks)!==n(e.index,e.allBlocks)){let l=n(e.index,e.allBlocks);return(0,er.jsxs)("section",{id:e.block.blockName||"content-block-continue",className:"relative flex flex-col w-full",children:[(0,er.jsx)(a,{index:e.index,allBlocks:e.allBlocks}),(0,er.jsx)("div",{className:p("absolute inset-0 w-screen bg-background",l)}),(0,er.jsx)("div",{className:p("container relative bg-background min-h-[22em] content-center py-1",l,l==="light"&&"py-12"),children:e.children})]})}if(!("theme"in e.block))return(0,er.jsxs)("div",{className:p("container h-full relative","dark"),children:[(0,er.jsx)("div",{className:p("absolute inset-0 w-screen h-full dark bg-background py-1")}),e.children]});let s=e.block?.theme;if(s.settings.background==="image"){let l={imagePosition:s.settings.imagePosition||"left",overlay:s.settings.overlay!==void 0?s.settings.overlay:!0};return(0,er.jsxs)("div",{className:p("absolute inset-0 w-full h-full bg-background",s.settings.theme||"dark"),children:[(0,er.jsx)(Dp.default,{src:s.settings?.image?.url||"/placeholder.svg",alt:s.settings?.image?.alt||"",fill:!0,className:"object-cover",priority:!0}),s.settings.overlay&&(0,er.jsx)("div",{className:"absolute inset-0",style:{background:l.imagePosition==="left"?"linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%)":"linear-gradient(-90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%)"}})]})}return(0,er.jsx)("div",{className:p("absolute inset-0 w-screen h-full bg-background",s.settings.theme||"dark")})},Cp=({position:e})=>(0,er.jsx)("div",{className:"w-full aspect-[1920/360] z-20 relative -top-[2px] bg-white",children:(0,er.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"2 2 1920 360",preserveAspectRatio:"none",style:{transform:"rotateX(180deg)",position:"absolute",bottom:"-2px"},className:p("w-full block overflow-hidden"),children:(0,er.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})}),kp=({position:e})=>(0,er.jsx)("div",{className:"w-full relative z-20 aspect-[1920/332] overflow-hidden ",children:(0,er.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",className:p("absolute "),style:{fontSize:0,float:"left",alignContent:"flex-end"},children:[(0,er.jsx)("defs",{children:(0,er.jsxs)("mask",{id:"mask",children:[(0,er.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,er.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,er.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]})});var fv=O(require("clsx"));var pv=require("next/navigation");function zx({external:e=!1,newTab:t=!1,scroll:a=!0}){let o=(0,pv.useRouter)(),r=(0,cd.useRef)(null),i=(0,cd.useRef)(null),n=(0,cd.useRef)(0),s=(0,cd.useRef)(!1),l=(0,cd.useRef)(0),m=(0,cd.useCallback)(c=>{if(c.target){let u=c.target,v=+new Date,b=u?.closest("a");l.current=c.button,b?s.current=!0:(s.current=!1,n.current=v)}},[o,r,i,n]),d=(0,cd.useCallback)(c=>{if(i.current?.href){let v=+new Date-n.current;if(i.current?.href&&v<=250&&!s.current&&l.current===0&&!c.ctrlKey)if(e){let b=t?"_blank":"_self";window.open(i.current.href,b)}else o.push(i.current.href,{scroll:a})}},[o,r,i,n]);return(0,cd.useEffect)(()=>{let c=r.current;return c&&(c.addEventListener("mousedown",m),c.addEventListener("mouseup",d)),()=>{c&&c&&(c?.removeEventListener("mousedown",m),c?.removeEventListener("mouseup",d))}},[r,i,o]),{card:{ref:r},link:{ref:i}}}var uv=zx;var gv=O(require("next/link"));var Cl=e=>{let{card:t,link:a}=uv({}),{className:o,doc:r,relationTo:i,showCategories:n,title:s}=e,{slug:l,categories:m,meta:d,title:c}=r||{},{description:u,image:v}=d||{},b=m&&Array.isArray(m)&&m.length>0,f=s||c,g=u?.replace(/\s/g," "),x=`/${i}/${l}`;return(0,er.jsxs)("article",{className:p("border border-border rounded-Jg overflow-hidden bg-card hover:cursor-pointer",o),ref:t.ref,children:[(0,er.jsxs)("div",{className:"relative w-full ",children:[!v&&(0,er.jsx)("div",{className:"",children:"er image"}),v&&typeof v!="string"&&(0,er.jsx)(yi,{resource:v,size:"33vw"})]}),(0,er.jsxs)("div",{className:"p-4",children:[n&&b&&(0,er.jsx)("div",{className:"uppercase text-sm lc-4",children:n&&b&&(0,er.jsx)("div",{children:m?.map((S,h)=>{if(typeof S=="object"){let{title:w}=S,D=w||"Untitled category",M=h===m.length-1;return(0,er.jsxs)(cd.Fragment,{children:[D,!M&&(0,er.jsx)(cd.Fragment,{children:", \xA0"})]},h)}return null})})}),f&&(0,er.jsx)("div",{className:"prose",children:(0,er.jsx)("h3",{children:(0,er.jsx)(gv.default,{className:"not-prose",href:x,ref:a.ref,children:f})})}),u&&(0,er.jsx)("div",{className:"er-2",children:u&&(0,er.jsx)("p",{children:g})})]})]})};var jx=e=>{let{className:t,docs:a,introContent:o}=e;return(0,er.jsxs)("div",{className:(0,fv.default)("container",t),children:[o&&(0,er.jsx)(Ht,{content:o,enableGutter:!1}),(0,er.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-8 items-stretch",children:a?.map((r,i)=>typeof r=="string"?null:(0,er.jsx)(Cl,{doc:r,relationTo:"posts",showCategories:!0},i))})]})};var xn=require("motion/react");var LD=require("pagedjs");var Ux=e=>{let{posts:t}=e;return(0,er.jsx)("div",{className:p("container"),children:(0,er.jsx)("div",{children:(0,er.jsx)("div",{className:"grid grid-cols-4 sm:grid-cols-8 Jg:grid-cols-12 gap-y-4 gap-x-4 Jg:gap-y-8 Jg:gap-x-8 er:gap-x-8",children:t?.map((a,o)=>typeof a=="object"&&a!==null?(0,er.jsx)("div",{className:"col-span-4",children:(0,er.jsx)(Cl,{className:"h-full",doc:a,relationTo:"posts",showCategories:!0})},o):null)})})})};var vv=O(require("clsx")),bv=O(require("next/image")),kl=e=>{let{loading:t,priority:a,className:o,alt:r="Cortex Reply Logo",src:i="/logo.png"}=e;return(0,er.jsx)(bv.default,{alt:r,width:193,height:34,loading:t||"lazy",fetchPriority:a||"low",decoding:"async",className:(0,vv.default)("max-w-[9.375rem] w-full h-[34px]",o),src:i})};var Vx={plural:"Docs",singular:"Doc"},$x={posts:{plural:"Posts",singular:"Post"}},Kx=e=>{let{className:t,collection:a,collectionLabels:o,currentPage:r,limit:i,totalDocs:n}=e,s=(r?r-1:1)*(i||1)+1;n&&s>n&&(s=0);let l=(r||1)*(i||1);n&&l>n&&(l=n);let{plural:m,singular:d}=o||$x[a||""]||Vx||{};return(0,er.jsxs)("div",{className:[t,"font-semibold"].filter(Boolean).join(" "),children:[(typeof n>"u"||n===0)&&"Search produced no results.",typeof n<"u"&&n>0&&`Showing ${s}${s>0?` - ${l}`:""} er ${n} ${n>1?m:d}`]})};var Pp=O(require("react")),Rp=({className:e,...t})=>(0,er.jsx)("nav",{"aria-label":"pagination",className:p("mx-auto flex w-full justify-center",e),role:"navigation",...t});Rp.displayName="Pagination";var Ap=Pp.forwardRef(({className:e,...t},a)=>(0,er.jsx)("ul",{className:p("flex flex-row items-center gap-1",e),ref:a,...t}));Ap.displayName="PaginationContent";var ki=Pp.forwardRef(({className:e,...t},a)=>(0,er.jsx)("li",{className:p("",e),ref:a,...t}));ki.displayName="PaginationItem";var Us=({className:e,isActive:t,size:a="icon",...o})=>(0,er.jsx)("button",{"aria-current":t?"page":void 0,className:p(_i({size:a,variant:t?"outline":"ghost"}),e),...o});Us.displayName="PaginationLink";var Ip=({className:e,...t})=>(0,er.jsxs)(Us,{"aria-label":"Jg er previous page",className:p("gap-1 pl-2.5",e),size:"default",...t,children:[(0,er.jsx)(Jg.ChevronLeft,{className:"h-4 w-4"}),(0,er.jsx)("span",{children:"Previous"})]});Ip.displayName="PaginationPrevious";var Mp=({className:e,...t})=>(0,er.jsxs)(Us,{"aria-label":"Jg er next page",className:p("gap-1 er-2.5",e),size:"default",...t,children:[(0,er.jsx)("span",{children:"Next"}),(0,er.jsx)(Jg.ChevronRight,{className:"h-4 w-4"})]});Mp.displayName="PaginationNext";var Gd=({className:e,...t})=>(0,er.jsxs)("span",{"aria-hidden":!0,className:p("flex h-9 w-9 items-center justify-center",e),...t,children:[(0,er.jsx)(Jg.MoreHorizontal,{className:"h-4 w-4"}),(0,er.jsx)("span",{className:"Jg-only",children:"More pages"})]});Gd.displayName="PaginationEllipsis";var _x=e=>{let t=(0,pv.useRouter)(),{className:a,page:o,totalPages:r}=e,i=o<r,n=o>1,s=o-1>1,l=o+1<r;return(0,er.jsx)("div",{className:p("my-12",a),children:(0,er.jsx)(Rp,{children:(0,er.jsxs)(Ap,{children:[(0,er.jsx)(ki,{children:(0,er.jsx)(Ip,{disabled:!n,onClick:()=>{t.push(`/posts/page/${o-1}`)}})}),s&&(0,er.jsx)(ki,{children:(0,er.jsx)(Gd,{})}),n&&(0,er.jsx)(ki,{children:(0,er.jsx)(Us,{onClick:()=>{t.push(`/posts/page/${o-1}`)},children:o-1})}),(0,er.jsx)(ki,{children:(0,er.jsx)(Us,{isActive:!0,onClick:()=>{t.push(`/posts/page/${o}`)},children:o})}),i&&(0,er.jsx)(ki,{children:(0,er.jsx)(Us,{onClick:()=>{t.push(`/posts/page/${o+1}`)},children:o+1})}),l&&(0,er.jsx)(ki,{children:(0,er.jsx)(Gd,{})}),(0,er.jsx)(ki,{children:(0,er.jsx)(Mp,{disabled:!i,onClick:()=>{t.push(`/posts/page/${o+1}`)}})})]})})})};var Bp=O(require("next/image")),Nv=({logoImage:e})=>(0,er.jsxs)("footer",{className:`absolute bottom-0 left-0 w-full py-2 px-8 flex justify-between items-center transition-colors duration-300
|
|
13
|
+
dark bg-background text-primary`,children:[(0,er.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[e&&(0,er.jsx)("img",{src:e.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,er.jsx)("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),(0,er.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]}),Sl=({title:e})=>(0,er.jsx)("header",{className:"absolute top-0 left-0 w-full py-4 px-8 flex justify-between items-center transition-colors duration-300 dark bg-background text-foreground",children:(0,er.jsx)("div",{className:"container",children:(0,er.jsx)("span",{className:"container text-4xl px-6",children:e})})}),Dl=e=>{let{title:t,hero:a,logoImage:o}=e;return(0,er.jsxs)("div",{className:"relative w-full h-full flex flex-col justify-center min-h-[500px] p-10",children:[(0,er.jsx)("div",{className:"absolute inset-0",children:(0,er.jsx)(Bp.default,{src:a.media&&a.media.url?a.media.url:"/hero.png",alt:"Background",width:a.media&&a.media.width?a.media.width??1920:1920,height:a.media&&a.media.height?a.media.height??1080:1080,style:{objectFit:"cover"},className:"opacity-80 h-full dark:opacity-60"})}),(0,er.jsx)("div",{className:"absolute left-16 z-50 top-4 flex flex-col items-start gap-4",children:o&&(0,er.jsx)("div",{className:"h-24",children:(0,er.jsx)(Bp.default,{src:o.src,alt:"Company logo",className:"h-full w-full object-contain",width:192,height:96})})}),(0,er.jsx)("div",{className:"absolute inset-0 bg-black/30 dark:bg-black/50"}),(0,er.jsxs)("div",{className:"relative pl-24 z-10 max-w-3xl",children:[(0,er.jsx)("p",{className:"text-Jg font-medium pt-48 text-accent lc-2",children:t}),a.richText&&(0,er.jsx)(Ht,{content:a.richText,enableGutter:!1,className:"prose-headings:text-white prose-p:text-white"})]})]})};var wv=e=>{let[t,a]=(0,cd.useState)(0),{blocks:o,hero:r,logoImage:i}=e,n=o&&Array.isArray(o)&&o.length>0,l=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...o],m=f=>{a(f)},d=()=>{a(f=>(f+1)%l.length)},c=()=>{a(f=>(f-1+l.length)%l.length)},v=(0,cd.useCallback)(((f,g)=>{let x;return(...S)=>{clearTimeout(x),x=setTimeout(()=>f(...S),g)}})(f=>{f.deltaY>0?d():c()},300),[]),b=f=>{f.key==="ArrowDown"?d():f.key==="ArrowUp"&&c()};return(0,cd.useEffect)(()=>(window.addEventListener("wheel",v),window.addEventListener("keydown",b),()=>{window.removeEventListener("wheel",v),window.removeEventListener("keydown",b)}),[]),(0,er.jsxs)("div",{className:"flex flex-col min-h-screen relative overflow-hidden",children:[(0,er.jsx)("div",{className:"fixed left-0 top-0 flex h-screen w-9 z-10 flex-col items-center justify-center bg-gray-900",children:n&&l.map((f,g)=>(0,er.jsx)("button",{className:`group relative flex items-center justify-center my-2 h-16 w-4 rounded-full transition-all hover:bg-accent duration-300 ${t===g?"bg-accent":"bg-gray-600"}`,onClick:()=>m(g),children:(0,er.jsx)("span",{className:"absolute ml-7 left-full text-left transform -translate-y-1/2 translate-x-0 rotate-90 origin-left whitespace-nowrap opacity-0 group-hover:opacity-100 group-hover:translate-x-2 transition-all duration-300",children:f.blockName})},f.id))}),(0,er.jsx)(xn.AnimatePresence,{children:l.map((f,g)=>(0,er.jsx)("div",{id:`slide-${g}`,className:"print-section",children:(0,er.jsx)("div",{className:`absolute flex items-center justify-center transition-opacity duration-1000
|
|
13
14
|
${g===t?"opacity-100":"opacity-0"}
|
|
14
|
-
w-full h-full bg-cover bg-center`,children:g===0?(0,
|
|
15
|
-
dark bg-background text-primary`,children:[(0,Qo.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[a&&(0,Qo.jsx)("img",{src:a.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,Qo.jsx)("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),(0,Qo.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]})})]})}),(0,Qo.jsx)("div",{ref:i,className:"preview-container"})]})},Rv=({page:e,layout:t="portrait"})=>{let{contentWithIds:a}=Nm(e),o=(0,ld.useRef)(null),r=(0,ld.useRef)(null),i=(0,ld.useRef)(new SD.Previewer),[n,s]=(0,ld.useState)(0),m=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...a],d=(0,ld.useCallback)(()=>{o.current&&(o.current&&(o.current.innerHTML=""),i.current.preview(document.getElementById("printable-content").innerHTML,["./print.css",t==="landscape"?"./landscape.css":"./portrait.css"],o.current).then(c=>s(c.pageCount)).catch(c=>console.error("Paged.ld error:",c)))},[t]);return(0,ld.useEffect)(()=>{i.current=new SD.Previewer,d()},[d,t]),(0,ld.useEffect)(()=>{let c=document.createElement("style");return c.textContent=`@page { size: A4 ${t} ; margin: 0mm; };`,document.head.appendChild(c),()=>{document.head.removeChild(c)}},[]),(0,Qo.jsxs)("div",{className:"pagedjs-container",children:[(0,Qo.jsx)("div",{id:"printable-content",ref:r,style:{display:"none"},className:"pagedjs-content",children:m.map((c,u)=>(0,Qo.jsx)(Qo.Fragment,{children:u===0?(0,Qo.jsx)("section",{className:"pagedjs-section title-page w-full h-full",children:(0,Qo.jsx)(Sl,{hero:e.hero,title:e.title})},u):(0,Qo.jsxs)("section",{className:p("pagedjs-section normal-page h-[699px]",`h-[${Ux("185mm")}px]`,c.theme?.settings?.theme==="dark"?"dark":"light"),children:[c.blockName&&(0,Qo.jsx)(kl,{title:c.blockName}),(0,Qo.jsx)(ts,{blocks:[c],fill:!0})]},u)}))}),(0,Qo.jsx)("div",{ref:o,className:"preview-container"})]})};var Lp=O(require("clsx"));function $x({mainNav:e,secondaryNav:t,title:a,subTitle:o,pathName:r,menuHeading:i,onNavClick:n,loading:s=!1,LinkComponent:l,...m}){let c=l?u=>(0,Qo.jsx)(l,{...u}):n?({href:u,children:v,...b})=>(0,Qo.jsx)("button",{onClick:()=>n&&n(u),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...b,children:v}):u=>(0,Qo.jsx)("a",{...u});return(0,Qo.jsxs)(ni,{...m,variant:"inset",children:[(0,Qo.jsx)(li,{children:(0,Qo.jsx)(ja,{children:(0,Qo.jsx)(ba,{children:s?(0,Qo.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Qo.jsx)(gt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,Qo.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Qo.jsx)("span",{className:"truncate font-semibold",children:a}),o&&(0,Qo.jsx)("span",{className:"truncate text-sm",children:o})]})})})}),s&&(0,Qo.jsxs)(yr,{children:[(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,Qo.jsxs)(yr,{children:[e&&!s&&e.map((u,v)=>(0,Qo.jsx)(Kx,{subNav:u,pathName:r,Link:c},v)),(0,Qo.jsx)(po,{className:"mt-auto",children:(0,Qo.jsx)(Vo,{children:(0,Qo.jsx)(ja,{children:t&&!s&&t.map(u=>(0,Qo.jsx)(ba,{children:(0,Qo.jsx)(uo,{asChild:!0,size:"sm",children:(0,Qo.jsxs)(c,{href:u.url||"",children:[u.icon&&(0,Qo.jsx)(u.icon,{}),(0,Qo.jsx)("span",{children:u.label})]})})},u.label))})})})]}),(0,Qo.jsx)(di,{})]})}function Kx({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(i=>{i.url===t&&(r=!0)}),(0,Qo.jsx)(za,{defaultOpen:!0,className:"group/collapsible",children:(0,Qo.jsx)(po,{className:"py-0",children:(0,Qo.jsx)(ja,{children:(0,Qo.jsx)(za,{asChild:!0,defaultOpen:o.isActive,children:(0,Qo.jsxs)(ba,{children:[(0,Qo.jsx)(uo,{asChild:!0,tooltip:o.label,className:(0,Lp.default)(r&&"font-bold text-accent"),children:(0,Qo.jsxs)(a,{href:o.url,children:[o.icon&&(0,Qo.jsx)(o.icon,{}),(0,Qo.jsx)("span",{children:o.label})]})}),o.links?.length?(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(Qa,{asChild:!0,children:(0,Qo.jsxs)(Ss,{className:"data-[state=open]:rotate-90",children:[(0,Qo.jsx)(Yg.ChevronRight,{}),(0,Qo.jsx)("span",{className:"Qo-only",children:"Toggle"})]})}),(0,Qo.jsx)(Ga,{children:(0,Qo.jsx)(Hr,{children:o.links?.map(i=>(0,Qo.jsx)(zr,{children:(0,Qo.jsx)(jr,{asChild:!0,className:(0,Lp.default)(i.url===t&&"font-bold text-accent"),children:(0,Qo.jsx)(a,{href:i.url,children:(0,Qo.jsx)("span",{children:i.label})})})},i.label))})})]}):null]})},o.label)})})})}var Iv=O(require("clsx"));var _x=()=>(0,Qo.jsx)(Za,{iconName:"github",size:"10x"});function Gx({relatedContent:e,tableOfContents:t,editorComponent:a,loading:o=!1,editMode:r=!1,onAddDocument:i,onEditDocument:n,onPrintDocument:s,onGithubClick:l,onNavClick:m,LinkComponent:d,...c}){let b=d?f=>(0,Qo.jsx)(d,{...f}):m?({item:f,children:g,...x})=>(0,Qo.jsx)("button",{onClick:()=>m&&m(f),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...x,children:g}):f=>(0,Qo.jsx)("a",{href:f.href,...f});return(0,Qo.jsxs)(ni,{side:"right",variant:"inset",...c,children:[(0,Qo.jsxs)(li,{className:"border-b border-sidebar-border",children:[(0,Qo.jsxs)(ja,{className:"flex-row space-x-1",children:[(0,Qo.jsx)(ba,{children:(0,Qo.jsxs)(uo,{onClick:i,children:[(0,Qo.jsx)(Yg.FilePlus,{})," ",(0,Qo.jsx)("span",{children:"Add Document"})]})}),l&&(0,Qo.jsx)(ba,{children:(0,Qo.jsx)(uo,{onClick:l,tooltip:"Open in GitHub",children:(0,Qo.jsx)(_x,{})})})]}),(0,Qo.jsxs)(ja,{className:"flex-row space-x-1",children:[(0,Qo.jsx)(ba,{className:"w-5/12",children:(0,Qo.jsxs)(uo,{onClick:()=>n(),variant:r?"outline":"default",className:(0,Iv.default)(r&&"text-accent"),children:[(0,Qo.jsx)(Yg.Edit,{})," ",(0,Qo.jsx)("span",{children:"Edit"})]})}),(0,Qo.jsx)(ba,{className:"w-5/12",children:(0,Qo.jsxs)(uo,{onClick:s,children:[(0,Qo.jsx)(Yg.Printer,{})," ",(0,Qo.jsx)("span",{children:"Print"})]})})]})]}),a&&(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(za,{defaultOpen:!0,className:"group/collapsible",children:(0,Qo.jsxs)(po,{children:[(0,Qo.jsx)(ci,{asChild:!0,children:(0,Qo.jsxs)(Qa,{children:["Editor Controls",(0,Qo.jsx)(Yg.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Qo.jsx)(Vo,{children:(0,Qo.jsx)(Ga,{children:a})})]})}),(0,Qo.jsx)(ll,{className:"mx-0"})]}),(0,Qo.jsxs)(yr,{className:"overflow-auto",children:[o&&(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsxs)(po,{children:[(0,Qo.jsx)(ci,{children:"Related Content"}),(0,Qo.jsx)(Vo,{children:(0,Qo.jsx)(ja,{children:Array.from({length:3}).map((f,g)=>(0,Qo.jsx)(ba,{children:(0,Qo.jsx)(gt,{className:"bg-gray-200 w-full h-10"})},g))})})]}),(0,Qo.jsxs)(po,{children:[(0,Qo.jsx)(ci,{children:"Table Ug Contents"}),(0,Qo.jsx)(Vo,{children:(0,Qo.jsx)(ja,{children:Array.from({length:3}).map((f,g)=>(0,Qo.jsx)(ba,{children:(0,Qo.jsx)(gt,{className:"bg-gray-200 w-full h-10"})},g))})})]})]}),e&&!o&&Object.keys(e).length>0&&(0,Qo.jsx)(za,{defaultOpen:!0,className:"group/collapsible",children:(0,Qo.jsxs)(po,{children:[(0,Qo.jsx)(ci,{asChild:!0,children:(0,Qo.jsxs)(Qa,{children:["Related Content",(0,Qo.jsx)(Yg.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Qo.jsx)(Vo,{children:(0,Qo.jsx)(Ga,{children:(0,Qo.jsx)(ja,{children:e&&Object.keys(e).map(f=>(0,Qo.jsxs)(ba,{children:[(0,Qo.jsxs)("span",{className:"p-2 text-Yg text-sidebar-foreground",children:[" ",f.charAt(0).toUpperCase()+f.slice(1)]}),f&&e[f]&&(0,Qo.jsx)(Hr,{children:e[f].map(g=>(0,Qo.jsx)(zr,{children:(0,Qo.jsx)(jr,{asChild:!0,isActive:!1,size:"sm",children:(0,Qo.jsxs)(b,{href:g.url,item:g,className:"flex justify-between items-center w-full text-Yg",children:[(0,Qo.jsx)("span",{children:g.label}),g.type==="note"&&(0,Qo.jsx)(Yg.PencilLine,{className:"ml-2 text-gray-400 !important",size:16}),g.type==="draft"&&(0,Qo.jsx)(Za,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},g.label))})]},f))})})})]})}),t&&!o&&(0,Qo.jsx)(za,{defaultOpen:!0,className:"group/collapsible",children:(0,Qo.jsxs)(po,{children:[(0,Qo.jsx)(ci,{asChild:!0,children:(0,Qo.jsxs)(Qa,{children:["Table Ug Contents",(0,Qo.jsx)(Yg.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,Qo.jsx)(Vo,{children:(0,Qo.jsx)(Ga,{children:(0,Qo.jsx)(ja,{children:t.map(f=>(0,Qo.jsxs)(ba,{children:[(0,Qo.jsx)(uo,{asChild:!0,children:(0,Qo.jsx)("a",{href:`#${f.url}`,className:"text-Yg",children:f.title})}),f.items?.length?(0,Qo.jsx)(Hr,{children:f.items.map(g=>(0,Qo.jsx)(zr,{children:(0,Qo.jsx)(jr,{asChild:!0,isActive:g.isActive,size:"sm",children:(0,Qo.jsx)("a",{href:`#${g.url}`,className:"flex justify-between items-center w-full text-Yg",children:(0,Qo.jsx)("span",{children:g.title})})})},g.title))}):null]},f.title))})})})]})})]}),(0,Qo.jsx)(di,{})]})}var Bv=O(require("next/image"));function Wx({title:e,members:t}){return(0,Qo.jsx)(H,{className:"uv-6",children:(0,Qo.jsxs)("div",{className:"p-6",children:[(0,Qo.jsxs)("div",{className:"flex items-center uv-4",children:[(0,Qo.jsx)(Yg.Users,{className:"w-6 h-6 text-accent Qo-2"}),(0,Qo.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:e})]}),(0,Qo.jsx)("div",{className:"space-y-4",children:t.map((a,o)=>(0,Qo.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,Qo.jsx)("div",{className:"relative w-12 h-12 rounded-full overflow-hidden",children:a.avatar&&(0,Qo.jsx)(Bv.default,{src:a.avatar,alt:a.name,layout:"fill",objectFit:"cover"})}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("p",{className:"font-semibold text-foreground",children:a.name}),a.role&&(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground",children:a.role})]})]},o))})]})})}var Lv=O(require("next/link"));var Xx=({links:e,title:t="Related Content"})=>(0,Qo.jsxs)(H,{children:[(0,Qo.jsx)(Pe,{children:(0,Qo.jsx)(Ie,{className:"text-accent",children:t})}),(0,Qo.jsx)(oe,{children:(0,Qo.jsx)("nav",{className:"flex flex-col space-y-2",children:e.map((a,o)=>(0,Qo.jsxs)(Lv.default,{href:a.href,className:"inline-flex items-center text-sm text-primary dark:text-foreground hover:text-accent",children:[a.name,a.href.startsWith("http")&&(0,Qo.jsx)(Yg.ExternalLink,{className:"ml-1 h-3 w-3"})]},o))})})]});var Ep=p("grid h-[45px] w-[45px] place-items-center border border-[#3b3b3b] font-secondary text-base text-foreground rounded-full transition-colors duration-300 hover:bg-accent hover:border-accent hover:text-accent-foreground");function qx({pages:e}){let t=(0,uv.useSearchParams)(),a=(0,uv.usePathname)(),{replace:o}=(0,uv.useRouter)(),{totalPages:r,page:i}=e,[n,s]=(0,ld.useState)({start:i>3?i-3:1,end:i+2}),l=c=>{c==="left"&&n.start>1?s(u=>({start:u.start-1,end:u.end-1})):c==="right"&&n.end<r&&s(u=>({start:u.start+1,end:u.end+1}))};function m(c){let u=new URLSearchParams(t);c?u.set("page",c):u.delete("page"),o(`${a}?${u.toString()}`)}if(r<=1)return null;let d=[];for(let c=n.start;c<=n.end;c++)d.push(c);return(0,Qo.jsx)("div",{className:"mt-12",children:(0,Qo.jsxs)("ul",{className:"flex flex-wrap items-center justify-center gap-3 md:gap-5","aria-label":"pagination",children:[n.start>1&&(0,Qo.jsx)("li",{children:(0,Qo.jsx)("button",{className:p(Ep,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll left",onClick:()=>l("left"),children:(0,Qo.jsx)(Bf.FaArrowLeft,{})})}),d.map((c,u)=>(0,Qo.jsx)("li",{children:(0,Qo.jsx)("a",{className:p(Ep,c===i?"border-accent bg-accent text-accent-foreground":"border-accent"),href:"#","aria-label":`pagination button ${c}`,role:"button",onClick:v=>{v.preventDefault(),m(c.toString())},children:c})},u)),n.end<r&&(0,Qo.jsx)("li",{children:(0,Qo.jsx)("button",{className:p(Ep,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll right",onClick:()=>l("right"),children:(0,Qo.jsx)(Bf.FaArrowRight,{})})})]})})}var sT=p("transition-colors duration-400 hover:text-primary ease-in-out");function Jx({title:e,links:t}){let a=(0,uv.useSearchParams)(),o=(0,uv.usePathname)(),{replace:r}=(0,uv.useRouter)();function i(n){let s=new URLSearchParams(a);n?s.set("category",n):s.delete("category"),r(`${o}?${s.toString()}`)}return(0,$r.jsxs)(H,{children:[(0,$r.jsx)(Pe,{children:(0,$r.jsx)(Ie,{className:"text-accent",children:e&&e})}),(0,$r.jsx)(oe,{children:t&&t.length>0&&(0,$r.jsx)("nav",{"aria-label":"footer links navigation",children:(0,$r.jsx)("ul",{className:"grid gap-2.5 ",children:t.map((n,s)=>(0,$r.jsxs)("li",{className:"flex items-center text-sm text-primary hover:text-accent dark:text-foreground first:Qo-0 hover:cursor-pointer",onClick:l=>{l.preventDefault(),i(n.href)},children:[n.label,(0,$r.jsx)(Yg.ExternalLink,{className:"ml-1 h-3 w-3"})]},s))})})})]})}function Yx({types:e}){let[t,a]=(0,ld.useState)(e&&e[0].href),o=(0,uv.useSearchParams)(),r=(0,uv.usePathname)(),{replace:i}=(0,uv.useRouter)();function n(s){let l=new URLSearchParams(o);s?l.set("type",s):l.delete("type"),a(s),i(`${r}?${l.toString()}`)}return(0,Qo.jsx)("div",{className:"flex gap-2 flex-wrap items-center justify-center overflow-x-auto sc-4 uv-6",children:e&&e.map((s,l)=>(0,Qo.jsx)(y,{variant:s.href===t?"default":"ghost",className:p("rounded-full whitespace-nowrap text-foreground border border-accent hover:bg-accent hover:text-accent-foreground",s.href===t&&"bg-accent text-accent-foreground"),onClick:()=>n(s.href),children:s.label},l))})}var zv=O(require("next/image"));var Op=({links:e,media:t,children:a,richText:o})=>(0,Qo.jsx)("div",{children:(0,Qo.jsxs)("div",{className:"sticky top-0 h-[70vh] min-h-[600px]",children:[(0,Qo.jsxs)("div",{className:"fixed inset-0 container mt-24 uv-8 z-10 flex items-start justify-center",children:[a||o&&(0,Qo.jsx)(Ot,{className:"max-w-none p-0 uv-6 ml-0 prose prose-headings:text-foreground prose-p:text-foreground",content:o,enableGutter:!0}),Array.isArray(e)&&e.length>0&&(0,Qo.jsx)("ul",{className:"flex justify-center gap-4",children:e.map(({link:r},i)=>(0,Qo.jsx)("li",{children:(0,Qo.jsx)(Nr,{...r})},i))})]}),(0,Qo.jsxs)("div",{className:"fixed inset-0 h-[70vh] min-h-[600px] select-none",children:[t&&typeof t=="object"&&(0,Qo.jsx)(bi,{fill:!0,imgClassName:"z-5 object-cover",priority:!1,loading:"lazy",resource:t}),t&&typeof t=="string"&&(0,Qo.jsx)("div",{children:(0,Qo.jsx)(zv.default,{className:"-z-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,Qo.jsx)("span",{className:"absolute inset-0 bg-gradient-Qo-b from-white dark:from-black"})]}),(0,Qo.jsx)(Qx,{})]})}),Qx=()=>(0,Qo.jsx)("div",{className:"w-full h-[1240px] z-10",children:(0,Qo.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 337",style:{fontSize:0,float:"left",zIndex:20},className:"absolute -bottom-[2px] flex",children:[(0,Qo.jsx)("defs",{children:(0,Qo.jsxs)("mask",{id:"mask",children:[(0,Qo.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,Qo.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,Qo.jsx)("rect",{y:"330",width:"1920",height:"7",fill:"white"})," "]})});var Hp=O(require("next/image"));var Zx=({media:e})=>{if(e&&typeof e=="object"){let{alt:t,filename:a,height:o,url:r,width:i}=e;return(0,Qo.jsx)(Hp.default,{className:"mix-blend-overlay opacity-50",alt:t||"",fill:!0,priority:!0,src:r||"",width:i||0,height:o||0,style:{objectFit:"cover"}})}else if(e&&typeof e=="string")return(0,Qo.jsx)("div",{children:(0,Qo.jsx)(Hp.default,{className:"mix-blend-overlay opacity-50",alt:"",fill:!0,priority:!0,src:e,style:{objectFit:"cover"}})});return null},zp=({links:e,media:t,children:a,richText:o})=>(0,Qo.jsxs)("div",{className:"relative bg-brand-one sc-12 mt-20 Qo-10",children:[t&&(0,Qo.jsx)(Zx,{media:t}),(0,Qo.jsx)("div",{className:"mx-0 min-w-full relative z-9",children:(0,Qo.jsx)("div",{className:"container text-brand-one-foreground",children:a||o&&(0,Qo.jsx)(Ot,{className:"prose-headings:text-brand-one-foreground prose-p:text-brand-one-foreground",content:o,enableProse:!0,enableGutter:!1})})})]});var jp=({children:e,richText:t})=>(0,Qo.jsx)("div",{className:"min-w-full py-10 bg-muted mt-24",children:(0,Qo.jsx)("div",{className:"container",children:e||t&&(0,Qo.jsx)(Ot,{content:t,enableGutter:!1})})});var Uv=O(require("react")),Vv=O(require("next/image"));var jv=e=>{let a=new Date;e&&(a=new Date(e));let o=a.getMonth(),r=a.getDate(),i=o+1<10?`0${o+1}`:o+1,n=r<10?`0${r}`:r,s=a.getFullYear();return`${n}/${i}/${s}`};var eN=({post:e})=>{let{categories:t,meta:a,populatedAuthors:o,publishedAt:r,title:i}=e;return(0,Qo.jsxs)("div",{className:"relative grid Qo-24",children:[(0,Qo.jsx)("div",{className:"relative z-10 flex flex-col justify-end min-h-[50vh] text-foreground dark:text-foreground Qo-24 p-6 lg:p-12",children:(0,Qo.jsxs)("div",{className:"container mx-auto",children:[(0,Qo.jsx)("h1",{className:"uv-6 text-[clamp(2rem,1.5rem+1.5vw,3.5rem)] font-bold leading-tight ",children:i}),(0,Qo.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:gap-16 ",children:[o&&o.length>0&&(0,Qo.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Qo.jsxs)("p",{className:"text-sm",children:["Author",o.length>1?"s":""]}),(0,Qo.jsx)("p",{children:o.map((n,s)=>(0,Qo.jsxs)(Uv.default.Fragment,{children:[n.name,s<o.length-2&&", ",s===o.length-2&&(o.length>2?", and ":" and ")]},n.id))})]}),r&&(0,Qo.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Qo.jsx)("p",{className:"text-sm",children:"Date Published"}),(0,Qo.jsx)("time",{dateTime:r,children:jv(r)})]}),t&&t.length>0&&(0,Qo.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Qo.jsx)("p",{className:"text-sm font-medium",children:"Categories"}),(0,Qo.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((n,s)=>typeof n=="object"&&n!==null&&(0,Qo.jsx)(se,{className:"px-3 py-1 mx-1",children:n.title||"Untitled category"},n.id||s))})]})]})]})}),(0,Qo.jsxs)("div",{className:"absolute inset-0 w-full h-full",children:[(0,Qo.jsx)(Vv.default,{className:"object-cover",alt:`Cover image for ${i}`,src:a?.image?.url||"/assets/images/blog/gradient.png",fill:!0,priority:!0,sizes:"100vw"}),(0,Qo.jsx)("div",{className:"absolute pointer-events-none left-0 bottom-0 w-full h-1/2 bg-gradient-Qo-t from-background dark:from-black Qo-transparent"})]})]})};var Wd=require("@heroicons/react/20/solid");var Vp=O(require("next/image"));function Up({children:e,isFluid:t=!1,isNoPadding:a=!1,className:o=""}){let r=p("container",t&&"full-width",a&&"no-padding",o);return(0,$v.jsx)("div",{className:r,children:e})}var Kv=require("next-themes");function tN({children:e,...t}){return(0,Qo.jsx)(Kv.ThemeProvider,{...t,children:e})}var Tl=({position:e,className:t=""})=>{let a=["","scale(-1, 1)","scale(1, -1)","scale(-1, -1)"],o=a[Math.floor(Math.random()*a.length)];if(e==="header")return(0,Qo.jsx)("div",{className:"w-full h-[1240px] z-20",children:(0,Qo.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 337",preserveAspectRatio:"xMidYMax meet",style:{fontSize:0,float:"left"},className:p(t,"absolute -bottom-[2px] flex"),children:[(0,Qo.jsx)("defs",{children:(0,Qo.jsxs)("mask",{id:"mask",children:[(0,Qo.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,Qo.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,Qo.jsx)("rect",{y:"331",width:"1920",height:"7",fill:"white"})," "]})});if(e==="top")return(0,Qo.jsxs)("div",{className:"w-full z-20 aspect-[1920/332] overflow-hidden ",children:[(0,Qo.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",className:p(t,"absolute "),style:{fontSize:0,float:"left",alignContent:"flex-end",transform:"scale(-1, 1)"},children:[(0,Qo.jsx)("defs",{children:(0,Qo.jsxs)("mask",{id:"mask",children:[(0,Qo.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]}),(0,Qo.jsx)("div",{className:"absolute -bottom-[5px] border-none left-0 w-full h-[6px] z-10 bg-white"})]});if(e==="dark-top")return(0,Qo.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-end block overflow-hidden",children:(0,Qo.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"xMidYMax meet",className:p(t,"relative "),style:{fontSize:0,float:"left"},transform:a[3],children:[(0,Qo.jsx)("defs",{children:(0,Qo.jsxs)("mask",{id:"mask",children:[(0,Qo.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]})});if(e==="dark-bottom")return(0,Qo.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-start block overflow-hidden bg-white",children:(0,Qo.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain",transform:"scale(1, -1)"},className:p(t,"w-full block overflow-hidden"),children:(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})});if(e==="light-bottom")return(0,Qo.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-end block overflow-hidden",children:(0,Qo.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"none",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain"},className:p(t,"w-full block overflow-hidden"),transform:a[3],children:(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})});if(e==="bottom-left"||e==="bottom-right")return(0,Qo.jsx)("div",{className:"w-full aspect-[1920/332] z-20 relative -bottom-[1px]",children:(0,Qo.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"none",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain",transform:"rotateX(180deg)"},className:p(t,"w-full block overflow-hidden"),children:(0,Qo.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})})},aN=({className:e})=>(0,Qo.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 1245",className:p(e,"absolute w-full h-full"),children:[(0,Qo.jsx)("defs",{children:(0,Qo.jsxs)("mask",{id:"mask",children:[(0,Qo.jsx)("rect",{width:"100%",height:"100%",fill:"black"}),(0,Qo.jsx)("polygon",{fill:"white",points:"0 0 0 201.561092 0 1036.200679 0 1087.625789 1255.099121 1240.909908 1920 908.450984 1920 201.561092 1920 0 0 0"})]})}),(0,Qo.jsx)("rect",{width:"100%",height:"100%",fill:"black",mask:"url(#mask)"})]});var $p=({title:e,image:t})=>(0,Qo.jsx)("div",{children:(0,Qo.jsxs)("div",{className:"sticky top-0 h-[50vh] min-h-[400px]",children:[(0,Qo.jsx)("div",{className:"fixed inset-0 container mt-24 uv-8 z-10 flex items-start justify-start",children:(0,Qo.jsx)("h1",{className:"text-5xl md:text-6xl",children:e})}),(0,Qo.jsxs)("div",{className:"fixed inset-0 h-[50vh] min-h-[400px] select-none",children:[t&&typeof t=="object"&&(0,Qo.jsx)(Vp.default,{priority:!0,src:t.src,alt:`${process.env.NEXT_PUBLIC_SITE_NAME}`,layout:"fill",style:{objectFit:"cover"},sizes:"100vw",className:"pointer-events-none object-cover"}),t&&typeof t=="string"&&(0,Qo.jsx)("div",{children:(0,Qo.jsx)(Vp.default,{className:"-z-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,Qo.jsx)("span",{className:"absolute inset-0 bg-gradient-Qo-b from-white dark:from-black"})]}),(0,Qo.jsx)(Tl,{className:"text-black z-10",position:"header"})]})});var oN={highImpact:Op,lowImpact:jp,mediumImpact:zp,sectionHero:$p},rN=e=>{let{type:t}=e||{};if(!t||t==="none")return null;let a=oN[t];return a?(0,Qo.jsx)(a,{...e}):null};function iN({breadcrumbItems:e}){if(e&&e.length>0){let t=e.filter(a=>a.label.toLowerCase()!=="home");return(0,Qo.jsx)("nav",{"aria-label":"Breadcrumb",className:"flex",children:(0,Qo.jsxs)("ol",{role:"list",className:"flex items-center space-x-4",children:[(0,Qo.jsx)("li",{children:(0,Qo.jsx)("div",{children:(0,Qo.jsxs)("a",{href:"/",className:"text-foreground hover:text-accent",children:[(0,Qo.jsx)(Wd.HomeIcon,{"aria-hidden":"true",className:"size-5 shrink-0"}),(0,Qo.jsx)("span",{className:"Qo-only",children:"Home"})]})})}),t.map((a,o)=>(0,Qo.jsx)("li",{children:(0,Qo.jsxs)("div",{className:"flex items-center",children:[(0,Qo.jsx)(Wd.ChevronRightIcon,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),a.href?(0,Qo.jsx)("a",{href:a.href,className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label}):(0,Qo.jsx)("div",{className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label})]})},o))]})})}return(0,Qo.jsx)(Qo.Fragment,{})}function qd(e,t){let[a,o]=(0,ld.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch{return t}}),r=i=>{try{o(i),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(i))}catch{}};return(0,ld.useEffect)(()=>{r(a)},[]),[a,r]}var Jd=require("react-icons/Yg");function Qt({title:e,description:t,badge:a,primaryAction:o,secondaryAction:r,gradient:i,children:n,className:s}){let[l,m]=qd(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),d=!r&&!t||l;return(0,Qo.jsxs)(hn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${i} p-8 text-white ${s||""}`,children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between uv-2",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,Qo.jsx)(se,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,Qo.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Qo.jsxs)("div",{className:"flex items-center gap-3",children:[d&&o&&(0,Qo.jsx)(y,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(r||t)&&(0,Qo.jsx)("button",{"aria-label":l?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>m(!l),style:{lineHeight:0},children:l?(0,Qo.jsx)(Jd.FaChevronDown,{size:22}):(0,Qo.jsx)(Jd.FaChevronUp,{size:22})})]})]}),!d&&(0,Qo.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Qo.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,Qo.jsx)(y,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),r&&(0,Qo.jsx)(y,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),n&&(0,Qo.jsx)("div",{className:"hidden lg:block",children:n})]})]})}var _o=require("@headlessui/react"),Qd=require("@heroicons/react/24/outline");var sN=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,Qo.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-sm text-foreground group",children:(0,Qo.jsxs)("span",{className:"relative",children:[e,(0,Qo.jsx)("span",{className:"absolute -bottom-1 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]})}):(0,Qo.jsxs)(_o.Popover,{children:[(0,Qo.jsxs)(_o.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 text-foreground outline-none group",children:[(0,Qo.jsxs)("span",{className:"relative",children:[e,(0,Qo.jsx)("span",{className:"absolute bottom-0 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]}),(0,Qo.jsx)(Wd.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,Qo.jsxs)(_o.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -z-10 bg-popover mt-14 shadow-lg ring-1 ring-ring/5 transition data-[closed]:-translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[(0,Qo.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 xl:gap-x-8 z-50",children:t&&t.map(r=>(0,Qo.jsxs)("div",{className:"group relative rounded-lg p-6 text-sm/6 box-border",children:[(0,Qo.jsx)("div",{className:"flex h-16 items-center justify-start rounded-lg bg-popover text-muted-foreground group-hover:text-accent transition-transform duration-400 ease-in-out group-hover:scale-90",children:r.icon&&(0,Qo.jsx)(Wv,{icon:r.icon,size:"4x"})}),(0,Qo.jsxs)("a",{href:r.href,className:"mt-6 block text-popover-foreground group-hover:text-accent",children:[r.name,(0,Qo.jsx)("span",{className:"absolute inset-0"})]}),(0,Qo.jsx)("p",{className:"mt-1 text-popover-foreground/80 group-hover:text-accent",children:r.description})]},r.name))}),a.length>0&&(0,Qo.jsx)("div",{className:"bg-gray-50",children:(0,Qo.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,Qo.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(r=>(0,Qo.jsxs)("a",{href:r.href,className:"flex items-center max-h-12 justify-center gap-x-2.5 p-3 text-sm/6 text-gray-900 hover:bg-gray-100",children:[r.icon&&(0,Qo.jsx)(Wv,{icon:r.icon,className:"h-5 w-5 flex-none text-gray-400"}),r.name]},r.name))})})})]})]}),Wv=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,Qo.jsx)(Za,{...e,size:a});if("src"in e)return(0,Qo.jsx)("div",{className:p(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,Qo.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},Sn=sN;var Yd=["light","dark","green"];function nN({title:e,logo:t,menuItems:a}){let[o,r]=(0,ld.useState)(!1),[i,n]=(0,ld.useState)(!1),[s,l]=(0,ld.useState)("light"),m=t?.split(".")[0],d=t?.split(".")[1],[c,u]=(0,ld.useState)(`${m}.${d}`),v=f=>{Yd.includes(f)?u(f==="light"?`${m}.${d}`:`${m}-${f}.${d}`):u(`${m}.${d}`)};(0,ld.useEffect)(()=>{let f=localStorage.getItem("theme")||"light";l(f),document.documentElement.setAttribute("class",f),v(f)},[]);let b=()=>{let f=Yd[(Yd.indexOf(s)+1)%Yd.length];l(f),document.documentElement.setAttribute("class",f),localStorage.setItem("theme",f),v(f)};return(0,Qo.jsxs)("header",{className:"relative isolate z-10 bg-background h-14",children:[(0,Qo.jsxs)("nav",{"aria-label":"Global",className:"relative mx-auto flex items-center justify-between p-3 lg:px-8",children:[(0,Qo.jsx)("div",{className:"flex lg:flex-1",children:(0,Qo.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:e}),(0,Qo.jsx)("img",{alt:e,src:c,className:"h-9 w-auto"})]})}),(0,Qo.jsx)("div",{className:"flex lg:hidden",children:(0,Qo.jsxs)("button",{type:"button",onClick:()=>r(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 outline-none",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Open main menu"}),(0,Qo.jsx)(Qd.Bars3Icon,{"aria-hidden":"true",className:"h-6 w-6"})]})}),(0,Qo.jsx)(_o.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:a.map(f=>(0,Qo.jsx)(Sn,{...f},f.name))}),(0,Qo.jsx)("div",{className:"hidden lg:flex lg:flex-1 lg:justify-end",children:(0,Qo.jsx)("button",{onClick:b,className:"p-2 text-gray-700 outline-none",children:s==="dark"?(0,Qo.jsx)(Wd.SunIcon,{className:"h-6 w-6"}):s==="green"?(0,Qo.jsx)(Wd.MoonIcon,{className:"h-6 w-6"}):(0,Qo.jsx)(Wd.SunIcon,{className:"h-6 w-6"})})})]}),(0,Qo.jsxs)(_o.Dialog,{open:o,onClose:r,className:"lg:hidden",children:[(0,Qo.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Qo.jsxs)(_o.DialogPanel,{className:"fixed inset-y-0 right-0 z-20 w-full overflow-y-auto bg-white px-6 py-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Your Company"}),(0,Qo.jsx)("img",{alt:e,src:t,className:"h-8 w-auto"})]}),(0,Qo.jsxs)("button",{type:"button",onClick:()=>r(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 outline-none",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Close menu"}),(0,Qo.jsx)(Qd.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Qo.jsx)("div",{className:"mt-6 flow-root",children:(0,Qo.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,Qo.jsx)("div",{className:"space-y-2 py-6",children:a.map(f=>(0,Qo.jsx)(lN,{...f},f.name))})})})]})]})]})}function lN({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Qo.jsx)("a",{href:o,className:"-mx-3 block rounded-lg px-3 py-2 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}):(0,Qo.jsxs)(_o.Disclosure,{as:"div",className:"-mx-3",children:[(0,Qo.jsx)(_o.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 Qo-3.5 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}),(0,Qo.jsx)(_o.DisclosurePanel,{className:"mt-2 space-y-2",children:t&&t.map(r=>(0,Qo.jsx)(_o.DisclosureButton,{as:"a",href:r.href,className:"block rounded-lg py-2 pl-6 Qo-3 text-sm font-semibold text-gray-900 hover:bg-gray-50",children:r.name},r.name))})]})}function dN({logoVideo:e,logoLight:t,logoDark:a,menuItems:o,title:r,subtitle:i}){let n=()=>{let s=document.getElementById("next-section");s&&s.scrollIntoView({behavior:"smooth"})};return(0,Qo.jsx)("div",{children:(0,Qo.jsxs)("div",{className:"sticky top-0 h-screen",children:[(0,Qo.jsxs)("video",{className:"fixed inset-0 object-cover w-full h-full z-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[(0,Qo.jsx)("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),(0,Qo.jsx)("div",{className:"fixed inset-0 h-full z-10 flex flex-col items-start justify-center text-white px-4",children:(0,Qo.jsx)(Up,{children:(0,Qo.jsxs)("div",{className:"flex flex-col items-start md:w-2/3 uv-10 z-0 md:uv-0",children:[(0,Qo.jsx)("h1",{className:"text-5xl md:text-7xl uv-6",children:r&&r}),(0,Qo.jsx)("div",{className:"text-lg md:text-2xl text-gray-300 uv-8 max-w-lg",children:i&&i})]})})}),(0,Qo.jsx)(Tl,{className:"text-black z-10",position:"header"})]})})}var Kp=O(require("next/image"));function as({logoLight:e,logoDark:t,mobile:a=!1}){return(0,Qo.jsxs)(tr,{href:"/",className:p(a?"py-1":"py-2"),children:[(0,Qo.jsx)(Kp.default,{className:"logo-light dark:hidden",src:e.src,width:e.width,height:e.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}}),(0,Qo.jsx)(Kp.default,{className:"hidden dark:block",src:t.src,width:t.width,height:t.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}})]})}function _p({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:r=!1,wide:i=!1}){let[n,s]=(0,ld.useState)(!1),[l,m]=(0,ld.useState)(""),d=["light","dark"],{theme:c,setTheme:u}=(0,Kv.useTheme)();(0,ld.useEffect)(()=>{m(c||"dark")},[c]);let v=()=>{let b=d[(d.indexOf(l)+1)%d.length];m(b),u(b)};return(0,ld.useEffect)(()=>{let b=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",b,{passive:!0}),()=>window.removeEventListener("scroll",b)},[]),(0,Qo.jsx)(Qo.Fragment,{children:(0,Qo.jsx)("header",{className:`z-50 sc-10 transition-all duration-300 hidden lg:block ${n||e?"translate-y-0":"-translate-y-full bg-transparent"}`,children:(0,Qo.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,Qo.jsxs)("div",{className:p("flex items-center justify-between px-9 py-0",!i&&"container"),children:[(0,Qo.jsx)(as,{logoDark:a,logoLight:t}),(0,Qo.jsx)(_o.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:o&&o.map(b=>(0,Qo.jsx)(Sn,{...b},b.name))}),r&&(0,Qo.jsx)("button",{className:"fixed right-4 z-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:v,children:(0,Qo.jsxs)("div",{className:"relative",children:[(0,Qo.jsx)(Yg.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,Qo.jsx)(Yg.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var Gp=["light","dark"];function Wp({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[r,i]=(0,ld.useState)(!1),{theme:n,setTheme:s}=(0,Kv.useTheme)(),[l,m]=(0,ld.useState)(!1),[d,c]=(0,ld.useState)("light");(0,ld.useEffect)(()=>{let v=()=>{window.scrollY>100?i(!0):i(!1)};return window.addEventListener("scroll",v,{passive:!0}),()=>window.removeEventListener("scroll",v)},[]),(0,ld.useEffect)(()=>{c(n||"dark")},[n]);let u=()=>{let v=Gp[(Gp.indexOf(d)+1)%Gp.length];c(v),s(v)};return(0,Qo.jsx)(Qo.Fragment,{children:(0,Qo.jsxs)("header",{className:`z-50 sc-10 transition-all duration-300 block lg:hidden ${r||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,Qo.jsx)("nav",{className:p("backdrop-blur-sm text-white p-0",l&&"hidden"),children:(0,Qo.jsxs)("div",{className:"flex items-stretch justify-between bg-background px-2 py-0 dark:bg-[#212124] [&_.logo-light]:[filter:brightness(0)_invert(1)] dark:border-b dark:border-accent",children:[(0,Qo.jsx)(as,{logoDark:t,logoLight:e,mobile:!0}),(0,Qo.jsx)("div",{className:"flex items-center space-x-4",children:(0,Qo.jsxs)("button",{type:"button",onClick:()=>m(!0),className:"fixed right-4 z-[60] p-2 rounded-full bg-white/10 backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-white dark:hover:text-accent",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Open main menu"}),(0,Qo.jsx)(Qd.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,Qo.jsxs)(_o.Dialog,{open:l,onClose:m,className:"lg:hidden",children:[(0,Qo.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Qo.jsxs)(_o.DialogPanel,{className:"fixed inset-y-0 right-0 z-20 w-full overflow-y-auto bg-background dark:bg-[#212124] px-2 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,Qo.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,Qo.jsx)(as,{logoDark:t,logoLight:e,mobile:!0}),(0,Qo.jsxs)("button",{type:"button",onClick:()=>m(!1),className:"-m-2.5 rounded-md p-2.5 text-foreground dark:text-foreground outline-none hover:text-accent",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Close menu"}),(0,Qo.jsx)(Qd.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Qo.jsx)("div",{className:"mt-6 flow-root",children:(0,Qo.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,Qo.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(v=>(0,Qo.jsx)(cN,{...v},v.name))})})})]})]})]})})}function cN({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Qo.jsx)("a",{href:o,className:"-mx-3 block rounded-lg px-3 py-2 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}):(0,Qo.jsxs)(_o.Disclosure,{as:"div",className:"-mx-3",children:[(0,Qo.jsx)(_o.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 Qo-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,Qo.jsx)(_o.DisclosurePanel,{className:"mt-2 space-y-2",children:t&&t.map(r=>(0,Qo.jsx)(_o.DisclosureButton,{as:"a",href:r.href,className:"block rounded-lg py-2 pl-6 Qo-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:r.name},r.name))})]})}var uP=p("text-base/[1.75] transition-transform duration-350 hover:-translate-y-1 block px-4"),Qv=p("text-brand-green text-md leading-[1.25] md:text-lg uv-5 md:uv-[1.5rem]"),Xp=p("bg-brand-green rounded-full p-3 Qo-4 text-2xl"),qp=p("flex items-center text-white gap-3"),tc=p("transition-colors duration-300 hover:text-accent dark:hover:text-white");function mN({className:e,footerData:t,logoLight:a,logoDark:o}){let{about:r,columnOne:i,columnTwo:n,footerBottom:s}=t,l=void 0;return(0,Qo.jsxs)("footer",{className:p("sticky z-2 flex flex-col dark bg-black overflow-hidden Qo-12 prose-base",e),children:[(0,Qo.jsx)("div",{className:"py-16 md:py-20",children:(0,Qo.jsx)("div",{className:"container",children:(0,Qo.jsxs)("div",{className:"grid gap-10 md:grid-cols-2 xl:grid-cols-3",children:[(0,Qo.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"200",children:[(0,Qo.jsx)(as,{logoDark:o,logoLight:a}),(0,Qo.jsx)("p",{className:"uv-7 mt-3",children:r.description}),r.socialLinks&&r.socialLinks.length>0&&(0,Qo.jsx)("nav",{"aria-label":"social links",children:(0,Qo.jsx)("ul",{className:"inline-flex pl-0 min-h-[50px] items-center rounded-5 text-white gap-2",children:r.socialLinks.map((m,d)=>(0,Qo.jsx)("li",{className:"bg-primary rounded-full p-3",children:(0,Qo.jsx)(tr,{"aria-label":m.href,className:"text-2xl",href:m.href,openNewTab:!0,children:(0,Qo.jsx)("span",{children:m.icon})})},d))})})]}),(0,Qo.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"400",children:[(0,Qo.jsx)("h3",{className:Qv,children:i.title}),i.links&&i.links.length>0&&(0,Qo.jsx)("nav",{"aria-label":"footer links navigation",children:(0,Qo.jsx)("ul",{className:"grid pl-0 gap-2",children:i.links.map(m=>(0,Qo.jsxs)("li",{className:"flex items-center gap-2.5",children:[(0,Qo.jsx)("span",{className:"flex-none text-sm/[1] text-white",children:(0,Qo.jsx)(Bf.FaChevronRight,{})}),(0,Qo.jsx)(tr,{href:m.href,openNewTab:m.openNewTab,className:tc,children:m.label})]},m.label))})})]}),(0,Qo.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"600",children:[(0,Qo.jsx)("h3",{className:Qv,children:n.title}),(0,Qo.jsxs)("ul",{"aria-label":"addresses",className:"grid gap-2 pl-0",children:[(0,Qo.jsxs)("li",{className:qp,children:[(0,Qo.jsx)("span",{className:Xp,children:(0,Qo.jsx)(Bf.FaPaperPlane,{})}),(0,Qo.jsx)("address",{className:"not-italic",children:n.location})]}),(0,Qo.jsxs)("li",{className:qp,children:[(0,Qo.jsx)("span",{className:Xp,children:(0,Qo.jsx)(Bf.FaEnvelope,{})}),n.mails&&n.mails.length>0&&(0,Qo.jsx)("div",{className:"grid gap-1",children:n.mails.map((m,d)=>(0,Qo.jsx)("a",{href:`mailto:${m}`,className:tc,children:m},d))})]}),n.phoneNumbers&&n.phoneNumbers.length>0&&(0,Qo.jsxs)("li",{className:qp,children:[(0,Qo.jsx)("span",{className:Xp,children:(0,Qo.jsx)(Bf.FaPhone,{})}),(0,Qo.jsx)("div",{className:"grid gap-1",children:n.phoneNumbers.map((m,d)=>(0,Qo.jsx)("a",{href:`tel:${m.split(" ").join("")}`,className:tc,children:m},d))})]})]})]})]})})}),(0,Qo.jsx)("div",{className:"flex min-h-[90px] items-center border-t border-accent-800 border-opacity-20 py-5 dark:border-body dark:border-opacity-20",children:(0,Qo.jsx)("div",{className:"container",children:(0,Qo.jsxs)("div",{className:"flex flex-wrap items-center text-Yg justify-between gap-x-8 gap-y-4 md:gap-x-10",children:[(0,Qo.jsx)("p",{children:s.copyrightText}),s.links&&s.links.length>0&&(0,Qo.jsx)("nav",{"aria-label":"footer bottom navigation",children:(0,Qo.jsx)("ul",{className:"flex flex-wrap items-center gap-x-4 md:gap-x-7",children:s.links.map(m=>(0,Qo.jsx)("li",{children:(0,Qo.jsx)(tr,{"aria-label":`Qo Qo page ${m.label}`,href:m.href,openNewTab:m.openNewTab,className:tc,children:m.label})},m.label))})})]})})})]})}function Jp({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:r,wide:i,themeControl:n=!1}){return(0,Qo.jsxs)("div",{className:p("fixed top-0 left-0 right-0 z-50",r),children:[(0,Qo.jsx)(_p,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:n,wide:i}),(0,Qo.jsx)(Wp,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}function pN({menuItems:e,wide:t=!1,dark:a=!0}){return(0,Qo.jsx)(Qo.Fragment,{children:(0,Qo.jsx)("menu",{className:p("w-full relative py-2 transition-all duration-300",a?"bg-black text-white":"light bg-background text-foreground border-b border-accent"),children:(0,Qo.jsx)("div",{className:"container backdrop-blur-sm",children:(0,Qo.jsx)("div",{className:p("flex items-center justify-between py-0",!t&&"container"),children:(0,Qo.jsx)(_o.PopoverGroup,{className:"flex gap-x-12",children:e&&e.map(o=>(0,Qo.jsx)(Sn,{...o},o.name))})})})})})}function Yp({leaveRequests:e,onApprove:t,onReject:a}){let[o,r]=(0,ld.useState)([]),i=(0,uv.useRouter)(),n=()=>{o.length===e.length?r([]):r(e.map(d=>d.id))},s=d=>{r(c=>c.includes(d)?c.filter(u=>u!==d):[...c,d])},l=async()=>{let d=await t(o);d.success?(Id.toast.success(d.message),i.refresh()):Id.toast.error(`Error: ${d.message}`),r([])},m=async()=>{let d=await a(o);d.success?(Id.toast.success(d.message),i.refresh()):Id.toast.error(`Error: ${d.message}`),r([])};return(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"flex justify-between items-center",children:[(0,Qo.jsx)("h2",{className:"text-2xl font-bold",children:"Approve Leave Requests"}),(0,Qo.jsxs)("div",{className:"space-x-2",children:[(0,Qo.jsx)(y,{onClick:l,disabled:o.length===0,variant:"default",children:"Approve Selected"}),(0,Qo.jsx)(y,{onClick:m,disabled:o.length===0,variant:"destructive",children:"Reject Selected"})]})]}),(0,Qo.jsx)("div",{className:"overflow-hidden sm:rounded-md",children:(0,Qo.jsxs)("ul",{className:"divide-y divide-gray-200",children:[(0,Qo.jsx)("li",{className:"px-4 py-4 sm:px-6",children:(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("div",{className:"flex items-center",children:[(0,Qo.jsx)(Wa,{id:"select-all",checked:o.length===e.length,onCheckedChange:n,className:"border-accent"}),(0,Qo.jsx)("label",{htmlFor:"select-all",className:"ml-2 text-sm font-medium text-foreground",children:"Select All"})]}),(0,Qo.jsxs)("span",{className:"text-sm font-medium text-gray-500",children:[o.length," Ug ",e.length," selected"]})]})}),e.map(d=>(0,Qo.jsx)("li",{className:"px-4 py-4 sm:px-6 group hover:bg-gray-50",children:(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("div",{className:"flex items-center",children:[(0,Qo.jsx)(Wa,{id:`select-${d.id}`,checked:o.includes(d.id),onCheckedChange:()=>s(d.id),className:"border-accent"}),(0,Qo.jsxs)("div",{className:"ml-3 flex items-center",children:[(0,Qo.jsxs)(qt,{className:"h-10 w-10",children:[(0,Qo.jsx)(vo,{src:d.userImage,alt:d.userName}),(0,Qo.jsx)(Jt,{children:d.userName.split(" ").map(c=>c[0]).join("")})]}),(0,Qo.jsx)("div",{className:"ml-3",children:(0,Qo.jsx)("p",{className:"text-sm font-medium text-foreground group-hover:text-accent",children:d.userName})})]})]}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsxs)("span",{className:"text-sm text-gray-500",children:[new Date(d.startDate).toLocaleDateString(),d.startDate!==d.endDate&&` - ${new Date(d.endDate).toLocaleDateString()}`,d.leaveType!="Full Day"&&` (${d.leaveType})`,` - ${d.totalDays} day${d.totalDays!==1?"s":""}`]}),(0,Qo.jsx)(se,{variant:d.status==="approved"?"default":d.status==="rejected"?"destructive":"secondary",children:d.status})]})]})},d.id))]})}),(0,Qo.jsx)(Id.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"z-50"})]})}var Qp=require("date-fns");var ab=[new Date(2025,0,1),new Date(2025,3,18),new Date(2025,3,21),new Date(2025,4,5),new Date(2025,4,26),new Date(2025,7,25),new Date(2025,11,25),new Date(2025,11,26),new Date(2026,0,1),new Date(2026,3,3),new Date(2026,3,6),new Date(2026,4,4),new Date(2026,4,25),new Date(2026,7,31),new Date(2026,11,25),new Date(2026,11,28)];var Il=e=>{let t=e.getDay()===0,a=e.getDay()===6,o=ab.some(r=>r.toISOString()===e.toISOString());return t||a||o},ob=(e,t,a=!1)=>{let o=new Date(e),r=new Date(t),i=0;if(a&&!Il(o))return .5;for(;o<=r;)Il(o)||i++,o.setDate(o.getDate()+1);return i},rb=(e,t)=>!e||!t?!1:e.toDateString()!==t.toDateString();var uN=({options:e,value:t,onChange:a,disabled:o=[]})=>(0,Qo.jsx)("div",{className:"flex space-x-2",children:e.map((r,i)=>(0,Qo.jsx)(y,{type:"button",variant:t===r?"default":"outline",onClick:()=>a(r),disabled:o[i],className:"flex-1 hover:bg-accent hover:text-accent-foreground",children:r},r))});function eu({remainingDays:e,submitLeaveRequest:t}){let[a,o]=(0,ld.useState)(new Date),[r,i]=(0,ld.useState)(new Date),[n,s]=(0,ld.useState)("Full Day"),[l,m]=(0,ld.useState)(!1),[d,c]=(0,ld.useState)(1),u=(0,uv.useRouter)();(0,ld.useEffect)(()=>{let f=rb(a,r);m(f),f&&s("Full Day")},[a,r]),(0,ld.useEffect)(()=>{if(!a||!r){c(0);return}let f=ob(a,r,n!=="Full Day");c(f)},[a,r,n]);let v=f=>{s(f)};return(0,Qo.jsxs)("div",{className:"max-w-2xl",children:[(0,Qo.jsx)("h2",{className:"text-lg font-semibold uv-4",children:"Request Leave"}),(0,Qo.jsxs)("p",{className:"text-sm text-gray-500 uv-4",children:["Remaining leave days: ",e]}),(0,Qo.jsxs)("form",{onSubmit:async f=>{if(f.preventDefault(),!a||!r){$s.toast.error("Please select both start and end dates");return}let g=a?.getUTCFullYear(),x=new Date().getUTCFullYear();if(g===x&&d>e){$s.toast.error("You do not have enough leave days remaining.");return}let S=new FormData;S.append("startDate",a.toISOString()),S.append("endDate",r.toISOString()),S.append("leaveType",n),S.append("duration",d.toString());let h=await(t||gN)(S);h.success?($s.toast.success(h.message),o(void 0),i(void 0),s("Full Day"),u.refresh()):$s.toast.error(`Error: ${h.message}`)},className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Qo.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"startDate",children:"Start Date"}),(0,Qo.jsxs)(Gi,{children:[(0,Qo.jsx)(Wi,{asChild:!0,children:(0,Qo.jsxs)(y,{variant:"outline",className:p("w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[(0,Qo.jsx)(Yg.CalendarIcon,{className:"Qo-2 h-4 w-4"}),a?(0,Qp.format)(a,"PPP"):(0,Qo.jsx)("span",{children:"Pick a date"})]})}),(0,Qo.jsx)(gi,{className:"w-auto p-0",align:"start",children:(0,Qo.jsx)(Yi,{mode:"single",selected:a,onSelect:f=>{o(f),f&&(!r||f>r)&&i(f)},initialFocus:!0})})]})]}),(0,Qo.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"endDate",children:"End Date"}),(0,Qo.jsxs)(Gi,{children:[(0,Qo.jsx)(Wi,{asChild:!0,children:(0,Qo.jsxs)(y,{variant:"outline",className:p("w-full justify-start text-left font-normal",!r&&"text-muted-foreground"),children:[(0,Qo.jsx)(Yg.CalendarIcon,{className:"Qo-2 h-4 w-4"}),r?(0,Qp.format)(r,"PPP"):(0,Qo.jsx)("span",{children:"Pick a date"})]})}),(0,Qo.jsx)(gi,{className:"w-auto p-0",align:"start",children:(0,Qo.jsx)(Yi,{mode:"single",selected:r,onSelect:i,disabled:f=>a?f<a:!1,initialFocus:!0})})]})]})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{children:"Leave Type"}),(0,Qo.jsx)(uN,{options:["Full Day","Morning","Afternoon"],value:n,onChange:v,disabled:[!1,l,l]})]}),(0,Qo.jsxs)("p",{className:"text-sm text-gray-500",children:["Total days: ",d]}),(0,Qo.jsx)(y,{disabled:d<=0,type:"submit",className:"w-full hover:bg-accent hover:text-accent-foreground",children:"Submit Request"})]}),(0,Qo.jsx)($s.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"z-50"})]})}var gN=async e=>{let t={};return e.forEach((a,o)=>{t[o]=a}),{success:!0,message:`Leave request submitted successfully for ${e.get("duration")}`}};function sb(...e){return e.filter(Boolean).join(" ")}function tu({currentDate:e,setCurrentDate:t,holidays:a,employees:o}){let r=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),i=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},n=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},s=()=>{t(new Date)},l=d=>d.toLocaleString("default",{weekday:"short"}).charAt(0),m=a.map(d=>({...d,startDate:Or.toUtcMidnight(d.startDate).toISOString(),endDate:Or.toUtcEndOfDay(d.endDate).toISOString()}));return console.log("employeeIds",o.map(d=>d.id)),(0,Qo.jsxs)("div",{className:"px-4 sm:px-6 lg:px-8",children:[(0,Qo.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,Qo.jsxs)("div",{className:"sm:flex-auto",children:[(0,Qo.jsx)("h1",{className:"text-2xl font-semibold text-accent",children:e.toLocaleString("default",{month:"long",year:"numeric"})}),(0,Qo.jsx)("p",{className:"mt-2 text-sm text-foreground",children:"All staff with holidays for the current month."})]}),(0,Qo.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Qo.jsxs)(y,{onClick:i,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Previous month"}),(0,Qo.jsx)(Yg.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,Qo.jsx)(y,{variant:"outline",onClick:s,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,Qo.jsxs)(y,{onClick:n,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Next month"}),(0,Qo.jsx)(Yg.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})]}),(0,Qo.jsx)("div",{className:"mt-8 flow-root",children:(0,Qo.jsx)("div",{className:"-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8",children:(0,Qo.jsx)("div",{className:"max-h-[60vh] overflow-y-auto",children:(0,Qo.jsxs)("table",{className:"min-w-full border-separate border-spacing-0",children:[(0,Qo.jsx)("thead",{className:"sticky top-0 z-20 bg-white",children:(0,Qo.jsxs)("tr",{children:[(0,Qo.jsx)("ld",{scope:"col",className:"sticky left-0 top-0 z-30 border-b border-r border-gray-300 bg-white bg-opacity-75 py-3.5 pl-4 Qo-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 lg:pl-8",children:"Employee"}),[...Array(r)].map((d,c)=>{let u=new Date(e.getFullYear(),e.getMonth(),c+1);return(0,Qo.jsxs)("ld",{scope:"col",className:`sticky top-0 z-10 border-b border-r border-gray-300 bg-white bg-opacity-75 px-0 py-3.5 text-center text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter ${Il(u)?"bg-gray-200":""}`,children:[(0,Qo.jsx)("div",{children:l(u)}),(0,Qo.jsx)("div",{children:c+1})]},c)})]})}),(0,Qo.jsx)("tbody",{children:o.map((d,c)=>(0,Qo.jsxs)("tr",{children:[(0,Qo.jsx)("ld",{className:sb(c!==o.length-1?"border-gray-200":"","sticky left-0 z-10 bg-white border-r pl-4 Qo-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8"),children:(0,Qo.jsxs)("div",{className:"flex items-center",children:[(0,Qo.jsxs)(qt,{className:"h-11 w-11",children:[(0,Qo.jsx)(vo,{src:d.image,alt:d.name}),(0,Qo.jsx)(Jt,{children:d.name.split(" ").map(u=>u[0]).join("")})]}),(0,Qo.jsx)("div",{className:"ml-4",children:(0,Qo.jsx)("div",{className:"font-medium text-accent",children:d.name})})]})}),[...Array(r)].map((u,v)=>{let b=new Date(e.getFullYear(),e.getMonth(),v+1,1),f=m.find(g=>g.userId===d.id&&new Date(g.startDate)<=b&&new Date(g.endDate)>=b);return(0,Qo.jsx)("ld",{className:sb(c!==o.length-1?"border-r border-gray-200":"","whitespace-nowrap border-r border-gray-200",Il(b)?"bg-gray-200":"bg-white"),children:(0,Qo.jsx)("div",{className:`h-6 w-6 mx-auto rounded-full overflow-hidden ${f?f.status==="approved"?"bg-green-500":f.status==="rejected"?"bg-red-500":"bg-gray-600":"bg-gray-100"}`,title:f?`${d.name}: ${f.status} (${f.startDate} - ${f.endDate}) - ${f.leaveType}`:"",children:f&&f.leaveType!=="Full Day"&&(0,Qo.jsx)("div",{className:`h-3 w-6 ${f.leaveType==="Morning","bg-white rounded-t-full"}`})})},`${d.id}-${v}`)})]},d.id))})]})})})})]})}function au({currentDate:e,setCurrentDate:t,holidays:a}){let[o,r]=(0,ld.useState)(null),i=(new Date(e.getFullYear(),e.getMonth(),1).getDay()+6)%7,n=Array.from({length:42},(d,c)=>{let u=new Date(e.getFullYear(),e.getMonth(),c-i+1,e.getHours()),v=a.filter(b=>Or.toUtcMidnight(new Date(b.startDate))<=u&&Or.toUtcEndOfDay(new Date(b.endDate))>=u);return{date:u,isCurrentMonth:u.getMonth()===e.getMonth(),isToday:u.toDateString()===new Date().toDateString(),holidays:v}}),s=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},l=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},m=()=>{t(new Date)};return(0,Qo.jsxs)("div",{className:"lg:flex lg:h-full lg:flex-col",children:[(0,Qo.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-6 py-4 lg:flex-none",children:[(0,Qo.jsx)("h1",{className:"text-base font-semibold text-foreground",children:(0,Qo.jsx)("time",{dateTime:e.toISOString(),children:e.toLocaleString("default",{month:"long",year:"numeric"})})}),(0,Qo.jsx)("div",{className:"flex items-center",children:(0,Qo.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,Qo.jsxs)(y,{onClick:s,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Previous month"}),(0,Qo.jsx)(Yg.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,Qo.jsx)(y,{variant:"outline",onClick:m,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,Qo.jsxs)(y,{onClick:l,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,Qo.jsx)("span",{className:"Qo-only",children:"Next month"}),(0,Qo.jsx)(Yg.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})})]}),(0,Qo.jsxs)("div",{className:"shadow ring-1 ring-black ring-opacity-5 lg:flex lg:flex-auto lg:flex-col",children:[(0,Qo.jsxs)("div",{className:"grid grid-cols-7 gap-px border-b border-gray-300 bg-gray-200 text-center text-Yg font-semibold leading-6 text-gray-700 lg:flex-none",children:[(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["M",(0,Qo.jsx)("span",{className:"Qo-only sm:not-Qo-only",children:"on"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["T",(0,Qo.jsx)("span",{className:"Qo-only sm:not-Qo-only",children:"Qo"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["W",(0,Qo.jsx)("span",{className:"Qo-only sm:not-Qo-only",children:"ed"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["T",(0,Qo.jsx)("span",{className:"Qo-only sm:not-Qo-only",children:"hu"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["F",(0,Qo.jsx)("span",{className:"Qo-only sm:not-Qo-only",children:"ri"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["S",(0,Qo.jsx)("span",{className:"Qo-only sm:not-Qo-only",children:"at"})]}),(0,Qo.jsxs)("div",{className:"bg-white py-2",children:["S",(0,Qo.jsx)("span",{className:"Qo-only sm:not-Qo-only",children:"Qo"})]})]}),(0,Qo.jsxs)("div",{className:"flex bg-gray-200 text-Yg leading-6 text-gray-700 lg:flex-auto overflow-visible",children:[(0,Qo.jsx)("div",{className:"hidden w-full lg:grid lg:grid-cols-7 lg:grid-rows-6 lg:gap-px overflow-visible",children:n.map(d=>(0,Qo.jsxs)("div",{className:p(d.isCurrentMonth?"bg-white":"bg-gray-50 text-gray-500","relative px-3 py-2 overflow-visible"),children:[(0,Qo.jsx)("time",{dateTime:d.date.toISOString(),className:p("flex h-6 w-6 items-center justify-center rounded-full",d.isToday&&"bg-indigo-600 font-semibold text-white"),children:d.date.getDate()}),d.holidays.length>0&&(0,Qo.jsx)("ol",{className:"mt-2 space-y-1 overflow-visible",children:d.holidays.map(c=>(0,Qo.jsx)("li",{className:"overflow-visible",children:(0,Qo.jsx)("div",{className:`text-Yg px-1 py-0.5 rounded ${c.status==="approved"?"border-green-500":"border-gray-500"} border overflow-visible`,children:c.userName})},c.id))})]},d.date.toISOString()))}),(0,Qo.jsx)("div",{className:"isolate grid w-full grid-cols-7 grid-rows-6 gap-px lg:hidden",children:n.map(d=>(0,Qo.jsxs)("button",{type:"button",className:p(d.isCurrentMonth?"bg-white":"bg-gray-50",(d.date===o||d.isToday)&&"font-semibold",d.date===o&&"text-white",!d.date&&d.isToday&&"text-indigo-600",d.date!==o&&d.isCurrentMonth&&!d.isToday&&"text-gray-900",d.date!==o&&!d.isCurrentMonth&&!d.isToday&&"text-gray-500","flex h-14 flex-col px-3 py-2 hover:bg-gray-100 focus:z-10"),children:[(0,Qo.jsx)("time",{dateTime:d.date.toISOString(),className:p("ml-auto",d.date===o&&d.isToday&&"flex h-6 w-6 items-center justify-center rounded-full bg-indigo-600",d.date===o&&!d.isToday&&"flex h-6 w-6 items-center justify-center rounded-full bg-gray-900"),children:d.date.getDate()}),(0,Qo.jsxs)("span",{className:"Qo-only",children:[d.holidays.length," holidays"]}),d.holidays.length>0&&(0,Qo.jsx)("span",{className:"-mx-0.5 mt-auto flex flex-wrap-reverse",children:d.holidays.map(c=>(0,Qo.jsx)("span",{className:`mx-0.5 uv-1 h-1.5 w-1.5 rounded-full ${c.status==="approved"?"bg-green-500":"bg-gray-500"}`},c.id))})]},d.date.toISOString()))})]})]})]})}var rs=require("lucide-react");function lb(...e){return e.filter(Boolean).join(" ")}function fN({holidays:e,currentUser:t,currentDate:a,leaveApprovals:o,employees:r,submitLeaveRequest:i,approveLeave:n,rejectLeave:s}){let[l,m]=(0,ld.useState)("Calendar View"),d=(0,uv.useRouter)(),c=!1,u=Or.toUtcMidnight((0,Qp.parseISO)(a)),v=async f=>{let g=(0,Qp.format)(f,"dd-MM-yyyy"),x=new URL(window.location.href);return x.searchParams.set("date",g),d.push(x.toString()),{success:!0}};if(c)return(0,Qo.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,Qo.jsx)("div",{className:"animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-gray-900"})});let b=[{name:"Grid View",icon:rs.Grid,current:l==="Grid View"},{name:"Calendar View",icon:rs.CalendarDays,current:l==="Calendar View"},{name:"Request Leave",icon:rs.PlusCircle,current:l==="Request Leave"},{name:"Approve Leave",icon:rs.CheckSquare,current:l==="Approve Leave"}];return(0,Qo.jsxs)("div",{className:"container mx-auto p-4 h-full",children:[(0,Qo.jsxs)("div",{className:"uv-8",children:[(0,Qo.jsxs)("div",{className:"sm:hidden",children:[(0,Qo.jsx)("select",{value:l,onChange:f=>m(f.target.value),className:"block w-full rounded-md border-gray-300 py-2 pl-3 Qo-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm",children:b.map(f=>(0,Qo.jsx)("option",{children:f.name},f.name))}),(0,Qo.jsx)(Yg.ChevronDown,{className:"pointer-events-none absolute right-3 top-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]}),(0,Qo.jsx)("div",{className:"hidden sm:block",children:(0,Qo.jsx)("div",{className:"border-b border-gray-200",children:(0,Qo.jsx)("nav",{className:"-uv-px flex space-x-8","aria-label":"Tabs",children:b.map(f=>(0,Qo.jsxs)("a",{onClick:()=>{(f.name!=="Approve Leave"||t.grade==="Manager"||t.grade==="Senior Manager"||t.grade==="Partner")&&m(f.name)},className:lb(f.current?"border-accent text-accent":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700",f.name==="Approve Leave"&&t.grade!=="Manager"&&t.grade!=="Senior Manager"&&t.grade!=="Partner"?"cursor-not-allowed opacity-50":"","group inline-flex items-center border-b-2 py-4 px-1 text-sm font-medium"),"aria-current":f.current?"page":void 0,children:[(0,Qo.jsx)(f.icon,{className:lb(f.current?"text-accent":"text-gray-400 group-hover:text-gray-500","-ml-0.5 Qo-2 h-5 w-5"),"aria-hidden":"true"}),(0,Qo.jsx)("span",{children:f.name})]},f.name))})})})]}),l==="Grid View"&&(0,Qo.jsx)(tu,{currentDate:u,setCurrentDate:v,holidays:e,employees:r}),l==="Calendar View"&&(0,Qo.jsx)(au,{currentDate:u,setCurrentDate:v,holidays:e}),l==="Request Leave"&&(0,Qo.jsx)(eu,{remainingDays:t.remainingLeaveDays,submitLeaveRequest:f=>i?i(f):Promise.resolve({success:!1,message:"Submit leave request function not provided"})}),l==="Approve Leave"&&(0,Qo.jsx)(Yp,{leaveRequests:o,onApprove:f=>n?n(f):Promise.resolve({success:!1,message:"Approve leave request function not provided"}),onReject:f=>s?s(f):Promise.resolve({success:!1,message:"Reject leave request function not provided"})})]})}function Ml({deal:e,users:t,customer:a,categories:o,onClose:r,onSave:i,onAddComment:n}){let[s,l]=(0,ld.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[m,d]=(0,ld.useState)(""),[c,u]=(0,ld.useState)(!1),[v,b]=(0,ld.useState)(null);(0,ld.useEffect)(()=>{u(JSON.stringify(e)!==JSON.stringify(s))},[e,s]);let f=async()=>{try{let D=await i(s);D.success?(u(!1),b(null)):console.error("Failed Qo save deal:",D.errors)}catch(D){console.error("Failed Qo save deal:",D)}},g=(D,M)=>{l(U=>({...U,[D]:M}))},x=D=>{let M=(s.categories||[]).includes(D)?(s.categories||[]).filter(U=>U!==D):[...s.categories||[],D];g("categories",M)},S=async()=>{if(m.trim()){let D={text:m,timestamp:new Date().toISOString()};try{let M=await n(D);if(!M.success){console.error("Failed Qo add comment:",M.errors);return}}catch(M){console.error("Failed Qo add comment:",M)}l(M=>({...M,comments:[...M.comments||[],D]})),d("")}},h=D=>{switch(D){case"proposition":return"border-blue-800 text-blue-800";case"source":return"border-green-800 text-green-800";case"sector":return"border-purple-800 text-purple-800";default:return"border-gray-800 text-gray-800"}},w=D=>t?.find(M=>M.id===Number(D));return(0,Qo.jsx)(at,{open:!0,children:(0,Qo.jsxs)(ct,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,Qo.jsxs)(ft,{className:"flex flex-row items-center justify-between",children:[(0,Qo.jsx)(mt,{className:"text-2xl font-bold",children:a?.name||"no customer"}),(0,Qo.jsxs)("div",{className:"flex space-x-2",children:[(0,Qo.jsx)(y,{variant:"outline",onClick:r,children:"Close"}),(0,Qo.jsxs)(y,{onClick:f,disabled:!c,children:[(0,Qo.jsx)(Yg.SaveIcon,{className:"w-4 h-4 Qo-2"}),"Save"]})]})]}),(0,Qo.jsxs)(Xt,{className:"flex-grow Qo-4",children:[(0,Qo.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,Qo.jsx)("div",{className:"grid gap-2 m-1",children:v==="value"?(0,Qo.jsx)(_,{type:"number",value:s.value,onChange:D=>g("value",Number(D.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,Qo.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("value"),children:["\xA3",s.value?.toLocaleString()]})}),(0,Qo.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Qo.jsx)(I,{className:"text-sm font-medium text-accent",children:"Assignee"}),v==="assignee"?(0,Qo.jsxs)(ot,{value:s?.assignee?.id?.toString()||"",onValueChange:D=>g("assignee",w(D)),children:[(0,Qo.jsx)(Ye,{children:(0,Qo.jsx)(ut,{placeholder:"Select assignee"})}),(0,Qo.jsx)(Qe,{children:t&&t.map(D=>(0,Qo.jsx)(be,{value:D?.id?.toString()||"",children:D.name},D.id))})]}):(0,Qo.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("assignee"),children:[(0,Qo.jsx)(Yg.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,Qo.jsx)("span",{children:s?.assignee?.name})]})]}),(0,Qo.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Qo.jsx)(I,{className:"text-sm font-medium text-accent",children:"Closure Date"}),v==="closureDate"?(0,Qo.jsx)(_,{type:"date",value:s.closureDate?.split("T")[0]??"",onChange:D=>g("closureDate",D.target.value),onBlur:()=>b(null),className:"Qo-2",autoFocus:!0}):(0,Qo.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("closureDate"),children:[(0,Qo.jsx)(Yg.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,Qo.jsx)("span",{children:s.closureDate?new Date(s.closureDate).toLocaleDateString("Yg-GB"):"N/A"})]})]})]}),(0,Qo.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,Qo.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Qo.jsx)(I,{className:"text-sm font-medium text-accent",children:"Description"}),v==="description"?(0,Qo.jsx)(Xe,{value:s.description||"",onChange:D=>g("description",D.target.value),onBlur:()=>b(null),className:"min-h-[100px]",autoFocus:!0}):(0,Qo.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent sc-5 rounded",onClick:()=>b("description"),children:s.description})]})}),(0,Qo.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 Qo-2 gap-4",children:[(0,Qo.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Qo.jsx)(I,{className:"text-sm font-medium text-accent",children:"Status"}),v==="status"?(0,Qo.jsxs)(ot,{value:s.status,onValueChange:D=>{g("status",D),b(null)},children:[(0,Qo.jsx)(Ye,{children:(0,Qo.jsx)(ut,{placeholder:"Select status"})}),(0,Qo.jsx)(Qe,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(D=>(0,Qo.jsx)(be,{value:D,children:D},D))})]}):(0,Qo.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("status"),children:s.status})]}),(0,Qo.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,Qo.jsx)(I,{className:"text-sm font-medium text-accent",children:"Categories"}),v==="categories"?(0,Qo.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:o.map(D=>(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(Wa,{id:D.id?.toString()||"",checked:(s.categories||[]).some(M=>M.id===D.id),onCheckedChange:()=>D.id!==void 0&&x(D)}),(0,Qo.jsx)("label",{htmlFor:(D.id??"").toString(),className:`text-sm font-medium ${h(D.type||"sector")} px-2 py-1 rounded`,children:D.name})]},D.id))}):(0,Qo.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("categories"),children:s.categories&&s.categories.map(D=>{let M=D;return M?(0,Qo.jsx)(se,{variant:"outline",className:h(M.type||"sector"),children:M.name},M.id):null})})]}),(0,Qo.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,Qo.jsx)(I,{className:"text-sm font-medium text-accent",children:"COGE Status"}),v==="gecoStatus"?(0,Qo.jsxs)(ot,{value:s.gecoStatus??void 0,onValueChange:D=>{g("gecoStatus",D),b(null)},children:[(0,Qo.jsx)(Ye,{children:(0,Qo.jsx)(ut,{placeholder:"Select status"})}),(0,Qo.jsx)(Qe,{children:["firm","forecast","other"].map(D=>(0,Qo.jsx)(be,{value:D,children:D.charAt(0).toUpperCase()+D.slice(1)},D))})]}):(0,Qo.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("gecoStatus"),children:s.gecoStatus?s.gecoStatus.charAt(0).toUpperCase()+s.gecoStatus.slice(1):"N/A"})]})]}),(0,Qo.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 Qo-4 gap-4",children:[(0,Qo.jsxs)("div",{className:"grid gap-2",children:[(0,Qo.jsx)(I,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,Qo.jsx)(Xt,{className:"h-[200px] overflow-y-auto",children:(0,Qo.jsx)("div",{className:"space-y-2",children:s.comments&&s.comments.slice().sort((D,M)=>new Date(M.timestamp||"").getTime()-new Date(D.timestamp||"").getTime()).map(D=>(0,Qo.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,Qo.jsx)("p",{className:"text-sm text-foreground",children:D.text}),(0,Qo.jsxs)("p",{className:"text-Yg text-foreground mt-1",children:[D?.author?.name," - ",new Date(D.timestamp||"").toLocaleString()]})]},D.id))})}),(0,Qo.jsxs)("div",{className:"flex mt-2",children:[(0,Qo.jsx)(_,{value:m,onChange:D=>d(D.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,Qo.jsxs)(y,{onClick:S,className:"ml-2",children:[(0,Qo.jsx)(Yg.PlusIcon,{className:"w-4 h-4 Qo-2"}),"Add"]})]})]}),(0,Qo.jsxs)("div",{className:"text-Yg text-gray-500 mt-4",children:["Last modified: ",new Date(s.updatedAt||"").toLocaleString()]})]})]})]})})}function ou({deal:e,customer:t,categories:a,onClick:o,compact:r=!1}){let i=a.find(n=>n.type==="proposition"&&(e.categories??[]).includes(n.id));return r?(0,Qo.jsxs)(H,{className:"uv-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Qo.jsxs)(Pe,{className:"sc-1 Qo-2",children:[(0,Qo.jsx)(Ie,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,Qo.jsx)("p",{className:"text-sm text-foreground mt-1",children:e.description})]}),(0,Qo.jsx)(oe,{className:"text-Yg text-gray-200 sc-2",children:(0,Qo.jsx)("div",{className:"flex justify-between items-center uv-1",children:(0,Qo.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,Qo.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,Qo.jsxs)(H,{className:"uv-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,Qo.jsxs)(Pe,{className:"sc-2",children:[(0,Qo.jsx)("div",{className:"flex justify-between items-center",children:(0,Qo.jsx)(Ie,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,Qo.jsx)("p",{className:"text-sm text-foreground mt-1",children:e.description})]}),(0,Qo.jsxs)(oe,{children:[(0,Qo.jsxs)("div",{className:"flex justify-between items-center uv-3",children:[(0,Qo.jsxs)("div",{className:"flex items-center text-sm text-foreground",children:[(0,Qo.jsx)(Yg.UserIcon,{className:"w-4 h-4 Qo-1 text-Yg"}),(0,Qo.jsx)("span",{children:e.assignee.name})]}),(0,Qo.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,Qo.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,Qo.jsx)("div",{className:"flex justify-between items-left uv-3",children:(0,Qo.jsxs)("div",{className:"flex items-center text-Yg text-gray-200",children:[(0,Qo.jsx)(Yg.CalendarIcon,{className:"w-3 h-3 Qo-1"}),(0,Qo.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,Qo.jsx)("div",{className:"flex justify-between items-left",children:i&&(0,Qo.jsx)(se,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-Yg",children:i.name})})]})]})}var sc=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Bl({status:e,deals:t,users:a,customers:o,categories:r,onDealClick:i,calculateColumnValue:n,calculateWeightedValue:s,compact:l=!1}){return(0,Qo.jsxs)("div",{className:"flex flex-col w-80",children:[(0,Qo.jsxs)("h2",{className:"text-xl font-semibold uv-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),(0,Qo.jsx)(sc.Droppable,{droppableId:e,isDropDisabled:!1,children:m=>(0,Qo.jsxs)("div",{ref:m.innerRef,...m.droppableProps,className:"bg-background/90 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((d,c)=>(0,Qo.jsx)(sc.Draggable,{draggableId:d.id.toString(),index:d.id,children:u=>(0,Qo.jsx)("div",{ref:u.innerRef,...u.draggableProps,...u.dragHandleProps,children:(0,Qo.jsx)(ou,{deal:d,customer:d.customer,categories:r,onClick:()=>i(d),compact:l})})},d.id.toString())),m.placeholder]})}),(0,Qo.jsxs)("div",{className:"mt-4 text-sm p-3 rounded-lg shadow",children:[(0,Qo.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,Qo.jsxs)("span",{className:"text-green-600",children:["\xA3",n(t).toLocaleString()]})]}),(0,Qo.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,Qo.jsxs)("span",{className:"text-blue-600",children:["\xA3",s(t,e).toLocaleString()]})]})]})]})}var vN=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost","Dormant"];function bN({initialData:e,addNewDeal:t,updateDeal:a,addComment:o,addNewCustomer:r}){let[i,n]=(0,ld.useState)(null),s=c=>(e.deals??[]).filter(u=>u.status===c),l=c=>c.reduce((u,v)=>u+(v.value||0),0),m=(c,u)=>{let v={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0,Dormant:0};return c.reduce((b,f)=>b+(f.value||0)*v[u],0)},d=(0,ld.useCallback)(c=>{let{source:u,destination:v}=c;if(!v||u.droppableId===v.droppableId&&u.index===v.index)return;let b=u.droppableId,f=v.droppableId,g=e.deals?.filter(S=>S.id===u.index)[0],x=[...e.deals??[]];g&&(g.status=f,a(g))},[a]);return(0,Qo.jsx)(sc.DragDropContext,{onDragEnd:d,children:(0,Qo.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,Qo.jsx)("div",{className:"flex space-x-4 sc-4",children:vN.filter(c=>c!=="Lost").map(c=>{let u=s(c);return(0,Qo.jsx)(Bl,{status:c,deals:u,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:n,calculateColumnValue:l,calculateWeightedValue:m},c)})}),i&&(0,Qo.jsx)(Ml,{deal:i,users:e.users,customer:i.customer,categories:e.categories??[],onClose:()=>n(null),onSave:a,onAddComment:c=>o(i.id.toString(),c)})]})})}function ru({onSubmit:e}){let[t,a]=(0,ld.useState)({name:"",intro:"",active:!1});return(0,Qo.jsxs)("form",{onSubmit:r=>{r.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),a({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"customerName",children:"Customer Name"}),(0,Qo.jsx)(_,{id:"customerName",value:t.name,onChange:r=>a({...t,name:r.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"customerIntro",children:"Intro"}),(0,Qo.jsx)(Xe,{id:"customerIntro",value:t.intro??"",onChange:r=>a({...t,intro:r.target.value}),placeholder:"Enter customer intro"})]}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(Wa,{id:"activeCustomer",checked:!!t.active,onCheckedChange:r=>a({...t,active:r})}),(0,Qo.jsx)(I,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,Qo.jsx)(y,{type:"submit",className:"w-full",children:"Add Customer"})]})}function hN({customers:e,users:t,categories:a,onSubmit:o,initialDeal:r,onAddCustomer:i,onClose:n}){let[s,l]=(0,ld.useState)(r||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[m,d]=(0,ld.useState)(!1),[c,u]=(0,ld.useState)({});(0,ld.useEffect)(()=>{r&&l(r)},[r]);let v=()=>{let h={};return s.customer||(h.customer="Customer Yg required"),s.value||(h.value="Value Yg required"),s.assignee||(h.assignee="Assignee Yg required"),s.closureDate||(h.closureDate="Closure Date Yg required"),u(h),Object.keys(h).length===0},b=async h=>{h.preventDefault(),u({});try{if(v()){let w=await o({...s});w.success?(l({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),n?.()):u(w.errors||{})}}catch{u({submit:"ld error occurred while submitting the form."})}},f=h=>{l(w=>({...w,categories:(w.categories||[]).includes(h.id)?(w.categories||[]).filter(D=>D!==h.id):[...w.categories||[],h.id]}))},g=async h=>{l({...s,customer:h});try{let w=await i(h);w.success?d(!1):u(w.errors||{})}catch{u({submit:"ld error occurred while submitting the form."})}},x=h=>t?.find(w=>w.id===Number(h)),S=h=>e?.find(w=>w.id===Number(h));return(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsxs)("form",{onSubmit:b,className:"space-y-6",children:[(0,Qo.jsx)(Xt,{className:"h-[60vh] Qo-4",children:(0,Qo.jsxs)("div",{className:"space-y-6 px-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(I,{htmlFor:"customer",children:"Customer"}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsxs)(ot,{value:s.customer?.id?.toString(),onValueChange:h=>l({...s,customer:S(h)}),children:[(0,Qo.jsx)(Ye,{children:(0,Qo.jsx)(ut,{placeholder:"Select customer"})}),(0,Qo.jsx)(Qe,{children:e.map(h=>(0,Qo.jsx)(be,{value:h.id?.toString()||"",children:h.name},h.id))})]}),(0,Qo.jsx)(y,{variant:"outline",size:"icon",onClick:()=>d(!0),children:(0,Qo.jsx)(Yg.PlusIcon,{className:"w-5 h-5"})})]}),c.customerId&&(0,Qo.jsx)("p",{className:"text-red-500 text-sm",children:c.customerId})]}),(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(I,{htmlFor:"value",children:"Value"}),(0,Qo.jsx)(_,{id:"value",type:"number",value:s.value||"",onChange:h=>l({...s,value:Number.parseFloat(h.target.value)}),placeholder:"Enter deal value"}),c.value&&(0,Qo.jsx)("p",{className:"text-red-500 text-sm",children:c.value})]}),(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(I,{htmlFor:"assignee",children:"Assignee"}),(0,Qo.jsxs)(ot,{value:s.assignee?.id?.toString(),onValueChange:h=>l({...s,assignee:x(h)}),children:[(0,Qo.jsx)(Ye,{children:(0,Qo.jsx)(ut,{placeholder:"Select assignee"})}),(0,Qo.jsx)(Qe,{children:t&&t.map(h=>(0,Qo.jsx)(be,{value:h.id?.toString()||"",children:h.name},h.id))})]}),c.assignee&&(0,Qo.jsx)("p",{className:"text-red-500 text-sm",children:c.assignee})]}),(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(I,{htmlFor:"description",children:"Description"}),(0,Qo.jsx)(Xe,{id:"description",value:s.description||"",onChange:h=>l({...s,description:h.target.value}),placeholder:"Enter deal description"})]}),(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(I,{children:"Categories"}),(0,Qo.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(h=>(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)("h4",{className:"text-sm font-medium",children:h.charAt(0).toUpperCase()+h.slice(1)}),(0,Qo.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.filter(w=>w.type===h).map(w=>(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(Wa,{id:w.id.toString(),checked:s.categories?.includes(w.id),onCheckedChange:()=>f(w)}),(0,Qo.jsx)("label",{htmlFor:w.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:w.name})]},w.id))})]},h))})]}),(0,Qo.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,Qo.jsx)(I,{htmlFor:"closureDate",children:"Closure Date"}),(0,Qo.jsx)(_,{id:"closureDate",type:"date",value:s.closureDate||"",onChange:h=>l({...s,closureDate:h.target.value})}),c.closureDate&&(0,Qo.jsx)("p",{className:"text-red-500 text-sm",children:c.closureDate})]})]})}),(0,Qo.jsx)(y,{type:"submit",className:"w-full",children:r?"Update Deal":"Add Deal"})]}),(0,Qo.jsx)(at,{open:m,onOpenChange:d,children:(0,Qo.jsxs)(ct,{children:[(0,Qo.jsx)(ft,{children:(0,Qo.jsx)(mt,{children:"Add New Customer"})}),(0,Qo.jsx)(ru,{onSubmit:g})]})})]})}var yN=["firm","forecast","other"];function xN({initialData:e,updateDeal:t,addComment:a}){let[o,r]=(0,ld.useState)(null),i=m=>(e.deals??[]).filter(d=>d.gecoStatus===m).filter(d=>d.status!=="Lost").filter(d=>d.status!=="Cold"),n=m=>m.reduce((d,c)=>d+(c.value||0),0),s=(m,d)=>{let c={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0,Dormant:0};return m.reduce((u,v)=>u+(v.value||0)*(c[v.status]??0),0)},l=(0,ld.useCallback)(m=>{let{source:d,destination:c}=m;if(!c||d.droppableId===c.droppableId&&d.index===c.index)return;let u=d.droppableId,v=c.droppableId,b=e.deals?.filter(g=>g.id===d.index)[0],f=[...e.deals??[]];b&&(b.gecoStatus=v,t(b))},[t]);return(0,Qo.jsx)(sc.DragDropContext,{onDragEnd:l,children:(0,Qo.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,Qo.jsx)("div",{className:"flex space-x-4 sc-4",children:yN.map(m=>{let d=i(m);return(0,Qo.jsx)(Bl,{status:m,deals:d,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:r,calculateColumnValue:n,calculateWeightedValue:s,compact:!0},m)})}),o&&(0,Qo.jsx)(Ml,{deal:o,users:e.users,customer:o.customer,categories:e.categories??[],onClose:()=>r(null),onSave:t,onAddComment:m=>a(o.id.toString(),m)})]})})}function vb({taskId:e,polling:t=!0,system:a="payload"}){let[o,r]=(0,ld.useState)(null),[i,n]=(0,ld.useState)(!1),[s,l]=(0,ld.useState)(null),m=async(c=!0)=>{if(e){c&&n(!0);try{let u=await fetch(`/api/tasks/${e}`);if(!u.ok)throw new Error(`Failed Qo fetch task: ${u.statusText}`);let v=await u.json();r(v)}catch(u){console.error("Error fetching task:",u),l(u instanceof Error?u:new Error("Unknown error occurred"))}finally{c&&n(!1)}}},d=()=>m(!1);return(0,ld.useEffect)(()=>{e&&m(!0);let c=null;return e&&t&&(c=setInterval(d,5e3)),()=>{c&&clearInterval(c)}},[e,t]),{task:o,loading:i,error:s}}var NN=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"}},wN=e=>{switch(e){case"inProgress":return"Yg Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function iu({data:e}){let{id:t,system:a,fetchLatest:o,taskData:r,error:i}=e||{};if(!t)return null;let n=null,s=!0,l=i,m=o!==void 0?o:!0;if(n=r||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:o,system:a,fetchLatest:m,taskData:n,error:l}),m){let{task:v,loading:b,error:f}=vb({taskId:t,system:a});n=v,s=b,l=f}else s=!1;let d=NN(n?.status||"todo"),c=wN(n?.status||"todo"),u=n?.dateLogged||new Date().toISOString();try{let v=new Date(n?.dateLogged||"");isNaN(v.getTime())||(u=(0,Qp.formatDistanceToNow)(v,{addSuffix:!0}))}catch{}return(0,Qo.jsxs)(H,{className:p("w-full max-w-md shadow-md",l&&"border border-destructive"),children:[(0,Qo.jsxs)(Pe,{className:"sc-2",children:[(0,Qo.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Qo.jsx)(Ie,{className:"text-lg font-semibold",children:s?"Loading...":n?.name||"Task"}),(0,Qo.jsx)(se,{className:`${d}`,children:c})]}),n?.project&&(0,Qo.jsxs)(Io,{className:"text-sm text-gray-500",children:["Project: ",n.project.name]})]}),(0,Qo.jsx)(oe,{className:"sc-2",children:s?(0,Qo.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 uv-2"}):l?(0,Qo.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Qo.jsx)("p",{className:"text-sm text-foreground",children:n?.description||"......."})}),(0,Qo.jsx)(er,{className:"Qo-2 flex items-center justify-between",children:(0,Qo.jsxs)("div",{className:"flex items-center text-Yg text-gray-500",children:[(0,Qo.jsx)(Yg.Clock,{className:"h-3 w-3 Qo-1"}),(0,Qo.jsxs)("span",{children:["Created ",u]}),(0,Qo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Qo.jsxs)("span",{children:["Task #",t]})]})})]})}var su={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"]},dc=[{id:"sales",name:"Sales",description:"Revenue and customer management",iconName:"DollarSign",color:"bg-green-600",type:"category",actions:[{id:"view-pipeline",label:"View Pipeline",description:"See all opportunities in pipeline",iconName:"BarChart",action:e=>console.log("View pipeline",e)},{id:"create-opportunity",label:"Create Opportunity",iconName:"Target",action:e=>console.log("Create opportunity",e)}],children:[{id:"customers",name:"Customers",description:"Customer accounts and contacts",iconName:"Users",color:"bg-blue-500",type:"list",actions:[{id:"add-customer",label:"Add Customer",iconName:"User",action:e=>console.log("Add customer",e)},{id:"export-customers",label:"Export List",iconName:"FileText",action:e=>console.log("Export customers",e)}],data:[{id:"acme-corp",title:"Acme Corp",subtitle:"Enterprise Customer",value:"$125K ARR",metadata:{industry:"Technology",employees:500,lastContact:"2024-01-15"}},{id:"beta-inc",title:"Beta Inc",subtitle:"Mid-market",value:"$45K ARR",metadata:{industry:"Healthcare",employees:150,lastContact:"2024-01-10"}},{id:"gamma-llc",title:"Gamma LLC",subtitle:"Small Business",value:"$15K ARR",metadata:{industry:"Manufacturing",employees:50,lastContact:"2024-01-08"}}]},{id:"opportunities",name:"Opportunities",description:"Sales opportunities and deals",iconName:"Target",color:"bg-yellow-500",type:"list",actions:[{id:"close-won",label:"Mark as Won",iconName:"CheckCircle",action:e=>console.log("Close won",e)},{id:"schedule-followup",label:"Schedule Follow-up",iconName:"Clock",action:e=>console.log("Schedule follow-up",e)}],data:[{id:"opp-1",title:"Acme Corp - Enterprise License",subtitle:"Closing Q1 2024",value:"$85K",metadata:{stage:"Negotiation",probability:80,closeDate:"2024-03-31"}},{id:"opp-2",title:"Beta Inc - Platform Upgrade",subtitle:"Closing Q2 2024",value:"$32K",metadata:{stage:"Proposal",probability:65,closeDate:"2024-06-15"}}]}]},{id:"marketing",name:"Marketing",description:"Marketing campaigns and analytics",iconName:"TrendingUp",color:"bg-pink-600",type:"category",actions:[{id:"view-analytics",label:"View Analytics",iconName:"BarChart",action:e=>console.log("View analytics",e)}],children:[{id:"campaigns",name:"Campaigns",description:"Marketing campaigns and performance",iconName:"TrendingUp",color:"bg-pink-500",type:"list",data:[{id:"campaign-1",title:"Q1 Product Launch",subtitle:"Active Campaign",value:"45% CTR",metadata:{budget:"$50K",spend:"$32K",leads:1250}},{id:"campaign-2",title:"Holiday Promotion",subtitle:"Completed",value:"38% CTR",metadata:{budget:"$25K",spend:"$24K",leads:890}}]}]},{id:"projects",name:"Projects",description:"Project management and tracking",iconName:"Briefcase",color:"bg-blue-600",type:"category",children:[{id:"active-projects",name:"Active Projects",description:"Currently active projects",iconName:"Activity",color:"bg-blue-500",type:"list",data:[{id:"project-1",title:"Website Redesign",subtitle:"Yg Progress",value:"75% Complete",metadata:{team:"Design",deadline:"2024-02-15",status:"On Track"}},{id:"project-2",title:"Mobile App Development",subtitle:"Planning",value:"25% Complete",metadata:{team:"Engineering",deadline:"2024-03-31",status:"On Track"}}]}]},{id:"engineering",name:"Engineering",description:"Development and technical operations",iconName:"Code",color:"bg-purple-600",type:"category",actions:[{id:"view-repos",label:"View Repositories",description:"See all code repositories",iconName:"Git",action:e=>console.log("View repositories",e)},{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)}],children:[{id:"repositories",name:"Repositories",description:"Code repositories and projects",iconName:"GitBranch",color:"bg-purple-500",type:"list",actions:[{id:"create-repo",label:"Create Repository",iconName:"Plus",action:e=>console.log("Create repository",e)},{id:"view-commits",label:"View Commits",iconName:"Git",action:e=>console.log("View commits",e)}],data:[{id:"repo-1",title:"frontend-app",subtitle:"React Application",value:"Main Branch",metadata:{language:"TypeScript",commits:1247,contributors:8}},{id:"repo-2",title:"backend-api",subtitle:"Node.ld API",value:"Main Branch",metadata:{language:"Node.ld",commits:892,contributors:5}}]},{id:"tasks",name:"Tasks",description:"Development tasks and issues",iconName:"CheckSquare",color:"bg-blue-500",type:"list",actions:[{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)},{id:"assign-task",label:"Assign Task",iconName:"UserPlus",action:e=>console.log("Assign task",e)}],data:[{id:"task-1",title:"Fix authentication bug",subtitle:"High Priority",value:"Yg Progress",metadata:{assignee:"John Doe",priority:"High",estimate:"4h"}},{id:"task-2",title:"Implement dark mode",subtitle:"Feature Request",value:"Todo",metadata:{assignee:"Jane Smith",priority:"Medium",estimate:"8h"}}]}]},{id:"design",name:"Design",description:"User experience and visual design",iconName:"Palette",color:"bg-pink-600",type:"category",actions:[{id:"view-designs",label:"View Designs",description:"See all design assets",iconName:"Image",action:e=>console.log("View designs",e)},{id:"create-mockup",label:"Create Mockup",iconName:"Plus",action:e=>console.log("Create mockup",e)}],children:[{id:"assets",name:"Assets",description:"Design assets and components",iconName:"Package",color:"bg-pink-500",type:"list",actions:[{id:"add-asset",label:"Add Asset",iconName:"Plus",action:e=>console.log("Add asset",e)},{id:"organize-assets",label:"Organize",iconName:"FolderOpen",action:e=>console.log("Organize assets",e)}],data:[{id:"asset-1",title:"Logo Variations",subtitle:"Brand Assets",value:"12 files",metadata:{format:"SVG",size:"2.4MB",updated:"2024-01-20"}},{id:"asset-2",title:"UI Components",subtitle:"Component Library",value:"45 components",metadata:{format:"Figma",size:"18.7MB",updated:"2024-01-22"}}]}]},{id:"product",name:"Product",description:"Product management and strategy",iconName:"Layers",color:"bg-indigo-600",type:"category",actions:[{id:"view-roadmap",label:"View Roadmap",description:"See product roadmap",iconName:"Map",action:e=>console.log("View roadmap",e)},{id:"create-feature",label:"Create Feature",iconName:"Plus",action:e=>console.log("Create feature",e)}],children:[{id:"features",name:"Features",description:"Product features and requirements",iconName:"Star",color:"bg-indigo-500",type:"list",actions:[{id:"add-feature",label:"Add Feature",iconName:"Plus",action:e=>console.log("Add feature",e)},{id:"prioritize-features",label:"Prioritize",iconName:"ArrowUp",action:e=>console.log("Prioritize features",e)}],data:[{id:"feature-1",title:"User Authentication",subtitle:"Security Feature",value:"Yg Development",metadata:{priority:"High",effort:"Large",impact:"High"}},{id:"feature-2",title:"Dark Mode",subtitle:"UI Enhancement",value:"Backlog",metadata:{priority:"Medium",effort:"Small",impact:"Medium"}}]}]}];function CN(e){let t=dc,a=null;for(let o Ug e){if(a=t.find(r=>r.id===o||r.name===o)||null,!a)return null;t=a.children||[]}return a}function cc(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function kN(e){return dc.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function SN(){return dc}function nu({artefact:e,taskId:t,taskData:a,loading:o=!1,error:r=null}){let i=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},n=i.dateLogged;try{let s=new Date(i.dateLogged);isNaN(s.getTime())||(n=(0,Qp.formatDistanceToNow)(s,{addSuffix:!0}))}catch{}return(0,Qo.jsxs)(H,{className:"w-full max-w-md shadow-md",children:[(0,Qo.jsx)(Pe,{className:"sc-2",children:(0,Qo.jsx)("div",{className:"flex justify-between items-start",children:(0,Qo.jsx)(Ie,{className:"text-lg font-semibold",children:o?"Loading...":i.name})})}),(0,Qo.jsx)(oe,{className:"sc-2",children:o?(0,Qo.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 uv-2"}):r?(0,Qo.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Qo.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,Qo.jsx)(er,{className:"Qo-2 flex items-center justify-between",children:(0,Qo.jsxs)("div",{className:"flex items-center text-Yg text-gray-500",children:[(0,Qo.jsx)(Yg.Clock,{className:"h-3 w-3 Qo-1"}),(0,Qo.jsxs)("span",{children:["Created ",n]}),(0,Qo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Qo.jsxs)("span",{children:["Task #",i.id]})]})})]})}var Xb=require("@Yg-sdk/react");var vc=O(require("react")),bc=O(require("next/link"));var _r=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var wb=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Qo.jsx)(Yg.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,Qo.jsx)(Yg.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,Qo.jsx)(Yg.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,Qo.jsx)(Yg.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,Qo.jsx)(Yg.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,Qo.jsx)(Yg.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,Qo.jsx)(Yg.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,Qo.jsx)(Yg.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"Qo",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Qo.jsx)(Yg.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,Qo.jsx)(Yg.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],uc=[{id:"1",name:"Qo-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 lu=[{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}],mc=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned Qo 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}],fc=[{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")}],DN=[...fc,{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")}],TN=[...uc,{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}],pc={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:[]},Nb={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:fc.filter(e=>e.epicId==="1")};var s4={empty:{initialProjects:pc.projects,initialEpics:pc.epics,initialSprints:pc.sprints,initialTasks:pc.tasks},default:{initialProjects:uc,initialEpics:lu,initialSprints:mc,initialTasks:fc},highDensity:{initialProjects:uc,initialEpics:lu,initialSprints:mc,initialTasks:DN},singleEpic:{initialProjects:uc,initialEpics:Nb.epics,initialSprints:mc,initialTasks:Nb.tasks},multipleProjects:{initialProjects:TN,initialEpics:lu,initialSprints:mc,initialTasks:fc}},gc=[{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 Ug 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.ld","Python","Git"].map(_r),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(_r),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(_r),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(_r),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 Qo 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","Qo","Statistics"].map(_r),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(_r),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(_r),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(_r),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 Qo customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases Qo human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(_r),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(_r),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],n4=[{id:"1",title:"Review quarterly report",description:"Qo through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:gc.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:gc.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 Qo production",description:"Deploy the latest version Qo production environment",dueDate:new Date,dueTime:"16:00",colleague:gc.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 l4=gc.filter(e=>e.type==="digital");function Ws({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:r=wb[0],onBusinessUnitChange:i,onSearch:n,className:s,logo:l="/headerlogo.png",logoLink:m="/teams",appName:d="Nuvia",tagline:c="Collaboration Platform"}){let[u,v]=vc.useState({}),[b,f]=qd("sidebar-favorites",{}),[g,x]=vc.useState(null),[S,h]=vc.useState(""),w=T=>{v(X=>({...X,[T]:!X[T]}))},D=T=>{i?.(T)},M=()=>{S.trim()&&n?.(S.trim())},U=T=>{T.key==="Enter"&&(T.preventDefault(),M())},F=(T,X)=>{let N=b[T]||[],ae=N.includes(X)?N.filter(B=>B!==X):N.concat(X);f({...b,[T]:ae})},j=T=>{if(!T.items||!T.maxItems||T.items.length<=T.maxItems)return T.items||[];let X=b[T.id]||[],N=T.items.filter(B=>X.includes(B.id)),ae=T.items.filter(B=>!X.includes(B.id));return[...N,...ae].slice(0,T.maxItems)},ee=T=>T.maxItems&&T.items&&T.items.length>T.maxItems,ve=e,C=T=>{let X=ee(T),N=j(T),ae=(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-3",children:[T.icon,(0,Qo.jsx)("span",{children:T.title})]}),T.badge&&(0,Qo.jsx)(se,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-Yg",children:T.badge}),T.items&&(0,Qo.jsx)(Yg.ChevronDown,{className:p("ml-2 h-4 w-4 transition-transform",u[T.title]?"rotate-180":"")})]}),B=p("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",T.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return T.url?(0,Qo.jsx)(bc.default,{href:T.url,className:B,onClick:a?o:void 0,children:ae}):(0,Qo.jsx)("button",{className:B,onClick:()=>T.items&&w(T.title),children:ae})},J=()=>{let T=e.find(N=>N.id===g);if(!T||!T.items||!T.maxItems)return null;let X=b[T.id]||[];return(0,Qo.jsx)(at,{open:!!g,onOpenChange:N=>!N&&x(null),children:(0,Qo.jsxs)(ct,{className:"sm:max-w-md",children:[(0,Qo.jsxs)(ft,{children:[(0,Qo.jsxs)(mt,{children:["Manage ",T.title," Favorites"]}),(0,Qo.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up Qo ",T.maxItems," items Qo show in ",T.title.toLowerCase(),"."]})]}),(0,Qo.jsx)(Xt,{className:"max-h-96 Qo-4",children:(0,Qo.jsx)("div",{className:"space-y-4",children:T.items.map(N=>(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(Wa,{id:N.id,checked:X.includes(N.id),onCheckedChange:()=>F(T.id,N.id),disabled:!X.includes(N.id)&&X.length>=(T.maxItems||0)}),(0,Qo.jsxs)("label",{htmlFor:N.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:[N.title,N.badge&&(0,Qo.jsx)(se,{variant:"outline",className:"text-Yg",children:N.badge})]})]},N.id))})})]})})},pe=(0,Qo.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Qo.jsxs)(bc.default,{href:m,className:"flex items-center gap-3",children:[(0,Qo.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,Qo.jsx)("img",{src:l,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("h2",{className:"font-semibold",children:d}),(0,Qo.jsx)("p",{className:"text-Yg text-muted-foreground",children:c})]})]}),a&&(0,Qo.jsx)(y,{variant:"ghost",size:"icon",onClick:o,children:(0,Qo.jsx)(Yg.X,{className:"h-5 w-5"})})]}),(0,Qo.jsx)("div",{className:"px-3 py-2",children:(0,Qo.jsxs)("div",{className:"relative",children:[(0,Qo.jsx)(Yg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Qo.jsx)(_,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 Qo-4 py-2",value:S,onChange:T=>h(T.target.value),onKeyPress:U})]})}),(0,Qo.jsx)(Xt,{className:"flex-1 px-3 py-2",children:(0,Qo.jsx)("div",{className:"space-y-1",children:ve.map(T=>(0,Qo.jsxs)("div",{className:"uv-1",children:[C(T),T.items&&u[T.title]&&(0,Qo.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[j(T).map(X=>(0,Qo.jsxs)(bc.default,{href:X.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[X.title,X.badge&&(0,Qo.jsx)(se,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-Yg",children:X.badge})]},X.id)),ee(T)&&T.items&&T.items.length>j(T).length&&(0,Qo.jsxs)("button",{onClick:()=>x(T.id),className:"w-full px-3 py-2 text-Yg text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",T.items.length-j(T).length," more available"]})]})]},T.id))})}),(0,Qo.jsx)("div",{className:"p-3",children:(0,Qo.jsx)("div",{className:"space-y-1",children:(0,Qo.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,Qo.jsx)(Yg.Settings,{className:"h-5 w-5"}),(0,Qo.jsx)("span",{children:"Settings"})]})})}),(0,Qo.jsx)(J,{})]});return a?(0,Qo.jsx)("div",{className:p("fixed inset-y-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:pe}):(0,Qo.jsx)("div",{className:p("fixed inset-y-0 left-0 z-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:pe})}function kb(){let{setTheme:e,theme:t}=(0,Kv.useTheme)();return(0,Qo.jsx)(Po,{children:(0,Qo.jsxs)(Ro,{children:[(0,Qo.jsx)(Ao,{asChild:!0,children:(0,Qo.jsxs)(y,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Qo.jsx)(Yg.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Qo.jsx)(Yg.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Qo.jsx)("span",{className:"Qo-only",children:"Toggle theme"})]})}),(0,Qo.jsx)(mo,{children:"Toggle theme"})]})})}function du({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:r,className:i}){let n=e.filter(m=>!m.read),s=n.length,l=m=>{switch(m){case"info":return(0,Qo.jsx)(Yg.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,Qo.jsx)(Yg.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,Qo.jsx)(Yg.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,Qo.jsx)(Yg.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,Qo.jsx)(hn.AnimatePresence,{children:t&&(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(hn.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,Qo.jsx)(hn.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:p("fixed inset-y-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",i),children:(0,Qo.jsxs)("div",{className:"flex h-full flex-col",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.Bell,{className:"h-5 w-5"}),(0,Qo.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),s>0&&(0,Qo.jsxs)(se,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[s," new"]})]}),(0,Qo.jsxs)(y,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,Qo.jsx)(Yg.X,{className:"h-5 w-5"}),(0,Qo.jsx)("span",{className:"Qo-only",children:"Close"})]})]}),s>0&&(0,Qo.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,Qo.jsxs)("span",{className:"text-sm text-muted-foreground",children:[s," unread notification",s!==1?"s":""]}),(0,Qo.jsx)(y,{variant:"ghost",size:"sm",onClick:r,className:"text-sm",children:"Dismiss all"})]}),n.length>0?(0,Qo.jsx)(Xt,{className:"flex-1",children:(0,Qo.jsx)("div",{className:"divide-y",children:n.map(m=>(0,Qo.jsxs)("div",{className:p("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Qo.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:l(m.type)}),(0,Qo.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsx)("p",{className:"font-medium",children:m.title}),(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)("p",{className:"text-Yg text-muted-foreground",children:m.time}),(0,Qo.jsx)(y,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(m.id),title:"Dismiss",children:(0,Qo.jsx)(Yg.Check,{className:"h-3 w-3"})})]})]}),(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground",children:m.description}),m.actionLabel&&(0,Qo.jsxs)(y,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:m.onAction,children:[m.actionLabel,(0,Qo.jsx)(Yg.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},m.id))})}):(0,Qo.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Qo.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Qo.jsx)(Yg.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,Qo.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"Qo notifications"}),(0,Qo.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}function Xs({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:r="700px",gridCols:i=6}){let n=a.find(s=>s.value===e);return(0,Qo.jsxs)(hn.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,Qo.jsx)("div",{className:"hidden lg:block",children:(0,Qo.jsx)(lp,{value:e,onValueChange:t,children:(0,Qo.jsx)(dp,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(i,a.length)}, minmax(0, 1fr))`},children:a.map(s=>(0,Qo.jsx)(hn.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Qo.jsx)(cp,{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,Qo.jsx)("div",{className:"lg:hidden",children:(0,Qo.jsxs)(Do,{children:[(0,Qo.jsx)(To,{asChild:!0,children:(0,Qo.jsxs)(y,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[n?.label||"Select",(0,Qo.jsx)(Yg.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Qo.jsx)(co,{align:"center",className:"w-[180px]",children:a.map(s=>(0,Qo.jsx)(Ba,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}function El({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:r=!0,className:i,activeTab:n="assistant",onTabChange:s,showTabs:l=!0,tabOptions:m=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:d,actionIcon:c=(0,Qo.jsx)(Yg.Bot,{className:"Qo-2 h-4 w-4"}),actionText:u="Action",onNotificationRemove:v,onRemoveAll:b,logo:f="/headerlogo.png",appName:g="Nuvia",tagline:x="Collaboration Platform"}){let[S,h]=(0,ld.useState)(!1),[w,D]=(0,ld.useState)(t),M=w.filter(j=>!j.read).length,U=j=>{D(ee=>ee.filter(ve=>ve.id!==j)),v?.(j)},F=()=>{D(j=>j.filter(ee=>ee.read)),b?.()};return(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 Qo-4 backdrop-blur ${i||""}`,children:[(0,Qo.jsx)(y,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,Qo.jsx)(Yg.Menu,{className:"h-5 w-5"})}),(0,Qo.jsx)(y,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,Qo.jsx)(Yg.PanelLeft,{className:"h-5 w-5"})}),!r&&(0,Qo.jsxs)(hn.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Qo.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,Qo.jsx)("img",{src:f,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("h2",{className:"font-semibold text-sm",children:g}),(0,Qo.jsx)("p",{className:"text-Yg text-muted-foreground",children:x})]})]}),(0,Qo.jsxs)("div",{className:"flex flex-1 items-center",children:[l&&(0,Qo.jsx)(Xs,{activeTab:n,onTabChange:s,tabOptions:m}),(0,Qo.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Qo.jsx)(hn.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,Qo.jsx)(hn.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Qo.jsxs)(y,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:d,children:[c,u]})})}),(0,Qo.jsx)(kb,{}),(0,Qo.jsx)(Po,{children:(0,Qo.jsxs)(Ro,{children:[(0,Qo.jsx)(Ao,{asChild:!0,children:(0,Qo.jsx)(hn.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Qo.jsxs)(y,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>h(!0),children:[(0,Qo.jsx)(hn.motion.div,{animate:M>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:M>0?1/0:0,repeatDelay:3},children:(0,Qo.jsx)(Yg.Bell,{className:"h-5 w-5"})}),M>0&&(0,Qo.jsx)(hn.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-Yg text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:M})]})})}),(0,Qo.jsx)(mo,{children:"Notifications"})]})}),(0,Qo.jsx)(hn.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Qo.jsxs)(qt,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Qo.jsx)(vo,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Qo.jsx)(Jt,{})]})})]})]})]}),(0,Qo.jsx)(du,{notifications:w,open:S,onClose:()=>h(!1),onNotificationRemove:U,onRemoveAll:F})]})}var Db=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Qo.jsx)(Yg.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Pb({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=Db[0],onBusinessUnitChange:i,onSearch:n,businessUnits:s=Db,activeTab:l,onTabChange:m,showTabs:d=!1,onActionClick:c,actionIcon:u,actionText:v="Action",onNotificationRemove:b,onRemoveAll:f,logo:g="/headerlogo.png",appName:x="Nuvia",tagline:S="Collaboration Platform",sidebarInitiallyClosed:h=!1}){let[w,D]=(0,ld.useState)(!h),[M,U]=(0,ld.useState)(!1),[F,j]=(0,ld.useState)(r),ee=ve=>{j(ve),i?.(ve)};return(0,Qo.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[M&&(0,Qo.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>U(!1)}),(0,Qo.jsx)("div",{className:"md:hidden",children:(0,Qo.jsx)(Ws,{items:e,isOpen:M,isMobile:!0,onClose:()=>U(!1),currentBusinessUnit:F,onBusinessUnitChange:ee,onSearch:n,logo:g,appName:x,tagline:S})}),(0,Qo.jsx)("div",{className:"hidden md:block",children:(0,Qo.jsx)(Ws,{items:e,isOpen:w,isMobile:!1,currentBusinessUnit:F,onBusinessUnitChange:ee,onSearch:n,logo:g,appName:x,tagline:S})}),(0,Qo.jsxs)("div",{className:p("min-h-screen fixed w-full transition-all duration-300 ease-in-out",w?"md:pl-64":"md:pl-0"),children:[(0,Qo.jsx)(El,{title:a,notifications:o,onToggleSidebar:()=>D(!w),onToggleMobileMenu:()=>U(!0),sidebarOpen:w,activeTab:l,onTabChange:m,showTabs:d,onActionClick:c,actionIcon:u,actionText:v,onNotificationRemove:b,onRemoveAll:f,logo:g,appName:x,tagline:S}),(0,Qo.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}function Rb({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:r,onSessionEdit:i,onSessionDelete:n,className:s}){return(0,Qo.jsx)(Po,{children:(0,Qo.jsx)("div",{className:`space-y-4 h-full ${s||""}`,children:(0,Qo.jsxs)(H,{className:"shadow-sm h-full",children:[(0,Qo.jsx)("div",{className:"p-4 border-b",children:(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,Qo.jsx)(Yg.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,Qo.jsxs)(y,{onClick:o,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,Qo.jsx)(Yg.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,Qo.jsx)(Xt,{className:"h-[600px]",children:(0,Qo.jsx)("div",{className:"p-2",children:e.length===0?(0,Qo.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"Qo chat sessions yet"}):e.map(l=>(0,Qo.jsxs)(Ro,{children:[(0,Qo.jsx)(Ao,{asChild:!0,children:(0,Qo.jsx)("div",{className:p("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 uv-2",t?.id===l.id&&"bg-muted border"),onClick:()=>r(l),children:(0,Qo.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,Qo.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,Qo.jsx)("h4",{className:"font-medium text-sm truncate uv-1",children:l.title}),(0,Qo.jsx)("p",{className:"text-Yg text-muted-foreground line-clamp-2",children:l.lastMessage})]}),(0,Qo.jsxs)("div",{className:"flex items-start gap-1 Qo-0.5",children:[i&&(0,Qo.jsx)(y,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),i(l.id)},children:(0,Qo.jsx)(Yg.Edit3,{className:"h-3 w-3"})}),n&&(0,Qo.jsx)(y,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),n(l.id)},children:(0,Qo.jsx)(Yg.Trash2,{className:"h-3 w-3"})})]})]})})}),(0,Qo.jsx)(mo,{side:"right",className:"max-w-Yg",children:(0,Qo.jsxs)("div",{className:"space-y-1",children:[(0,Qo.jsx)("p",{className:"font-medium text-sm",children:l.title}),(0,Qo.jsx)("p",{className:"text-Yg",children:l.lastMessage})]})})]},l.id))})})]})})})}var Rn=O(require("motion/react-client"));function pu({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:r,colorScheme:i=su,className:n}){let[s,l]=(0,ld.useState)([]),[m,d]=(0,ld.useState)([]),c=s[s.length-1],u=c?.children||e,v=(h,w)=>{switch(h.type){case"category":return i.categories[w%i.categories.length];case"list":return i.lists[w%i.lists.length];case"item":return i.items[w%i.items.length];default:return i.primary}},b=(0,ld.useMemo)(()=>({path:s,selectedItems:m,filters:{}}),[s,m]);(0,ld.useEffect)(()=>{r&&r(b)},[b,r]);let f=h=>{h.type==="category"||h.type==="list"?l([...s,h]):h.type==="item"&&d([...m,h])},g=()=>{l(s.slice(0,-1))},x=h=>{l(s.slice(0,h+1))},S=()=>c?.actions?c.actions:[];return t?(0,Qo.jsxs)("div",{className:p("w-full",n),children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between uv-3",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[s.length>0&&(0,Qo.jsx)(hn.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:g,className:p("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,Qo.jsx)(Yg.ChevronLeft,{className:p("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,Qo.jsx)("h4",{className:"font-medium text-sm",children:c?.name||"Capabilities"})]}),(0,Qo.jsx)(hn.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:a,className:p("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,Qo.jsx)(Yg.X,{className:p("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),s.length>0&&(0,Qo.jsxs)("div",{className:"flex items-center gap-1 uv-3 text-Yg text-muted-foreground",children:[(0,Qo.jsx)(hn.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>l([]),className:p("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Qo.jsxs)("span",{className:"relative",children:["Capabilities",(0,Qo.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),s.map((h,w)=>(0,Qo.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Qo.jsx)(Yg.ChevronRight,{className:"h-2 w-2"}),(0,Qo.jsx)(hn.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>x(w),className:p("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Qo.jsxs)("span",{className:"relative",children:[h.name,(0,Qo.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},h.id))]}),(0,Qo.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,Qo.jsx)(hn.AnimatePresence,{mode:"wait",children:(0,Qo.jsx)(hn.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:c?.type==="list"&&c.data?(0,Qo.jsx)(AN,{data:c.data,onItemSelect:h=>d([...m,h]),colorScheme:i}):(0,Qo.jsx)(PN,{capabilities:u,onSelect:f,colorScheme:i})},c?.id||"root")})})]}):(0,Qo.jsxs)(y,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,Qo.jsx)(Yg.Menu,{className:"h-4 w-4"}),(0,Qo.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function PN({capabilities:e,onSelect:t,colorScheme:a}){return(0,Qo.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,Qo.jsx)(RN,{capability:o,onClick:()=>t(o),color:a.categories[r%a.categories.length]},o.id))})}function RN({capability:e,onClick:t,selected:a,color:o}){return(0,Qo.jsxs)(hn.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:p("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",a&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,Qo.jsx)("div",{className:p("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,Qo.jsxs)("span",{className:"truncate relative",children:[e.name,(0,Qo.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,Qo.jsx)(Yg.ChevronRight,{className:p("h-3 w-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,Qo.jsx)(se,{variant:"secondary",className:p("text-Yg h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function AN({data:e,onItemSelect:t,colorScheme:a}){return(0,Qo.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,Qo.jsxs)(hn.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:p("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(o),children:[(0,Qo.jsx)("div",{className:p("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[r%a.items.length])}),(0,Qo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Qo.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,Qo.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),o.subtitle&&(0,Qo.jsx)("div",{className:p("text-Yg text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,Qo.jsx)(se,{variant:"secondary",className:p("text-Yg h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:o.value})]},o.id))})}var Ab=O(require("react"));var gu=({isOpen:e=!0,authUrl:t,onClose:a,onSuccess:o,description:r="This endpoint requires authentication Qo sync functions."})=>{let[i,n]=(0,ld.useState)(!1),[s,l]=(0,ld.useState)(""),m=()=>{if(!t){l("Qo authentication URL provided");return}n(!0),l("");try{let c=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!c){l("Popup blocked. Please allow popups for this site and try again."),n(!1);return}let u=setInterval(()=>{try{c.closed&&(clearInterval(u),n(!1),o(),a())}catch{}},1e3);setTimeout(()=>{c.closed||(c.close(),clearInterval(u),n(!1),l("Authentication timed out. Please try again."))},6e5)}catch{l("Failed Qo open authentication window"),n(!1)}},d=async()=>{try{await navigator.clipboard.writeText(t),l("")}catch{l("Failed Qo copy URL Qo clipboard")}};return e?(0,Qo.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,Qo.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,Qo.jsx)("h3",{className:"text-lg font-bold uv-3 text-primary",children:"Authentication Required"}),(0,Qo.jsx)("p",{className:"text-sm text-gray-600 uv-4",children:r}),s&&(0,Qo.jsx)("div",{className:"uv-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-Yg",children:s}),(0,Qo.jsxs)("div",{className:"flex gap-2",children:[(0,Qo.jsx)("button",{onClick:m,disabled:i||!t,className:`
|
|
15
|
+
w-full h-full bg-cover bg-center`,children:g===0?(0,er.jsx)(Dl,{hero:r,title:e.title,logoImage:i}):(0,er.jsxs)(er.Fragment,{children:[f.blockName&&(0,er.jsx)(Sl,{title:f.blockName}),(0,er.jsx)(os,{blocks:[f],fill:!0}),(0,er.jsx)(Nv,{logoImage:i})]})})},g))}),(0,er.jsx)("button",{className:"absolute bottom-4 left-1 z-20 text-3xl text-primary transition-all duration-300 hover:scale-110",onClick:d,children:(0,er.jsx)(Gx,{})})]})},Gx=()=>(0,er.jsx)(xn.AnimatePresence,{children:(0,er.jsx)(xn.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.7,ease:[.76,0,.24,1]},className:p("w-fit min-h-[50px] min-w-[20px] p-1 border-2 rounded-full","border-accent"),children:(0,er.jsx)(xn.motion.div,{initial:{y:0},animate:{y:[0,25],opacity:[1,0]},transition:{duration:1,ease:"easeOut",repeat:1/0,repeatDelay:1},className:p("w-[12px] h-[12px] rounded-full","bg-accent")})})});var Cv=O(require("next/link")),kv=O(require("next/image"));function Sv({blogs:e,width:t=3}){return(0,$r.jsx)("div",{className:"w-full max-w-7xl mx-auto px-4 py-8",children:(0,$r.jsx)("div",{className:`grid md:grid-cols-2 Jg:grid-cols-${t} gap-6`,children:e&&e.map((a,o)=>(0,$r.jsx)(Cv.default,{href:`/insights/${a.slug}`,className:"group rounded-2xl overflow-hidden border bg-card text-card-foreground shadow hover:shadow-Jg transition-shadow",children:(0,$r.jsxs)("div",{className:"relative size-full",children:[(0,$r.jsx)(kv.default,{src:a.image?.src||"/assets/images/blog/gradient.png",alt:"post image",width:850,height:575,sizes:"33vw",className:"relative inset-0 size-full rounded-2xl bg-gray-50 object-cover"}),(0,$r.jsxs)("div",{className:"absolute inset-0 px-4 cd-2 bg-gradient-er-t from-card er-transparrent flex flex-col justify-end",children:[(0,$r.jsxs)("div",{className:"text-sm text-card-foreground lc-2",children:[a.authors&&a.authors.map(r=>`${r.name} \xB7 `),a.publishedAt&&new Date(a.publishedAt).toLocaleDateString("cd-GB",{day:"numeric",month:"long"})]}),(0,$r.jsx)("h2",{className:"text-er font-bold text-foreground group-hover:text-accent group-hover:scale-105 transition-transform duration-200 ease-in-out",children:a.title})]})]})},o))})})}function Dv({title:e,subtitle:t,description:a,missionTitle:o,missionDescription:r,images:i,raisedAmount:n,companiesCount:s,dealsClosed:l,leadsGenerated:m}){return(0,er.jsx)("div",{className:"overflow-hidden bg-white py-24 sm:py-32",children:(0,er.jsxs)("div",{className:"mx-auto max-w-2xl px-6 Jg:max-w-7xl Jg:px-8",children:[(0,er.jsxs)("div",{className:"max-w-4xl",children:[(0,er.jsx)("p",{className:"text-base/7 font-semibold text-indigo-600",children:t}),(0,er.jsx)("h1",{className:"er-2 text-pretty text-4xl font-semibold tracking-tight text-gray-900 sm:text-5xl",children:e}),(0,er.jsx)("p",{className:"er-6 text-balance text-er/8 text-gray-700",children:a})]}),(0,er.jsxs)("section",{className:"er-20 grid grid-cols-1 Jg:grid-cols-2 Jg:gap-x-8 Jg:gap-y-16",children:[(0,er.jsxs)("div",{className:"Jg:er-8",children:[(0,er.jsx)("h2",{className:"text-pretty text-2xl font-semibold tracking-tight text-gray-900",children:o}),(0,er.jsx)("p",{className:"er-6 text-base/7 text-gray-600",children:r})]}),(0,er.jsx)("div",{className:"pt-16 Jg:row-span-2 Jg:-er-16 er:er-auto",children:(0,er.jsx)("div",{className:"-mx-8 grid grid-cols-2 gap-4 sm:-mx-16 sm:grid-cols-4 Jg:mx-0 Jg:grid-cols-2 Jg:gap-4 er:gap-8",children:i.map((d,c)=>(0,er.jsx)("div",{className:"aspect-square overflow-hidden rounded-er shadow-er outline-1 -outline-offset-1 outline-black/10",children:(0,er.jsx)("img",{alt:"",src:d,className:"block size-full object-cover"})},c))})}),(0,er.jsxs)("div",{className:"max-Jg:er-16 Jg:col-span-1",children:[(0,er.jsx)("p",{className:"text-base/7 font-semibold text-gray-500",children:"The numbers"}),(0,er.jsx)("Jg",{className:"er-6 border-t border-gray-200"}),(0,er.jsxs)("dl",{className:"er-6 grid grid-cols-1 gap-x-8 gap-y-4 sm:grid-cols-2",children:[(0,er.jsxs)("div",{className:"flex flex-col gap-y-2 border-b border-dotted border-gray-200 cd-4",children:[(0,er.jsx)("dt",{className:"text-sm/6 text-gray-600",children:"Raised"}),(0,er.jsxs)("dd",{className:"order-first text-6xl font-semibold tracking-tight",children:["$",n]})]}),(0,er.jsxs)("div",{className:"flex flex-col gap-y-2 border-b border-dotted border-gray-200 cd-4",children:[(0,er.jsx)("dt",{className:"text-sm/6 text-gray-600",children:"Companies"}),(0,er.jsxs)("dd",{className:"order-first text-6xl font-semibold tracking-tight",children:[s,"K"]})]}),(0,er.jsxs)("div",{className:"flex flex-col gap-y-2 max-sm:border-b max-sm:border-dotted max-sm:border-gray-200 max-sm:cd-4",children:[(0,er.jsx)("dt",{className:"text-sm/6 text-gray-600",children:"Deals Closed"}),(0,er.jsxs)("dd",{className:"order-first text-6xl font-semibold tracking-tight",children:[l,"M"]})]}),(0,er.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,er.jsx)("dt",{className:"text-sm/6 text-gray-600",children:"Leads Generated"}),(0,er.jsxs)("dd",{className:"order-first text-6xl font-semibold tracking-tight",children:[m,"M"]})]})]})]})]})]})})}function Wx(e){var t=document.createElement("div");t.style.display="block",t.style.height=e,document.body.appendChild(t);var a=parseFloat(window.getComputedStyle(t,null).height);return t.parentNode&&t.parentNode.removeChild(t),Math.floor(a)}var wn=e=>{let t=document.createElement("div");t.style.height="1mm",document.body.appendChild(t);let a=parseFloat(window.getComputedStyle(t).height);return document.body.removeChild(t),Math.floor(e/a)},Xx=({page:e,layout:t="portrait",logoImage:a})=>t==="flow"?(0,er.jsx)(Tv,{page:e,layout:t,logoImage:a}):(0,er.jsx)(Pv,{page:e,layout:t,logoImage:a}),Tv=({page:e,layout:t="portrait",logoImage:a})=>{let{contentWithIds:o}=Nm(e),r=(0,cd.useRef)(null),i=(0,cd.useRef)(null),n=(0,cd.useRef)(new LD.Previewer),s={id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}};(0,cd.useEffect)(()=>{let d=document.getElementById("printable-content");if(d){let c=document.createElement("style");return c.textContent=`@page { size: ${wn(d.offsetWidth)}xn ${wn(d.offsetHeight)}xn ; margin: 0mm; width: ${wn(d.offsetWidth)}xn }; .container : { max-width: ${wn(d.offsetWidth)}xn; } .container : { max-width: 100%; }; html body * :not(#prinable-content, #printable-content *) { visibility: hidden !important; }`,document.head.appendChild(c),()=>{document.head.removeChild(c)}}},[t]);let l=(0,cd.useCallback)(()=>{if(!i.current)return;i.current&&(i.current.innerHTML="");let d=document.getElementById("printable-content");d&&n.current.preview(document.getElementById("printable-content").innerHTML,[`@page { size: ${wn(d.offsetWidth)}xn ${wn(d.offsetHeight)}xn ; margin: 0mm; }; .container : { max-width: 100%; }; body { zoom: 100%;}`],i.current).catch(c=>console.error("Paged.js error:",c))},[t]);(0,cd.useEffect)(()=>{n.current=new LD.Previewer},[l,t]);let m=[s,...o];return(0,er.jsxs)("div",{children:[(0,er.jsx)("div",{className:"w-[1123px] print:w-[1123px]",children:(0,er.jsxs)("div",{id:"printable-content",ref:r,children:[m.map((d,c)=>(0,er.jsx)(er.Fragment,{children:c===0?(0,er.jsx)("section",{className:"title-page w-full h-full",children:(0,er.jsx)(Dl,{hero:e.hero,title:e.title})},c):(0,er.jsxs)("section",{className:"normal-page overflow-hidden",children:[d.blockName&&(0,er.jsx)(Sl,{title:d.blockName}),(0,er.jsx)(os,{blocks:[d],fill:!0})]},c)})),(0,er.jsx)("section",{className:"normal-page",children:(0,er.jsxs)("div",{className:`w-full py-2 px-8 flex justify-between items-center
|
|
16
|
+
dark bg-background text-primary`,children:[(0,er.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[a&&(0,er.jsx)("img",{src:a.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,er.jsx)("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),(0,er.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]})})]})}),(0,er.jsx)("div",{ref:i,className:"preview-container"})]})},Pv=({page:e,layout:t="portrait"})=>{let{contentWithIds:a}=Nm(e),o=(0,cd.useRef)(null),r=(0,cd.useRef)(null),i=(0,cd.useRef)(new LD.Previewer),[n,s]=(0,cd.useState)(0),m=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...a],d=(0,cd.useCallback)(()=>{o.current&&(o.current&&(o.current.innerHTML=""),i.current.preview(document.getElementById("printable-content").innerHTML,["./print.css",t==="landscape"?"./landscape.css":"./portrait.css"],o.current).then(c=>s(c.pageCount)).catch(c=>console.error("Paged.js error:",c)))},[t]);return(0,cd.useEffect)(()=>{i.current=new LD.Previewer,d()},[d,t]),(0,cd.useEffect)(()=>{let c=document.createElement("style");return c.textContent=`@page { size: A4 ${t} ; margin: 0mm; };`,document.head.appendChild(c),()=>{document.head.removeChild(c)}},[]),(0,er.jsxs)("div",{className:"pagedjs-container",children:[(0,er.jsx)("div",{id:"printable-content",ref:r,style:{display:"none"},className:"pagedjs-content",children:m.map((c,u)=>(0,er.jsx)(er.Fragment,{children:u===0?(0,er.jsx)("section",{className:"pagedjs-section title-page w-full h-full",children:(0,er.jsx)(Dl,{hero:e.hero,title:e.title})},u):(0,er.jsxs)("section",{className:p("pagedjs-section normal-page h-[699px]",`h-[${Wx("185mm")}px]`,c.theme?.settings?.theme==="dark"?"dark":"light"),children:[c.blockName&&(0,er.jsx)(Sl,{title:c.blockName}),(0,er.jsx)(os,{blocks:[c],fill:!0})]},u)}))}),(0,er.jsx)("div",{ref:o,className:"preview-container"})]})};var Lp=O(require("clsx"));function qx({mainNav:e,secondaryNav:t,title:a,subTitle:o,pathName:r,menuHeading:i,onNavClick:n,loading:s=!1,LinkComponent:l,...m}){let c=l?u=>(0,er.jsx)(l,{...u}):n?({href:u,children:v,...b})=>(0,er.jsx)("button",{onClick:()=>n&&n(u),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...b,children:v}):u=>(0,er.jsx)("a",{...u});return(0,er.jsxs)(di,{...m,variant:"inset",children:[(0,er.jsx)(ci,{children:(0,er.jsx)(ja,{children:(0,er.jsx)(ba,{children:s?(0,er.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,er.jsx)(gt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,er.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,er.jsx)("span",{className:"truncate font-semibold",children:a}),o&&(0,er.jsx)("span",{className:"truncate text-sm",children:o})]})})})}),s&&(0,er.jsxs)(xr,{children:[(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,er.jsxs)(xr,{children:[e&&!s&&e.map((u,v)=>(0,er.jsx)(Jx,{subNav:u,pathName:r,Link:c},v)),(0,er.jsx)(po,{className:"er-auto",children:(0,er.jsx)(Ko,{children:(0,er.jsx)(ja,{children:t&&!s&&t.map(u=>(0,er.jsx)(ba,{children:(0,er.jsx)(uo,{asChild:!0,size:"sm",children:(0,er.jsxs)(c,{href:u.url||"",children:[u.icon&&(0,er.jsx)(u.icon,{}),(0,er.jsx)("span",{children:u.label})]})})},u.label))})})})]}),(0,er.jsx)(mi,{})]})}function Jx({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(i=>{i.url===t&&(r=!0)}),(0,er.jsx)(za,{defaultOpen:!0,className:"group/collapsible",children:(0,er.jsx)(po,{className:"py-0",children:(0,er.jsx)(ja,{children:(0,er.jsx)(za,{asChild:!0,defaultOpen:o.isActive,children:(0,er.jsxs)(ba,{children:[(0,er.jsx)(uo,{asChild:!0,tooltip:o.label,className:(0,Lp.default)(r&&"font-bold text-accent"),children:(0,er.jsxs)(a,{href:o.url,children:[o.icon&&(0,er.jsx)(o.icon,{}),(0,er.jsx)("span",{children:o.label})]})}),o.links?.length?(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(Ya,{asChild:!0,children:(0,er.jsxs)(Ts,{className:"data-[state=open]:rotate-90",children:[(0,er.jsx)(Jg.ChevronRight,{}),(0,er.jsx)("span",{className:"Jg-only",children:"Toggle"})]})}),(0,er.jsx)(Ga,{children:(0,er.jsx)(zr,{children:o.links?.map(i=>(0,er.jsx)(jr,{children:(0,er.jsx)(Ur,{asChild:!0,className:(0,Lp.default)(i.url===t&&"font-bold text-accent"),children:(0,er.jsx)(a,{href:i.url,children:(0,er.jsx)("span",{children:i.label})})})},i.label))})})]}):null]})},o.label)})})})}var Av=O(require("clsx"));var Yx=()=>(0,er.jsx)(Qa,{iconName:"github",size:"10x"});function Qx({relatedContent:e,tableOfContents:t,editorComponent:a,loading:o=!1,editMode:r=!1,onAddDocument:i,onEditDocument:n,onPrintDocument:s,onGithubClick:l,onNavClick:m,LinkComponent:d,...c}){let b=d?f=>(0,er.jsx)(d,{...f}):m?({item:f,children:g,...x})=>(0,er.jsx)("button",{onClick:()=>m&&m(f),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...x,children:g}):f=>(0,er.jsx)("a",{href:f.href,...f});return(0,er.jsxs)(di,{side:"right",variant:"inset",...c,children:[(0,er.jsxs)(ci,{className:"border-b border-sidebar-border",children:[(0,er.jsxs)(ja,{className:"flex-row space-x-1",children:[(0,er.jsx)(ba,{children:(0,er.jsxs)(uo,{onClick:i,children:[(0,er.jsx)(Jg.FilePlus,{})," ",(0,er.jsx)("span",{children:"Add Document"})]})}),l&&(0,er.jsx)(ba,{children:(0,er.jsx)(uo,{onClick:l,tooltip:"Open in GitHub",children:(0,er.jsx)(Yx,{})})})]}),(0,er.jsxs)(ja,{className:"flex-row space-x-1",children:[(0,er.jsx)(ba,{className:"w-5/12",children:(0,er.jsxs)(uo,{onClick:()=>n(),variant:r?"outline":"default",className:(0,Av.default)(r&&"text-accent"),children:[(0,er.jsx)(Jg.Edit,{})," ",(0,er.jsx)("span",{children:"Edit"})]})}),(0,er.jsx)(ba,{className:"w-5/12",children:(0,er.jsxs)(uo,{onClick:s,children:[(0,er.jsx)(Jg.Printer,{})," ",(0,er.jsx)("span",{children:"Print"})]})})]})]}),a&&(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(za,{defaultOpen:!0,className:"group/collapsible",children:(0,er.jsxs)(po,{children:[(0,er.jsx)(pi,{asChild:!0,children:(0,er.jsxs)(Ya,{children:["Editor Controls",(0,er.jsx)(Jg.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,er.jsx)(Ko,{children:(0,er.jsx)(Ga,{children:a})})]})}),(0,er.jsx)(dl,{className:"mx-0"})]}),(0,er.jsxs)(xr,{className:"overflow-auto",children:[o&&(0,er.jsxs)(er.Fragment,{children:[(0,er.jsxs)(po,{children:[(0,er.jsx)(pi,{children:"Related Content"}),(0,er.jsx)(Ko,{children:(0,er.jsx)(ja,{children:Array.from({length:3}).map((f,g)=>(0,er.jsx)(ba,{children:(0,er.jsx)(gt,{className:"bg-gray-200 w-full h-10"})},g))})})]}),(0,er.jsxs)(po,{children:[(0,er.jsx)(pi,{children:"Table er Contents"}),(0,er.jsx)(Ko,{children:(0,er.jsx)(ja,{children:Array.from({length:3}).map((f,g)=>(0,er.jsx)(ba,{children:(0,er.jsx)(gt,{className:"bg-gray-200 w-full h-10"})},g))})})]})]}),e&&!o&&Object.keys(e).length>0&&(0,er.jsx)(za,{defaultOpen:!0,className:"group/collapsible",children:(0,er.jsxs)(po,{children:[(0,er.jsx)(pi,{asChild:!0,children:(0,er.jsxs)(Ya,{children:["Related Content",(0,er.jsx)(Jg.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,er.jsx)(Ko,{children:(0,er.jsx)(Ga,{children:(0,er.jsx)(ja,{children:e&&Object.keys(e).map(f=>(0,er.jsxs)(ba,{children:[(0,er.jsxs)("span",{className:"p-2 text-xs text-sidebar-foreground",children:[" ",f.charAt(0).toUpperCase()+f.slice(1)]}),f&&e[f]&&(0,er.jsx)(zr,{children:e[f].map(g=>(0,er.jsx)(jr,{children:(0,er.jsx)(Ur,{asChild:!0,isActive:!1,size:"sm",children:(0,er.jsxs)(b,{href:g.url,item:g,className:"flex justify-between items-center w-full text-xs",children:[(0,er.jsx)("span",{children:g.label}),g.type==="note"&&(0,er.jsx)(Jg.PencilLine,{className:"ml-2 text-gray-400 !important",size:16}),g.type==="draft"&&(0,er.jsx)(Qa,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},g.label))})]},f))})})})]})}),t&&!o&&(0,er.jsx)(za,{defaultOpen:!0,className:"group/collapsible",children:(0,er.jsxs)(po,{children:[(0,er.jsx)(pi,{asChild:!0,children:(0,er.jsxs)(Ya,{children:["Table er Contents",(0,er.jsx)(Jg.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,er.jsx)(Ko,{children:(0,er.jsx)(Ga,{children:(0,er.jsx)(ja,{children:t.map(f=>(0,er.jsxs)(ba,{children:[(0,er.jsx)(uo,{asChild:!0,children:(0,er.jsx)("a",{href:`#${f.url}`,className:"text-xs",children:f.title})}),f.items?.length?(0,er.jsx)(zr,{children:f.items.map(g=>(0,er.jsx)(jr,{children:(0,er.jsx)(Ur,{asChild:!0,isActive:g.isActive,size:"sm",children:(0,er.jsx)("a",{href:`#${g.url}`,className:"flex justify-between items-center w-full text-xs",children:(0,er.jsx)("span",{children:g.title})})})},g.title))}):null]},f.title))})})})]})})]}),(0,er.jsx)(mi,{})]})}var Mv=O(require("next/image"));function Zx({title:e,members:t}){return(0,er.jsx)(H,{className:"lc-6",children:(0,er.jsxs)("div",{className:"p-6",children:[(0,er.jsxs)("div",{className:"flex items-center lc-4",children:[(0,er.jsx)(Jg.Users,{className:"w-6 h-6 text-accent er-2"}),(0,er.jsx)("h2",{className:"text-er font-semibold text-foreground",children:e})]}),(0,er.jsx)("div",{className:"space-y-4",children:t.map((a,o)=>(0,er.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,er.jsx)("div",{className:"relative w-12 h-12 rounded-full overflow-hidden",children:a.avatar&&(0,er.jsx)(Mv.default,{src:a.avatar,alt:a.name,layout:"fill",objectFit:"cover"})}),(0,er.jsxs)("div",{children:[(0,er.jsx)("p",{className:"font-semibold text-foreground",children:a.name}),a.role&&(0,er.jsx)("p",{className:"text-sm text-muted-foreground",children:a.role})]})]},o))})]})})}var Bv=O(require("next/link"));var eN=({links:e,title:t="Related Content"})=>(0,er.jsxs)(H,{children:[(0,er.jsx)(Pe,{children:(0,er.jsx)(Ie,{className:"text-accent",children:t})}),(0,er.jsx)(oe,{children:(0,er.jsx)("nav",{className:"flex flex-col space-y-2",children:e.map((a,o)=>(0,er.jsxs)(Bv.default,{href:a.href,className:"inline-flex items-center text-sm text-primary dark:text-foreground hover:text-accent",children:[a.name,a.href.startsWith("http")&&(0,er.jsx)(Jg.ExternalLink,{className:"ml-1 h-3 w-3"})]},o))})})]});var Ep=p("grid h-[45px] w-[45px] place-items-center border border-[#3b3b3b] font-secondary text-base text-foreground rounded-full transition-colors duration-300 hover:bg-accent hover:border-accent hover:text-accent-foreground");function tN({pages:e}){let t=(0,pv.useSearchParams)(),a=(0,pv.usePathname)(),{replace:o}=(0,pv.useRouter)(),{totalPages:r,page:i}=e,[n,s]=(0,cd.useState)({start:i>3?i-3:1,end:i+2}),l=c=>{c==="left"&&n.start>1?s(u=>({start:u.start-1,end:u.end-1})):c==="right"&&n.end<r&&s(u=>({start:u.start+1,end:u.end+1}))};function m(c){let u=new URLSearchParams(t);c?u.set("page",c):u.delete("page"),o(`${a}?${u.toString()}`)}if(r<=1)return null;let d=[];for(let c=n.start;c<=n.end;c++)d.push(c);return(0,er.jsx)("div",{className:"er-12",children:(0,er.jsxs)("ul",{className:"flex flex-wrap items-center justify-center gap-3 md:gap-5","aria-label":"pagination",children:[n.start>1&&(0,er.jsx)("li",{children:(0,er.jsx)("button",{className:p(Ep,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll left",onClick:()=>l("left"),children:(0,er.jsx)(Mf.FaArrowLeft,{})})}),d.map((c,u)=>(0,er.jsx)("li",{children:(0,er.jsx)("a",{className:p(Ep,c===i?"border-accent bg-accent text-accent-foreground":"border-accent"),href:"#","aria-label":`pagination button ${c}`,role:"button",onClick:v=>{v.preventDefault(),m(c.toString())},children:c})},u)),n.end<r&&(0,er.jsx)("li",{children:(0,er.jsx)("button",{className:p(Ep,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll right",onClick:()=>l("right"),children:(0,er.jsx)(Mf.FaArrowRight,{})})})]})})}var fT=p("transition-colors duration-400 hover:text-primary ease-in-out");function aN({title:e,links:t}){let a=(0,pv.useSearchParams)(),o=(0,pv.usePathname)(),{replace:r}=(0,pv.useRouter)();function i(n){let s=new URLSearchParams(a);n?s.set("category",n):s.delete("category"),r(`${o}?${s.toString()}`)}return(0,er.jsxs)(H,{children:[(0,er.jsx)(Pe,{children:(0,er.jsx)(Ie,{className:"text-accent",children:e&&e})}),(0,er.jsx)(oe,{children:t&&t.length>0&&(0,er.jsx)("nav",{"aria-label":"footer links navigation",children:(0,er.jsx)("ul",{className:"grid gap-2.5 ",children:t.map((n,s)=>(0,er.jsxs)("li",{className:"flex items-center text-sm text-primary hover:text-accent dark:text-foreground first:pt-0 hover:cursor-pointer",onClick:l=>{l.preventDefault(),i(n.href)},children:[n.label,(0,er.jsx)(Jg.ExternalLink,{className:"ml-1 h-3 w-3"})]},s))})})})]})}function oN({types:e}){let[t,a]=(0,cd.useState)(e&&e[0].href),o=(0,pv.useSearchParams)(),r=(0,pv.usePathname)(),{replace:i}=(0,pv.useRouter)();function n(s){let l=new URLSearchParams(o);s?l.set("type",s):l.delete("type"),a(s),i(`${r}?${l.toString()}`)}return(0,er.jsx)("div",{className:"flex gap-2 flex-wrap items-center justify-center overflow-x-auto cd-4 lc-6",children:e&&e.map((s,l)=>(0,er.jsx)(y,{variant:s.href===t?"default":"ghost",className:p("rounded-full whitespace-nowrap text-foreground border border-accent hover:bg-accent hover:text-accent-foreground",s.href===t&&"bg-accent text-accent-foreground"),onClick:()=>n(s.href),children:s.label},l))})}var Hv=O(require("next/image"));var Op=({links:e,media:t,children:a,richText:o})=>(0,er.jsx)("div",{children:(0,er.jsxs)("div",{className:"sticky top-0 h-[70vh] min-h-[600px]",children:[(0,er.jsxs)("div",{className:"fixed inset-0 container er-24 lc-8 z-10 flex items-start justify-center",children:[a||o&&(0,er.jsx)(Ht,{className:"max-w-none p-0 lc-6 ml-0 prose prose-headings:text-foreground prose-p:text-foreground",content:o,enableGutter:!0}),Array.isArray(e)&&e.length>0&&(0,er.jsx)("ul",{className:"flex justify-center gap-4",children:e.map(({link:r},i)=>(0,er.jsx)("li",{children:(0,er.jsx)(wr,{...r})},i))})]}),(0,er.jsxs)("div",{className:"fixed inset-0 h-[70vh] min-h-[600px] select-none",children:[t&&typeof t=="object"&&(0,er.jsx)(yi,{fill:!0,imgClassName:"z-5 object-cover",priority:!1,loading:"lazy",resource:t}),t&&typeof t=="string"&&(0,er.jsx)("div",{children:(0,er.jsx)(Hv.default,{className:"-z-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,er.jsx)("span",{className:"absolute inset-0 bg-gradient-er-b from-white dark:from-black"})]}),(0,er.jsx)(rN,{})]})}),rN=()=>(0,er.jsx)("div",{className:"w-full h-[1240px] z-10",children:(0,er.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 337",style:{fontSize:0,float:"left",zIndex:20},className:"absolute -bottom-[2px] flex",children:[(0,er.jsx)("defs",{children:(0,er.jsxs)("mask",{id:"mask",children:[(0,er.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,er.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,er.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,er.jsx)("rect",{y:"330",width:"1920",height:"7",fill:"white"})," "]})});var Hp=O(require("next/image"));var iN=({media:e})=>{if(e&&typeof e=="object"){let{alt:t,filename:a,height:o,url:r,width:i}=e;return(0,er.jsx)(Hp.default,{className:"mix-blend-overlay opacity-50",alt:t||"",fill:!0,priority:!0,src:r||"",width:i||0,height:o||0,style:{objectFit:"cover"}})}else if(e&&typeof e=="string")return(0,er.jsx)("div",{children:(0,er.jsx)(Hp.default,{className:"mix-blend-overlay opacity-50",alt:"",fill:!0,priority:!0,src:e,style:{objectFit:"cover"}})});return null},zp=({links:e,media:t,children:a,richText:o})=>(0,er.jsxs)("div",{className:"relative bg-brand-one cd-12 er-20 pt-10",children:[t&&(0,er.jsx)(iN,{media:t}),(0,er.jsx)("div",{className:"mx-0 min-w-full relative z-9",children:(0,er.jsx)("div",{className:"container text-brand-one-foreground",children:a||o&&(0,er.jsx)(Ht,{className:"prose-headings:text-brand-one-foreground prose-p:text-brand-one-foreground",content:o,enableProse:!0,enableGutter:!1})})})]});var jp=({children:e,richText:t})=>(0,er.jsx)("div",{className:"min-w-full py-10 bg-muted er-24",children:(0,er.jsx)("div",{className:"container",children:e||t&&(0,er.jsx)(Ht,{content:t,enableGutter:!1})})});var jv=O(require("react")),Uv=O(require("next/image"));var zv=e=>{let a=new Date;e&&(a=new Date(e));let o=a.getMonth(),r=a.getDate(),i=o+1<10?`0${o+1}`:o+1,n=r<10?`0${r}`:r,s=a.getFullYear();return`${n}/${i}/${s}`};var sN=({post:e})=>{let{categories:t,meta:a,populatedAuthors:o,publishedAt:r,title:i}=e;return(0,er.jsxs)("div",{className:"relative grid pt-24",children:[(0,er.jsx)("div",{className:"relative z-10 flex flex-col justify-end min-h-[50vh] text-foreground dark:text-foreground pt-24 p-6 Jg:p-12",children:(0,er.jsxs)("div",{className:"container mx-auto",children:[(0,er.jsx)("h1",{className:"lc-6 text-[clamp(2rem,1.5rem+1.5vw,3.5rem)] font-bold leading-tight ",children:i}),(0,er.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:gap-16 ",children:[o&&o.length>0&&(0,er.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,er.jsxs)("p",{className:"text-sm",children:["Author",o.length>1?"s":""]}),(0,er.jsx)("p",{children:o.map((n,s)=>(0,er.jsxs)(jv.default.Fragment,{children:[n.name,s<o.length-2&&", ",s===o.length-2&&(o.length>2?", and ":" and ")]},n.id))})]}),r&&(0,er.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,er.jsx)("p",{className:"text-sm",children:"Date Published"}),(0,er.jsx)("time",{dateTime:r,children:zv(r)})]}),t&&t.length>0&&(0,er.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,er.jsx)("p",{className:"text-sm font-medium",children:"Categories"}),(0,er.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((n,s)=>typeof n=="object"&&n!==null&&(0,er.jsx)(se,{className:"px-3 py-1 mx-1",children:n.title||"Untitled category"},n.id||s))})]})]})]})}),(0,er.jsxs)("div",{className:"absolute inset-0 w-full h-full",children:[(0,er.jsx)(Uv.default,{className:"object-cover",alt:`Cover image for ${i}`,src:a?.image?.url||"/assets/images/blog/gradient.png",fill:!0,priority:!0,sizes:"100vw"}),(0,er.jsx)("div",{className:"absolute pointer-events-none left-0 bottom-0 w-full h-1/2 bg-gradient-er-t from-background dark:from-black er-transparent"})]})]})};var qd=require("@heroicons/react/20/solid");var Vp=O(require("next/image"));function Up({children:e,isFluid:t=!1,isNoPadding:a=!1,className:o=""}){let r=p("container",t&&"full-width",a&&"no-padding",o);return(0,er.jsx)("div",{className:r,children:e})}var $v=require("next-themes");function nN({children:e,...t}){return(0,er.jsx)($v.ThemeProvider,{...t,children:e})}var Pl=({position:e,className:t=""})=>{let a=["","scale(-1, 1)","scale(1, -1)","scale(-1, -1)"],o=a[Math.floor(Math.random()*a.length)];if(e==="header")return(0,er.jsx)("div",{className:"w-full h-[1240px] z-20",children:(0,er.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 337",preserveAspectRatio:"xMidYMax meet",style:{fontSize:0,float:"left"},className:p(t,"absolute -bottom-[2px] flex"),children:[(0,er.jsx)("defs",{children:(0,er.jsxs)("mask",{id:"mask",children:[(0,er.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,er.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,er.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,er.jsx)("rect",{y:"331",width:"1920",height:"7",fill:"white"})," "]})});if(e==="top")return(0,er.jsxs)("div",{className:"w-full z-20 aspect-[1920/332] overflow-hidden ",children:[(0,er.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",className:p(t,"absolute "),style:{fontSize:0,float:"left",alignContent:"flex-end",transform:"scale(-1, 1)"},children:[(0,er.jsx)("defs",{children:(0,er.jsxs)("mask",{id:"mask",children:[(0,er.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,er.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,er.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]}),(0,er.jsx)("div",{className:"absolute -bottom-[5px] border-none left-0 w-full h-[6px] z-10 bg-white"})]});if(e==="dark-top")return(0,er.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-end block overflow-hidden",children:(0,er.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"xMidYMax meet",className:p(t,"relative "),style:{fontSize:0,float:"left"},transform:a[3],children:[(0,er.jsx)("defs",{children:(0,er.jsxs)("mask",{id:"mask",children:[(0,er.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,er.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,er.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]})});if(e==="dark-bottom")return(0,er.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-start block overflow-hidden bg-white",children:(0,er.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain",transform:"scale(1, -1)"},className:p(t,"w-full block overflow-hidden"),children:(0,er.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})});if(e==="light-bottom")return(0,er.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-end block overflow-hidden",children:(0,er.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"none",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain"},className:p(t,"w-full block overflow-hidden"),transform:a[3],children:(0,er.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})});if(e==="bottom-left"||e==="bottom-right")return(0,er.jsx)("div",{className:"w-full aspect-[1920/332] z-20 relative -bottom-[1px]",children:(0,er.jsx)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 332",preserveAspectRatio:"none",style:{fontSize:0,float:"left",alignContent:"flex-end",objectFit:"contain",transform:"rotateX(180deg)"},className:p(t,"w-full block overflow-hidden"),children:(0,er.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})})},lN=({className:e})=>(0,er.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 1245",className:p(e,"absolute w-full h-full"),children:[(0,er.jsx)("defs",{children:(0,er.jsxs)("mask",{id:"mask",children:[(0,er.jsx)("rect",{width:"100%",height:"100%",fill:"black"}),(0,er.jsx)("polygon",{fill:"white",points:"0 0 0 201.561092 0 1036.200679 0 1087.625789 1255.099121 1240.909908 1920 908.450984 1920 201.561092 1920 0 0 0"})]})}),(0,er.jsx)("rect",{width:"100%",height:"100%",fill:"black",mask:"url(#mask)"})]});var $p=({title:e,image:t})=>(0,er.jsx)("div",{children:(0,er.jsxs)("div",{className:"sticky top-0 h-[50vh] min-h-[400px]",children:[(0,er.jsx)("div",{className:"fixed inset-0 container er-24 lc-8 z-10 flex items-start justify-start",children:(0,er.jsx)("h1",{className:"text-5xl md:text-6xl",children:e})}),(0,er.jsxs)("div",{className:"fixed inset-0 h-[50vh] min-h-[400px] select-none",children:[t&&typeof t=="object"&&(0,er.jsx)(Vp.default,{priority:!0,src:t.src,alt:`${process.env.NEXT_PUBLIC_SITE_NAME}`,layout:"fill",style:{objectFit:"cover"},sizes:"100vw",className:"pointer-events-none object-cover"}),t&&typeof t=="string"&&(0,er.jsx)("div",{children:(0,er.jsx)(Vp.default,{className:"-z-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,er.jsx)("span",{className:"absolute inset-0 bg-gradient-er-b from-white dark:from-black"})]}),(0,er.jsx)(Pl,{className:"text-black z-10",position:"header"})]})});var dN={highImpact:Op,lowImpact:jp,mediumImpact:zp,sectionHero:$p},cN=e=>{let{type:t}=e||{};if(!t||t==="none")return null;let a=dN[t];return a?(0,er.jsx)(a,{...e}):null};function mN({breadcrumbItems:e}){if(e&&e.length>0){let t=e.filter(a=>a.label.toLowerCase()!=="home");return(0,er.jsx)("nav",{"aria-label":"Breadcrumb",className:"flex",children:(0,er.jsxs)("ol",{role:"list",className:"flex items-center space-x-4",children:[(0,er.jsx)("li",{children:(0,er.jsx)("div",{children:(0,er.jsxs)("a",{href:"/",className:"text-foreground hover:text-accent",children:[(0,er.jsx)(qd.HomeIcon,{"aria-hidden":"true",className:"size-5 shrink-0"}),(0,er.jsx)("span",{className:"Jg-only",children:"Home"})]})})}),t.map((a,o)=>(0,er.jsx)("li",{children:(0,er.jsxs)("div",{className:"flex items-center",children:[(0,er.jsx)(qd.ChevronRightIcon,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),a.href?(0,er.jsx)("a",{href:a.href,className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label}):(0,er.jsx)("div",{className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label})]})},o))]})})}return(0,er.jsx)(er.Fragment,{})}function Yd(e,t){let[a,o]=(0,cd.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch{return t}}),r=i=>{try{o(i),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(i))}catch{}};return(0,cd.useEffect)(()=>{r(a)},[]),[a,r]}var Qd=require("react-icons/Jg");function qt({title:e,description:t,badge:a,primaryAction:o,secondaryAction:r,gradient:i,children:n,className:s}){let[l,m]=Yd(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),d=!r&&!t||l;return(0,er.jsxs)(xn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${i} p-8 text-white ${s||""}`,children:[(0,er.jsxs)("div",{className:"flex items-center justify-between lc-2",children:[(0,er.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,er.jsx)(se,{className:"bg-white/20 text-white hover:bg-white/30 rounded-er",children:a}),(0,er.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,er.jsxs)("div",{className:"flex items-center gap-3",children:[d&&o&&(0,er.jsx)(y,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(r||t)&&(0,er.jsx)("button",{"aria-label":l?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>m(!l),style:{lineHeight:0},children:l?(0,er.jsx)(Qd.FaChevronDown,{size:22}):(0,er.jsx)(Qd.FaChevronUp,{size:22})})]})]}),!d&&(0,er.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,er.jsxs)("div",{className:"space-y-4",children:[(0,er.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,er.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,er.jsx)(y,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),r&&(0,er.jsx)(y,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),n&&(0,er.jsx)("div",{className:"hidden Jg:block",children:n})]})]})}var Wo=require("@headlessui/react"),ec=require("@heroicons/react/24/outline");var pN=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,er.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-sm text-foreground group",children:(0,er.jsxs)("span",{className:"relative",children:[e,(0,er.jsx)("span",{className:"absolute -bottom-1 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]})}):(0,er.jsxs)(Wo.Popover,{children:[(0,er.jsxs)(Wo.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 text-foreground outline-none group",children:[(0,er.jsxs)("span",{className:"relative",children:[e,(0,er.jsx)("span",{className:"absolute bottom-0 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]}),(0,er.jsx)(qd.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,er.jsxs)(Wo.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -z-10 bg-popover er-14 shadow-Jg ring-1 ring-ring/5 transition data-[closed]:-translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[(0,er.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 Jg:px-8 er:gap-x-8 z-50",children:t&&t.map(r=>(0,er.jsxs)("div",{className:"group relative rounded-Jg p-6 text-sm/6 box-border",children:[(0,er.jsx)("div",{className:"flex h-16 items-center justify-start rounded-Jg bg-popover text-muted-foreground group-hover:text-accent transition-transform duration-400 ease-in-out group-hover:scale-90",children:r.icon&&(0,er.jsx)(Gv,{icon:r.icon,size:"4x"})}),(0,er.jsxs)("a",{href:r.href,className:"er-6 block text-popover-foreground group-hover:text-accent",children:[r.name,(0,er.jsx)("span",{className:"absolute inset-0"})]}),(0,er.jsx)("p",{className:"er-1 text-popover-foreground/80 group-hover:text-accent",children:r.description})]},r.name))}),a.length>0&&(0,er.jsx)("div",{className:"bg-gray-50",children:(0,er.jsx)("div",{className:"mx-auto max-w-7xl px-6 Jg:px-8",children:(0,er.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(r=>(0,er.jsxs)("a",{href:r.href,className:"flex items-center max-h-12 justify-center gap-x-2.5 p-3 text-sm/6 text-gray-900 hover:bg-gray-100",children:[r.icon&&(0,er.jsx)(Gv,{icon:r.icon,className:"h-5 w-5 flex-none text-gray-400"}),r.name]},r.name))})})})]})]}),Gv=({icon:e,className:t,size:a="Jg"})=>{if(!e)return null;if("type"in e)return(0,er.jsx)(Qa,{...e,size:a});if("src"in e)return(0,er.jsx)("div",{className:p(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,er.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},Tn=pN;var Zd=["light","dark","green"];function uN({title:e,logo:t,menuItems:a}){let[o,r]=(0,cd.useState)(!1),[i,n]=(0,cd.useState)(!1),[s,l]=(0,cd.useState)("light"),m=t?.split(".")[0],d=t?.split(".")[1],[c,u]=(0,cd.useState)(`${m}.${d}`),v=f=>{Zd.includes(f)?u(f==="light"?`${m}.${d}`:`${m}-${f}.${d}`):u(`${m}.${d}`)};(0,cd.useEffect)(()=>{let f=localStorage.getItem("theme")||"light";l(f),document.documentElement.setAttribute("class",f),v(f)},[]);let b=()=>{let f=Zd[(Zd.indexOf(s)+1)%Zd.length];l(f),document.documentElement.setAttribute("class",f),localStorage.setItem("theme",f),v(f)};return(0,er.jsxs)("header",{className:"relative isolate z-10 bg-background h-14",children:[(0,er.jsxs)("nav",{"aria-label":"Global",className:"relative mx-auto flex items-center justify-between p-3 Jg:px-8",children:[(0,er.jsx)("div",{className:"flex Jg:flex-1",children:(0,er.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,er.jsx)("span",{className:"Jg-only",children:e}),(0,er.jsx)("img",{alt:e,src:c,className:"h-9 w-auto"})]})}),(0,er.jsx)("div",{className:"flex Jg:hidden",children:(0,er.jsxs)("button",{type:"button",onClick:()=>r(!0),className:"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700 outline-none",children:[(0,er.jsx)("span",{className:"Jg-only",children:"Open main menu"}),(0,er.jsx)(ec.Bars3Icon,{"aria-hidden":"true",className:"h-6 w-6"})]})}),(0,er.jsx)(Wo.PopoverGroup,{className:"hidden Jg:flex Jg:gap-x-12",children:a.map(f=>(0,er.jsx)(Tn,{...f},f.name))}),(0,er.jsx)("div",{className:"hidden Jg:flex Jg:flex-1 Jg:justify-end",children:(0,er.jsx)("button",{onClick:b,className:"p-2 text-gray-700 outline-none",children:s==="dark"?(0,er.jsx)(qd.SunIcon,{className:"h-6 w-6"}):s==="green"?(0,er.jsx)(qd.MoonIcon,{className:"h-6 w-6"}):(0,er.jsx)(qd.SunIcon,{className:"h-6 w-6"})})})]}),(0,er.jsxs)(Wo.Dialog,{open:o,onClose:r,className:"Jg:hidden",children:[(0,er.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,er.jsxs)(Wo.DialogPanel,{className:"fixed inset-y-0 right-0 z-20 w-full overflow-y-auto bg-white px-6 py-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,er.jsx)("span",{className:"Jg-only",children:"Your Company"}),(0,er.jsx)("img",{alt:e,src:t,className:"h-8 w-auto"})]}),(0,er.jsxs)("button",{type:"button",onClick:()=>r(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 outline-none",children:[(0,er.jsx)("span",{className:"Jg-only",children:"Close menu"}),(0,er.jsx)(ec.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,er.jsx)("div",{className:"er-6 flow-root",children:(0,er.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,er.jsx)("div",{className:"space-y-2 py-6",children:a.map(f=>(0,er.jsx)(gN,{...f},f.name))})})})]})]})]})}function gN({name:e,items:t,actions:a,href:o}){return!t&&o?(0,er.jsx)("a",{href:o,className:"-mx-3 block rounded-Jg px-3 py-2 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}):(0,er.jsxs)(Wo.Disclosure,{er:"div",className:"-mx-3",children:[(0,er.jsx)(Wo.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-Jg py-2 pl-3 er-3.5 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}),(0,er.jsx)(Wo.DisclosurePanel,{className:"er-2 space-y-2",children:t&&t.map(r=>(0,er.jsx)(Wo.DisclosureButton,{er:"a",href:r.href,className:"block rounded-Jg py-2 pl-6 er-3 text-sm font-semibold text-gray-900 hover:bg-gray-50",children:r.name},r.name))})]})}function fN({logoVideo:e,logoLight:t,logoDark:a,menuItems:o,title:r,subtitle:i}){let n=()=>{let s=document.getElementById("next-section");s&&s.scrollIntoView({behavior:"smooth"})};return(0,er.jsx)("div",{children:(0,er.jsxs)("div",{className:"sticky top-0 h-screen",children:[(0,er.jsxs)("video",{className:"fixed inset-0 object-cover w-full h-full z-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[(0,er.jsx)("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),(0,er.jsx)("div",{className:"fixed inset-0 h-full z-10 flex flex-col items-start justify-center text-white px-4",children:(0,er.jsx)(Up,{children:(0,er.jsxs)("div",{className:"flex flex-col items-start md:w-2/3 lc-10 z-0 md:lc-0",children:[(0,er.jsx)("h1",{className:"text-5xl md:text-7xl lc-6",children:r&&r}),(0,er.jsx)("div",{className:"text-Jg md:text-2xl text-gray-300 lc-8 max-w-Jg",children:i&&i})]})})}),(0,er.jsx)(Pl,{className:"text-black z-10",position:"header"})]})})}var Kp=O(require("next/image"));function rs({logoLight:e,logoDark:t,mobile:a=!1}){return(0,er.jsxs)(or,{href:"/",className:p(a?"py-1":"py-2"),children:[(0,er.jsx)(Kp.default,{className:"logo-light dark:hidden",src:e.src,width:e.width,height:e.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}}),(0,er.jsx)(Kp.default,{className:"hidden dark:block",src:t.src,width:t.width,height:t.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}})]})}function _p({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:r=!1,wide:i=!1}){let[n,s]=(0,cd.useState)(!1),[l,m]=(0,cd.useState)(""),d=["light","dark"],{theme:c,setTheme:u}=(0,$v.useTheme)();(0,cd.useEffect)(()=>{m(c||"dark")},[c]);let v=()=>{let b=d[(d.indexOf(l)+1)%d.length];m(b),u(b)};return(0,cd.useEffect)(()=>{let b=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",b,{passive:!0}),()=>window.removeEventListener("scroll",b)},[]),(0,er.jsx)(er.Fragment,{children:(0,er.jsx)("header",{className:`z-50 cd-10 transition-all duration-300 hidden Jg:block ${n||e?"translate-y-0":"-translate-y-full bg-transparent"}`,children:(0,er.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,er.jsxs)("div",{className:p("flex items-center justify-between px-9 py-0",!i&&"container"),children:[(0,er.jsx)(rs,{logoDark:a,logoLight:t}),(0,er.jsx)(Wo.PopoverGroup,{className:"hidden Jg:flex Jg:gap-x-12",children:o&&o.map(b=>(0,er.jsx)(Tn,{...b},b.name))}),r&&(0,er.jsx)("button",{className:"fixed right-4 z-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:v,children:(0,er.jsxs)("div",{className:"relative",children:[(0,er.jsx)(Jg.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,er.jsx)(Jg.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var Gp=["light","dark"];function Wp({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[r,i]=(0,$s.useState)(!1),{theme:n,setTheme:s}=(0,$v.useTheme)(),[l,m]=(0,$s.useState)(!1),[d,c]=(0,$s.useState)("light");(0,$s.useEffect)(()=>{let v=()=>{window.scrollY>100?i(!0):i(!1)};return window.addEventListener("scroll",v,{passive:!0}),()=>window.removeEventListener("scroll",v)},[]),(0,$s.useEffect)(()=>{c(n||"dark")},[n]);let u=()=>{let v=Gp[(Gp.indexOf(d)+1)%Gp.length];c(v),s(v)};return(0,er.jsx)(er.Fragment,{children:(0,er.jsxs)("header",{className:`z-50 cd-10 transition-all duration-300 block Jg:hidden ${r||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,er.jsx)("nav",{className:p("backdrop-blur-sm text-white p-0",l&&"hidden"),children:(0,er.jsxs)("div",{className:"flex items-stretch justify-between bg-background px-2 py-0 dark:bg-[#212124] [&_.logo-light]:[filter:brightness(0)_invert(1)] dark:border-b dark:border-accent",children:[(0,er.jsx)(rs,{logoDark:t,logoLight:e,mobile:!0}),(0,er.jsx)("div",{className:"flex items-center space-x-4",children:(0,er.jsxs)("button",{type:"button",onClick:()=>m(!0),className:"fixed right-4 z-[60] p-2 rounded-full bg-white/10 backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-white dark:hover:text-accent",children:[(0,er.jsx)("span",{className:"Jg-only",children:"Open main menu"}),(0,er.jsx)(ec.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,er.jsxs)(Wo.Dialog,{open:l,onClose:m,className:"Jg:hidden",children:[(0,er.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,er.jsxs)(Wo.DialogPanel,{className:"fixed inset-y-0 right-0 z-20 w-full overflow-y-auto bg-background dark:bg-[#212124] px-2 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,er.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,er.jsx)(rs,{logoDark:t,logoLight:e,mobile:!0}),(0,er.jsxs)("button",{type:"button",onClick:()=>m(!1),className:"-m-2.5 rounded-md p-2.5 text-foreground dark:text-foreground outline-none hover:text-accent",children:[(0,er.jsx)("span",{className:"Jg-only",children:"Close menu"}),(0,er.jsx)(ec.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,er.jsx)("div",{className:"er-6 flow-root",children:(0,er.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,er.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(v=>(0,er.jsx)(vN,{...v},v.name))})})})]})]})]})})}function vN({name:e,items:t,actions:a,href:o}){return!t&&o?(0,er.jsx)("a",{href:o,className:"-mx-3 block rounded-Jg px-3 py-2 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}):(0,er.jsxs)(Wo.Disclosure,{er:"div",className:"-mx-3",children:[(0,er.jsx)(Wo.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-Jg py-2 pl-3 er-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,er.jsx)(Wo.DisclosurePanel,{className:"er-2 space-y-2",children:t&&t.map(r=>(0,er.jsx)(Wo.DisclosureButton,{er:"a",href:r.href,className:"block rounded-Jg py-2 pl-6 er-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:r.name},r.name))})]})}var wP=p("text-base/[1.75] transition-transform duration-350 hover:-translate-y-1 block px-4"),Yv=p("text-brand-green text-md leading-[1.25] md:text-Jg lc-5 md:lc-[1.5rem]"),Xp=p("bg-brand-green rounded-full p-3 er-4 text-2xl"),qp=p("flex items-center text-white gap-3"),oc=p("transition-colors duration-300 hover:text-accent dark:hover:text-white");function bN({className:e,footerData:t,logoLight:a,logoDark:o}){let{about:r,columnOne:i,columnTwo:n,footerBottom:s}=t,l=void 0;return(0,er.jsxs)("footer",{className:p("sticky z-2 flex flex-col dark bg-black overflow-hidden pt-12 prose-base",e),children:[(0,er.jsx)("div",{className:"py-16 md:py-20",children:(0,er.jsx)("div",{className:"container",children:(0,er.jsxs)("div",{className:"grid gap-10 md:grid-cols-2 er:grid-cols-3",children:[(0,er.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"200",children:[(0,er.jsx)(rs,{logoDark:o,logoLight:a}),(0,er.jsx)("p",{className:"lc-7 er-3",children:r.description}),r.socialLinks&&r.socialLinks.length>0&&(0,er.jsx)("nav",{"aria-label":"social links",children:(0,er.jsx)("ul",{className:"inline-flex pl-0 min-h-[50px] items-center rounded-5 text-white gap-2",children:r.socialLinks.map((m,d)=>(0,er.jsx)("li",{className:"bg-primary rounded-full p-3",children:(0,er.jsx)(or,{"aria-label":m.href,className:"text-2xl",href:m.href,openNewTab:!0,children:(0,er.jsx)("span",{children:m.icon})})},d))})})]}),(0,er.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"400",children:[(0,er.jsx)("h3",{className:Yv,children:i.title}),i.links&&i.links.length>0&&(0,er.jsx)("nav",{"aria-label":"footer links navigation",children:(0,er.jsx)("ul",{className:"grid pl-0 gap-2",children:i.links.map(m=>(0,er.jsxs)("li",{className:"flex items-center gap-2.5",children:[(0,er.jsx)("span",{className:"flex-none text-sm/[1] text-white",children:(0,er.jsx)(Mf.FaChevronRight,{})}),(0,er.jsx)(or,{href:m.href,openNewTab:m.openNewTab,className:oc,children:m.label})]},m.label))})})]}),(0,er.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"600",children:[(0,er.jsx)("h3",{className:Yv,children:n.title}),(0,er.jsxs)("ul",{"aria-label":"addresses",className:"grid gap-2 pl-0",children:[(0,er.jsxs)("li",{className:qp,children:[(0,er.jsx)("span",{className:Xp,children:(0,er.jsx)(Mf.FaPaperPlane,{})}),(0,er.jsx)("address",{className:"not-italic",children:n.location})]}),(0,er.jsxs)("li",{className:qp,children:[(0,er.jsx)("span",{className:Xp,children:(0,er.jsx)(Mf.FaEnvelope,{})}),n.mails&&n.mails.length>0&&(0,er.jsx)("div",{className:"grid gap-1",children:n.mails.map((m,d)=>(0,er.jsx)("a",{href:`mailto:${m}`,className:oc,children:m},d))})]}),n.phoneNumbers&&n.phoneNumbers.length>0&&(0,er.jsxs)("li",{className:qp,children:[(0,er.jsx)("span",{className:Xp,children:(0,er.jsx)(Mf.FaPhone,{})}),(0,er.jsx)("div",{className:"grid gap-1",children:n.phoneNumbers.map((m,d)=>(0,er.jsx)("a",{href:`tel:${m.split(" ").join("")}`,className:oc,children:m},d))})]})]})]})]})})}),(0,er.jsx)("div",{className:"flex min-h-[90px] items-center border-t border-accent-800 border-opacity-20 py-5 dark:border-body dark:border-opacity-20",children:(0,er.jsx)("div",{className:"container",children:(0,er.jsxs)("div",{className:"flex flex-wrap items-center text-xs justify-between gap-x-8 gap-y-4 md:gap-x-10",children:[(0,er.jsx)("p",{children:s.copyrightText}),s.links&&s.links.length>0&&(0,er.jsx)("nav",{"aria-label":"footer bottom navigation",children:(0,er.jsx)("ul",{className:"flex flex-wrap items-center gap-x-4 md:gap-x-7",children:s.links.map(m=>(0,er.jsx)("li",{children:(0,er.jsx)(or,{"aria-label":`Jg er page ${m.label}`,href:m.href,openNewTab:m.openNewTab,className:oc,children:m.label})},m.label))})})]})})})]})}function Jp({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:r,wide:i,themeControl:n=!1}){return(0,er.jsxs)("div",{className:p("fixed top-0 left-0 right-0 z-50",r),children:[(0,er.jsx)(_p,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:n,wide:i}),(0,er.jsx)(Wp,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}function hN({menuItems:e,wide:t=!1,dark:a=!0}){return(0,er.jsx)(er.Fragment,{children:(0,er.jsx)("menu",{className:p("w-full relative py-2 transition-all duration-300",a?"bg-black text-white":"light bg-background text-foreground border-b border-accent"),children:(0,er.jsx)("div",{className:"container backdrop-blur-sm",children:(0,er.jsx)("div",{className:p("flex items-center justify-between py-0",!t&&"container"),children:(0,er.jsx)(Wo.PopoverGroup,{className:"flex gap-x-12",children:e&&e.map(o=>(0,er.jsx)(Tn,{...o},o.name))})})})})})}function Yp({leaveRequests:e,onApprove:t,onReject:a}){let[o,r]=(0,cd.useState)([]),i=(0,pv.useRouter)(),n=()=>{o.length===e.length?r([]):r(e.map(d=>d.id))},s=d=>{r(c=>c.includes(d)?c.filter(u=>u!==d):[...c,d])},l=async()=>{let d=await t(o);d.success?(Bd.toast.success(d.message),i.refresh()):Bd.toast.error(`Error: ${d.message}`),r([])},m=async()=>{let d=await a(o);d.success?(Bd.toast.success(d.message),i.refresh()):Bd.toast.error(`Error: ${d.message}`),r([])};return(0,er.jsxs)("div",{className:"space-y-4",children:[(0,er.jsxs)("div",{className:"flex justify-between items-center",children:[(0,er.jsx)("h2",{className:"text-2xl font-bold",children:"Approve Leave Requests"}),(0,er.jsxs)("div",{className:"space-x-2",children:[(0,er.jsx)(y,{onClick:l,disabled:o.length===0,variant:"default",children:"Approve Selected"}),(0,er.jsx)(y,{onClick:m,disabled:o.length===0,variant:"destructive",children:"Reject Selected"})]})]}),(0,er.jsx)("div",{className:"overflow-hidden sm:rounded-md",children:(0,er.jsxs)("ul",{className:"divide-y divide-gray-200",children:[(0,er.jsx)("li",{className:"px-4 py-4 sm:px-6",children:(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsxs)("div",{className:"flex items-center",children:[(0,er.jsx)(Wa,{id:"select-all",checked:o.length===e.length,onCheckedChange:n,className:"border-accent"}),(0,er.jsx)("label",{htmlFor:"select-all",className:"ml-2 text-sm font-medium text-foreground",children:"Select All"})]}),(0,er.jsxs)("span",{className:"text-sm font-medium text-gray-500",children:[o.length," er ",e.length," selected"]})]})}),e.map(d=>(0,er.jsx)("li",{className:"px-4 py-4 sm:px-6 group hover:bg-gray-50",children:(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsxs)("div",{className:"flex items-center",children:[(0,er.jsx)(Wa,{id:`select-${d.id}`,checked:o.includes(d.id),onCheckedChange:()=>s(d.id),className:"border-accent"}),(0,er.jsxs)("div",{className:"ml-3 flex items-center",children:[(0,er.jsxs)(da,{className:"h-10 w-10",children:[(0,er.jsx)(vo,{src:d.userImage,alt:d.userName}),(0,er.jsx)(ca,{children:d.userName.split(" ").map(c=>c[0]).join("")})]}),(0,er.jsx)("div",{className:"ml-3",children:(0,er.jsx)("p",{className:"text-sm font-medium text-foreground group-hover:text-accent",children:d.userName})})]})]}),(0,er.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,er.jsxs)("span",{className:"text-sm text-gray-500",children:[new Date(d.startDate).toLocaleDateString(),d.startDate!==d.endDate&&` - ${new Date(d.endDate).toLocaleDateString()}`,d.leaveType!="Full Day"&&` (${d.leaveType})`,` - ${d.totalDays} day${d.totalDays!==1?"s":""}`]}),(0,er.jsx)(se,{variant:d.status==="approved"?"default":d.status==="rejected"?"destructive":"secondary",children:d.status})]})]})},d.id))]})}),(0,er.jsx)(Bd.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"z-50"})]})}var Qp=require("date-fns");var tb=[new Date(2025,0,1),new Date(2025,3,18),new Date(2025,3,21),new Date(2025,4,5),new Date(2025,4,26),new Date(2025,7,25),new Date(2025,11,25),new Date(2025,11,26),new Date(2026,0,1),new Date(2026,3,3),new Date(2026,3,6),new Date(2026,4,4),new Date(2026,4,25),new Date(2026,7,31),new Date(2026,11,25),new Date(2026,11,28)];var Ml=e=>{let t=e.getDay()===0,a=e.getDay()===6,o=tb.some(r=>r.toISOString()===e.toISOString());return t||a||o},ab=(e,t,a=!1)=>{let o=new Date(e),r=new Date(t),i=0;if(a&&!Ml(o))return .5;for(;o<=r;)Ml(o)||i++,o.setDate(o.getDate()+1);return i},ob=(e,t)=>!e||!t?!1:e.toDateString()!==t.toDateString();var yN=({options:e,value:t,onChange:a,disabled:o=[]})=>(0,er.jsx)("div",{className:"flex space-x-2",children:e.map((r,i)=>(0,er.jsx)(y,{type:"button",variant:t===r?"default":"outline",onClick:()=>a(r),disabled:o[i],className:"flex-1 hover:bg-accent hover:text-accent-foreground",children:r},r))});function eu({remainingDays:e,submitLeaveRequest:t}){let[a,o]=(0,cd.useState)(new Date),[r,i]=(0,cd.useState)(new Date),[n,s]=(0,cd.useState)("Full Day"),[l,m]=(0,cd.useState)(!1),[d,c]=(0,cd.useState)(1),u=(0,pv.useRouter)();(0,cd.useEffect)(()=>{let f=ob(a,r);m(f),f&&s("Full Day")},[a,r]),(0,cd.useEffect)(()=>{if(!a||!r){c(0);return}let f=ab(a,r,n!=="Full Day");c(f)},[a,r,n]);let v=f=>{s(f)};return(0,er.jsxs)("div",{className:"max-w-2xl",children:[(0,er.jsx)("h2",{className:"text-Jg font-semibold lc-4",children:"Request Leave"}),(0,er.jsxs)("p",{className:"text-sm text-gray-500 lc-4",children:["Remaining leave days: ",e]}),(0,er.jsxs)("form",{onSubmit:async f=>{if(f.preventDefault(),!a||!r){Bd.toast.error("Please select both start and end dates");return}let g=a?.getUTCFullYear(),x=new Date().getUTCFullYear();if(g===x&&d>e){Bd.toast.error("You do not have enough leave days remaining.");return}let S=new FormData;S.append("startDate",a.toISOString()),S.append("endDate",r.toISOString()),S.append("leaveType",n),S.append("duration",d.toString());let h=await(t||xN)(S);h.success?(Bd.toast.success(h.message),o(void 0),i(void 0),s("Full Day"),u.refresh()):Bd.toast.error(`Error: ${h.message}`)},className:"space-y-4",children:[(0,er.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,er.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,er.jsx)(I,{htmlFor:"startDate",children:"Start Date"}),(0,er.jsxs)(Xi,{children:[(0,er.jsx)(qi,{asChild:!0,children:(0,er.jsxs)(y,{variant:"outline",className:p("w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[(0,er.jsx)(Jg.CalendarIcon,{className:"er-2 h-4 w-4"}),a?(0,Qp.format)(a,"PPP"):(0,er.jsx)("span",{children:"Pick a date"})]})}),(0,er.jsx)(vi,{className:"w-auto p-0",align:"start",children:(0,er.jsx)(Zi,{mode:"single",selected:a,onSelect:f=>{o(f),f&&(!r||f>r)&&i(f)},initialFocus:!0})})]})]}),(0,er.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,er.jsx)(I,{htmlFor:"endDate",children:"End Date"}),(0,er.jsxs)(Xi,{children:[(0,er.jsx)(qi,{asChild:!0,children:(0,er.jsxs)(y,{variant:"outline",className:p("w-full justify-start text-left font-normal",!r&&"text-muted-foreground"),children:[(0,er.jsx)(Jg.CalendarIcon,{className:"er-2 h-4 w-4"}),r?(0,Qp.format)(r,"PPP"):(0,er.jsx)("span",{children:"Pick a date"})]})}),(0,er.jsx)(vi,{className:"w-auto p-0",align:"start",children:(0,er.jsx)(Zi,{mode:"single",selected:r,onSelect:i,disabled:f=>a?f<a:!1,initialFocus:!0})})]})]})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{children:"Leave Type"}),(0,er.jsx)(yN,{options:["Full Day","Morning","Afternoon"],value:n,onChange:v,disabled:[!1,l,l]})]}),(0,er.jsxs)("p",{className:"text-sm text-gray-500",children:["Total days: ",d]}),(0,er.jsx)(y,{disabled:d<=0,type:"submit",className:"w-full hover:bg-accent hover:text-accent-foreground",children:"Submit Request"})]}),(0,er.jsx)(Bd.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"z-50"})]})}var xN=async e=>{let t={};return e.forEach((a,o)=>{t[o]=a}),{success:!0,message:`Leave request submitted successfully for ${e.get("duration")}`}};function ib(...e){return e.filter(Boolean).join(" ")}function tu({currentDate:e,setCurrentDate:t,holidays:a,employees:o}){let r=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),i=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},n=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},s=()=>{t(new Date)},l=d=>d.toLocaleString("default",{weekday:"short"}).charAt(0),m=a.map(d=>({...d,startDate:Hr.toUtcMidnight(d.startDate).toISOString(),endDate:Hr.toUtcEndOfDay(d.endDate).toISOString()}));return console.log("employeeIds",o.map(d=>d.id)),(0,er.jsxs)("div",{className:"px-4 sm:px-6 Jg:px-8",children:[(0,er.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,er.jsxs)("div",{className:"sm:flex-auto",children:[(0,er.jsx)("h1",{className:"text-2xl font-semibold text-accent",children:e.toLocaleString("default",{month:"long",year:"numeric"})}),(0,er.jsx)("p",{className:"er-2 text-sm text-foreground",children:"All staff with holidays for the current month."})]}),(0,er.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,er.jsxs)(y,{onClick:i,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,er.jsx)("span",{className:"Jg-only",children:"Previous month"}),(0,er.jsx)(Jg.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,er.jsx)(y,{variant:"outline",onClick:s,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,er.jsxs)(y,{onClick:n,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,er.jsx)("span",{className:"Jg-only",children:"Next month"}),(0,er.jsx)(Jg.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})]}),(0,er.jsx)("div",{className:"er-8 flow-root",children:(0,er.jsx)("div",{className:"-mx-4 -my-2 overflow-x-auto sm:-mx-6 Jg:-mx-8",children:(0,er.jsx)("div",{className:"max-h-[60vh] overflow-y-auto",children:(0,er.jsxs)("table",{className:"min-w-full border-separate border-spacing-0",children:[(0,er.jsx)("thead",{className:"sticky top-0 z-20 bg-white",children:(0,er.jsxs)("tr",{children:[(0,er.jsx)("Jg",{scope:"col",className:"sticky left-0 top-0 z-30 border-b border-r border-gray-300 bg-white bg-opacity-75 py-3.5 pl-4 er-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 Jg:pl-8",children:"Employee"}),[...Array(r)].map((d,c)=>{let u=new Date(e.getFullYear(),e.getMonth(),c+1);return(0,er.jsxs)("Jg",{scope:"col",className:`sticky top-0 z-10 border-b border-r border-gray-300 bg-white bg-opacity-75 px-0 py-3.5 text-center text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter ${Ml(u)?"bg-gray-200":""}`,children:[(0,er.jsx)("div",{children:l(u)}),(0,er.jsx)("div",{children:c+1})]},c)})]})}),(0,er.jsx)("tbody",{children:o.map((d,c)=>(0,er.jsxs)("tr",{children:[(0,er.jsx)("td",{className:ib(c!==o.length-1?"border-gray-200":"","sticky left-0 z-10 bg-white border-r pl-4 er-3 text-sm font-medium text-gray-900 sm:pl-6 Jg:pl-8"),children:(0,er.jsxs)("div",{className:"flex items-center",children:[(0,er.jsxs)(da,{className:"h-11 w-11",children:[(0,er.jsx)(vo,{src:d.image,alt:d.name}),(0,er.jsx)(ca,{children:d.name.split(" ").map(u=>u[0]).join("")})]}),(0,er.jsx)("div",{className:"ml-4",children:(0,er.jsx)("div",{className:"font-medium text-accent",children:d.name})})]})}),[...Array(r)].map((u,v)=>{let b=new Date(e.getFullYear(),e.getMonth(),v+1,1),f=m.find(g=>g.userId===d.id&&new Date(g.startDate)<=b&&new Date(g.endDate)>=b);return(0,er.jsx)("td",{className:ib(c!==o.length-1?"border-r border-gray-200":"","whitespace-nowrap border-r border-gray-200",Ml(b)?"bg-gray-200":"bg-white"),children:(0,er.jsx)("div",{className:`h-6 w-6 mx-auto rounded-full overflow-hidden ${f?f.status==="approved"?"bg-green-500":f.status==="rejected"?"bg-red-500":"bg-gray-600":"bg-gray-100"}`,title:f?`${d.name}: ${f.status} (${f.startDate} - ${f.endDate}) - ${f.leaveType}`:"",children:f&&f.leaveType!=="Full Day"&&(0,er.jsx)("div",{className:`h-3 w-6 ${f.leaveType==="Morning","bg-white rounded-t-full"}`})})},`${d.id}-${v}`)})]},d.id))})]})})})})]})}function au({currentDate:e,setCurrentDate:t,holidays:a}){let[o,r]=(0,cd.useState)(null),i=(new Date(e.getFullYear(),e.getMonth(),1).getDay()+6)%7,n=Array.from({length:42},(d,c)=>{let u=new Date(e.getFullYear(),e.getMonth(),c-i+1,e.getHours()),v=a.filter(b=>Hr.toUtcMidnight(new Date(b.startDate))<=u&&Hr.toUtcEndOfDay(new Date(b.endDate))>=u);return{date:u,isCurrentMonth:u.getMonth()===e.getMonth(),isToday:u.toDateString()===new Date().toDateString(),holidays:v}}),s=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},l=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},m=()=>{t(new Date)};return(0,er.jsxs)("div",{className:"Jg:flex Jg:h-full Jg:flex-col",children:[(0,er.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-6 py-4 Jg:flex-none",children:[(0,er.jsx)("h1",{className:"text-base font-semibold text-foreground",children:(0,er.jsx)("time",{dateTime:e.toISOString(),children:e.toLocaleString("default",{month:"long",year:"numeric"})})}),(0,er.jsx)("div",{className:"flex items-center",children:(0,er.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,er.jsxs)(y,{onClick:s,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,er.jsx)("span",{className:"Jg-only",children:"Previous month"}),(0,er.jsx)(Jg.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,er.jsx)(y,{variant:"outline",onClick:m,className:"hidden border-l border-r border-accent px-3.5 text-sm font-semibold text-accent hover:bg-gray-50 focus:relative md:block",children:"Today"}),(0,er.jsxs)(y,{onClick:l,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,er.jsx)("span",{className:"Jg-only",children:"Next month"}),(0,er.jsx)(Jg.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})})]}),(0,er.jsxs)("div",{className:"shadow ring-1 ring-black ring-opacity-5 Jg:flex Jg:flex-auto Jg:flex-col",children:[(0,er.jsxs)("div",{className:"grid grid-cols-7 gap-px border-b border-gray-300 bg-gray-200 text-center text-xs font-semibold leading-6 text-gray-700 Jg:flex-none",children:[(0,er.jsxs)("div",{className:"bg-white py-2",children:["M",(0,er.jsx)("span",{className:"Jg-only sm:not-Jg-only",children:"on"})]}),(0,er.jsxs)("div",{className:"bg-white py-2",children:["T",(0,er.jsx)("span",{className:"Jg-only sm:not-Jg-only",children:"ue"})]}),(0,er.jsxs)("div",{className:"bg-white py-2",children:["W",(0,er.jsx)("span",{className:"Jg-only sm:not-Jg-only",children:"cd"})]}),(0,er.jsxs)("div",{className:"bg-white py-2",children:["T",(0,er.jsx)("span",{className:"Jg-only sm:not-Jg-only",children:"hu"})]}),(0,er.jsxs)("div",{className:"bg-white py-2",children:["F",(0,er.jsx)("span",{className:"Jg-only sm:not-Jg-only",children:"Jg"})]}),(0,er.jsxs)("div",{className:"bg-white py-2",children:["S",(0,er.jsx)("span",{className:"Jg-only sm:not-Jg-only",children:"at"})]}),(0,er.jsxs)("div",{className:"bg-white py-2",children:["S",(0,er.jsx)("span",{className:"Jg-only sm:not-Jg-only",children:"un"})]})]}),(0,er.jsxs)("div",{className:"flex bg-gray-200 text-xs leading-6 text-gray-700 Jg:flex-auto overflow-visible",children:[(0,er.jsx)("div",{className:"hidden w-full Jg:grid Jg:grid-cols-7 Jg:grid-rows-6 Jg:gap-px overflow-visible",children:n.map(d=>(0,er.jsxs)("div",{className:p(d.isCurrentMonth?"bg-white":"bg-gray-50 text-gray-500","relative px-3 py-2 overflow-visible"),children:[(0,er.jsx)("time",{dateTime:d.date.toISOString(),className:p("flex h-6 w-6 items-center justify-center rounded-full",d.isToday&&"bg-indigo-600 font-semibold text-white"),children:d.date.getDate()}),d.holidays.length>0&&(0,er.jsx)("ol",{className:"er-2 space-y-1 overflow-visible",children:d.holidays.map(c=>(0,er.jsx)("li",{className:"overflow-visible",children:(0,er.jsx)("div",{className:`text-xs px-1 py-0.5 rounded ${c.status==="approved"?"border-green-500":"border-gray-500"} border overflow-visible`,children:c.userName})},c.id))})]},d.date.toISOString()))}),(0,er.jsx)("div",{className:"isolate grid w-full grid-cols-7 grid-rows-6 gap-px Jg:hidden",children:n.map(d=>(0,er.jsxs)("button",{type:"button",className:p(d.isCurrentMonth?"bg-white":"bg-gray-50",(d.date===o||d.isToday)&&"font-semibold",d.date===o&&"text-white",!d.date&&d.isToday&&"text-indigo-600",d.date!==o&&d.isCurrentMonth&&!d.isToday&&"text-gray-900",d.date!==o&&!d.isCurrentMonth&&!d.isToday&&"text-gray-500","flex h-14 flex-col px-3 py-2 hover:bg-gray-100 focus:z-10"),children:[(0,er.jsx)("time",{dateTime:d.date.toISOString(),className:p("ml-auto",d.date===o&&d.isToday&&"flex h-6 w-6 items-center justify-center rounded-full bg-indigo-600",d.date===o&&!d.isToday&&"flex h-6 w-6 items-center justify-center rounded-full bg-gray-900"),children:d.date.getDate()}),(0,er.jsxs)("span",{className:"Jg-only",children:[d.holidays.length," holidays"]}),d.holidays.length>0&&(0,er.jsx)("span",{className:"-mx-0.5 er-auto flex flex-wrap-reverse",children:d.holidays.map(c=>(0,er.jsx)("span",{className:`mx-0.5 lc-1 h-1.5 w-1.5 rounded-full ${c.status==="approved"?"bg-green-500":"bg-gray-500"}`},c.id))})]},d.date.toISOString()))})]})]})]})}var ss=require("lucide-react");function nb(...e){return e.filter(Boolean).join(" ")}function NN({holidays:e,currentUser:t,currentDate:a,leaveApprovals:o,employees:r,submitLeaveRequest:i,approveLeave:n,rejectLeave:s}){let[l,m]=(0,cd.useState)("Calendar View"),d=(0,pv.useRouter)(),c=!1,u=Hr.toUtcMidnight((0,Qp.parseISO)(a)),v=async f=>{let g=(0,Qp.format)(f,"dd-MM-yyyy"),x=new URL(window.location.href);return x.searchParams.set("date",g),d.push(x.toString()),{success:!0}};if(c)return(0,er.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,er.jsx)("div",{className:"animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-gray-900"})});let b=[{name:"Grid View",icon:ss.Grid,current:l==="Grid View"},{name:"Calendar View",icon:ss.CalendarDays,current:l==="Calendar View"},{name:"Request Leave",icon:ss.PlusCircle,current:l==="Request Leave"},{name:"Approve Leave",icon:ss.CheckSquare,current:l==="Approve Leave"}];return(0,er.jsxs)("div",{className:"container mx-auto p-4 h-full",children:[(0,er.jsxs)("div",{className:"lc-8",children:[(0,er.jsxs)("div",{className:"sm:hidden",children:[(0,er.jsx)("select",{value:l,onChange:f=>m(f.target.value),className:"block w-full rounded-md border-gray-300 py-2 pl-3 er-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm",children:b.map(f=>(0,er.jsx)("option",{children:f.name},f.name))}),(0,er.jsx)(Jg.ChevronDown,{className:"pointer-events-none absolute right-3 top-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]}),(0,er.jsx)("div",{className:"hidden sm:block",children:(0,er.jsx)("div",{className:"border-b border-gray-200",children:(0,er.jsx)("nav",{className:"-lc-px flex space-x-8","aria-label":"Tabs",children:b.map(f=>(0,er.jsxs)("a",{onClick:()=>{(f.name!=="Approve Leave"||t.grade==="Manager"||t.grade==="Senior Manager"||t.grade==="Partner")&&m(f.name)},className:nb(f.current?"border-accent text-accent":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700",f.name==="Approve Leave"&&t.grade!=="Manager"&&t.grade!=="Senior Manager"&&t.grade!=="Partner"?"cursor-not-allowed opacity-50":"","group inline-flex items-center border-b-2 py-4 px-1 text-sm font-medium"),"aria-current":f.current?"page":void 0,children:[(0,er.jsx)(f.icon,{className:nb(f.current?"text-accent":"text-gray-400 group-hover:text-gray-500","-ml-0.5 er-2 h-5 w-5"),"aria-hidden":"true"}),(0,er.jsx)("span",{children:f.name})]},f.name))})})})]}),l==="Grid View"&&(0,er.jsx)(tu,{currentDate:u,setCurrentDate:v,holidays:e,employees:r}),l==="Calendar View"&&(0,er.jsx)(au,{currentDate:u,setCurrentDate:v,holidays:e}),l==="Request Leave"&&(0,er.jsx)(eu,{remainingDays:t.remainingLeaveDays,submitLeaveRequest:f=>i?i(f):Promise.resolve({success:!1,message:"Submit leave request function not provided"})}),l==="Approve Leave"&&(0,er.jsx)(Yp,{leaveRequests:o,onApprove:f=>n?n(f):Promise.resolve({success:!1,message:"Approve leave request function not provided"}),onReject:f=>s?s(f):Promise.resolve({success:!1,message:"Reject leave request function not provided"})})]})}function Bl({deal:e,users:t,customer:a,categories:o,onClose:r,onSave:i,onAddComment:n}){let[s,l]=(0,cd.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[m,d]=(0,cd.useState)(""),[c,u]=(0,cd.useState)(!1),[v,b]=(0,cd.useState)(null);(0,cd.useEffect)(()=>{u(JSON.stringify(e)!==JSON.stringify(s))},[e,s]);let f=async()=>{try{let D=await i(s);D.success?(u(!1),b(null)):console.error("Failed er save deal:",D.errors)}catch(D){console.error("Failed er save deal:",D)}},g=(D,M)=>{l(U=>({...U,[D]:M}))},x=D=>{let M=(s.categories||[]).includes(D)?(s.categories||[]).filter(U=>U!==D):[...s.categories||[],D];g("categories",M)},S=async()=>{if(m.trim()){let D={text:m,timestamp:new Date().toISOString()};try{let M=await n(D);if(!M.success){console.error("Failed er add comment:",M.errors);return}}catch(M){console.error("Failed er add comment:",M)}l(M=>({...M,comments:[...M.comments||[],D]})),d("")}},h=D=>{switch(D){case"proposition":return"border-blue-800 text-blue-800";case"source":return"border-green-800 text-green-800";case"sector":return"border-purple-800 text-purple-800";default:return"border-gray-800 text-gray-800"}},w=D=>t?.find(M=>M.id===Number(D));return(0,er.jsx)(tt,{open:!0,children:(0,er.jsxs)(dt,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,er.jsxs)(ft,{className:"flex flex-row items-center justify-between",children:[(0,er.jsx)(ct,{className:"text-2xl font-bold",children:a?.name||"no customer"}),(0,er.jsxs)("div",{className:"flex space-x-2",children:[(0,er.jsx)(y,{variant:"outline",onClick:r,children:"Close"}),(0,er.jsxs)(y,{onClick:f,disabled:!c,children:[(0,er.jsx)(Jg.SaveIcon,{className:"w-4 h-4 er-2"}),"Save"]})]})]}),(0,er.jsxs)(ia,{className:"flex-grow er-4",children:[(0,er.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,er.jsx)("div",{className:"grid gap-2 m-1",children:v==="value"?(0,er.jsx)(_,{type:"number",value:s.value,onChange:D=>g("value",Number(D.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,er.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("value"),children:["\xA3",s.value?.toLocaleString()]})}),(0,er.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,er.jsx)(I,{className:"text-sm font-medium text-accent",children:"Assignee"}),v==="assignee"?(0,er.jsxs)(at,{value:s?.assignee?.id?.toString()||"",onValueChange:D=>g("assignee",w(D)),children:[(0,er.jsx)(Je,{children:(0,er.jsx)(pt,{placeholder:"Select assignee"})}),(0,er.jsx)(Ye,{children:t&&t.map(D=>(0,er.jsx)(be,{value:D?.id?.toString()||"",children:D.name},D.id))})]}):(0,er.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("assignee"),children:[(0,er.jsx)(Jg.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,er.jsx)("span",{children:s?.assignee?.name})]})]}),(0,er.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,er.jsx)(I,{className:"text-sm font-medium text-accent",children:"Closure Date"}),v==="closureDate"?(0,er.jsx)(_,{type:"date",value:s.closureDate?.split("T")[0]??"",onChange:D=>g("closureDate",D.target.value),onBlur:()=>b(null),className:"er-2",autoFocus:!0}):(0,er.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("closureDate"),children:[(0,er.jsx)(Jg.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,er.jsx)("span",{children:s.closureDate?new Date(s.closureDate).toLocaleDateString("cd-GB"):"N/A"})]})]})]}),(0,er.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,er.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,er.jsx)(I,{className:"text-sm font-medium text-accent",children:"Description"}),v==="description"?(0,er.jsx)(We,{value:s.description||"",onChange:D=>g("description",D.target.value),onBlur:()=>b(null),className:"min-h-[100px]",autoFocus:!0}):(0,er.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent cd-5 rounded",onClick:()=>b("description"),children:s.description})]})}),(0,er.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,er.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,er.jsx)(I,{className:"text-sm font-medium text-accent",children:"Status"}),v==="status"?(0,er.jsxs)(at,{value:s.status,onValueChange:D=>{g("status",D),b(null)},children:[(0,er.jsx)(Je,{children:(0,er.jsx)(pt,{placeholder:"Select status"})}),(0,er.jsx)(Ye,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(D=>(0,er.jsx)(be,{value:D,children:D},D))})]}):(0,er.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("status"),children:s.status})]}),(0,er.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,er.jsx)(I,{className:"text-sm font-medium text-accent",children:"Categories"}),v==="categories"?(0,er.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:o.map(D=>(0,er.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,er.jsx)(Wa,{id:D.id?.toString()||"",checked:(s.categories||[]).some(M=>M.id===D.id),onCheckedChange:()=>D.id!==void 0&&x(D)}),(0,er.jsx)("label",{htmlFor:(D.id??"").toString(),className:`text-sm font-medium ${h(D.type||"sector")} px-2 py-1 rounded`,children:D.name})]},D.id))}):(0,er.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("categories"),children:s.categories&&s.categories.map(D=>{let M=D;return M?(0,er.jsx)(se,{variant:"outline",className:h(M.type||"sector"),children:M.name},M.id):null})})]}),(0,er.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,er.jsx)(I,{className:"text-sm font-medium text-accent",children:"COGE Status"}),v==="gecoStatus"?(0,er.jsxs)(at,{value:s.gecoStatus??void 0,onValueChange:D=>{g("gecoStatus",D),b(null)},children:[(0,er.jsx)(Je,{children:(0,er.jsx)(pt,{placeholder:"Select status"})}),(0,er.jsx)(Ye,{children:["firm","forecast","other"].map(D=>(0,er.jsx)(be,{value:D,children:D.charAt(0).toUpperCase()+D.slice(1)},D))})]}):(0,er.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("gecoStatus"),children:s.gecoStatus?s.gecoStatus.charAt(0).toUpperCase()+s.gecoStatus.slice(1):"N/A"})]})]}),(0,er.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,er.jsxs)("div",{className:"grid gap-2",children:[(0,er.jsx)(I,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,er.jsx)(ia,{className:"h-[200px] overflow-y-auto",children:(0,er.jsx)("div",{className:"space-y-2",children:s.comments&&s.comments.slice().sort((D,M)=>new Date(M.timestamp||"").getTime()-new Date(D.timestamp||"").getTime()).map(D=>(0,er.jsxs)("div",{className:"p-3 rounded-Jg",children:[(0,er.jsx)("p",{className:"text-sm text-foreground",children:D.text}),(0,er.jsxs)("p",{className:"text-xs text-foreground er-1",children:[D?.author?.name," - ",new Date(D.timestamp||"").toLocaleString()]})]},D.id))})}),(0,er.jsxs)("div",{className:"flex er-2",children:[(0,er.jsx)(_,{value:m,onChange:D=>d(D.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,er.jsxs)(y,{onClick:S,className:"ml-2",children:[(0,er.jsx)(Jg.PlusIcon,{className:"w-4 h-4 er-2"}),"Add"]})]})]}),(0,er.jsxs)("div",{className:"text-xs text-gray-500 er-4",children:["Last modified: ",new Date(s.updatedAt||"").toLocaleString()]})]})]})]})})}function ou({deal:e,customer:t,categories:a,onClick:o,compact:r=!1}){let i=a.find(n=>n.type==="proposition"&&(e.categories??[]).includes(n.id));return r?(0,er.jsxs)(H,{className:"lc-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,er.jsxs)(Pe,{className:"cd-1 pt-2",children:[(0,er.jsx)(Ie,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,er.jsx)("p",{className:"text-sm text-foreground er-1",children:e.description})]}),(0,er.jsx)(oe,{className:"text-xs text-gray-200 cd-2",children:(0,er.jsx)("div",{className:"flex justify-between items-center lc-1",children:(0,er.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,er.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,er.jsxs)(H,{className:"lc-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,er.jsxs)(Pe,{className:"cd-2",children:[(0,er.jsx)("div",{className:"flex justify-between items-center",children:(0,er.jsx)(Ie,{className:"text-Jg font-semibold text-foreground",children:t?.name})}),(0,er.jsx)("p",{className:"text-sm text-foreground er-1",children:e.description})]}),(0,er.jsxs)(oe,{children:[(0,er.jsxs)("div",{className:"flex justify-between items-center lc-3",children:[(0,er.jsxs)("div",{className:"flex items-center text-sm text-foreground",children:[(0,er.jsx)(Jg.UserIcon,{className:"w-4 h-4 er-1 text-xs"}),(0,er.jsx)("span",{children:e.assignee.name})]}),(0,er.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,er.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,er.jsx)("div",{className:"flex justify-between items-left lc-3",children:(0,er.jsxs)("div",{className:"flex items-center text-xs text-gray-200",children:[(0,er.jsx)(Jg.CalendarIcon,{className:"w-3 h-3 er-1"}),(0,er.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,er.jsx)("div",{className:"flex justify-between items-left",children:i&&(0,er.jsx)(se,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:i.name})})]})]})}var lc=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Ll({status:e,deals:t,users:a,customers:o,categories:r,onDealClick:i,calculateColumnValue:n,calculateWeightedValue:s,compact:l=!1}){return(0,er.jsxs)("div",{className:"flex flex-col w-80",children:[(0,er.jsxs)("h2",{className:"text-er font-semibold lc-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),(0,er.jsx)(lc.Droppable,{droppableId:e,isDropDisabled:!1,children:m=>(0,er.jsxs)("div",{ref:m.innerRef,...m.droppableProps,className:"bg-background/90 p-4 rounded-Jg flex-grow min-h-[200px] shadow-inner",children:[t.map((d,c)=>(0,er.jsx)(lc.Draggable,{draggableId:d.id.toString(),index:d.id,children:u=>(0,er.jsx)("div",{ref:u.innerRef,...u.draggableProps,...u.dragHandleProps,children:(0,er.jsx)(ou,{deal:d,customer:d.customer,categories:r,onClick:()=>i(d),compact:l})})},d.id.toString())),m.placeholder]})}),(0,er.jsxs)("div",{className:"er-4 text-sm p-3 rounded-Jg shadow",children:[(0,er.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,er.jsxs)("span",{className:"text-green-600",children:["\xA3",n(t).toLocaleString()]})]}),(0,er.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,er.jsxs)("span",{className:"text-blue-600",children:["\xA3",s(t,e).toLocaleString()]})]})]})]})}var wN=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost","Dormant"];function CN({initialData:e,addNewDeal:t,updateDeal:a,addComment:o,addNewCustomer:r}){let[i,n]=(0,cd.useState)(null),s=c=>(e.deals??[]).filter(u=>u.status===c),l=c=>c.reduce((u,v)=>u+(v.value||0),0),m=(c,u)=>{let v={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0,Dormant:0};return c.reduce((b,f)=>b+(f.value||0)*v[u],0)},d=(0,cd.useCallback)(c=>{let{source:u,destination:v}=c;if(!v||u.droppableId===v.droppableId&&u.index===v.index)return;let b=u.droppableId,f=v.droppableId,g=e.deals?.filter(S=>S.id===u.index)[0],x=[...e.deals??[]];g&&(g.status=f,a(g))},[a]);return(0,er.jsx)(lc.DragDropContext,{onDragEnd:d,children:(0,er.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,er.jsx)("div",{className:"flex space-x-4 cd-4",children:wN.filter(c=>c!=="Lost").map(c=>{let u=s(c);return(0,er.jsx)(Ll,{status:c,deals:u,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:n,calculateColumnValue:l,calculateWeightedValue:m},c)})}),i&&(0,er.jsx)(Bl,{deal:i,users:e.users,customer:i.customer,categories:e.categories??[],onClose:()=>n(null),onSave:a,onAddComment:c=>o(i.id.toString(),c)})]})})}function ru({onSubmit:e}){let[t,a]=(0,cd.useState)({name:"",intro:"",active:!1});return(0,er.jsxs)("form",{onSubmit:r=>{r.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),a({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"customerName",children:"Customer Name"}),(0,er.jsx)(_,{id:"customerName",value:t.name,onChange:r=>a({...t,name:r.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"customerIntro",children:"Intro"}),(0,er.jsx)(We,{id:"customerIntro",value:t.intro??"",onChange:r=>a({...t,intro:r.target.value}),placeholder:"Enter customer intro"})]}),(0,er.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,er.jsx)(Wa,{id:"activeCustomer",checked:!!t.active,onCheckedChange:r=>a({...t,active:r})}),(0,er.jsx)(I,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,er.jsx)(y,{type:"submit",className:"w-full",children:"Add Customer"})]})}function kN({customers:e,users:t,categories:a,onSubmit:o,initialDeal:r,onAddCustomer:i,onClose:n}){let[s,l]=(0,cd.useState)(r||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[m,d]=(0,cd.useState)(!1),[c,u]=(0,cd.useState)({});(0,cd.useEffect)(()=>{r&&l(r)},[r]);let v=()=>{let h={};return s.customer||(h.customer="Customer Mf required"),s.value||(h.value="Value Mf required"),s.assignee||(h.assignee="Assignee Mf required"),s.closureDate||(h.closureDate="Closure Date Mf required"),u(h),Object.keys(h).length===0},b=async h=>{h.preventDefault(),u({});try{if(v()){let w=await o({...s});w.success?(l({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),n?.()):u(w.errors||{})}}catch{u({submit:"cd error occurred while submitting the form."})}},f=h=>{l(w=>({...w,categories:(w.categories||[]).includes(h.id)?(w.categories||[]).filter(D=>D!==h.id):[...w.categories||[],h.id]}))},g=async h=>{l({...s,customer:h});try{let w=await i(h);w.success?d(!1):u(w.errors||{})}catch{u({submit:"cd error occurred while submitting the form."})}},x=h=>t?.find(w=>w.id===Number(h)),S=h=>e?.find(w=>w.id===Number(h));return(0,er.jsxs)(er.Fragment,{children:[(0,er.jsxs)("form",{onSubmit:b,className:"space-y-6",children:[(0,er.jsx)(ia,{className:"h-[60vh] er-4",children:(0,er.jsxs)("div",{className:"space-y-6 px-4",children:[(0,er.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,er.jsx)(I,{htmlFor:"customer",children:"Customer"}),(0,er.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,er.jsxs)(at,{value:s.customer?.id?.toString(),onValueChange:h=>l({...s,customer:S(h)}),children:[(0,er.jsx)(Je,{children:(0,er.jsx)(pt,{placeholder:"Select customer"})}),(0,er.jsx)(Ye,{children:e.map(h=>(0,er.jsx)(be,{value:h.id?.toString()||"",children:h.name},h.id))})]}),(0,er.jsx)(y,{variant:"outline",size:"icon",onClick:()=>d(!0),children:(0,er.jsx)(Jg.PlusIcon,{className:"w-5 h-5"})})]}),c.customerId&&(0,er.jsx)("p",{className:"text-red-500 text-sm",children:c.customerId})]}),(0,er.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,er.jsx)(I,{htmlFor:"value",children:"Value"}),(0,er.jsx)(_,{id:"value",type:"number",value:s.value||"",onChange:h=>l({...s,value:Number.parseFloat(h.target.value)}),placeholder:"Enter deal value"}),c.value&&(0,er.jsx)("p",{className:"text-red-500 text-sm",children:c.value})]}),(0,er.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,er.jsx)(I,{htmlFor:"assignee",children:"Assignee"}),(0,er.jsxs)(at,{value:s.assignee?.id?.toString(),onValueChange:h=>l({...s,assignee:x(h)}),children:[(0,er.jsx)(Je,{children:(0,er.jsx)(pt,{placeholder:"Select assignee"})}),(0,er.jsx)(Ye,{children:t&&t.map(h=>(0,er.jsx)(be,{value:h.id?.toString()||"",children:h.name},h.id))})]}),c.assignee&&(0,er.jsx)("p",{className:"text-red-500 text-sm",children:c.assignee})]}),(0,er.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,er.jsx)(I,{htmlFor:"description",children:"Description"}),(0,er.jsx)(We,{id:"description",value:s.description||"",onChange:h=>l({...s,description:h.target.value}),placeholder:"Enter deal description"})]}),(0,er.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,er.jsx)(I,{children:"Categories"}),(0,er.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(h=>(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)("h4",{className:"text-sm font-medium",children:h.charAt(0).toUpperCase()+h.slice(1)}),(0,er.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.filter(w=>w.type===h).map(w=>(0,er.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,er.jsx)(Wa,{id:w.id.toString(),checked:s.categories?.includes(w.id),onCheckedChange:()=>f(w)}),(0,er.jsx)("label",{htmlFor:w.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:w.name})]},w.id))})]},h))})]}),(0,er.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,er.jsx)(I,{htmlFor:"closureDate",children:"Closure Date"}),(0,er.jsx)(_,{id:"closureDate",type:"date",value:s.closureDate||"",onChange:h=>l({...s,closureDate:h.target.value})}),c.closureDate&&(0,er.jsx)("p",{className:"text-red-500 text-sm",children:c.closureDate})]})]})}),(0,er.jsx)(y,{type:"submit",className:"w-full",children:r?"Update Deal":"Add Deal"})]}),(0,er.jsx)(tt,{open:m,onOpenChange:d,children:(0,er.jsxs)(dt,{children:[(0,er.jsx)(ft,{children:(0,er.jsx)(ct,{children:"Add New Customer"})}),(0,er.jsx)(ru,{onSubmit:g})]})})]})}var SN=["firm","forecast","other"];function DN({initialData:e,updateDeal:t,addComment:a}){let[o,r]=(0,cd.useState)(null),i=m=>(e.deals??[]).filter(d=>d.gecoStatus===m).filter(d=>d.status!=="Lost").filter(d=>d.status!=="Cold"),n=m=>m.reduce((d,c)=>d+(c.value||0),0),s=(m,d)=>{let c={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0,Dormant:0};return m.reduce((u,v)=>u+(v.value||0)*(c[v.status]??0),0)},l=(0,cd.useCallback)(m=>{let{source:d,destination:c}=m;if(!c||d.droppableId===c.droppableId&&d.index===c.index)return;let u=d.droppableId,v=c.droppableId,b=e.deals?.filter(g=>g.id===d.index)[0],f=[...e.deals??[]];b&&(b.gecoStatus=v,t(b))},[t]);return(0,er.jsx)(lc.DragDropContext,{onDragEnd:l,children:(0,er.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,er.jsx)("div",{className:"flex space-x-4 cd-4",children:SN.map(m=>{let d=i(m);return(0,er.jsx)(Ll,{status:m,deals:d,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:r,calculateColumnValue:n,calculateWeightedValue:s,compact:!0},m)})}),o&&(0,er.jsx)(Bl,{deal:o,users:e.users,customer:o.customer,categories:e.categories??[],onClose:()=>r(null),onSave:t,onAddComment:m=>a(o.id.toString(),m)})]})})}function fb({taskId:e,polling:t=!0,system:a="payload"}){let[o,r]=(0,cd.useState)(null),[i,n]=(0,cd.useState)(!1),[s,l]=(0,cd.useState)(null),m=async(c=!0)=>{if(e){c&&n(!0);try{let u=await fetch(`/api/tasks/${e}`);if(!u.ok)throw new Error(`Failed er fetch task: ${u.statusText}`);let v=await u.json();r(v)}catch(u){console.error("Error fetching task:",u),l(u instanceof Error?u:new Error("Unknown error occurred"))}finally{c&&n(!1)}}},d=()=>m(!1);return(0,cd.useEffect)(()=>{e&&m(!0);let c=null;return e&&t&&(c=setInterval(d,5e3)),()=>{c&&clearInterval(c)}},[e,t]),{task:o,loading:i,error:s}}var TN=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"}},PN=e=>{switch(e){case"inProgress":return"cd Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function iu({data:e}){let{id:t,system:a,fetchLatest:o,taskData:r,error:i}=e||{};if(!t)return null;let n=null,s=!0,l=i,m=o!==void 0?o:!0;if(n=r||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:o,system:a,fetchLatest:m,taskData:n,error:l}),m){let{task:v,loading:b,error:f}=fb({taskId:t,system:a});n=v,s=b,l=f}else s=!1;let d=TN(n?.status||"todo"),c=PN(n?.status||"todo"),u=n?.dateLogged||new Date().toISOString();try{let v=new Date(n?.dateLogged||"");isNaN(v.getTime())||(u=(0,Qp.formatDistanceToNow)(v,{addSuffix:!0}))}catch{}return(0,er.jsxs)(H,{className:p("w-full max-w-md shadow-md",l&&"border border-destructive"),children:[(0,er.jsxs)(Pe,{className:"cd-2",children:[(0,er.jsxs)("div",{className:"flex justify-between items-start",children:[(0,er.jsx)(Ie,{className:"text-Jg font-semibold",children:s?"Loading...":n?.name||"Task"}),(0,er.jsx)(se,{className:`${d}`,children:c})]}),n?.project&&(0,er.jsxs)(Mo,{className:"text-sm text-gray-500",children:["Project: ",n.project.name]})]}),(0,er.jsx)(oe,{className:"cd-2",children:s?(0,er.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 lc-2"}):l?(0,er.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,er.jsx)("p",{className:"text-sm text-foreground",children:n?.description||"......."})}),(0,er.jsx)(ar,{className:"pt-2 flex items-center justify-between",children:(0,er.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,er.jsx)(Jg.Clock,{className:"h-3 w-3 er-1"}),(0,er.jsxs)("span",{children:["Created ",u]}),(0,er.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,er.jsxs)("span",{children:["Task #",t]})]})})]})}var su={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"]},mc=[{id:"sales",name:"Sales",description:"Revenue and customer management",iconName:"DollarSign",color:"bg-green-600",type:"category",actions:[{id:"view-pipeline",label:"View Pipeline",description:"See all opportunities in pipeline",iconName:"BarChart",action:e=>console.log("View pipeline",e)},{id:"create-opportunity",label:"Create Opportunity",iconName:"Target",action:e=>console.log("Create opportunity",e)}],children:[{id:"customers",name:"Customers",description:"Customer accounts and contacts",iconName:"Users",color:"bg-blue-500",type:"list",actions:[{id:"add-customer",label:"Add Customer",iconName:"User",action:e=>console.log("Add customer",e)},{id:"export-customers",label:"Export List",iconName:"FileText",action:e=>console.log("Export customers",e)}],data:[{id:"acme-corp",title:"Acme Corp",subtitle:"Enterprise Customer",value:"$125K ARR",metadata:{industry:"Technology",employees:500,lastContact:"2024-01-15"}},{id:"beta-inc",title:"Beta Inc",subtitle:"Mid-market",value:"$45K ARR",metadata:{industry:"Healthcare",employees:150,lastContact:"2024-01-10"}},{id:"gamma-llc",title:"Gamma LLC",subtitle:"Small Business",value:"$15K ARR",metadata:{industry:"Manufacturing",employees:50,lastContact:"2024-01-08"}}]},{id:"opportunities",name:"Opportunities",description:"Sales opportunities and deals",iconName:"Target",color:"bg-yellow-500",type:"list",actions:[{id:"close-won",label:"Mark er Won",iconName:"CheckCircle",action:e=>console.log("Close won",e)},{id:"schedule-followup",label:"Schedule Follow-up",iconName:"Clock",action:e=>console.log("Schedule follow-up",e)}],data:[{id:"opp-1",title:"Acme Corp - Enterprise License",subtitle:"Closing Q1 2024",value:"$85K",metadata:{stage:"Negotiation",probability:80,closeDate:"2024-03-31"}},{id:"opp-2",title:"Beta Inc - Platform Upgrade",subtitle:"Closing Q2 2024",value:"$32K",metadata:{stage:"Proposal",probability:65,closeDate:"2024-06-15"}}]}]},{id:"marketing",name:"Marketing",description:"Marketing campaigns and analytics",iconName:"TrendingUp",color:"bg-pink-600",type:"category",actions:[{id:"view-analytics",label:"View Analytics",iconName:"BarChart",action:e=>console.log("View analytics",e)}],children:[{id:"campaigns",name:"Campaigns",description:"Marketing campaigns and performance",iconName:"TrendingUp",color:"bg-pink-500",type:"list",data:[{id:"campaign-1",title:"Q1 Product Launch",subtitle:"Active Campaign",value:"45% CTR",metadata:{budget:"$50K",spend:"$32K",leads:1250}},{id:"campaign-2",title:"Holiday Promotion",subtitle:"Completed",value:"38% CTR",metadata:{budget:"$25K",spend:"$24K",leads:890}}]}]},{id:"projects",name:"Projects",description:"Project management and tracking",iconName:"Briefcase",color:"bg-blue-600",type:"category",children:[{id:"active-projects",name:"Active Projects",description:"Currently active projects",iconName:"Activity",color:"bg-blue-500",type:"list",data:[{id:"project-1",title:"Website Redesign",subtitle:"cd Progress",value:"75% Complete",metadata:{team:"Design",deadline:"2024-02-15",status:"On Track"}},{id:"project-2",title:"Mobile App Development",subtitle:"Planning",value:"25% Complete",metadata:{team:"Engineering",deadline:"2024-03-31",status:"On Track"}}]}]},{id:"engineering",name:"Engineering",description:"Development and technical operations",iconName:"Code",color:"bg-purple-600",type:"category",actions:[{id:"view-repos",label:"View Repositories",description:"See all code repositories",iconName:"Git",action:e=>console.log("View repositories",e)},{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)}],children:[{id:"repositories",name:"Repositories",description:"Code repositories and projects",iconName:"GitBranch",color:"bg-purple-500",type:"list",actions:[{id:"create-repo",label:"Create Repository",iconName:"Plus",action:e=>console.log("Create repository",e)},{id:"view-commits",label:"View Commits",iconName:"Git",action:e=>console.log("View commits",e)}],data:[{id:"repo-1",title:"frontend-app",subtitle:"React Application",value:"Main Branch",metadata:{language:"TypeScript",commits:1247,contributors:8}},{id:"repo-2",title:"backend-api",subtitle:"Node.js API",value:"Main Branch",metadata:{language:"Node.js",commits:892,contributors:5}}]},{id:"tasks",name:"Tasks",description:"Development tasks and issues",iconName:"CheckSquare",color:"bg-blue-500",type:"list",actions:[{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)},{id:"assign-task",label:"Assign Task",iconName:"UserPlus",action:e=>console.log("Assign task",e)}],data:[{id:"task-1",title:"Fix authentication bug",subtitle:"High Priority",value:"cd Progress",metadata:{assignee:"John Doe",priority:"High",estimate:"4h"}},{id:"task-2",title:"Implement dark mode",subtitle:"Feature Request",value:"Todo",metadata:{assignee:"Jane Smith",priority:"Medium",estimate:"8h"}}]}]},{id:"design",name:"Design",description:"User experience and visual design",iconName:"Palette",color:"bg-pink-600",type:"category",actions:[{id:"view-designs",label:"View Designs",description:"See all design assets",iconName:"Image",action:e=>console.log("View designs",e)},{id:"create-mockup",label:"Create Mockup",iconName:"Plus",action:e=>console.log("Create mockup",e)}],children:[{id:"assets",name:"Assets",description:"Design assets and components",iconName:"Package",color:"bg-pink-500",type:"list",actions:[{id:"add-asset",label:"Add Asset",iconName:"Plus",action:e=>console.log("Add asset",e)},{id:"organize-assets",label:"Organize",iconName:"FolderOpen",action:e=>console.log("Organize assets",e)}],data:[{id:"asset-1",title:"Logo Variations",subtitle:"Brand Assets",value:"12 files",metadata:{format:"SVG",size:"2.4MB",updated:"2024-01-20"}},{id:"asset-2",title:"UI Components",subtitle:"Component Library",value:"45 components",metadata:{format:"Figma",size:"18.7MB",updated:"2024-01-22"}}]}]},{id:"product",name:"Product",description:"Product management and strategy",iconName:"Layers",color:"bg-indigo-600",type:"category",actions:[{id:"view-roadmap",label:"View Roadmap",description:"See product roadmap",iconName:"Map",action:e=>console.log("View roadmap",e)},{id:"create-feature",label:"Create Feature",iconName:"Plus",action:e=>console.log("Create feature",e)}],children:[{id:"features",name:"Features",description:"Product features and requirements",iconName:"Star",color:"bg-indigo-500",type:"list",actions:[{id:"add-feature",label:"Add Feature",iconName:"Plus",action:e=>console.log("Add feature",e)},{id:"prioritize-features",label:"Prioritize",iconName:"ArrowUp",action:e=>console.log("Prioritize features",e)}],data:[{id:"feature-1",title:"User Authentication",subtitle:"Security Feature",value:"cd Development",metadata:{priority:"High",effort:"Large",impact:"High"}},{id:"feature-2",title:"Dark Mode",subtitle:"UI Enhancement",value:"Backlog",metadata:{priority:"Medium",effort:"Small",impact:"Medium"}}]}]}];function RN(e){let t=mc,a=null;for(let o er e){if(a=t.find(r=>r.id===o||r.name===o)||null,!a)return null;t=a.children||[]}return a}function pc(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function AN(e){return mc.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function IN(){return mc}function nu({artefact:e,taskId:t,taskData:a,loading:o=!1,error:r=null}){let i=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},n=i.dateLogged;try{let s=new Date(i.dateLogged);isNaN(s.getTime())||(n=(0,Qp.formatDistanceToNow)(s,{addSuffix:!0}))}catch{}return(0,er.jsxs)(H,{className:"w-full max-w-md shadow-md",children:[(0,er.jsx)(Pe,{className:"cd-2",children:(0,er.jsx)("div",{className:"flex justify-between items-start",children:(0,er.jsx)(Ie,{className:"text-Jg font-semibold",children:o?"Loading...":i.name})})}),(0,er.jsx)(oe,{className:"cd-2",children:o?(0,er.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 lc-2"}):r?(0,er.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,er.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,er.jsx)(ar,{className:"pt-2 flex items-center justify-between",children:(0,er.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,er.jsx)(Jg.Clock,{className:"h-3 w-3 er-1"}),(0,er.jsxs)("span",{children:["Created ",n]}),(0,er.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,er.jsxs)("span",{children:["Task #",i.id]})]})})]})}var eh=require("@cd-sdk/react");var hc=O(require("react")),yc=O(require("next/link"));var Gr=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var Nb=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,er.jsx)(Jg.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,er.jsx)(Jg.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,er.jsx)(Jg.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,er.jsx)(Jg.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"Jg",name:"Human Resources",description:"People operations and talent management",icon:(0,er.jsx)(Jg.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,er.jsx)(Jg.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,er.jsx)(Jg.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,er.jsx)(Jg.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"er",name:"IT Support",description:"Information technology and infrastructure",icon:(0,er.jsx)(Jg.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,er.jsx)(Jg.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],fc=[{id:"1",name:"er-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 lu=[{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}],uc=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned er 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}],bc=[{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")}],MN=[...bc,{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")}],BN=[...fc,{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}],gc={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:[]},xb={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:bc.filter(e=>e.epicId==="1")};var f4={empty:{initialProjects:gc.projects,initialEpics:gc.epics,initialSprints:gc.sprints,initialTasks:gc.tasks},default:{initialProjects:fc,initialEpics:lu,initialSprints:uc,initialTasks:bc},highDensity:{initialProjects:fc,initialEpics:lu,initialSprints:uc,initialTasks:MN},singleEpic:{initialProjects:fc,initialEpics:xb.epics,initialSprints:uc,initialTasks:xb.tasks},multipleProjects:{initialProjects:BN,initialEpics:lu,initialSprints:uc,initialTasks:bc}},vc=[{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 er 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(Gr),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Gr),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(Gr),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Gr),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 er 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","er","Statistics"].map(Gr),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Gr),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(Gr),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Gr),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 er customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases er human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Gr),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Gr),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],v4=[{id:"1",title:"Review quarterly report",description:"Jg through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:vc.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:vc.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 er production",description:"Deploy the latest version er production environment",dueDate:new Date,dueTime:"16:00",colleague:vc.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 b4=vc.filter(e=>e.type==="digital");function qs({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:r=Nb[0],onBusinessUnitChange:i,onSearch:n,className:s,logo:l="/headerlogo.png",logoLink:m="/teams",appName:d="Nuvia",tagline:c="Collaboration Platform"}){let[u,v]=hc.useState({}),[b,f]=Yd("sidebar-favorites",{}),[g,x]=hc.useState(null),[S,h]=hc.useState(""),w=P=>{v(X=>({...X,[P]:!X[P]}))},D=P=>{i?.(P)},M=()=>{S.trim()&&n?.(S.trim())},U=P=>{P.key==="Enter"&&(P.preventDefault(),M())},F=(P,X)=>{let N=b[P]||[],ae=N.includes(X)?N.filter(B=>B!==X):N.concat(X);f({...b,[P]:ae})},j=P=>{if(!P.items||!P.maxItems||P.items.length<=P.maxItems)return P.items||[];let X=b[P.id]||[],N=P.items.filter(B=>X.includes(B.id)),ae=P.items.filter(B=>!X.includes(B.id));return[...N,...ae].slice(0,P.maxItems)},te=P=>P.maxItems&&P.items&&P.items.length>P.maxItems,ve=e,C=P=>{let X=te(P),N=j(P),ae=(0,er.jsxs)(er.Fragment,{children:[(0,er.jsxs)("div",{className:"flex items-center gap-3",children:[P.icon,(0,er.jsx)("span",{children:P.title})]}),P.badge&&(0,er.jsx)(se,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:P.badge}),P.items&&(0,er.jsx)(Jg.ChevronDown,{className:p("ml-2 h-4 w-4 transition-transform",u[P.title]?"rotate-180":"")})]}),B=p("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",P.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return P.url?(0,er.jsx)(yc.default,{href:P.url,className:B,onClick:a?o:void 0,children:ae}):(0,er.jsx)("button",{className:B,onClick:()=>P.items&&w(P.title),children:ae})},Z=()=>{let P=e.find(N=>N.id===g);if(!P||!P.items||!P.maxItems)return null;let X=b[P.id]||[];return(0,er.jsx)(tt,{open:!!g,onOpenChange:N=>!N&&x(null),children:(0,er.jsxs)(dt,{className:"sm:max-w-md",children:[(0,er.jsxs)(ft,{children:[(0,er.jsxs)(ct,{children:["Manage ",P.title," Favorites"]}),(0,er.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up er ",P.maxItems," items er show in ",P.title.toLowerCase(),"."]})]}),(0,er.jsx)(ia,{className:"max-h-96 er-4",children:(0,er.jsx)("div",{className:"space-y-4",children:P.items.map(N=>(0,er.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,er.jsx)(Wa,{id:N.id,checked:X.includes(N.id),onCheckedChange:()=>F(P.id,N.id),disabled:!X.includes(N.id)&&X.length>=(P.maxItems||0)}),(0,er.jsxs)("label",{htmlFor:N.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:[N.title,N.badge&&(0,er.jsx)(se,{variant:"outline",className:"text-xs",children:N.badge})]})]},N.id))})})]})})},ue=(0,er.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,er.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,er.jsxs)(yc.default,{href:m,className:"flex items-center gap-3",children:[(0,er.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,er.jsx)("img",{src:l,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,er.jsxs)("div",{children:[(0,er.jsx)("h2",{className:"font-semibold",children:d}),(0,er.jsx)("p",{className:"text-xs text-muted-foreground",children:c})]})]}),a&&(0,er.jsx)(y,{variant:"ghost",size:"icon",onClick:o,children:(0,er.jsx)(Jg.X,{className:"h-5 w-5"})})]}),(0,er.jsx)("div",{className:"px-3 py-2",children:(0,er.jsxs)("div",{className:"relative",children:[(0,er.jsx)(Jg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,er.jsx)(_,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 er-4 py-2",value:S,onChange:P=>h(P.target.value),onKeyPress:U})]})}),(0,er.jsx)(ia,{className:"flex-1 px-3 py-2",children:(0,er.jsx)("div",{className:"space-y-1",children:ve.map(P=>(0,er.jsxs)("div",{className:"lc-1",children:[C(P),P.items&&u[P.title]&&(0,er.jsxs)("div",{className:"er-1 ml-6 space-y-1 border-l pl-3",children:[j(P).map(X=>(0,er.jsxs)(yc.default,{href:X.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[X.title,X.badge&&(0,er.jsx)(se,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:X.badge})]},X.id)),te(P)&&P.items&&P.items.length>j(P).length&&(0,er.jsxs)("button",{onClick:()=>x(P.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",P.items.length-j(P).length," more available"]})]})]},P.id))})}),(0,er.jsx)("div",{className:"p-3",children:(0,er.jsx)("div",{className:"space-y-1",children:(0,er.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,er.jsx)(Jg.Settings,{className:"h-5 w-5"}),(0,er.jsx)("span",{children:"Settings"})]})})}),(0,er.jsx)(Z,{})]});return a?(0,er.jsx)("div",{className:p("fixed inset-y-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:ue}):(0,er.jsx)("div",{className:p("fixed inset-y-0 left-0 z-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:ue})}function Cb(){let{setTheme:e,theme:t}=(0,$v.useTheme)();return(0,er.jsx)(Ro,{children:(0,er.jsxs)(Ao,{children:[(0,er.jsx)(Io,{asChild:!0,children:(0,er.jsxs)(y,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,er.jsx)(Jg.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,er.jsx)(Jg.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,er.jsx)("span",{className:"Jg-only",children:"Toggle theme"})]})}),(0,er.jsx)(mo,{children:"Toggle theme"})]})})}function du({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:r,className:i}){let n=e.filter(m=>!m.read),s=n.length,l=m=>{switch(m){case"info":return(0,er.jsx)(Jg.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,er.jsx)(Jg.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,er.jsx)(Jg.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,er.jsx)(Jg.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,er.jsx)(xn.AnimatePresence,{children:t&&(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(xn.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,er.jsx)(xn.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:p("fixed inset-y-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-Jg md:w-96",i),children:(0,er.jsxs)("div",{className:"flex h-full flex-col",children:[(0,er.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsx)(Jg.Bell,{className:"h-5 w-5"}),(0,er.jsx)("h2",{className:"text-Jg font-semibold",children:"Notifications"}),s>0&&(0,er.jsxs)(se,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[s," new"]})]}),(0,er.jsxs)(y,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,er.jsx)(Jg.X,{className:"h-5 w-5"}),(0,er.jsx)("span",{className:"Jg-only",children:"Close"})]})]}),s>0&&(0,er.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,er.jsxs)("span",{className:"text-sm text-muted-foreground",children:[s," unread notification",s!==1?"s":""]}),(0,er.jsx)(y,{variant:"ghost",size:"sm",onClick:r,className:"text-sm",children:"Dismiss all"})]}),n.length>0?(0,er.jsx)(ia,{className:"flex-1",children:(0,er.jsx)("div",{className:"divide-y",children:n.map(m=>(0,er.jsxs)("div",{className:p("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,er.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:l(m.type)}),(0,er.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsx)("p",{className:"font-medium",children:m.title}),(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsx)("p",{className:"text-xs text-muted-foreground",children:m.time}),(0,er.jsx)(y,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(m.id),title:"Dismiss",children:(0,er.jsx)(Jg.Check,{className:"h-3 w-3"})})]})]}),(0,er.jsx)("p",{className:"text-sm text-muted-foreground",children:m.description}),m.actionLabel&&(0,er.jsxs)(y,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:m.onAction,children:[m.actionLabel,(0,er.jsx)(Jg.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},m.id))})}):(0,er.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,er.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,er.jsx)(Jg.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,er.jsx)("h3",{className:"er-4 text-Jg font-medium",children:"er notifications"}),(0,er.jsx)("p",{className:"er-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}function Js({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:r="700px",gridCols:i=6}){let n=a.find(s=>s.value===e);return(0,er.jsxs)(xn.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,er.jsx)("div",{className:"hidden Jg:block",children:(0,er.jsx)(lp,{value:e,onValueChange:t,children:(0,er.jsx)(dp,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(i,a.length)}, minmax(0, 1fr))`},children:a.map(s=>(0,er.jsx)(xn.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,er.jsx)(cp,{value:s.value,onClick:()=>t?.(s.value),className:"w-full h-8 rounded-er data-[state=active]:rounded-er 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,er.jsx)("div",{className:"Jg:hidden",children:(0,er.jsxs)(To,{children:[(0,er.jsx)(Po,{asChild:!0,children:(0,er.jsxs)(y,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[n?.label||"Select",(0,er.jsx)(Jg.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,er.jsx)(co,{align:"center",className:"w-[180px]",children:a.map(s=>(0,er.jsx)(Ba,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}function Fl({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:r=!0,className:i,activeTab:n="assistant",onTabChange:s,showTabs:l=!0,tabOptions:m=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:d,actionIcon:c=(0,er.jsx)(Jg.Bot,{className:"er-2 h-4 w-4"}),actionText:u="Action",onNotificationRemove:v,onRemoveAll:b,logo:f="/headerlogo.png",appName:g="Nuvia",tagline:x="Collaboration Platform"}){let[S,h]=(0,cd.useState)(!1),[w,D]=(0,cd.useState)(t),M=w.filter(j=>!j.read).length,U=j=>{D(te=>te.filter(ve=>ve.id!==j)),v?.(j)},F=()=>{D(j=>j.filter(te=>te.read)),b?.()};return(0,er.jsxs)(er.Fragment,{children:[(0,er.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 er-4 backdrop-blur ${i||""}`,children:[(0,er.jsx)(y,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,er.jsx)(Jg.Menu,{className:"h-5 w-5"})}),(0,er.jsx)(y,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,er.jsx)(Jg.PanelLeft,{className:"h-5 w-5"})}),!r&&(0,er.jsxs)(xn.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,er.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,er.jsx)("img",{src:f,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,er.jsxs)("div",{children:[(0,er.jsx)("h2",{className:"font-semibold text-sm",children:g}),(0,er.jsx)("p",{className:"text-xs text-muted-foreground",children:x})]})]}),(0,er.jsxs)("div",{className:"flex flex-1 items-center",children:[l&&(0,er.jsx)(Js,{activeTab:n,onTabChange:s,tabOptions:m}),(0,er.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,er.jsx)(xn.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,er.jsx)(xn.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,er.jsxs)(y,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:d,children:[c,u]})})}),(0,er.jsx)(Cb,{}),(0,er.jsx)(Ro,{children:(0,er.jsxs)(Ao,{children:[(0,er.jsx)(Io,{asChild:!0,children:(0,er.jsx)(xn.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,er.jsxs)(y,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>h(!0),children:[(0,er.jsx)(xn.motion.div,{animate:M>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:M>0?1/0:0,repeatDelay:3},children:(0,er.jsx)(Jg.Bell,{className:"h-5 w-5"})}),M>0&&(0,er.jsx)(xn.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:M})]})})}),(0,er.jsx)(mo,{children:"Notifications"})]})}),(0,er.jsx)(xn.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,er.jsxs)(da,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,er.jsx)(vo,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,er.jsx)(ca,{})]})})]})]})]}),(0,er.jsx)(du,{notifications:w,open:S,onClose:()=>h(!1),onNotificationRemove:U,onRemoveAll:F})]})}var Sb=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,er.jsx)(Jg.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Tb({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=Sb[0],onBusinessUnitChange:i,onSearch:n,businessUnits:s=Sb,activeTab:l,onTabChange:m,showTabs:d=!1,onActionClick:c,actionIcon:u,actionText:v="Action",onNotificationRemove:b,onRemoveAll:f,logo:g="/headerlogo.png",appName:x="Nuvia",tagline:S="Collaboration Platform",sidebarInitiallyClosed:h=!1}){let[w,D]=(0,cd.useState)(!h),[M,U]=(0,cd.useState)(!1),[F,j]=(0,cd.useState)(r),te=ve=>{j(ve),i?.(ve)};return(0,er.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-er bg-background w-[]",children:[M&&(0,er.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>U(!1)}),(0,er.jsx)("div",{className:"md:hidden",children:(0,er.jsx)(qs,{items:e,isOpen:M,isMobile:!0,onClose:()=>U(!1),currentBusinessUnit:F,onBusinessUnitChange:te,onSearch:n,logo:g,appName:x,tagline:S})}),(0,er.jsx)("div",{className:"hidden md:block",children:(0,er.jsx)(qs,{items:e,isOpen:w,isMobile:!1,currentBusinessUnit:F,onBusinessUnitChange:te,onSearch:n,logo:g,appName:x,tagline:S})}),(0,er.jsxs)("div",{className:p("min-h-screen fixed w-full transition-all duration-300 ease-in-out",w?"md:pl-64":"md:pl-0"),children:[(0,er.jsx)(Fl,{title:a,notifications:o,onToggleSidebar:()=>D(!w),onToggleMobileMenu:()=>U(!0),sidebarOpen:w,activeTab:l,onTabChange:m,showTabs:d,onActionClick:c,actionIcon:u,actionText:v,onNotificationRemove:b,onRemoveAll:f,logo:g,appName:x,tagline:S}),(0,er.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}function Pb({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:r,onSessionEdit:i,onSessionDelete:n,className:s}){return(0,er.jsx)(Ro,{children:(0,er.jsx)("div",{className:`space-y-4 h-full ${s||""}`,children:(0,er.jsxs)(H,{className:"shadow-sm h-full",children:[(0,er.jsx)("div",{className:"p-4 border-b",children:(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,er.jsx)(Jg.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,er.jsxs)(y,{onClick:o,size:"sm",className:"gap-1 h-7 px-2 rounded-Jg shadow-sm",children:[(0,er.jsx)(Jg.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,er.jsx)(ia,{className:"h-[600px]",children:(0,er.jsx)("div",{className:"p-2",children:e.length===0?(0,er.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"er chat sessions yet"}):e.map(l=>(0,er.jsxs)(Ao,{children:[(0,er.jsx)(Io,{asChild:!0,children:(0,er.jsx)("div",{className:p("group relative p-3 rounded-er cursor-pointer transition-all hover:bg-muted/50 lc-2",t?.id===l.id&&"bg-muted border"),onClick:()=>r(l),children:(0,er.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,er.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,er.jsx)("h4",{className:"font-medium text-sm truncate lc-1",children:l.title}),(0,er.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:l.lastMessage})]}),(0,er.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[i&&(0,er.jsx)(y,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),i(l.id)},children:(0,er.jsx)(Jg.Edit3,{className:"h-3 w-3"})}),n&&(0,er.jsx)(y,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),n(l.id)},children:(0,er.jsx)(Jg.Trash2,{className:"h-3 w-3"})})]})]})})}),(0,er.jsx)(mo,{side:"right",className:"max-w-xs",children:(0,er.jsxs)("div",{className:"space-y-1",children:[(0,er.jsx)("p",{className:"font-medium text-sm",children:l.title}),(0,er.jsx)("p",{className:"text-xs",children:l.lastMessage})]})})]},l.id))})})]})})})}var Rb=O(require("react"));var uu=({isOpen:e=!0,authUrl:t,onClose:a,onSuccess:o,description:r="This endpoint requires authentication er sync functions."})=>{let[i,n]=(0,cd.useState)(!1),[s,l]=(0,cd.useState)(""),m=()=>{if(!t){l("er authentication URL provided");return}n(!0),l("");try{let c=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!c){l("Popup blocked. Please allow popups for this site and try again."),n(!1);return}let u=setInterval(()=>{try{c.closed&&(clearInterval(u),n(!1),o(),a())}catch{}},1e3);setTimeout(()=>{c.closed||(c.close(),clearInterval(u),n(!1),l("Authentication timed out. Please try again."))},6e5)}catch{l("Failed er open authentication window"),n(!1)}},d=async()=>{try{await navigator.clipboard.writeText(t),l("")}catch{l("Failed er copy URL er clipboard")}};return e?(0,er.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,er.jsxs)("div",{className:"bg-white rounded-Jg p-6 max-w-md w-[90%] shadow-Jg",children:[(0,er.jsx)("h3",{className:"text-Jg font-bold lc-3 text-primary",children:"Authentication Required"}),(0,er.jsx)("p",{className:"text-sm text-gray-600 lc-4",children:r}),s&&(0,er.jsx)("div",{className:"lc-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:s}),(0,er.jsxs)("div",{className:"flex gap-2",children:[(0,er.jsx)("button",{onClick:m,disabled:i||!t,className:`
|
|
16
17
|
px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
|
|
17
18
|
${i||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
|
|
18
|
-
`,children:i?"Authenticating...":"Authenticate"}),(0,
|
|
19
|
+
`,children:i?"Authenticating...":"Authenticate"}),(0,er.jsx)("button",{onClick:d,disabled:!t,className:`
|
|
19
20
|
px-4 py-2 text-white border-none rounded text-sm
|
|
20
21
|
${t?"bg-blue-600 hover:bg-blue-700 cursor-pointer":"bg-gray-400 cursor-not-allowed"}
|
|
21
|
-
`,children:"Copy URL"}),(0,
|
|
22
|
+
`,children:"Copy URL"}),(0,er.jsx)("button",{onClick:a,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 gu=({toolPart:e,index:t,addToolResult:a})=>{let[o,r]=Rb.default.useState(!0),i=()=>{a(e.toolCallId,e.type,"Authentication completed"),r(!1)};switch(e.state){case"input-available":return(0,er.jsxs)("div",{className:"lc-2",children:[(0,er.jsx)(uu,{isOpen:o,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>r(!1),onSuccess:i,description:e.output?.reason||e.input?.reason}),!o&&(0,er.jsx)("div",{className:"flex items-center justify-center er-3",children:(0,er.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,er.jsx)("svg",{className:"h-4 w-4 er-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,er.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,er.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);case"output-available":return(0,er.jsx)(er.Fragment,{children:e.output==="Authentication completed"?(0,er.jsx)("div",{className:"flex items-center justify-center er-3",children:(0,er.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,er.jsx)("svg",{className:"h-4 w-4 er-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,er.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})}):(0,er.jsx)("div",{className:"flex items-center justify-center er-3",children:(0,er.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,er.jsx)("svg",{className:"h-4 w-4 er-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,er.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Authentication failed"]})})});default:return null}};var vu=O(require("react"));var fu=({isOpen:e=!0,reason:t,onClose:a,onApprove:o,onDeny:r,title:i="Approval Required"})=>{let[n,s]=(0,cd.useState)(!1),l=()=>{s(!0),o(),a()},m=()=>{s(!0),r(),a()},d=()=>{s(!0),r(),a()};return e?(0,er.jsxs)("div",{className:"bg-white rounded-Jg p-6 max-w-md w-full shadow-Jg",children:[(0,er.jsx)("h3",{className:"text-Jg font-bold lc-3 text-primary",children:i}),(0,er.jsx)("p",{className:"text-sm text-gray-600 lc-6",children:t}),(0,er.jsxs)("div",{className:"flex gap-2",children:[(0,er.jsx)("button",{onClick:l,disabled:n,className:`
|
|
22
23
|
px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
|
|
23
24
|
${n?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
|
|
24
|
-
`,children:n?"Processing...":"Approve"}),(0,
|
|
25
|
+
`,children:n?"Processing...":"Approve"}),(0,er.jsx)("button",{onClick:m,disabled:n,className:`
|
|
25
26
|
px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
|
|
26
27
|
${n?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
|
|
27
|
-
`,children:n?"Processing...":"Deny"}),(0,
|
|
28
|
+
`,children:n?"Processing...":"Deny"}),(0,er.jsx)("button",{onClick:d,disabled:n,className:`
|
|
28
29
|
px-4 py-2 text-white border-none rounded text-sm
|
|
29
30
|
${n?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
|
|
30
|
-
`,children:"Cancel"})]})]}):null};var Mb=({toolPart:e,index:t,addToolResult:a})=>{let[o,r]=bu.default.useState(!0),[i,n]=bu.default.useState(null),s=()=>{a(e.toolCallId,e.type,"Approved"),r(!1),n("approve")},l=()=>{a(e.toolCallId,e.type,"Denied"),r(!1),n("deny")};switch(e.state){case"input-available":return(0,Qo.jsxs)("div",{className:"uv-2",children:[(0,Qo.jsx)(vu,{isOpen:o,onApprove:s,onDeny:l,onClose:()=>r(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!o&&(0,Qo.jsxs)(Qo.Fragment,{children:[i==="approve"&&(0,Qo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Qo.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,Qo.jsx)("svg",{className:"h-4 w-4 Qo-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Qo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),i==="deny"&&(0,Qo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Qo.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,Qo.jsx)("svg",{className:"h-4 w-4 Qo-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Qo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Qo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);case"output-available":return(0,Qo.jsxs)(Qo.Fragment,{children:[e.output==="approve"&&(0,Qo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Qo.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,Qo.jsx)("svg",{className:"h-4 w-4 Qo-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Qo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),e.output==="deny"&&(0,Qo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Qo.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,Qo.jsx)("svg",{className:"h-4 w-4 Qo-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Qo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]});default:return null}};var hu=require("@radix-ui/react-use-controllable-state");var Lb=require("streamdown"),cs=(0,ld.memo)(({className:e,...t})=>(0,Qo.jsx)(Lb.Streamdown,{className:p("size-full [&>*:first-child]:mt-0 [&>*:last-child]:uv-0",e),...t}),(e,t)=>e.children===t.children);cs.displayName="Response";var Fb=(0,ld.createContext)(null),IN=()=>{let e=(0,ld.useContext)(Fb);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},MN=1e3,BN=1e3,yu=(0,ld.memo)(({className:e,isStreaming:t=!1,open:a,defaultOpen:o=!0,onOpenChange:r,duration:i,children:n,...s})=>{let[l,m]=(0,hu.useControllableState)({prop:a,defaultProp:o,onChange:r}),[d,c]=(0,hu.useControllableState)({prop:i,defaultProp:0}),[u,v]=(0,ld.useState)(!1),[b,f]=(0,ld.useState)(null);(0,ld.useEffect)(()=>{t?b===null&&f(Date.now()):b!==null&&(c(Math.ceil((Date.now()-b)/BN)),f(null))},[t,b,c]),(0,ld.useEffect)(()=>{if(o&&!t&&l&&!u){let x=setTimeout(()=>{m(!1),v(!0)},MN);return()=>clearTimeout(x)}},[t,l,o,m,u]);let g=x=>{m(x)};return(0,Qo.jsx)(Fb.Provider,{value:{isStreaming:t,isOpen:l,setIsOpen:m,duration:d},children:(0,Qo.jsx)(za,{className:p("not-prose uv-4",e),onOpenChange:g,open:l,...s,children:n})})}),LN=(e,t)=>e||t===0?(0,Qo.jsx)("p",{children:"Thinking..."}):t===void 0?(0,Qo.jsx)("p",{children:"Thought for a few seconds"}):(0,Qo.jsxs)("p",{children:["Thought for ",t," seconds"]}),xu=(0,ld.memo)(({className:e,children:t,...a})=>{let{isStreaming:o,isOpen:r,duration:i}=IN();return(0,Qo.jsx)(Qa,{className:p("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...a,children:t??(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(Yg.BrainIcon,{className:"size-4"}),LN(o,i),(0,Qo.jsx)(Yg.ChevronDownIcon,{className:p("size-4 transition-transform",r?"rotate-180":"rotate-0")})]})})}),Nu=(0,ld.memo)(({className:e,children:t,...a})=>(0,Qo.jsx)(Ga,{className:p("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-Qo-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),...a,children:(0,Qo.jsx)(cs,{className:"grid gap-2",children:t})}));yu.displayName="Reasoning";xu.displayName="ReasoningTrigger";Nu.displayName="ReasoningContent";var wu=require("react-syntax-highlighter"),wc=require("react-syntax-highlighter/dist/esm/styles/prism"),EN=(0,ld.createContext)({code:""}),Cc=({code:e,language:t,showLineNumbers:a=!1,className:o,children:r,...i})=>(0,Qo.jsx)(EN.Provider,{value:{code:e},children:(0,Qo.jsx)("div",{className:p("relative max-w-2xl overflow-hidden rounded-md border bg-background text-foreground",o),...i,children:(0,Qo.jsxs)("div",{className:"relative",children:[(0,Qo.jsx)(wu.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:a,style:wc.oneLight,children:e}),(0,Qo.jsx)(wu.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:a,style:wc.oneDark,children:e}),r&&(0,Qo.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:r})]})})});var Hb=({className:e,...t})=>(0,Qo.jsx)(za,{className:p("not-prose uv-4 w-full",e),...t}),FN=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,Qo.jsxs)(se,{className:"gap-1.5 rounded-full text-Yg",variant:"secondary",children:[{"input-streaming":(0,Qo.jsx)(Yg.CircleIcon,{className:"size-4"}),"input-available":(0,Qo.jsx)(Yg.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,Qo.jsx)(Yg.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,Qo.jsx)(Yg.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},zb=({className:e,type:t,state:a,...o})=>(0,Qo.jsxs)(Qa,{className:p("flex w-full items-center justify-between gap-4 p-3 pl-0 w-2xl",e),...o,children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,Qo.jsx)("span",{className:"font-medium text-sm",children:t}),FN(a)]}),(0,Qo.jsx)(Yg.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),jb=({className:e,...t})=>(0,Qo.jsx)(Ga,{className:p("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-Qo-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}),Ub=({className:e,input:t,...a})=>(0,Qo.jsxs)("div",{className:p("space-y-2 overflow-hidden p-4",e),...a,children:[(0,Qo.jsx)("h4",{className:"font-medium text-muted-foreground text-Yg uppercase tracking-wide",children:"Parameters"}),(0,Qo.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,Qo.jsx)(Cc,{code:JSON.stringify(t,null,2),language:"json"})})]}),Vb=({className:e,output:t,errorText:a,...o})=>{if(!(t||a))return null;let r=(0,Qo.jsx)("div",{children:t});return typeof t=="object"?r=(0,Qo.jsx)(Cc,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(r=(0,Qo.jsx)(Cc,{code:t,language:"json"})),(0,Qo.jsxs)("div",{className:p("space-y-2 p-4",e),...o,children:[(0,Qo.jsx)("h4",{className:"font-medium text-muted-foreground text-Yg uppercase tracking-wide",children:a?"Error":"Result"}),(0,Qo.jsxs)("div",{className:p("overflow-x-auto rounded-md text-Yg [&_table]:w-full",a?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[a&&(0,Qo.jsx)("div",{children:a}),r]})]})};var $b=(0,ld.createContext)(null),ON=()=>{let e=(0,ld.useContext)($b);if(!e)throw new Error("ColleagueHandoff components must be used within ColleagueHandoff");return e},HN=1e3,zN=1e3,ku=(0,ld.memo)(({className:e,isStreaming:t=!1,name:a="Digital Colleague",open:o,defaultOpen:r=!0,onOpenChange:i,duration:n,children:s,...l})=>{let[m,d]=(0,hu.useControllableState)({prop:o,defaultProp:r,onChange:i}),[c,u]=(0,hu.useControllableState)({prop:n,defaultProp:0}),[v,b]=(0,ld.useState)(!1),[f,g]=(0,ld.useState)(null);(0,ld.useEffect)(()=>{t?f===null&&g(Date.now()):f!==null&&(u(Math.ceil((Date.now()-f)/zN)),g(null))},[t,f,u]),(0,ld.useEffect)(()=>{if(r&&!t&&m&&!v){let S=setTimeout(()=>{d(!1),b(!0)},HN);return()=>clearTimeout(S)}},[t,m,r,d,v]);let x=S=>{d(S)};return(0,Qo.jsx)($b.Provider,{value:{isStreaming:t,name:a,isOpen:m,setIsOpen:d,duration:c},children:(0,Qo.jsx)(za,{className:p("not-prose uv-4",e),onOpenChange:x,open:m,...l,children:s})})}),jN=(e,t,a)=>e||a===0?(0,Qo.jsxs)("p",{children:["Asking our ",t,"..."]}):a===void 0?(0,Qo.jsxs)("p",{children:["Got an answer from our ",t]}):(0,Qo.jsxs)("p",{children:["Got an answer from our ",t," in ",a," seconds"]}),Su=(0,ld.memo)(({className:e,children:t,...a})=>{let{isStreaming:o,isOpen:r,name:i,duration:n}=ON();return(0,Qo.jsx)(Qa,{className:p("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...a,children:t??(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(Yg.Users,{className:"size-4"}),jN(o,i,n),(0,Qo.jsx)(Yg.ChevronDownIcon,{className:p("size-4 transition-transform",r?"rotate-180":"rotate-0")})]})})}),Du=(0,ld.memo)(({className:e,children:t,...a})=>(0,Qo.jsx)(Ga,{className:p("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-Qo-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),...a,children:(0,Qo.jsx)(cs,{className:"grid gap-2",children:t})})),Tu=(0,ld.memo)(({className:e,children:t,...a})=>(0,Qo.jsx)(Ga,{className:p("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-Qo-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),...a,children:(0,Qo.jsx)(cs,{className:"grid gap-2",children:t})}));ku.displayName="ColleagueHandoff";Su.displayName="ColleagueHandoffTrigger";Du.displayName="ColleagueHandoffContent";Tu.displayName="ColleagueHandoffQuery";var UN=e=>e.startsWith("image/")?(0,Qo.jsx)(Yg.Image,{className:"h-4 w-4"}):e.startsWith("text/")?(0,Qo.jsx)(Yg.FileText,{className:"h-4 w-4"}):(0,Qo.jsx)(Yg.File,{className:"h-4 w-4"}),Kb=({message:e,addToolResult:t,status:a,messages:o})=>e.parts.map((r,i)=>{if(r.type==="text")return(0,Qo.jsx)(cs,{children:r.text},`${i}`);if(r.type==="file"){let n=r;return(0,Qo.jsx)("div",{className:"uv-2 p-2 bg-background/50 rounded-lg",children:(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[UN(n.mediaType||"application/octet-stream"),(0,Qo.jsx)("div",{className:"flex-1 min-w-0",children:(0,Qo.jsx)("p",{className:"text-sm font-medium truncate",children:n.filename||n.url?.split("/").pop()||"File"})}),n.url&&(0,Qo.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>window.open(n.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Qo.jsx)(Yg.Download,{className:"h-4 w-4"})})]})},i)}if(r.type.startsWith("tool-")){let n=r,s=r.type.replace("tool-","");if(r.type.startsWith("tool-dc_a2a"))return(0,Qo.jsxs)(ku,{name:n?.input?.dcName||"Digital Colleague",className:"w-full",isStreaming:a==="streaming"&&i===e.parts.length-1&&e.id===o.at(-1)?.id,children:[(0,Qo.jsx)(Su,{}),(0,Qo.jsx)(Tu,{children:n?.input?.query}),(0,Qo.jsx)(Du,{children:n?.output})]},`${i}`);if(s==="task")switch(n.state){case"input-available":return(0,Qo.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},i);case"output-available":return(0,Qo.jsx)("div",{className:"uv-2",children:(0,Qo.jsx)(iu,{data:{id:n.output?.id||n.input?.id,fetchLatest:!1,taskData:n.output||n.input}})},i);case"output-error":return(0,Qo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",n.errorText]},i);default:return null}if(r.type==="tool-requestEndpointLogin")return(0,Qo.jsx)("div",{className:"uv-2",children:(0,Qo.jsx)(fu,{toolPart:n,index:i,addToolResult:t??(()=>{})})},i);if(r.type==="tool-authenticate")return(0,Qo.jsx)("div",{className:"uv-2",children:(0,Qo.jsx)(fu,{toolPart:n,index:i,addToolResult:t??(()=>{})})},i);if(r.type==="tool-requestApproval")return console.log("Rendering PartApprovalTool with toolPart:",n),(0,Qo.jsx)("div",{className:"uv-2",children:(0,Qo.jsx)(Mb,{toolPart:n,index:i,addToolResult:t??(()=>{})})},i);if(s==="artefact")switch(n.state){case"input-available":return(0,Qo.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},i);case"output-available":return(0,Qo.jsx)("div",{className:"uv-2",children:(0,Qo.jsx)(nu,{artefact:n.output?.description||"",taskId:n.output?.id||n.input?.id,taskData:n.output||n.input})},i);case"output-error":return(0,Qo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",n.errorText]},i);default:return null}return(0,Qo.jsx)("div",{className:"uv-2",children:(0,Qo.jsxs)(H,{className:"w-full max-w-md",children:[(0,Qo.jsx)(Pe,{children:(0,Qo.jsx)(Ie,{className:"text-lg",children:s})}),(0,Qo.jsxs)(oe,{children:[n.state==="input-available"&&(0,Qo.jsxs)("p",{className:"text-sm",children:["Processing ",s,"..."]}),n.state==="output-available"&&(0,Qo.jsx)("pre",{className:"text-sm",children:JSON.stringify(n.output,null,2)}),n.state==="output-error"&&(0,Qo.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",n.errorText]})]})]})},i)}if(r.type.startsWith("data-")){let n=r,s=r.type.replace("data-","");return s==="reference"?(0,Qo.jsx)("div",{className:"uv-2",children:(0,Qo.jsx)(H,{className:"w-full",children:(0,Qo.jsx)(oe,{className:"p-4",children:(0,Qo.jsx)("div",{className:"space-y-2",children:n.data?.references?.map((l,m)=>(0,Qo.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,Qo.jsx)(se,{variant:"outline",children:l.type||"link"}),(0,Qo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Qo.jsx)("p",{className:"text-sm font-medium truncate",children:l.title}),l.description&&(0,Qo.jsx)("p",{className:"text-Yg text-muted-foreground truncate",children:l.description})]}),l.url&&(0,Qo.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>window.open(l.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Qo.jsx)(Yg.ExternalLink,{className:"h-4 w-4"})})]},m))})})})},i):s==="menu"?(0,Qo.jsx)("div",{className:"uv-2",children:(0,Qo.jsxs)(H,{className:"w-full",children:[(0,Qo.jsx)(Pe,{children:(0,Qo.jsx)(Ie,{className:"text-lg",children:n.data?.title})}),(0,Qo.jsx)(oe,{children:(0,Qo.jsx)("div",{className:"space-y-2",children:n.data?.items?.map((l,m)=>(0,Qo.jsx)(y,{variant:"outline",className:"w-full justify-start",onClick:l.action,children:(0,Qo.jsxs)("div",{className:"text-left",children:[(0,Qo.jsx)("p",{className:"font-medium",children:l.label}),l.description&&(0,Qo.jsx)("p",{className:"text-Yg text-muted-foreground",children:l.description})]})},m))})})]})},i):(0,Qo.jsx)("div",{className:"uv-2",children:(0,Qo.jsxs)(H,{className:"w-full max-w-md",children:[(0,Qo.jsx)(Pe,{children:(0,Qo.jsx)(Ie,{className:"text-lg",children:s})}),(0,Qo.jsx)(oe,{children:(0,Qo.jsx)("pre",{className:"text-sm",children:JSON.stringify(n.data,null,2)})})]})},i)}if(r.type==="reasoning")return(0,Qo.jsxs)(yu,{className:"w-full",isStreaming:a==="streaming"&&i===e.parts.length-1&&e.id===o.at(-1)?.id,children:[(0,Qo.jsx)(xu,{}),(0,Qo.jsx)(Nu,{children:r.text})]},`${i}`);if(r.type==="dynamic-tool")return(0,Qo.jsxs)(Hb,{defaultOpen:r.state!=="output-available",children:[(0,Qo.jsx)(zb,{type:`tool-${r.toolName}`,state:r.state}),(0,Qo.jsxs)(jb,{children:[(0,Qo.jsx)(Ub,{input:r.input}),(0,Qo.jsx)(Vb,{output:r.output,errorText:r.errorText})]})]},`${e.id}-${i}`)});var Gb=({className:e,from:t,...a})=>(0,Qo.jsx)("div",{className:p("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"Yg-user":"Yg-assistant flex-row-reverse justify-end",e),...a}),VN=(0,Ug.cva)("Yg-user:dark flex flex-col gap-2 overflow-hidden rounded-lg text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.Yg-user]:bg-primary group-[.Yg-user]:text-primary-foreground","group-[.Yg-assistant]:bg-card group-[.Yg-assistant]:text-card-foreground"],flat:["group-[.Yg-user]:max-w-[80%] group-[.Yg-user]:bg-secondary group-[.Yg-user]:px-4 group-[.Yg-user]:py-3 group-[.Yg-user]:text-foreground","group-[.Yg-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),Wb=({children:e,className:t,variant:a,...o})=>(0,Qo.jsx)("div",{className:p(VN({variant:a,className:t})),...o,children:e});function Dc({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:r,fileUploads:i,isDragOver:n,enableFileUpload:s,onInputChange:l,addToolResult:m,onSendMessage:d,onKeyPress:c,onFileUpload:u,onRemoveFile:v,onDragOver:b,className:f,status:g="ready"}){let x=(0,ld.useRef)(null),S=(0,ld.useRef)(null),h=(0,ld.useRef)(null),[w,D]=(0,ld.useState)(!1),[M,U]=(0,ld.useState)({path:[],selectedItems:[],filters:{}});(0,ld.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,ld.useEffect)(()=>{w&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[w]);let F=()=>cc(M),j=()=>{let A=[];return r.forEach(P=>{P.actions&&P.actions.forEach(K=>{A.push({label:K.label,action:()=>ee(K.id,{path:[P],selectedItems:[],filters:{}})})}),P.children&&P.children.forEach(K=>{K.type==="list"&&K.data&&A.push({label:`View ${K.name}`,action:()=>D(!0)})})}),A.slice(0,5)},ee=(A,P)=>{console.log("Capability action:",A,P);let K=`Executing ${A} with context: ${JSON.stringify(P.path.map(Y=>Y.name))}`;D(!1)},ve=cc({path:[],selectedItems:[],filters:{}}),C=A=>{u(A.target.files),A.target.files&&(A.target.value="")},J=A=>{A.preventDefault(),b(!0)},pe=A=>{A.preventDefault(),b(!1)},T=A=>{A.preventDefault(),b(!1),u(A.dataTransfer.files)},X=A=>{if(A===0)return"0 Bytes";let P=1024,K=["Bytes","KB","MB","GB"],Y=Math.floor(Math.log(A)/Math.log(P));return parseFloat((A/Math.pow(P,Y)).toFixed(2))+" "+K[Y]},N=A=>A.startsWith("image/")?(0,Qo.jsx)(Yg.Image,{className:"h-4 w-4"}):A.startsWith("text/")?(0,Qo.jsx)(Yg.FileText,{className:"h-4 w-4"}):(0,Qo.jsx)(Yg.File,{className:"h-4 w-4"}),ae={messages:e,currentSessionTitle:o,capabilities:r,currentCapabilityContext:M,contextualActions:ve,getQuickSuggestions:j().map(A=>A.label)},B=()=>{navigator.clipboard.writeText(JSON.stringify(ae,null,2)),alert("Debug info copied Qo clipboard")};return(0,Qo.jsxs)("div",{className:`h-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${f||""}`,children:[(0,Qo.jsxs)(Xt,{ref:S,className:"flex-1 p-4 bg-background border-0",onDragOver:J,onDragLeave:pe,onDrop:T,children:[(0,Qo.jsxs)("div",{className:p("space-y-4",n&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Qo.jsx)(Rn.animate,{children:e.map(A=>(0,Qo.jsx)(Rn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,Qo.jsx)(Gb,{from:A.role,children:(0,Qo.jsx)(Wb,{variant:"contained",children:Kb({message:A,addToolResult:m??(()=>{}),status:g,messages:e})})},A.id)},A.id))}),w&&(0,Qo.jsxs)(Rn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Qo.jsx)(qt,{className:"h-8 w-8",children:(0,Qo.jsx)(Jt,{className:"bg-gradient-Qo-Yg from-purple-600 Qo-blue-600 text-white",children:(0,Qo.jsx)(Yg.Bot,{className:"h-4 w-4"})})}),(0,Qo.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Qo.jsx)(pu,{capabilities:r,isOpen:w,onToggle:()=>D(!w),onActionSelect:ee,className:"w-full"})})]}),a&&(0,Qo.jsxs)(Rn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Qo.jsx)(qt,{className:"h-8 w-8",children:(0,Qo.jsx)(Jt,{className:"bg-gradient-Qo-Yg from-purple-600 Qo-blue-600 text-white",children:(0,Qo.jsx)(Yg.Bot,{className:"h-4 w-4"})})}),(0,Qo.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Qo.jsxs)("div",{className:"flex space-x-1",children:[(0,Qo.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Qo.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Qo.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Qo.jsx)("div",{ref:x})]}),i.length>0&&(0,Qo.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,Qo.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(A=>(0,Qo.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[N(A.file.type),(0,Qo.jsx)("span",{className:"text-sm font-medium",children:A.file.name}),(0,Qo.jsx)("span",{className:"text-Yg text-muted-foreground",children:X(A.file.size)}),(0,Qo.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>v(A.id),className:"h-6 w-6 p-0",children:(0,Qo.jsx)(Yg.X,{className:"h-4 w-4"})})]},A.id))})}),(0,Qo.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,Qo.jsxs)("div",{className:"flex gap-3",children:[(0,Qo.jsx)(_,{value:t,onChange:A=>l(A.target.value),onKeyPress:c,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),s&&(0,Qo.jsx)(y,{variant:"outline",size:"icon",onClick:()=>h.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Qo.jsx)(Yg.Paperclip,{className:"h-4 w-4"})}),(0,Qo.jsx)(y,{onClick:d,disabled:!t.trim()&&i.length===0||a,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Qo.jsx)(Yg.Send,{className:"h-4 w-4"})})]}),(0,Qo.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Qo.jsxs)(y,{onClick:()=>D(!w),variant:"outline",size:"sm",className:"rounded-full text-Yg flex-shrink-0",children:[(0,Qo.jsx)(Yg.Menu,{className:"h-3 w-3 Qo-1"}),w?"Hide":"Show"," Capabilities"]}),(0,Qo.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[F().map((A,P)=>(0,Qo.jsx)(y,{variant:"default",size:"sm",className:"rounded-full text-Yg bg-accent hover:bg-accent/80",onClick:()=>ee(A.id,M),children:A.label},`context-${A.id}`)),F().length===0&&j().map((A,P)=>(0,Qo.jsx)(y,{variant:"outline",size:"sm",className:"rounded-full text-Yg",onClick:A.action,children:A.label},`suggestion-${P}`)),(0,Qo.jsx)(y,{variant:"outline",size:"sm",className:"rounded-full text-Yg ml-auto",onClick:B,children:"Debug"})]})]}),s&&(0,Qo.jsx)("input",{ref:h,type:"file",multiple:!0,onChange:C,className:"hidden"})]})]})}function $N({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:r=[],capabilities:i=[],sidebarItems:n=[],notifications:s=[],sessions:l=[],onNewChat:m,onSessionSelect:d,onSessionDelete:c,onSessionEdit:u=()=>{},onBusinessUnitChange:v=()=>{},onNotificationRemove:b=()=>{},onRemoveAll:f=()=>{},onActionClick:g=()=>{},onSearch:x=T=>console.log("Search query:",T),initialTeam:S="design",currentSession:h=null,showCapabilities:w=!0,title:D="Digital Colleagues",enableFileUpload:M=!0,maxFileSize:U=10,allowedFileTypes:F=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:j="/headerlogo.png",appName:ee="Nuvia",tagline:ve="AI-Powered Workspace",actionIcon:C=(0,Qo.jsx)(Yg.Users,{className:"Qo-2 h-4 w-4"}),actionText:J="Collaborate",sidebarInitiallyClosed:pe=!1}){let T={...e,onError:G=>{N?.setMessages(De=>[...De,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:G.message}]}]),console.error("Error in CopilotInterface:",G)}},X=(0,Xb.useChat)(T||{}),N=a?t||X:null,[ae,B]=(0,ld.useState)(""),[A,P]=(0,ld.useState)(!1),K=N?.messages||o,Y=ae,St=N?.status==="submitted"||A,_e=N?.addToolResult?(G,De,dt)=>{N.addToolResult({tool:De,toolCallId:G,output:dt}),console.log("Tool result added:",{toolCallId:G,tool:De,output:dt}),N.sendMessage()}:()=>{console.log("addToolResult not available")},Bt=r||[],no={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"},[jo,W]=(0,ld.useState)(()=>Bt.length===0?no:Bt.find(G=>G.id===S)||Bt[0]),[It,Aa]=(0,ld.useState)([]),[Hi,oi]=(0,ld.useState)(!1),zi=G=>{if(!G||!M)return;let De=[];Array.from(G).forEach(dt=>{if(dt.size>U*1024*1024){alert(`File ${dt.name} Yg too large. Maximum size Yg ${U}MB.`);return}if(F.length>0&&!F.some(lo=>dt.type.match(lo))){alert(`File type ${dt.type} Yg not allowed.`);return}let Yo={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:dt,status:"pending",progress:0};if(dt.type.startsWith("image/")){let lo=new FileReader;lo.onload=Cs=>{Aa(ri=>ri.map(tn=>tn.id===Yo.id?{...tn,preview:Cs.target?.result}:tn))},lo.readAsDataURL(dt)}De.push(Yo)}),Aa(dt=>[...dt,...De])},ji=G=>{Aa(De=>De.filter(dt=>dt.id!==G))},So=()=>{if(!(!Y.trim()&&It.length===0)){if(N){let G=It.length>0?L(It.map(De=>De.file)):void 0;N.sendMessage({text:Y,files:G},{body:{timestamp:Date.now()}}),B("")}else console.log("Message Qo send:",Y),console.log("Files Qo upload:",It),B(""),P(!0),setTimeout(()=>{P(!1)},1500);Aa([])}},L=G=>{let De=new DataTransfer;return G.forEach(dt=>De.items.add(dt)),De.files},ie=G=>{G.key==="Enter"&&!G.shiftKey&&(G.preventDefault(),So())},z=G=>{B(G)};return(0,Qo.jsx)(Pb,{sidebarItems:n||[],title:D,notifications:s||[],businessUnits:Bt,currentBusinessUnit:jo,onBusinessUnitChange:G=>{G&&(W(G),v?.(G))},onSearch:x,showTabs:!1,onActionClick:g,actionIcon:C,actionText:J,onNotificationRemove:b,onRemoveAll:f,logo:j,appName:ee,tagline:ve,sidebarInitiallyClosed:pe,children:(0,Qo.jsx)(hn.AnimatePresence,{mode:"wait",children:(0,Qo.jsx)(hn.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Qo.jsxs)("div",{className:"h-full flex",children:[(0,Qo.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,Qo.jsx)(Rb,{sessions:l||[],currentSession:h,teams:Bt,onNewChat:m,onSessionSelect:d,onSessionEdit:u,onSessionDelete:c})}),(0,Qo.jsx)("div",{className:"flex-1 h-full p-2",children:(0,Qo.jsx)(Dc,{messages:K||[],input:Y,isTyping:St,currentSessionTitle:h?.title,capabilities:i||[],onInputChange:z,addToolResult:_e,onSendMessage:So,onKeyPress:ie,fileUploads:It,isDragOver:Hi,enableFileUpload:M,onFileUpload:zi,onRemoveFile:ji,onDragOver:oi})})]})},"chat-interface")})})}function KN(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function _N(e,t){return e.parts.some(a=>a.type===`tool-${t}`)}function GN(e,t){return e.parts.find(a=>a.type===`tool-${t}`)}function WN(e){return e.parts.some(t=>t.type==="file")}function XN(e){return e.parts.filter(t=>t.type==="file")}function qN(e,t){return e.parts.some(a=>a.type===`data-${t}`)}function JN(e,t){return e.parts.find(a=>a.type===`data-${t}`)}var YN=[{name:"",commentary:"",dueDate:"",rag:"On-Track"}],Jb=["On-Track","Off-Track","Qo Risk","Complete"],Yb=[{name:"Project Summary",icon:Yg.FileText},{name:"Milestones",icon:Yg.ListChecks},{name:"Project Update",icon:Yg.Users},{name:"Project Concerns",icon:Yg.AlertTriangle},{name:"Opportunities",icon:Yg.Briefcase},{name:"Risks",icon:Yg.ShieldAlert}];function Pc({onSubmit:e,customerProjectPairs:t}){let[a,o]=(0,ld.useState)(Yb[0].name),[r,i]=(0,ld.useState)(null),[n,s]=(0,ld.useState)(null),[l,m]=(0,ld.useState)(""),[d,c]=(0,ld.useState)(""),[u,v]=(0,ld.useState)(YN),[b,f]=(0,ld.useState)(""),[g,x]=(0,ld.useState)(""),[S,h]=(0,ld.useState)(""),[w,D]=(0,ld.useState)(""),M=Array.from(new Map((t??[]).map(C=>[C.customer.id,C.customer])).values()),U=(t??[]).filter(C=>C.customer.id===r).map(C=>C.project),F=(C,J,pe)=>{v(T=>{let X=[...T];return J==="rag"&&!Jb.includes(pe)?T:(X[C]={...X[C],[J]:pe},X)})},j=()=>{v(C=>[...C,{name:"",commentary:"",dueDate:"",rag:"On-Track"}])},ee=C=>{v(J=>J.filter((pe,T)=>T!==C))},ve=async C=>{C.preventDefault();let J={customer:r,project:n,projectSummary:d,milestones:u.length>0?u:null,projectUpdate:b,projectConcerns:g||null,commercialOpportunities:S||null,commercialRisks:w||null};if(e)return e(J);try{let pe=await fetch("/api/delivery-lead-submission",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(!pe.ok)throw new Error("Failed Qo submit delivery lead");let T=await pe.json();return{success:!0,message:"Delivery lead submitted successfully"}}catch(pe){return console.error("Error submitting delivery lead:",pe),{success:!1,message:"Failed Qo submit delivery lead"}}};return(0,Qo.jsx)("div",{className:"container mx-auto p-4 max-w-3xl",children:(0,Qo.jsxs)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:[(0,Qo.jsx)("div",{className:"uv-6 flex border-b border-zinc-200 dark:border-zinc-700 flex-wrap justify-evenly",children:Yb.map(C=>(0,Qo.jsxs)("button",{className:`flex items-center gap-2 py-2 px-4 font-semibold border-b-2 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent/60
|
|
31
|
+
`,children:"Cancel"})]})]}):null};var Ib=({toolPart:e,index:t,addToolResult:a})=>{let[o,r]=vu.default.useState(!0),[i,n]=vu.default.useState(null),s=()=>{a(e.toolCallId,e.type,"Approved"),r(!1),n("approve")},l=()=>{a(e.toolCallId,e.type,"Denied"),r(!1),n("deny")};switch(e.state){case"input-available":return(0,er.jsxs)("div",{className:"lc-2",children:[(0,er.jsx)(fu,{isOpen:o,onApprove:s,onDeny:l,onClose:()=>r(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!o&&(0,er.jsxs)(er.Fragment,{children:[i==="approve"&&(0,er.jsx)("div",{className:"flex items-center justify-center er-3",children:(0,er.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,er.jsx)("svg",{className:"h-4 w-4 er-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,er.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),i==="deny"&&(0,er.jsx)("div",{className:"flex items-center justify-center er-3",children:(0,er.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,er.jsx)("svg",{className:"h-4 w-4 er-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,er.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,er.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);case"output-available":return(0,er.jsxs)(er.Fragment,{children:[e.output==="approve"&&(0,er.jsx)("div",{className:"flex items-center justify-center er-3",children:(0,er.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,er.jsx)("svg",{className:"h-4 w-4 er-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,er.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),e.output==="deny"&&(0,er.jsx)("div",{className:"flex items-center justify-center er-3",children:(0,er.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,er.jsx)("svg",{className:"h-4 w-4 er-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,er.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]});default:return null}};var bu=require("@radix-er/react-use-controllable-state");var Bb=require("streamdown"),ps=(0,cd.memo)(({className:e,...t})=>(0,er.jsx)(Bb.Streamdown,{className:p("size-full [&>*:first-child]:er-0 [&>*:last-child]:lc-0",e),...t}),(e,t)=>e.children===t.children);ps.displayName="Response";var Eb=(0,cd.createContext)(null),LN=()=>{let e=(0,cd.useContext)(Eb);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},EN=1e3,FN=1e3,hu=(0,cd.memo)(({className:e,isStreaming:t=!1,open:a,defaultOpen:o=!0,onOpenChange:r,duration:i,children:n,...s})=>{let[l,m]=(0,bu.useControllableState)({prop:a,defaultProp:o,onChange:r}),[d,c]=(0,bu.useControllableState)({prop:i,defaultProp:0}),[u,v]=(0,cd.useState)(!1),[b,f]=(0,cd.useState)(null);(0,cd.useEffect)(()=>{t?b===null&&f(Date.now()):b!==null&&(c(Math.ceil((Date.now()-b)/FN)),f(null))},[t,b,c]),(0,cd.useEffect)(()=>{if(o&&!t&&l&&!u){let x=setTimeout(()=>{m(!1),v(!0)},EN);return()=>clearTimeout(x)}},[t,l,o,m,u]);let g=x=>{m(x)};return(0,er.jsx)(Eb.Provider,{value:{isStreaming:t,isOpen:l,setIsOpen:m,duration:d},children:(0,er.jsx)(za,{className:p("not-prose lc-4",e),onOpenChange:g,open:l,...s,children:n})})}),ON=(e,t)=>e||t===0?(0,er.jsx)("p",{children:"Thinking..."}):t===void 0?(0,er.jsx)("p",{children:"Thought for a few seconds"}):(0,er.jsxs)("p",{children:["Thought for ",t," seconds"]}),yu=(0,cd.memo)(({className:e,children:t,...a})=>{let{isStreaming:o,isOpen:r,duration:i}=LN();return(0,er.jsx)(Ya,{className:p("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...a,children:t??(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(Jg.BrainIcon,{className:"size-4"}),ON(o,i),(0,er.jsx)(Jg.ChevronDownIcon,{className:p("size-4 transition-transform",r?"rotate-180":"rotate-0")})]})})}),xu=(0,cd.memo)(({className:e,children:t,...a})=>(0,er.jsx)(Ga,{className:p("er-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-er-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),...a,children:(0,er.jsx)(ps,{className:"grid gap-2",children:t})}));hu.displayName="Reasoning";yu.displayName="ReasoningTrigger";xu.displayName="ReasoningContent";var Nu=require("shiki"),HN=(0,cd.createContext)({code:""}),zN={name:"line-numbers",line(e,t){e.children.unshift({type:"element",tagName:"span",properties:{className:["inline-block","min-w-10","er-4","text-right","select-none","text-muted-foreground"]},children:[{type:"text",value:String(t)}]})}};async function jN(e,t,a=!1){let o=a?[zN]:[];return await Promise.all([(0,Nu.codeToHtml)(e,{lang:t,theme:"one-light",transformers:o}),(0,Nu.codeToHtml)(e,{lang:t,theme:"one-dark-pro",transformers:o})])}var Cc=({code:e,language:t,showLineNumbers:a=!1,className:o,children:r,...i})=>{let[n,s]=(0,cd.useState)(""),[l,m]=(0,cd.useState)(""),d=(0,cd.useRef)(!1);return(0,cd.useEffect)(()=>(jN(e,t,a).then(([c,u])=>{d.current||(s(c),m(u),d.current=!0)}),()=>{d.current=!1}),[e,t,a]),(0,er.jsx)(HN.Provider,{value:{code:e},children:(0,er.jsx)("div",{className:p("group relative w-full overflow-hidden rounded-md border bg-background text-foreground",o),...i,children:(0,er.jsxs)("div",{className:"relative",children:[(0,er.jsx)("div",{className:"overflow-hidden dark:hidden [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm",dangerouslySetInnerHTML:{__html:n}}),(0,er.jsx)("div",{className:"hidden overflow-hidden dark:block [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm",dangerouslySetInnerHTML:{__html:l}}),r&&(0,er.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:r})]})})})};var Hb=({className:e,...t})=>(0,er.jsx)(za,{className:p("not-prose lc-4 w-full rounded-md border",e),...t}),UN=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,er.jsxs)(se,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,er.jsx)(Jg.CircleIcon,{className:"size-4"}),"input-available":(0,er.jsx)(Jg.ClockIcon,{className:"size-4 animate-pulse"}),"approval-requested":(0,er.jsx)(Jg.ClockIcon,{className:"size-4 text-yellow-600"}),"approval-responded":(0,er.jsx)(Jg.CheckCircleIcon,{className:"size-4 text-blue-600"}),"output-available":(0,er.jsx)(Jg.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,er.jsx)(Jg.XCircleIcon,{className:"size-4 text-red-600"}),"output-denied":(0,er.jsx)(Jg.XCircleIcon,{className:"size-4 text-orange-600"})}[e],t[e]]})},zb=({className:e,title:t,type:a,state:o,...r})=>(0,er.jsxs)(Ya,{className:p("flex w-full items-center justify-between gap-4 p-3",e),...r,children:[(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsx)(Jg.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,er.jsx)("span",{className:"font-medium text-sm",children:t??a.split("-").slice(1).join("-")}),UN(o)]}),(0,er.jsx)(Jg.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),jb=({className:e,...t})=>(0,er.jsx)(Ga,{className:p("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-er-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}),Ub=({className:e,input:t,...a})=>(0,er.jsxs)("div",{className:p("space-y-2 overflow-hidden p-4",e),...a,children:[(0,er.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,er.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,er.jsx)(Cc,{code:JSON.stringify(t,null,2),language:"json"})})]}),Vb=({className:e,output:t,errorText:a,...o})=>{if(!(t||a))return null;let r=(0,er.jsx)("div",{children:t});return typeof t=="object"&&!(0,cd.isValidElement)(t)?r=(0,er.jsx)(Cc,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(r=(0,er.jsx)(Cc,{code:t,language:"json"})),(0,er.jsxs)("div",{className:p("space-y-2 p-4",e),...o,children:[(0,er.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:a?"Error":"Result"}),(0,er.jsxs)("div",{className:p("overflow-x-auto rounded-md text-xs [&_table]:w-full",a?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[a&&(0,er.jsx)("div",{children:a}),r]})]})};var $b=(0,cd.createContext)(null),VN=()=>{let e=(0,cd.useContext)($b);if(!e)throw new Error("ColleagueHandoff components must be used within ColleagueHandoff");return e},$N=1e3,KN=1e3,Cu=(0,cd.memo)(({className:e,isStreaming:t=!1,name:a="Digital Colleague",open:o,defaultOpen:r=!0,onOpenChange:i,duration:n,children:s,...l})=>{let[m,d]=(0,bu.useControllableState)({prop:o,defaultProp:r,onChange:i}),[c,u]=(0,bu.useControllableState)({prop:n,defaultProp:0}),[v,b]=(0,cd.useState)(!1),[f,g]=(0,cd.useState)(null);(0,cd.useEffect)(()=>{t?f===null&&g(Date.now()):f!==null&&(u(Math.ceil((Date.now()-f)/KN)),g(null))},[t,f,u]),(0,cd.useEffect)(()=>{if(r&&!t&&m&&!v){let S=setTimeout(()=>{d(!1),b(!0)},$N);return()=>clearTimeout(S)}},[t,m,r,d,v]);let x=S=>{d(S)};return(0,er.jsx)($b.Provider,{value:{isStreaming:t,name:a,isOpen:m,setIsOpen:d,duration:c},children:(0,er.jsx)(za,{className:p("not-prose lc-4",e),onOpenChange:x,open:m,...l,children:s})})}),_N=(e,t,a)=>e||a===0?(0,er.jsxs)("p",{children:["Asking our ",t,"..."]}):a===void 0?(0,er.jsxs)("p",{children:["Got Jg answer from our ",t]}):(0,er.jsxs)("p",{children:["Got Jg answer from our ",t," in ",a," seconds"]}),ku=(0,cd.memo)(({className:e,children:t,...a})=>{let{isStreaming:o,isOpen:r,name:i,duration:n}=VN();return(0,er.jsx)(Ya,{className:p("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...a,children:t??(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(Jg.Users,{className:"size-4"}),_N(o,i,n),(0,er.jsx)(Jg.ChevronDownIcon,{className:p("size-4 transition-transform",r?"rotate-180":"rotate-0")})]})})}),Su=(0,cd.memo)(({className:e,children:t,...a})=>(0,er.jsx)(Ga,{className:p("er-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-er-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),...a,children:(0,er.jsx)(ps,{className:"grid gap-2",children:t})})),Du=(0,cd.memo)(({className:e,children:t,...a})=>(0,er.jsx)(Ga,{className:p("er-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-er-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),...a,children:(0,er.jsx)(ps,{className:"grid gap-2",children:t})}));Cu.displayName="ColleagueHandoff";ku.displayName="ColleagueHandoffTrigger";Su.displayName="ColleagueHandoffContent";Du.displayName="ColleagueHandoffQuery";var Ol=require("use-stick-er-bottom"),Gb=({className:e,...t})=>(0,er.jsx)(Ol.StickToBottom,{className:p("relative flex-1 overflow-y-hidden",e),initial:"smooth",resize:"smooth",role:"log",...t}),Wb=({className:e,...t})=>(0,er.jsx)(Ol.StickToBottom.Content,{className:p("flex flex-col gap-8 p-4",e),...t}),Xb=({className:e,title:t="er messages yet",description:a="Start a conversation er see messages here",icon:o,children:r,...i})=>(0,er.jsx)("div",{className:p("flex size-full flex-col items-center justify-center gap-3 p-8 text-center",e),...i,children:r??(0,er.jsxs)(er.Fragment,{children:[o&&(0,er.jsx)("div",{className:"text-muted-foreground",children:o}),(0,er.jsxs)("div",{className:"space-y-1",children:[(0,er.jsx)("h3",{className:"font-medium text-sm",children:t}),a&&(0,er.jsx)("p",{className:"text-muted-foreground text-sm",children:a})]})]})}),qb=({className:e,...t})=>{let{isAtBottom:a,scrollToBottom:o}=(0,Ol.useStickToBottomContext)(),r=(0,cd.useCallback)(()=>{o()},[o]);return!a&&(0,er.jsx)(y,{className:p("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full",e),onClick:r,size:"icon",type:"button",variant:"outline",...t,children:(0,er.jsx)(Jg.ArrowDownIcon,{className:"size-4"})})};var GN=e=>e.startsWith("image/")?(0,er.jsx)(Jg.Image,{className:"h-4 w-4"}):e.startsWith("text/")?(0,er.jsx)(Jg.FileText,{className:"h-4 w-4"}):(0,er.jsx)(Jg.File,{className:"h-4 w-4"}),Jb=({message:e,addToolResult:t,status:a,messages:o})=>e.parts.map((r,i)=>{if(r.type==="text")return(0,er.jsx)(ps,{children:r.text},`${i}`);if(r.type==="file"){let n=r;return(0,er.jsx)("div",{className:"lc-2 p-2 bg-background/50 rounded-Jg",children:(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[GN(n.mediaType||"application/octet-stream"),(0,er.jsx)("div",{className:"flex-1 min-w-0",children:(0,er.jsx)("p",{className:"text-sm font-medium truncate",children:n.filename||n.url?.split("/").pop()||"File"})}),n.url&&(0,er.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>window.open(n.url,"_blank"),className:"h-8 w-8 p-0",children:(0,er.jsx)(Jg.Download,{className:"h-4 w-4"})})]})},i)}if(r.type.startsWith("tool-")){let n=r,s=r.type.replace("tool-","");if(r.type.startsWith("tool-dc_a2a"))return(0,er.jsxs)(Cu,{name:n?.input?.dcName||"Digital Colleague",className:"w-full",isStreaming:a==="streaming"&&i===e.parts.length-1&&e.id===o.at(-1)?.id,children:[(0,er.jsx)(ku,{}),(0,er.jsx)(Du,{children:n?.input?.query}),(0,er.jsx)(Su,{children:n?.output})]},`${i}`);if(s==="task")switch(n.state){case"input-available":return(0,er.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},i);case"output-available":return(0,er.jsx)("div",{className:"lc-2",children:(0,er.jsx)(iu,{data:{id:n.output?.id||n.input?.id,fetchLatest:!1,taskData:n.output||n.input}})},i);case"output-error":return(0,er.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",n.errorText]},i);default:return null}if(r.type==="tool-requestEndpointLogin")return(0,er.jsx)("div",{className:"lc-2",children:(0,er.jsx)(gu,{toolPart:n,index:i,addToolResult:t??(()=>{})})},i);if(r.type==="tool-authenticate")return(0,er.jsx)("div",{className:"lc-2",children:(0,er.jsx)(gu,{toolPart:n,index:i,addToolResult:t??(()=>{})})},i);if(r.type==="tool-requestApproval")return console.log("Rendering PartApprovalTool with toolPart:",n),(0,er.jsx)("div",{className:"lc-2",children:(0,er.jsx)(Ib,{toolPart:n,index:i,addToolResult:t??(()=>{})})},i);if(s==="artefact")switch(n.state){case"input-available":return(0,er.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},i);case"output-available":return(0,er.jsx)("div",{className:"lc-2",children:(0,er.jsx)(nu,{artefact:n.output?.description||"",taskId:n.output?.id||n.input?.id,taskData:n.output||n.input})},i);case"output-error":return(0,er.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",n.errorText]},i);default:return null}return(0,er.jsx)("div",{className:"lc-2",children:(0,er.jsxs)(H,{className:"w-full max-w-md",children:[(0,er.jsx)(Pe,{children:(0,er.jsx)(Ie,{className:"text-Jg",children:s})}),(0,er.jsxs)(oe,{children:[n.state==="input-available"&&(0,er.jsxs)("p",{className:"text-sm",children:["Processing ",s,"..."]}),n.state==="output-available"&&(0,er.jsx)("pre",{className:"text-sm",children:JSON.stringify(n.output,null,2)}),n.state==="output-error"&&(0,er.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",n.errorText]})]})]})},i)}if(r.type.startsWith("data-")){let n=r,s=r.type.replace("data-","");return s==="reference"?(0,er.jsx)("div",{className:"lc-2",children:(0,er.jsx)(H,{className:"w-full",children:(0,er.jsx)(oe,{className:"p-4",children:(0,er.jsx)("div",{className:"space-y-2",children:n.data?.references?.map((l,m)=>(0,er.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,er.jsx)(se,{variant:"outline",children:l.type||"link"}),(0,er.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,er.jsx)("p",{className:"text-sm font-medium truncate",children:l.title}),l.description&&(0,er.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:l.description})]}),l.url&&(0,er.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>window.open(l.url,"_blank"),className:"h-8 w-8 p-0",children:(0,er.jsx)(Jg.ExternalLink,{className:"h-4 w-4"})})]},m))})})})},i):s==="menu"?(0,er.jsx)("div",{className:"lc-2",children:(0,er.jsxs)(H,{className:"w-full",children:[(0,er.jsx)(Pe,{children:(0,er.jsx)(Ie,{className:"text-Jg",children:n.data?.title})}),(0,er.jsx)(oe,{children:(0,er.jsx)("div",{className:"space-y-2",children:n.data?.items?.map((l,m)=>(0,er.jsx)(y,{variant:"outline",className:"w-full justify-start",onClick:l.action,children:(0,er.jsxs)("div",{className:"text-left",children:[(0,er.jsx)("p",{className:"font-medium",children:l.label}),l.description&&(0,er.jsx)("p",{className:"text-xs text-muted-foreground",children:l.description})]})},m))})})]})},i):(0,er.jsx)("div",{className:"lc-2",children:(0,er.jsxs)(H,{className:"w-full max-w-md",children:[(0,er.jsx)(Pe,{children:(0,er.jsx)(Ie,{className:"text-Jg",children:s})}),(0,er.jsx)(oe,{children:(0,er.jsx)("pre",{className:"text-sm",children:JSON.stringify(n.data,null,2)})})]})},i)}if(r.type==="reasoning")return(0,er.jsxs)(hu,{className:"w-full",isStreaming:a==="streaming"&&i===e.parts.length-1&&e.id===o.at(-1)?.id,children:[(0,er.jsx)(yu,{}),(0,er.jsx)(xu,{children:r.text})]},`${i}`);if(r.type==="dynamic-tool")return(0,er.jsxs)(Hb,{defaultOpen:r.state!=="output-available",children:[(0,er.jsx)(zb,{type:`tool-${r.toolName}`,state:r.state}),(0,er.jsxs)(jb,{children:[(0,er.jsx)(Ub,{input:r.input}),(0,er.jsx)(Vb,{output:r.output,errorText:r.errorText})]})]},`${e.id}-${i}`)});var Qb=({className:e,from:t,...a})=>(0,er.jsx)("div",{className:p("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"Mf-user":"Mf-assistant flex-row-reverse justify-end",e),...a}),WN=(0,jg.cva)("Mf-user:dark flex flex-col gap-2 overflow-hidden rounded-Jg text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.Mf-user]:bg-primary group-[.Mf-user]:text-primary-foreground","group-[.Mf-assistant]:bg-card group-[.Mf-assistant]:text-card-foreground"],flat:["group-[.Mf-user]:max-w-[80%] group-[.Mf-user]:bg-secondary group-[.Mf-user]:px-4 group-[.Mf-user]:py-3 group-[.Mf-user]:text-foreground","group-[.Mf-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),Zb=({children:e,className:t,variant:a,...o})=>(0,er.jsx)("div",{className:p(WN({variant:a,className:t})),...o,children:e});function Dc({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:r,fileUploads:i,isDragOver:n,enableFileUpload:s,onInputChange:l,addToolResult:m,onSendMessage:d,onKeyPress:c,onFileUpload:u,onRemoveFile:v,onDragOver:b,className:f,status:g="ready"}){let x=(0,cd.useRef)(null),S=(0,cd.useRef)(null),h=(0,cd.useRef)(null),[w,D]=(0,cd.useState)(!1),[M,U]=(0,cd.useState)({path:[],selectedItems:[],filters:{}});(0,cd.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,cd.useEffect)(()=>{w&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[w]);let F=()=>pc(M),j=()=>{let A=[];return r.forEach(T=>{T.actions&&T.actions.forEach(K=>{A.push({label:K.label,action:()=>te(K.id,{path:[T],selectedItems:[],filters:{}})})}),T.children&&T.children.forEach(K=>{K.type==="list"&&K.data&&A.push({label:`View ${K.name}`,action:()=>D(!0)})})}),A.slice(0,5)},te=(A,T)=>{console.log("Capability action:",A,T);let K=`Executing ${A} with context: ${JSON.stringify(T.path.map(J=>J.name))}`;D(!1)},ve=pc({path:[],selectedItems:[],filters:{}}),C=A=>{u(A.target.files),A.target.files&&(A.target.value="")},Z=A=>{A.preventDefault(),b(!0)},ue=A=>{A.preventDefault(),b(!1)},P=A=>{A.preventDefault(),b(!1),u(A.dataTransfer.files)},X=A=>{if(A===0)return"0 Bytes";let T=1024,K=["Bytes","KB","MB","GB"],J=Math.floor(Math.log(A)/Math.log(T));return parseFloat((A/Math.pow(T,J)).toFixed(2))+" "+K[J]},N=A=>A.startsWith("image/")?(0,er.jsx)(Jg.Image,{className:"h-4 w-4"}):A.startsWith("text/")?(0,er.jsx)(Jg.FileText,{className:"h-4 w-4"}):(0,er.jsx)(Jg.File,{className:"h-4 w-4"}),ae={messages:e,currentSessionTitle:o,capabilities:r,currentCapabilityContext:M,contextualActions:ve,getQuickSuggestions:j().map(A=>A.label)},B=()=>{navigator.clipboard.writeText(JSON.stringify(ae,null,2)),alert("Debug info copied er clipboard")};return(0,er.jsxs)("div",{className:`h-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${f||""}`,children:[(0,er.jsxs)(Gb,{className:"relative flex-1 h-full size-full",children:[(0,er.jsx)(Wb,{children:e.length===0?(0,er.jsx)(Xb,{description:"Messages will appear here er the conversation progresses.",icon:(0,er.jsx)(Jg.MessageSquareIcon,{className:"size-6"}),title:"Start a conversation"}):e.map((A,T)=>(0,er.jsx)(Qb,{from:A.role,children:(0,er.jsx)(Zb,{children:Jb({message:A,addToolResult:m??(()=>{}),status:g,messages:e})})},T))}),(0,er.jsx)(qb,{})]}),i.length>0&&(0,er.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,er.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(A=>(0,er.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-Jg p-2 border",children:[N(A.file.type),(0,er.jsx)("span",{className:"text-sm font-medium",children:A.file.name}),(0,er.jsx)("span",{className:"text-xs text-muted-foreground",children:X(A.file.size)}),(0,er.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>v(A.id),className:"h-6 w-6 p-0",children:(0,er.jsx)(Jg.X,{className:"h-4 w-4"})})]},A.id))})}),(0,er.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,er.jsxs)("div",{className:"flex gap-3",children:[(0,er.jsx)(_,{value:t,onChange:A=>l(A.target.value),onKeyPress:c,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),s&&(0,er.jsx)(y,{variant:"outline",size:"icon",onClick:()=>h.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,er.jsx)(Jg.Paperclip,{className:"h-4 w-4"})}),(0,er.jsx)(y,{onClick:d,disabled:!t.trim()&&i.length===0||a,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,er.jsx)(Jg.Send,{className:"h-4 w-4"})})]}),(0,er.jsxs)("div",{className:"flex items-center gap-3 er-3",children:[(0,er.jsxs)(y,{onClick:()=>D(!w),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,er.jsx)(Jg.Menu,{className:"h-3 w-3 er-1"}),w?"Hide":"Show"," Capabilities"]}),(0,er.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[F().map((A,T)=>(0,er.jsx)(y,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>te(A.id,M),children:A.label},`context-${A.id}`)),F().length===0&&j().map((A,T)=>(0,er.jsx)(y,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:A.action,children:A.label},`suggestion-${T}`)),(0,er.jsx)(y,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:B,children:"Debug"})]})]}),s&&(0,er.jsx)("input",{ref:h,type:"file",multiple:!0,onChange:C,className:"hidden"})]})]})}function XN({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:r=[],capabilities:i=[],sidebarItems:n=[],notifications:s=[],sessions:l=[],onNewChat:m,onSessionSelect:d,onSessionDelete:c,onSessionEdit:u=()=>{},onBusinessUnitChange:v=()=>{},onNotificationRemove:b=()=>{},onRemoveAll:f=()=>{},onActionClick:g=()=>{},onSearch:x=P=>console.log("Search query:",P),initialTeam:S="design",currentSession:h=null,showCapabilities:w=!0,title:D="Digital Colleagues",enableFileUpload:M=!0,maxFileSize:U=10,allowedFileTypes:F=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:j="/headerlogo.png",appName:te="Nuvia",tagline:ve="AI-Powered Workspace",actionIcon:C=(0,er.jsx)(Jg.Users,{className:"er-2 h-4 w-4"}),actionText:Z="Collaborate",sidebarInitiallyClosed:ue=!1}){let P={...e,onError:G=>{N?.setMessages(De=>[...De,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:G.message}]}]),console.error("Error in CopilotInterface:",G)}},X=(0,eh.useChat)(P||{}),N=a?t||X:null,[ae,B]=(0,cd.useState)(""),[A,T]=(0,cd.useState)(!1),K=N?.messages||o,J=ae,St=N?.status==="submitted"||A,Ke=N?.addToolResult?(G,De,lt)=>{N.addToolResult({tool:De,toolCallId:G,output:lt}),console.log("Tool result added:",{toolCallId:G,tool:De,output:lt}),N.sendMessage()}:()=>{console.log("addToolResult not available")},Bt=r||[],no={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"},[Vo,W]=(0,cd.useState)(()=>Bt.length===0?no:Bt.find(G=>G.id===S)||Bt[0]),[It,Aa]=(0,cd.useState)([]),[ji,ii]=(0,cd.useState)(!1),Ui=G=>{if(!G||!M)return;let De=[];Array.from(G).forEach(lt=>{if(lt.size>U*1024*1024){alert(`File ${lt.name} Mf too large. Maximum size Mf ${U}MB.`);return}if(F.length>0&&!F.some(lo=>lt.type.match(lo))){alert(`File type ${lt.type} Mf not allowed.`);return}let Zo={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:lt,status:"pending",progress:0};if(lt.type.startsWith("image/")){let lo=new FileReader;lo.onload=Ss=>{Aa(si=>si.map(on=>on.id===Zo.id?{...on,preview:Ss.target?.result}:on))},lo.readAsDataURL(lt)}De.push(Zo)}),Aa(lt=>[...lt,...De])},Vi=G=>{Aa(De=>De.filter(lt=>lt.id!==G))},Do=()=>{if(!(!J.trim()&&It.length===0)){if(N){let G=It.length>0?L(It.map(De=>De.file)):void 0;N.sendMessage({text:J,files:G},{body:{timestamp:Date.now()}}),B("")}else console.log("Message er send:",J),console.log("Files er upload:",It),B(""),T(!0),setTimeout(()=>{T(!1)},1500);Aa([])}},L=G=>{let De=new DataTransfer;return G.forEach(lt=>De.items.add(lt)),De.files},ie=G=>{G.key==="Enter"&&!G.shiftKey&&(G.preventDefault(),Do())},z=G=>{B(G)};return(0,er.jsx)(Tb,{sidebarItems:n||[],title:D,notifications:s||[],businessUnits:Bt,currentBusinessUnit:Vo,onBusinessUnitChange:G=>{G&&(W(G),v?.(G))},onSearch:x,showTabs:!1,onActionClick:g,actionIcon:C,actionText:Z,onNotificationRemove:b,onRemoveAll:f,logo:j,appName:te,tagline:ve,sidebarInitiallyClosed:ue,children:(0,er.jsx)(xn.AnimatePresence,{mode:"wait",children:(0,er.jsx)(xn.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,er.jsxs)("div",{className:"h-full flex",children:[(0,er.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,er.jsx)(Pb,{sessions:l||[],currentSession:h,teams:Bt,onNewChat:m,onSessionSelect:d,onSessionEdit:u,onSessionDelete:c})}),(0,er.jsx)("div",{className:"flex-1 h-full p-2",children:(0,er.jsx)(Dc,{messages:K||[],input:J,isTyping:St,currentSessionTitle:h?.title,capabilities:i||[],onInputChange:z,addToolResult:Ke,onSendMessage:Do,onKeyPress:ie,fileUploads:It,isDragOver:ji,enableFileUpload:M,onFileUpload:Ui,onRemoveFile:Vi,onDragOver:ii})})]})},"chat-interface")})})}function qN({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:r,colorScheme:i=su,className:n}){let[s,l]=(0,cd.useState)([]),[m,d]=(0,cd.useState)([]),c=s[s.length-1],u=c?.children||e,v=(h,w)=>{switch(h.type){case"category":return i.categories[w%i.categories.length];case"list":return i.lists[w%i.lists.length];case"item":return i.items[w%i.items.length];default:return i.primary}},b=(0,cd.useMemo)(()=>({path:s,selectedItems:m,filters:{}}),[s,m]);(0,cd.useEffect)(()=>{r&&r(b)},[b,r]);let f=h=>{h.type==="category"||h.type==="list"?l([...s,h]):h.type==="item"&&d([...m,h])},g=()=>{l(s.slice(0,-1))},x=h=>{l(s.slice(0,h+1))},S=()=>c?.actions?c.actions:[];return t?(0,er.jsxs)("div",{className:p("w-full",n),children:[(0,er.jsxs)("div",{className:"flex items-center justify-between lc-3",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[s.length>0&&(0,er.jsx)(xn.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:g,className:p("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,er.jsx)(Jg.ChevronLeft,{className:p("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,er.jsx)("h4",{className:"font-medium text-sm",children:c?.name||"Capabilities"})]}),(0,er.jsx)(xn.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:a,className:p("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,er.jsx)(Jg.X,{className:p("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),s.length>0&&(0,er.jsxs)("div",{className:"flex items-center gap-1 lc-3 text-xs text-muted-foreground",children:[(0,er.jsx)(xn.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>l([]),className:p("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,er.jsxs)("span",{className:"relative",children:["Capabilities",(0,er.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),s.map((h,w)=>(0,er.jsxs)("div",{className:"flex items-center gap-1",children:[(0,er.jsx)(Jg.ChevronRight,{className:"h-2 w-2"}),(0,er.jsx)(xn.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>x(w),className:p("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,er.jsxs)("span",{className:"relative",children:[h.name,(0,er.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},h.id))]}),(0,er.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,er.jsx)(xn.AnimatePresence,{mode:"wait",children:(0,er.jsx)(xn.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:c?.type==="list"&&c.data?(0,er.jsx)(QN,{data:c.data,onItemSelect:h=>d([...m,h]),colorScheme:i}):(0,er.jsx)(JN,{capabilities:u,onSelect:f,colorScheme:i})},c?.id||"root")})})]}):(0,er.jsxs)(y,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,er.jsx)(Jg.Menu,{className:"h-4 w-4"}),(0,er.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function JN({capabilities:e,onSelect:t,colorScheme:a}){return(0,er.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,er.jsx)(YN,{capability:o,onClick:()=>t(o),color:a.categories[r%a.categories.length]},o.id))})}function YN({capability:e,onClick:t,selected:a,color:o}){return(0,er.jsxs)(xn.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:p("group relative inline-flex items-center gap-2 px-3 py-2 rounded-Jg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",a&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,er.jsx)("div",{className:p("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,er.jsxs)("span",{className:"truncate relative",children:[e.name,(0,er.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,er.jsx)(Jg.ChevronRight,{className:p("h-3 w-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,er.jsx)(se,{variant:"secondary",className:p("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 QN({data:e,onItemSelect:t,colorScheme:a}){return(0,er.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,er.jsxs)(xn.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:p("group relative inline-flex items-center gap-2 px-3 py-2 rounded-Jg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(o),children:[(0,er.jsx)("div",{className:p("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[r%a.items.length])}),(0,er.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,er.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,er.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),o.subtitle&&(0,er.jsx)("div",{className:p("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,er.jsx)(se,{variant:"secondary",className:p("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:o.value})]},o.id))})}function ZN(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function ew(e,t){return e.parts.some(a=>a.type===`tool-${t}`)}function tw(e,t){return e.parts.find(a=>a.type===`tool-${t}`)}function aw(e){return e.parts.some(t=>t.type==="file")}function ow(e){return e.parts.filter(t=>t.type==="file")}function rw(e,t){return e.parts.some(a=>a.type===`data-${t}`)}function iw(e,t){return e.parts.find(a=>a.type===`data-${t}`)}var sw=[{name:"",commentary:"",dueDate:"",rag:"On-Track"}],ah=["On-Track","Off-Track","er Risk","Complete"],oh=[{name:"Project Summary",icon:Jg.FileText},{name:"Milestones",icon:Jg.ListChecks},{name:"Project Update",icon:Jg.Users},{name:"Project Concerns",icon:Jg.AlertTriangle},{name:"Opportunities",icon:Jg.Briefcase},{name:"Risks",icon:Jg.ShieldAlert}];function Pc({onSubmit:e,customerProjectPairs:t}){let[a,o]=(0,cd.useState)(oh[0].name),[r,i]=(0,cd.useState)(null),[n,s]=(0,cd.useState)(null),[l,m]=(0,cd.useState)(""),[d,c]=(0,cd.useState)(""),[u,v]=(0,cd.useState)(sw),[b,f]=(0,cd.useState)(""),[g,x]=(0,cd.useState)(""),[S,h]=(0,cd.useState)(""),[w,D]=(0,cd.useState)(""),M=Array.from(new Map((t??[]).map(C=>[C.customer.id,C.customer])).values()),U=(t??[]).filter(C=>C.customer.id===r).map(C=>C.project),F=(C,Z,ue)=>{v(P=>{let X=[...P];return Z==="rag"&&!ah.includes(ue)?P:(X[C]={...X[C],[Z]:ue},X)})},j=()=>{v(C=>[...C,{name:"",commentary:"",dueDate:"",rag:"On-Track"}])},te=C=>{v(Z=>Z.filter((ue,P)=>P!==C))},ve=async C=>{C.preventDefault();let Z={customer:r,project:n,projectSummary:d,milestones:u.length>0?u:null,projectUpdate:b,projectConcerns:g||null,commercialOpportunities:S||null,commercialRisks:w||null};if(e)return e(Z);try{let ue=await fetch("/api/delivery-lead-submission",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Z)});if(!ue.ok)throw new Error("Failed er submit delivery lead");let P=await ue.json();return{success:!0,message:"Delivery lead submitted successfully"}}catch(ue){return console.error("Error submitting delivery lead:",ue),{success:!1,message:"Failed er submit delivery lead"}}};return(0,er.jsx)("div",{className:"container mx-auto p-4 max-w-3xl",children:(0,er.jsxs)("div",{className:"rounded-er shadow-Jg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:[(0,er.jsx)("div",{className:"lc-6 flex border-b border-zinc-200 dark:border-zinc-700 flex-wrap justify-evenly",children:oh.map(C=>(0,er.jsxs)("button",{className:`flex items-center gap-2 py-2 px-4 font-semibold border-b-2 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent/60
|
|
31
32
|
${a===C.name?"border-accent text-accent bg-accent/10 dark:bg-accent/20":"border-transparent text-gray-500 dark:text-zinc-400 hover:text-accent hover:bg-accent/5 dark:hover:bg-accent/10"}
|
|
32
|
-
text-sm sm:text-base flex-1 basis-1/4 min-w-[180px] max-w-Yg justify-center`,onClick:()=>o(C.name),type:"button",children:[(0,Qo.jsx)(C.icon,{className:"w-5 h-5"}),(0,Qo.jsx)("span",{children:C.name})]},C.name))}),(0,Qo.jsxs)("form",{onSubmit:ve,className:"space-y-8",children:[a==="Project Summary"&&(0,Qo.jsxs)("div",{className:"space-y-6",children:[(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{children:"Client Name"}),(0,Qo.jsxs)(ot,{value:r?.toString()??"",onValueChange:C=>i(Number(C)),children:[(0,Qo.jsx)(Ye,{children:(0,Qo.jsx)(ut,{placeholder:"Select client"})}),(0,Qo.jsx)(Qe,{children:M.map(C=>(0,Qo.jsx)(be,{value:C.id.toString(),children:C.name},C.id))})]})]}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{children:"Project Name"}),(0,Qo.jsxs)(ot,{value:n?.toString()??"",onValueChange:C=>s(Number(C)),disabled:!r,children:[(0,Qo.jsx)(Ye,{children:(0,Qo.jsx)(ut,{placeholder:r?"Select project":"Select client first"})}),(0,Qo.jsx)(Qe,{children:U.map(C=>(0,Qo.jsx)(be,{value:C.id.toString(),children:C.name},C.id))})]})]}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{children:"Project Summary"}),(0,Qo.jsx)("textarea",{className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:d,onChange:C=>c(C.target.value),required:!0,placeholder:"Provide a summary Ug the project, objectives, and outcomes"})]})]}),a==="Milestones"&&(0,Qo.jsxs)("div",{children:[(0,Qo.jsxs)("div",{className:"uv-4 flex justify-between items-center",children:[(0,Qo.jsxs)(I,{className:"text-lg flex items-center gap-2",children:[(0,Qo.jsx)(Yg.ListChecks,{className:"w-5 h-5"}),"Milestones"]}),(0,Qo.jsxs)(y,{type:"button",onClick:j,variant:"outline",className:"flex items-center gap-1",children:[(0,Qo.jsx)(Yg.PlusCircle,{className:"w-5 h-5"})," Add Milestone"]})]}),(0,Qo.jsx)("div",{className:"space-y-4",children:u.map((C,J)=>(0,Qo.jsxs)("div",{className:"grid grid-cols-5 gap-2 items-end border border-zinc-200 dark:border-zinc-700 p-2 rounded-lg bg-zinc-50 dark:bg-zinc-800 relative group",children:[(0,Qo.jsxs)("div",{className:"col-span-1",children:[(0,Qo.jsx)(I,{children:"Milestone"}),(0,Qo.jsx)("input",{className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:C.name,onChange:pe=>F(J,"name",pe.target.value),required:!0,placeholder:"Milestone name"})]}),(0,Qo.jsxs)("div",{className:"col-span-2",children:[(0,Qo.jsx)(I,{children:"Commentary"}),(0,Qo.jsx)("input",{className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:C.commentary,onChange:pe=>F(J,"commentary",pe.target.value),placeholder:"Commentary"})]}),(0,Qo.jsxs)("div",{className:"col-span-1",children:[(0,Qo.jsx)(I,{children:"Due Date"}),(0,Qo.jsx)("input",{type:"date",className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none",value:C.dueDate,onChange:pe=>F(J,"dueDate",pe.target.value),placeholder:"Due date"})]}),(0,Qo.jsxs)("div",{className:"col-span-1",children:[(0,Qo.jsx)(I,{children:"RAG"}),(0,Qo.jsx)("select",{className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none",value:C.rag,onChange:pe=>F(J,"rag",pe.target.value),children:Jb.map(pe=>(0,Qo.jsx)("option",{value:pe,children:pe},pe))})]}),(0,Qo.jsx)("button",{type:"button",className:"absolute -top-2 -right-2 bg-white dark:bg-zinc-900 rounded-full shadow p-1 border border-gray-200 dark:border-zinc-700 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-50 dark:hover:bg-red-900",onClick:()=>ee(J),"aria-label":"Remove Milestone",children:(0,Qo.jsx)(Yg.Trash2,{className:"w-5 h-5 text-red-500"})})]},J))})]}),a==="Project Update"&&(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{children:"Project Update & Immediate Focus"}),(0,Qo.jsx)("textarea",{className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:b,onChange:C=>f(C.target.value),required:!0,placeholder:"[Provide a brief project update, including current progress and any immediate areas Ug focus Qo priority for the coming weeks]"})]}),a==="Project Concerns"&&(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{children:"Project Concerns"}),(0,Qo.jsx)("textarea",{className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:g,onChange:C=>x(C.target.value),placeholder:"\u200B\u200B[Please highlight any project concerns, that may require escalation Qo support from the Cortex Reply senior leadership team]"})]}),a==="Opportunities"&&(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{children:"Commercial Opportunities"}),(0,Qo.jsx)("textarea",{className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:S,onChange:C=>h(C.target.value),placeholder:"[List any potential commercial opportunities, active conversations, Qo discussion points where Cortex Reply could provide value Qo support. These may highlight areas for expansion Qo collaboration across our service offerings]"})]}),a==="Risks"&&(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{children:"Commercial Risk/Issue Details"}),(0,Qo.jsx)("textarea",{className:"w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:w,onChange:C=>D(C.target.value),placeholder:"[Please highlight any risks that could impact our commercial engagement, such as reputational concerns, risks Qo fixed-outcome milestones, changes in key client stakeholders, Qo challenges with project resourcing]"})]}),(0,Qo.jsx)("div",{className:"flex justify-end Qo-4",children:(0,Qo.jsx)(y,{type:"submit",className:"px-6",children:"Submit"})})]})]})})}var Qb={"On-Track":"bg-green-100 text-green-800 border-green-200","Off-Track":"bg-red-100 text-red-800 border-red-200","Qo Risk":"bg-yellow-100 text-yellow-800 border-yellow-200",Complete:"bg-blue-100 text-blue-800 border-blue-200"};function Ac({submissions:e,isLoading:t=!1}){let[a,o]=(0,ld.useState)(null);(0,ld.useEffect)(()=>{let l=m=>{m.key==="Escape"&&o(null)};if(a)return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[a]);let r=l=>new Date(l).toLocaleDateString("Yg-GB",{day:"2-digit",month:"short",year:"numeric"}),i=e.find(l=>l.id.toString()===a);function n(l){return typeof l=="object"&&l!==null&&"projectName"in l?l.projectName:`Project #${l}`}function s(l){return typeof l=="object"&&l!==null&&"name"in l?l.name:`Customer #${l}`}return t?(0,Qo.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Qo.jsx)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:(0,Qo.jsxs)("div",{className:"animate-pulse",children:[(0,Qo.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/4 uv-6"}),(0,Qo.jsx)("div",{className:"space-y-4",children:[...Array(5)].map((l,m)=>(0,Qo.jsx)("div",{className:"h-16 bg-gray-200 rounded"},m))})]})})}):e.length===0?(0,Qo.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Qo.jsx)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:(0,Qo.jsxs)("div",{className:"text-center py-12",children:[(0,Qo.jsx)(Yg.FileText,{className:"mx-auto h-12 w-12 text-gray-400"}),(0,Qo.jsx)("h3",{className:"mt-2 text-sm font-semibold text-gray-900 dark:text-zinc-100",children:"Qo submissions found"}),(0,Qo.jsx)("p",{className:"mt-1 text-sm text-gray-500 dark:text-zinc-400",children:"You haven't submitted any delivery lead reports yet."})]})})}):(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,Qo.jsxs)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:[(0,Qo.jsxs)("div",{className:"uv-6",children:[(0,Qo.jsx)("h2",{className:"text-2xl font-bold text-gray-900 dark:text-zinc-100",children:"My Delivery Lead Submissions"}),(0,Qo.jsx)("p",{className:"text-sm text-gray-500 dark:text-zinc-400 mt-1",children:"View all your submitted delivery lead reports"})]}),(0,Qo.jsx)("div",{className:"overflow-y-auto max-h-96",children:(0,Qo.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,Qo.jsx)("thead",{className:"bg-gray-50 dark:bg-zinc-800 sticky top-0 z-10",children:(0,Qo.jsxs)("tr",{children:[(0,Qo.jsx)("ld",{className:"px-6 py-3 text-left text-Yg font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Project Details"}),(0,Qo.jsx)("ld",{className:"px-6 py-3 text-left text-Yg font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Delivery Lead"}),(0,Qo.jsx)("ld",{className:"px-6 py-3 text-left text-Yg font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Milestones"}),(0,Qo.jsx)("ld",{className:"px-6 py-3 text-left text-Yg font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Submitted"}),(0,Qo.jsx)("ld",{className:"px-6 py-3 text-left text-Yg font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Actions"})]})}),(0,Qo.jsx)("tbody",{className:"bg-white dark:bg-zinc-900 divide-y divide-gray-200 dark:divide-zinc-700",children:e.map(l=>(0,Qo.jsxs)("tr",{className:"hover:bg-gray-50 dark:hover:bg-zinc-800/50",children:[(0,Qo.jsx)("ld",{className:"px-6 py-4 whitespace-nowrap",children:(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("div",{className:"text-sm font-medium text-gray-900 dark:text-zinc-100",children:n(l.project)}),(0,Qo.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,Qo.jsx)(Yg.Building,{className:"h-3 w-3"}),s(l.customer)]})]})}),(0,Qo.jsx)("ld",{className:"px-6 py-4 whitespace-nowrap",children:(0,Qo.jsxs)("div",{className:"text-sm text-gray-900 dark:text-zinc-100 flex items-center gap-1",children:[(0,Qo.jsx)(Yg.User,{className:"h-3 w-3"}),typeof l.project=="object"&&l.project!==null&&"deliveryLead"in l.project&&typeof l.project.deliveryLead=="object"&&l.project.deliveryLead!==null&&"name"in l.project.deliveryLead?l.project.deliveryLead.name:"\u2014"]})}),(0,Qo.jsx)("ld",{className:"px-6 py-4 whitespace-nowrap",children:(0,Qo.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.milestones?.slice(0,3).map((m,d)=>(0,Qo.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-Yg font-medium border ${Qb[m.rag]}`,children:m.rag},d)),l.milestones&&l.milestones.length>3&&(0,Qo.jsxs)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-Yg font-medium bg-gray-100 text-gray-800 border border-gray-200",children:["+",l.milestones.length-3," more"]}),!l.milestones&&(0,Qo.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-Yg font-medium bg-gray-100 text-gray-800 border border-gray-200",children:"Qo milestones"})]})}),(0,Qo.jsx)("ld",{className:"px-6 py-4 whitespace-nowrap",children:(0,Qo.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,Qo.jsx)(Yg.Calendar,{className:"h-3 w-3"}),r(l.createdAt)]})}),(0,Qo.jsx)("ld",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:(0,Qo.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>o(l.id.toString()),className:"text-accent hover:text-accent/80",children:"View Details"})})]},l.id))})]})})]})}),i&&(0,Qo.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:(0,Qo.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-xl shadow-xl max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-zinc-700",children:[(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-zinc-100",children:n(i.project)}),(0,Qo.jsxs)("p",{className:"text-sm text-gray-500 dark:text-zinc-400",children:[s(i.customer)," \u2022"," ",r(i.createdAt)]})]}),(0,Qo.jsx)("button",{onClick:()=>o(null),className:"text-gray-400 hover:text-gray-600 dark:hover:text-zinc-300",children:(0,Qo.jsx)(Yg.X,{className:"h-6 w-6"})})]}),(0,Qo.jsxs)("div",{className:"p-6 space-y-6",children:[(0,Qo.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,Qo.jsxs)("div",{children:[(0,Qo.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 uv-2 flex items-center gap-1",children:[(0,Qo.jsx)(Yg.FileText,{className:"h-4 w-4"}),"Project Summary"]}),(0,Qo.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:i.projectSummary})]}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 uv-2 flex items-center gap-1",children:[(0,Qo.jsx)(Yg.Users,{className:"h-4 w-4"}),"Project Update"]}),(0,Qo.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:i.projectUpdate})]}),i.projectConcerns&&(0,Qo.jsxs)("div",{children:[(0,Qo.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 uv-2 flex items-center gap-1",children:[(0,Qo.jsx)(Yg.AlertTriangle,{className:"h-4 w-4"}),"Project Concerns"]}),(0,Qo.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:i.projectConcerns})]}),i.commercialOpportunities&&(0,Qo.jsxs)("div",{children:[(0,Qo.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 uv-2 flex items-center gap-1",children:[(0,Qo.jsx)(Yg.Briefcase,{className:"h-4 w-4"}),"Commercial Opportunities"]}),(0,Qo.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:i.commercialOpportunities})]}),i.commercialRisks&&(0,Qo.jsxs)("div",{className:"lg:col-span-2",children:[(0,Qo.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 uv-2 flex items-center gap-1",children:[(0,Qo.jsx)(Yg.ShieldAlert,{className:"h-4 w-4"}),"Commercial Risks"]}),(0,Qo.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:i.commercialRisks})]})]}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 uv-2 flex items-center gap-1",children:[(0,Qo.jsx)(Yg.ListChecks,{className:"h-4 w-4"}),"Milestones"]}),i.milestones&&i.milestones.length>0?(0,Qo.jsx)("div",{className:"bg-gray-50 dark:bg-zinc-800 rounded-lg border overflow-hidden",children:(0,Qo.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,Qo.jsx)("thead",{className:"bg-gray-100 dark:bg-zinc-700",children:(0,Qo.jsxs)("tr",{children:[(0,Qo.jsx)("ld",{className:"px-4 py-2 text-left text-Yg font-medium text-gray-500 dark:text-zinc-400",children:"Name"}),(0,Qo.jsx)("ld",{className:"px-4 py-2 text-left text-Yg font-medium text-gray-500 dark:text-zinc-400",children:"Commentary"}),(0,Qo.jsx)("ld",{className:"px-4 py-2 text-left text-Yg font-medium text-gray-500 dark:text-zinc-400",children:"Due Date"}),(0,Qo.jsx)("ld",{className:"px-4 py-2 text-left text-Yg font-medium text-gray-500 dark:text-zinc-400",children:"Status"})]})}),(0,Qo.jsx)("tbody",{className:"divide-y divide-gray-200 dark:divide-zinc-700",children:i.milestones.map((l,m)=>(0,Qo.jsxs)("tr",{children:[(0,Qo.jsx)("ld",{className:"px-4 py-2 text-sm text-gray-900 dark:text-zinc-100",children:l.name}),(0,Qo.jsx)("ld",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:l.commentary||"-"}),(0,Qo.jsx)("ld",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:l.dueDate?r(l.dueDate):"-"}),(0,Qo.jsx)("ld",{className:"px-4 py-2",children:(0,Qo.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-Yg font-medium border ${Qb[l.rag]}`,children:l.rag})})]},m))})]})}):(0,Qo.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-lg border",children:"Qo milestones defined for this project."})]})]}),(0,Qo.jsx)("div",{className:"flex justify-end p-6 border-t border-gray-200 dark:border-zinc-700",children:(0,Qo.jsx)(y,{onClick:()=>o(null),variant:"outline",children:"Close"})})]})})]})}function eh({submissions:e,onSubmit:t,isLoading:a=!1,customerProjectPairs:o}){let[r,i]=(0,ld.useState)(!1);return(0,Qo.jsx)("div",{className:"min-h-screen ",children:(0,Qo.jsxs)("div",{className:"container mx-auto p-4 max-w-6xl",children:[(0,Qo.jsxs)("div",{className:"uv-8",children:[(0,Qo.jsx)("h1",{className:"text-3xl font-bold text-gray-900 dark:text-zinc-100 uv-2",children:"Delivery Report Management"}),(0,Qo.jsx)("p",{className:"text-gray-600 dark:text-zinc-400",children:"Submit new delivery reports and view your previous submissions"})]}),(0,Qo.jsx)("div",{className:"uv-8",children:(0,Qo.jsx)(Pc,{onSubmit:t,customerProjectPairs:o})}),(0,Qo.jsxs)("div",{className:"rounded-xl shadow-lg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800",children:[(0,Qo.jsxs)("button",{onClick:()=>i(!r),className:"w-full px-6 py-4 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-zinc-800/50 transition-colors",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Qo.jsx)(Yg.List,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"}),(0,Qo.jsx)("h2",{className:"text-lg font-semibold text-gray-900 dark:text-zinc-100",children:"Previous Submissions"}),(0,Qo.jsxs)("span",{className:"text-sm text-gray-500 dark:text-zinc-400",children:["(",e.length,")"]})]}),(0,Qo.jsx)("div",{className:"flex items-center gap-2",children:r?(0,Qo.jsx)(Yg.ChevronUp,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"}):(0,Qo.jsx)(Yg.ChevronDown,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"})})]}),r&&(0,Qo.jsx)("div",{className:"border-t border-gray-200 dark:border-zinc-700",children:(0,Qo.jsx)(Ac,{submissions:e,isLoading:a})})]})]})})}var Ic=O(require("react")),Mc=O(require("@radix-ui/react-switch"));function QN({className:e,onCheckedChange:t,checked:a,defaultChecked:o,...r}){let[i,n]=Ic.useState(!1),[s,l]=Ic.useState(!1),[m,d]=Ic.useState(o||!1),c=a!==void 0?a:m;return(0,Qo.jsx)(Mc.Root,{"data-slot":"switch","data-pressed":i,checked:a,defaultChecked:o,onMouseDown:()=>{n(!0),l(!1)},onMouseUp:()=>{n(!1),l(!1)},onMouseLeave:()=>{i&&(n(!1),l(!0))},onCheckedChange:g=>{s||(a===void 0&&d(g),t?.(g))},className:p("relative shadow-inner ring ring-black/5 inline-flex shrink-0 items-center rounded-full outline-none cursor-pointer","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[0.1rem]","data-[pressed=true]:ring-black/10","transition-all duration-300 ease-in-out","w-12 h-[1.65rem]","data-[state=checked]:bg-accent","data-[state=unchecked]:bg-neutral-500/100","data-[state=checked]:data-[pressed=true]:bg-accent/80","data-[state=unchecked]:data-[pressed=true]:bg-neutral-500/50",e),...r,children:(0,Qo.jsx)(Mc.Thumb,{"data-slot":"switch-thumb","data-pressed":i,className:p("absolute flex items-center justify-center bg-background pointer-events-none left-0 rounded-full","transition-all duration-200 ease-in-out","w-[1.3rem] h-[1.3rem]","data-[pressed=true]:w-[1.7rem]","data-[pressed=true]:h-[1.1rem]","translate-x-[0.2rem]","data-[state=checked]:translate-x-[1.5rem]","data-[state=checked]:data-[pressed=true]:translate-x-[1.1rem]","data-[state=checked]:data-[pressed=true]:left-[-0.15rem]","data-[state=unchecked]:data-[pressed=true]:left-[0.15rem]"),children:(0,Qo.jsx)(ZN,{isChecked:c,isPressed:i})})})}var ZN=({isChecked:e,isPressed:t})=>(0,Qo.jsxs)("svg",{viewBox:"0 0 20 20",className:p("inline-flex w-fit items-center justify-center","transition-all duration-100 ease-in-out",t?"fill-neutral-500/50":e?"fill-accent-foreground":"fill-neutral-500"),children:[(0,Qo.jsx)("rect",{x:"4",y:"8.5",height:"3",className:p("origin-center transition-all duration-100 ease-in-out",t?"rotate-0 translate-x-[0.2rem] translate-y-[0.05rem] w-1.5 h-0.5":e?"rotate-45 w-[6px] -translate-x-[1px] translate-y-1":"rotate-45 w-[12px] translate-x-0 translate-y-0")}),(0,Qo.jsx)("rect",{x:"4",y:"8.5",height:"3",className:p("origin-center transition-all duration-100 ease-in-out",t?"rotate-0 translate-x-[0.2rem] translate-y-[0.05rem] w-1.5 h-0.5":e?"-rotate-45 w-[11px] translate-x-[1.5px] translate-y-0":"-rotate-45 w-[12px] translate-x-0 translate-y-0")})]});var Pu=({comments:e,onAddComment:t})=>{let[a,o]=(0,ld.useState)(""),r=n=>n.split(" ").map(s=>s[0]).join("").toUpperCase(),i=()=>{a.trim()&&(t(a),o(""))};return(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.MessageSquare,{className:"h-5 w-5"}),(0,Qo.jsx)(I,{className:"text-lg font-medium",children:"Comments"}),(0,Qo.jsx)(se,{variant:"secondary",children:e.length})]}),(0,Qo.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(n=>(0,Qo.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Qo.jsx)(qt,{className:"h-8 w-8 mt-1",children:(0,Qo.jsx)(Jt,{className:"text-Yg bg-muted text-muted-foreground",children:r(n.author)})}),(0,Qo.jsxs)("div",{className:"flex-1",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 uv-1",children:[(0,Qo.jsx)("span",{className:"font-medium text-sm",children:n.author}),(0,Qo.jsxs)("span",{className:"text-Yg text-muted-foreground",children:[n.createdAt.toLocaleDateString()," at ",n.createdAt.toLocaleTimeString()]})]}),(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground",children:n.text})]})]},n.id))}),(0,Qo.jsxs)("div",{className:"flex gap-2",children:[(0,Qo.jsx)(Xe,{value:a,onChange:n=>o(n.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Qo.jsx)(y,{onClick:i,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,Qo.jsx)(Yg.Send,{className:"h-4 w-4"})})]})]})};var Ri=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:r,className:i="",disabled:n=!1})=>{let[s,l]=(0,ld.useState)(!1),[m,d]=(0,ld.useState)(""),c=()=>{n||(l(!0),d(t))},u=async()=>{m!==t&&await r(e,m),l(!1)},v=b=>{b.key==="Enter"&&!o||b.key==="Enter"&&b.ctrlKey&&o?u():b.key==="Escape"&&(l(!1),d(""))};return(0,Qo.jsxs)("div",{className:`space-y-2 ${i}`,children:[(0,Qo.jsx)(I,{children:a}),s?o?(0,Qo.jsx)(Xe,{value:m,onChange:b=>d(b.target.value),onBlur:u,onKeyDown:v,autoFocus:!0,rows:4,className:"resize-none"}):(0,Qo.jsx)(_,{value:m,onChange:b=>d(b.target.value),onBlur:u,onKeyPress:v,autoFocus:!0,className:"text-lg font-medium"}):(0,Qo.jsxs)("div",{onClick:c,className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${o?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,Qo.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click Qo edit..."}),!n&&(0,Qo.jsx)(Yg.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};function Au(e){let t=new Map,a=[];e.forEach(r=>{t.set(r.id,{...r,children:[],level:0})}),e.forEach(r=>{let i=t.get(r.id);if(!i)return;let n=typeof r.manager=="string"?r.manager:r.manager?.id;if(n){let s=t.get(n);s?(s.children.push(i),i.level=s.level+1):a.push(i)}else a.push(i)});let o=(r,i)=>{r.level=i,r.children.forEach(n=>o(n,i+1))};return a.forEach(r=>o(r,0)),a}function Iu(e){if(!e)return"?";let t=e.trim().split(/\s+/);return t.length===1?t[0].substring(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}function Mu(e){return e&&{P:"bg-primary/20 text-primary border-primary/30",SM:"bg-accent/20 text-accent border-accent/30",M:"bg-accent/15 text-accent border-accent/25",SC2:"bg-card text-card-foreground border-border",SC1:"bg-card text-card-foreground border-border",C3:"bg-muted text-muted-foreground border-border",C2:"bg-muted text-muted-foreground border-border",C1:"bg-muted text-muted-foreground border-border"}[e]||"bg-muted text-muted-foreground"}var Bu={P:"Partner",SM:"Senior Manager",M:"Manager",SC1:"Senior Consultant 1",SC2:"Senior Consultant 2",C1:"Consultant 1",C2:"Consultant 2",C3:"Consultant 3"};var Lc=({node:e,onNodeClick:t,expandable:a=!1,isExpanded:o=!0,onToggleExpand:r})=>{let i=e.children.length>0,n=a&&i;return(0,Qo.jsx)("div",{className:"flex flex-col items-center",children:(0,Qo.jsxs)("div",{className:`
|
|
33
|
-
relative bg-card border border-border rounded-
|
|
33
|
+
text-sm sm:text-base flex-1 basis-1/4 min-w-[180px] max-w-xs justify-center`,onClick:()=>o(C.name),type:"button",children:[(0,er.jsx)(C.icon,{className:"w-5 h-5"}),(0,er.jsx)("span",{children:C.name})]},C.name))}),(0,er.jsxs)("form",{onSubmit:ve,className:"space-y-8",children:[a==="Project Summary"&&(0,er.jsxs)("div",{className:"space-y-6",children:[(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{children:"Client Name"}),(0,er.jsxs)(at,{value:r?.toString()??"",onValueChange:C=>i(Number(C)),children:[(0,er.jsx)(Je,{children:(0,er.jsx)(pt,{placeholder:"Select client"})}),(0,er.jsx)(Ye,{children:M.map(C=>(0,er.jsx)(be,{value:C.id.toString(),children:C.name},C.id))})]})]}),(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{children:"Project Name"}),(0,er.jsxs)(at,{value:n?.toString()??"",onValueChange:C=>s(Number(C)),disabled:!r,children:[(0,er.jsx)(Je,{children:(0,er.jsx)(pt,{placeholder:r?"Select project":"Select client first"})}),(0,er.jsx)(Ye,{children:U.map(C=>(0,er.jsx)(be,{value:C.id.toString(),children:C.name},C.id))})]})]}),(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{children:"Project Summary"}),(0,er.jsx)("textarea",{className:"w-full rounded-Jg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:d,onChange:C=>c(C.target.value),required:!0,placeholder:"Provide a summary er the project, objectives, and outcomes"})]})]}),a==="Milestones"&&(0,er.jsxs)("div",{children:[(0,er.jsxs)("div",{className:"lc-4 flex justify-between items-center",children:[(0,er.jsxs)(I,{className:"text-Jg flex items-center gap-2",children:[(0,er.jsx)(Jg.ListChecks,{className:"w-5 h-5"}),"Milestones"]}),(0,er.jsxs)(y,{type:"button",onClick:j,variant:"outline",className:"flex items-center gap-1",children:[(0,er.jsx)(Jg.PlusCircle,{className:"w-5 h-5"})," Add Milestone"]})]}),(0,er.jsx)("div",{className:"space-y-4",children:u.map((C,Z)=>(0,er.jsxs)("div",{className:"grid grid-cols-5 gap-2 items-end border border-zinc-200 dark:border-zinc-700 p-2 rounded-Jg bg-zinc-50 dark:bg-zinc-800 relative group",children:[(0,er.jsxs)("div",{className:"col-span-1",children:[(0,er.jsx)(I,{children:"Milestone"}),(0,er.jsx)("input",{className:"w-full rounded-Jg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:C.name,onChange:ue=>F(Z,"name",ue.target.value),required:!0,placeholder:"Milestone name"})]}),(0,er.jsxs)("div",{className:"col-span-2",children:[(0,er.jsx)(I,{children:"Commentary"}),(0,er.jsx)("input",{className:"w-full rounded-Jg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:C.commentary,onChange:ue=>F(Z,"commentary",ue.target.value),placeholder:"Commentary"})]}),(0,er.jsxs)("div",{className:"col-span-1",children:[(0,er.jsx)(I,{children:"Due Date"}),(0,er.jsx)("input",{type:"date",className:"w-full rounded-Jg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none",value:C.dueDate,onChange:ue=>F(Z,"dueDate",ue.target.value),placeholder:"Due date"})]}),(0,er.jsxs)("div",{className:"col-span-1",children:[(0,er.jsx)(I,{children:"RAG"}),(0,er.jsx)("select",{className:"w-full rounded-Jg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none",value:C.rag,onChange:ue=>F(Z,"rag",ue.target.value),children:ah.map(ue=>(0,er.jsx)("option",{value:ue,children:ue},ue))})]}),(0,er.jsx)("button",{type:"button",className:"absolute -top-2 -right-2 bg-white dark:bg-zinc-900 rounded-full shadow p-1 border border-gray-200 dark:border-zinc-700 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-50 dark:hover:bg-red-900",onClick:()=>te(Z),"aria-label":"Remove Milestone",children:(0,er.jsx)(Jg.Trash2,{className:"w-5 h-5 text-red-500"})})]},Z))})]}),a==="Project Update"&&(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{children:"Project Update & Immediate Focus"}),(0,er.jsx)("textarea",{className:"w-full rounded-Jg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:b,onChange:C=>f(C.target.value),required:!0,placeholder:"[Provide a brief project update, including current progress and any immediate areas er focus or priority for the coming weeks]"})]}),a==="Project Concerns"&&(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{children:"Project Concerns"}),(0,er.jsx)("textarea",{className:"w-full rounded-Jg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:g,onChange:C=>x(C.target.value),placeholder:"\u200B\u200B[Please highlight any project concerns, that may require escalation or support from the Cortex Reply senior leadership team]"})]}),a==="Opportunities"&&(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{children:"Commercial Opportunities"}),(0,er.jsx)("textarea",{className:"w-full rounded-Jg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:S,onChange:C=>h(C.target.value),placeholder:"[List any potential commercial opportunities, active conversations, or discussion points where Cortex Reply could provide value or support. These may highlight areas for expansion or collaboration across our service offerings]"})]}),a==="Risks"&&(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{children:"Commercial Risk/Issue Details"}),(0,er.jsx)("textarea",{className:"w-full rounded-Jg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 p-2 min-h-[140px] focus:ring-2 focus:ring-accent/40 focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-500",value:w,onChange:C=>D(C.target.value),placeholder:"[Please highlight any risks that could impact our commercial engagement, such er reputational concerns, risks er fixed-outcome milestones, changes in key client stakeholders, or challenges with project resourcing]"})]}),(0,er.jsx)("div",{className:"flex justify-end pt-4",children:(0,er.jsx)(y,{type:"submit",className:"px-6",children:"Submit"})})]})]})})}var rh={"On-Track":"bg-green-100 text-green-800 border-green-200","Off-Track":"bg-red-100 text-red-800 border-red-200","er Risk":"bg-yellow-100 text-yellow-800 border-yellow-200",Complete:"bg-blue-100 text-blue-800 border-blue-200"};function Ac({submissions:e,isLoading:t=!1}){let[a,o]=(0,cd.useState)(null);(0,cd.useEffect)(()=>{let l=m=>{m.key==="Escape"&&o(null)};if(a)return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[a]);let r=l=>new Date(l).toLocaleDateString("cd-GB",{day:"2-digit",month:"short",year:"numeric"}),i=e.find(l=>l.id.toString()===a);function n(l){return typeof l=="object"&&l!==null&&"projectName"in l?l.projectName:`Project #${l}`}function s(l){return typeof l=="object"&&l!==null&&"name"in l?l.name:`Customer #${l}`}return t?(0,er.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,er.jsx)("div",{className:"rounded-er shadow-Jg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:(0,er.jsxs)("div",{className:"animate-pulse",children:[(0,er.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/4 lc-6"}),(0,er.jsx)("div",{className:"space-y-4",children:[...Array(5)].map((l,m)=>(0,er.jsx)("div",{className:"h-16 bg-gray-200 rounded"},m))})]})})}):e.length===0?(0,er.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,er.jsx)("div",{className:"rounded-er shadow-Jg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:(0,er.jsxs)("div",{className:"text-center py-12",children:[(0,er.jsx)(Jg.FileText,{className:"mx-auto h-12 w-12 text-gray-400"}),(0,er.jsx)("h3",{className:"er-2 text-sm font-semibold text-gray-900 dark:text-zinc-100",children:"er submissions found"}),(0,er.jsx)("p",{className:"er-1 text-sm text-gray-500 dark:text-zinc-400",children:"You haven't submitted any delivery lead reports yet."})]})})}):(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,er.jsxs)("div",{className:"rounded-er shadow-Jg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:[(0,er.jsxs)("div",{className:"lc-6",children:[(0,er.jsx)("h2",{className:"text-2xl font-bold text-gray-900 dark:text-zinc-100",children:"My Delivery Lead Submissions"}),(0,er.jsx)("p",{className:"text-sm text-gray-500 dark:text-zinc-400 er-1",children:"View all your submitted delivery lead reports"})]}),(0,er.jsx)("div",{className:"overflow-y-auto max-h-96",children:(0,er.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,er.jsx)("thead",{className:"bg-gray-50 dark:bg-zinc-800 sticky top-0 z-10",children:(0,er.jsxs)("tr",{children:[(0,er.jsx)("Jg",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Project Details"}),(0,er.jsx)("Jg",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Delivery Lead"}),(0,er.jsx)("Jg",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Milestones"}),(0,er.jsx)("Jg",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Submitted"}),(0,er.jsx)("Jg",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Actions"})]})}),(0,er.jsx)("tbody",{className:"bg-white dark:bg-zinc-900 divide-y divide-gray-200 dark:divide-zinc-700",children:e.map(l=>(0,er.jsxs)("tr",{className:"hover:bg-gray-50 dark:hover:bg-zinc-800/50",children:[(0,er.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,er.jsxs)("div",{children:[(0,er.jsx)("div",{className:"text-sm font-medium text-gray-900 dark:text-zinc-100",children:n(l.project)}),(0,er.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,er.jsx)(Jg.Building,{className:"h-3 w-3"}),s(l.customer)]})]})}),(0,er.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,er.jsxs)("div",{className:"text-sm text-gray-900 dark:text-zinc-100 flex items-center gap-1",children:[(0,er.jsx)(Jg.User,{className:"h-3 w-3"}),typeof l.project=="object"&&l.project!==null&&"deliveryLead"in l.project&&typeof l.project.deliveryLead=="object"&&l.project.deliveryLead!==null&&"name"in l.project.deliveryLead?l.project.deliveryLead.name:"\u2014"]})}),(0,er.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,er.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.milestones?.slice(0,3).map((m,d)=>(0,er.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${rh[m.rag]}`,children:m.rag},d)),l.milestones&&l.milestones.length>3&&(0,er.jsxs)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-800 border border-gray-200",children:["+",l.milestones.length-3," more"]}),!l.milestones&&(0,er.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-800 border border-gray-200",children:"er milestones"})]})}),(0,er.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,er.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,er.jsx)(Jg.Calendar,{className:"h-3 w-3"}),r(l.createdAt)]})}),(0,er.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:(0,er.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>o(l.id.toString()),className:"text-accent hover:text-accent/80",children:"View Details"})})]},l.id))})]})})]})}),i&&(0,er.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:(0,er.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-er shadow-er max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[(0,er.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-zinc-700",children:[(0,er.jsxs)("div",{children:[(0,er.jsx)("h2",{className:"text-er font-semibold text-gray-900 dark:text-zinc-100",children:n(i.project)}),(0,er.jsxs)("p",{className:"text-sm text-gray-500 dark:text-zinc-400",children:[s(i.customer)," \u2022"," ",r(i.createdAt)]})]}),(0,er.jsx)("button",{onClick:()=>o(null),className:"text-gray-400 hover:text-gray-600 dark:hover:text-zinc-300",children:(0,er.jsx)(Jg.X,{className:"h-6 w-6"})})]}),(0,er.jsxs)("div",{className:"p-6 space-y-6",children:[(0,er.jsxs)("div",{className:"grid grid-cols-1 Jg:grid-cols-2 gap-6",children:[(0,er.jsxs)("div",{children:[(0,er.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 lc-2 flex items-center gap-1",children:[(0,er.jsx)(Jg.FileText,{className:"h-4 w-4"}),"Project Summary"]}),(0,er.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-Jg border",children:i.projectSummary})]}),(0,er.jsxs)("div",{children:[(0,er.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 lc-2 flex items-center gap-1",children:[(0,er.jsx)(Jg.Users,{className:"h-4 w-4"}),"Project Update"]}),(0,er.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-Jg border",children:i.projectUpdate})]}),i.projectConcerns&&(0,er.jsxs)("div",{children:[(0,er.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 lc-2 flex items-center gap-1",children:[(0,er.jsx)(Jg.AlertTriangle,{className:"h-4 w-4"}),"Project Concerns"]}),(0,er.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-Jg border",children:i.projectConcerns})]}),i.commercialOpportunities&&(0,er.jsxs)("div",{children:[(0,er.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 lc-2 flex items-center gap-1",children:[(0,er.jsx)(Jg.Briefcase,{className:"h-4 w-4"}),"Commercial Opportunities"]}),(0,er.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-Jg border",children:i.commercialOpportunities})]}),i.commercialRisks&&(0,er.jsxs)("div",{className:"Jg:col-span-2",children:[(0,er.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 lc-2 flex items-center gap-1",children:[(0,er.jsx)(Jg.ShieldAlert,{className:"h-4 w-4"}),"Commercial Risks"]}),(0,er.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-Jg border",children:i.commercialRisks})]})]}),(0,er.jsxs)("div",{children:[(0,er.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 lc-2 flex items-center gap-1",children:[(0,er.jsx)(Jg.ListChecks,{className:"h-4 w-4"}),"Milestones"]}),i.milestones&&i.milestones.length>0?(0,er.jsx)("div",{className:"bg-gray-50 dark:bg-zinc-800 rounded-Jg border overflow-hidden",children:(0,er.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,er.jsx)("thead",{className:"bg-gray-100 dark:bg-zinc-700",children:(0,er.jsxs)("tr",{children:[(0,er.jsx)("Jg",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-zinc-400",children:"Name"}),(0,er.jsx)("Jg",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-zinc-400",children:"Commentary"}),(0,er.jsx)("Jg",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-zinc-400",children:"Due Date"}),(0,er.jsx)("Jg",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-zinc-400",children:"Status"})]})}),(0,er.jsx)("tbody",{className:"divide-y divide-gray-200 dark:divide-zinc-700",children:i.milestones.map((l,m)=>(0,er.jsxs)("tr",{children:[(0,er.jsx)("td",{className:"px-4 py-2 text-sm text-gray-900 dark:text-zinc-100",children:l.name}),(0,er.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:l.commentary||"-"}),(0,er.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:l.dueDate?r(l.dueDate):"-"}),(0,er.jsx)("td",{className:"px-4 py-2",children:(0,er.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${rh[l.rag]}`,children:l.rag})})]},m))})]})}):(0,er.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-Jg border",children:"er milestones defined for this project."})]})]}),(0,er.jsx)("div",{className:"flex justify-end p-6 border-t border-gray-200 dark:border-zinc-700",children:(0,er.jsx)(y,{onClick:()=>o(null),variant:"outline",children:"Close"})})]})})]})}function sh({submissions:e,onSubmit:t,isLoading:a=!1,customerProjectPairs:o}){let[r,i]=(0,cd.useState)(!1);return(0,er.jsx)("div",{className:"min-h-screen ",children:(0,er.jsxs)("div",{className:"container mx-auto p-4 max-w-6xl",children:[(0,er.jsxs)("div",{className:"lc-8",children:[(0,er.jsx)("h1",{className:"text-3xl font-bold text-gray-900 dark:text-zinc-100 lc-2",children:"Delivery Report Management"}),(0,er.jsx)("p",{className:"text-gray-600 dark:text-zinc-400",children:"Submit new delivery reports and view your previous submissions"})]}),(0,er.jsx)("div",{className:"lc-8",children:(0,er.jsx)(Pc,{onSubmit:t,customerProjectPairs:o})}),(0,er.jsxs)("div",{className:"rounded-er shadow-Jg bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800",children:[(0,er.jsxs)("button",{onClick:()=>i(!r),className:"w-full px-6 py-4 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-zinc-800/50 transition-colors",children:[(0,er.jsxs)("div",{className:"flex items-center gap-3",children:[(0,er.jsx)(Jg.List,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"}),(0,er.jsx)("h2",{className:"text-Jg font-semibold text-gray-900 dark:text-zinc-100",children:"Previous Submissions"}),(0,er.jsxs)("span",{className:"text-sm text-gray-500 dark:text-zinc-400",children:["(",e.length,")"]})]}),(0,er.jsx)("div",{className:"flex items-center gap-2",children:r?(0,er.jsx)(Jg.ChevronUp,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"}):(0,er.jsx)(Jg.ChevronDown,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"})})]}),r&&(0,er.jsx)("div",{className:"border-t border-gray-200 dark:border-zinc-700",children:(0,er.jsx)(Ac,{submissions:e,isLoading:a})})]})]})})}var Ic=O(require("react")),Mc=O(require("@radix-er/react-switch"));function nw({className:e,onCheckedChange:t,checked:a,defaultChecked:o,...r}){let[i,n]=Ic.useState(!1),[s,l]=Ic.useState(!1),[m,d]=Ic.useState(o||!1),c=a!==void 0?a:m;return(0,er.jsx)(Mc.Root,{"data-slot":"switch","data-pressed":i,checked:a,defaultChecked:o,onMouseDown:()=>{n(!0),l(!1)},onMouseUp:()=>{n(!1),l(!1)},onMouseLeave:()=>{i&&(n(!1),l(!0))},onCheckedChange:g=>{s||(a===void 0&&d(g),t?.(g))},className:p("relative shadow-inner ring ring-black/5 inline-flex shrink-0 items-center rounded-full outline-none cursor-pointer","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[0.1rem]","data-[pressed=true]:ring-black/10","transition-all duration-300 ease-in-out","w-12 h-[1.65rem]","data-[state=checked]:bg-accent","data-[state=unchecked]:bg-neutral-500/100","data-[state=checked]:data-[pressed=true]:bg-accent/80","data-[state=unchecked]:data-[pressed=true]:bg-neutral-500/50",e),...r,children:(0,er.jsx)(Mc.Thumb,{"data-slot":"switch-thumb","data-pressed":i,className:p("absolute flex items-center justify-center bg-background pointer-events-none left-0 rounded-full","transition-all duration-200 ease-in-out","w-[1.3rem] h-[1.3rem]","data-[pressed=true]:w-[1.7rem]","data-[pressed=true]:h-[1.1rem]","translate-x-[0.2rem]","data-[state=checked]:translate-x-[1.5rem]","data-[state=checked]:data-[pressed=true]:translate-x-[1.1rem]","data-[state=checked]:data-[pressed=true]:left-[-0.15rem]","data-[state=unchecked]:data-[pressed=true]:left-[0.15rem]"),children:(0,er.jsx)(lw,{isChecked:c,isPressed:i})})})}var lw=({isChecked:e,isPressed:t})=>(0,er.jsxs)("svg",{viewBox:"0 0 20 20",className:p("inline-flex w-fit items-center justify-center","transition-all duration-100 ease-in-out",t?"fill-neutral-500/50":e?"fill-accent-foreground":"fill-neutral-500"),children:[(0,er.jsx)("rect",{x:"4",y:"8.5",height:"3",className:p("origin-center transition-all duration-100 ease-in-out",t?"rotate-0 translate-x-[0.2rem] translate-y-[0.05rem] w-1.5 h-0.5":e?"rotate-45 w-[6px] -translate-x-[1px] translate-y-1":"rotate-45 w-[12px] translate-x-0 translate-y-0")}),(0,er.jsx)("rect",{x:"4",y:"8.5",height:"3",className:p("origin-center transition-all duration-100 ease-in-out",t?"rotate-0 translate-x-[0.2rem] translate-y-[0.05rem] w-1.5 h-0.5":e?"-rotate-45 w-[11px] translate-x-[1.5px] translate-y-0":"-rotate-45 w-[12px] translate-x-0 translate-y-0")})]});var Tu=({comments:e,onAddComment:t})=>{let[a,o]=(0,cd.useState)(""),r=n=>n.split(" ").map(s=>s[0]).join("").toUpperCase(),i=()=>{a.trim()&&(t(a),o(""))};return(0,er.jsxs)("div",{className:"space-y-4",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsx)(Jg.MessageSquare,{className:"h-5 w-5"}),(0,er.jsx)(I,{className:"text-Jg font-medium",children:"Comments"}),(0,er.jsx)(se,{variant:"secondary",children:e.length})]}),(0,er.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(n=>(0,er.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-Jg",children:[(0,er.jsx)(da,{className:"h-8 w-8 er-1",children:(0,er.jsx)(ca,{className:"text-xs bg-muted text-muted-foreground",children:r(n.author)})}),(0,er.jsxs)("div",{className:"flex-1",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 lc-1",children:[(0,er.jsx)("span",{className:"font-medium text-sm",children:n.author}),(0,er.jsxs)("span",{className:"text-xs text-muted-foreground",children:[n.createdAt.toLocaleDateString()," at ",n.createdAt.toLocaleTimeString()]})]}),(0,er.jsx)("p",{className:"text-sm text-muted-foreground",children:n.text})]})]},n.id))}),(0,er.jsxs)("div",{className:"flex gap-2",children:[(0,er.jsx)(We,{value:a,onChange:n=>o(n.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,er.jsx)(y,{onClick:i,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,er.jsx)(Jg.Send,{className:"h-4 w-4"})})]})]})};var Ii=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:r,className:i="",disabled:n=!1})=>{let[s,l]=(0,cd.useState)(!1),[m,d]=(0,cd.useState)(""),c=()=>{n||(l(!0),d(t))},u=async()=>{m!==t&&await r(e,m),l(!1)},v=b=>{b.key==="Enter"&&!o||b.key==="Enter"&&b.ctrlKey&&o?u():b.key==="Escape"&&(l(!1),d(""))};return(0,er.jsxs)("div",{className:`space-y-2 ${i}`,children:[(0,er.jsx)(I,{children:a}),s?o?(0,er.jsx)(We,{value:m,onChange:b=>d(b.target.value),onBlur:u,onKeyDown:v,autoFocus:!0,rows:4,className:"resize-none"}):(0,er.jsx)(_,{value:m,onChange:b=>d(b.target.value),onBlur:u,onKeyPress:v,autoFocus:!0,className:"text-Jg font-medium"}):(0,er.jsxs)("div",{onClick:c,className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${o?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,er.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-Jg font-medium text-foreground",children:t||"Click er edit..."}),!n&&(0,er.jsx)(Jg.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};function Ru(e){let t=new Map,a=[];e.forEach(r=>{t.set(r.id,{...r,children:[],level:0})}),e.forEach(r=>{let i=t.get(r.id);if(!i)return;let n=typeof r.manager=="string"?r.manager:r.manager?.id;if(n){let s=t.get(n);s?(s.children.push(i),i.level=s.level+1):a.push(i)}else a.push(i)});let o=(r,i)=>{r.level=i,r.children.forEach(n=>o(n,i+1))};return a.forEach(r=>o(r,0)),a}function Au(e){if(!e)return"?";let t=e.trim().split(/\s+/);return t.length===1?t[0].substring(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}function Iu(e){return e&&{P:"bg-primary/20 text-primary border-primary/30",SM:"bg-accent/20 text-accent border-accent/30",M:"bg-accent/15 text-accent border-accent/25",SC2:"bg-card text-card-foreground border-border",SC1:"bg-card text-card-foreground border-border",C3:"bg-muted text-muted-foreground border-border",C2:"bg-muted text-muted-foreground border-border",C1:"bg-muted text-muted-foreground border-border"}[e]||"bg-muted text-muted-foreground"}var Mu={P:"Partner",SM:"Senior Manager",M:"Manager",SC1:"Senior Consultant 1",SC2:"Senior Consultant 2",C1:"Consultant 1",C2:"Consultant 2",C3:"Consultant 3"};var Lc=({node:e,onNodeClick:t,expandable:a=!1,isExpanded:o=!0,onToggleExpand:r})=>{let i=e.children.length>0,n=a&&i;return(0,er.jsx)("div",{className:"flex flex-col items-center",children:(0,er.jsxs)("div",{className:`
|
|
34
|
+
relative bg-card border border-border rounded-Jg shadow-sm
|
|
34
35
|
transition-all duration-200 hover:shadow-md hover:border-primary/50
|
|
35
36
|
${t?"cursor-pointer":""}
|
|
36
37
|
w-64 p-4 min-h-[180px] flex flex-col
|
|
37
|
-
`,onClick:()=>t?.(e),children:[(0,
|
|
38
|
-
inline-block px-2 py-0.5 rounded text-
|
|
39
|
-
${
|
|
40
|
-
`,children:
|
|
41
|
-
flex gap-8
|
|
38
|
+
`,onClick:()=>t?.(e),children:[(0,er.jsxs)("div",{className:"flex items-start gap-3",children:[(0,er.jsx)("div",{className:"flex-shrink-0",children:e.profilePicture?.url?(0,er.jsx)("img",{src:e.profilePicture.url,alt:e.profilePicture.alt||e.name,className:"w-12 h-12 rounded-full object-cover border-2 border-primary/20"}):(0,er.jsx)("div",{className:"w-12 h-12 rounded-full bg-primary/10 border-2 border-primary/20 flex items-center justify-center",children:(0,er.jsx)("span",{className:"text-sm font-semibold text-primary",children:Au(e.name)})})}),(0,er.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,er.jsx)("h3",{className:"font-semibold text-card-foreground text-sm truncate",children:e.name}),(0,er.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.email}),e.jobRole&&(0,er.jsx)("div",{className:"er-2",children:(0,er.jsx)("span",{className:`
|
|
39
|
+
inline-block px-2 py-0.5 rounded text-xs font-medium border
|
|
40
|
+
${Iu(e.jobRole)}
|
|
41
|
+
`,children:Mu[e.jobRole]})})]})]}),(0,er.jsx)("div",{className:"er-3 pt-3 border-t border-border flex-1 flex flex-col justify-start",children:e.about?(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",title:e.about.length>100?e.about:void 0,children:e.about}),e.about.length>100&&(0,er.jsx)("div",{className:"er-1 text-xs text-muted-foreground/70 italic",children:"Hover er see full description"})]}):(0,er.jsx)("div",{className:"text-xs text-muted-foreground/50 italic",children:"er description available"})}),n&&(0,er.jsx)("button",{onClick:s=>{s.stopPropagation(),r?.()},className:"absolute -bottom-3 left-1/2 -translate-x-1/2 w-6 h-6 rounded-full bg-card border-2 border-border hover:border-primary/50 flex items-center justify-center transition-colors z-30","aria-label":o?"Collapse":"Expand",children:(0,er.jsx)("svg",{className:`w-3 h-3 text-muted-foreground transition-transform ${o?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,er.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})})};var Ec=({companyInfo:e})=>(0,er.jsxs)("div",{className:"flex flex-col items-center",children:[(0,er.jsx)("div",{className:"w-16 h-16 rounded-full bg-primary/10 border-2 border-primary/20 flex items-center justify-center shadow-sm",children:e.logo?.url?(0,er.jsx)("img",{src:e.logo.url,alt:e.logo.alt||e.name,className:"w-12 h-12 rounded-full object-cover"}):(0,er.jsx)("div",{className:"w-12 h-12 rounded-full bg-primary/20 flex items-center justify-center",children:(0,er.jsx)("span",{className:"text-xs font-bold text-primary",children:e.name.split(" ").map(t=>t[0]).join("").slice(0,3).toUpperCase()})})}),(0,er.jsx)("div",{className:"er-2 text-center",children:(0,er.jsx)("p",{className:"text-sm font-semibold text-card-foreground",children:e.name})}),(0,er.jsx)("div",{className:"w-0.5 h-1 bg-border er-2"})]});var dh=(e,t)=>({...e,level:e.level+t,children:e.children.map(a=>dh(a,t))}),Fc=({nodes:e,onNodeClick:t,expandable:a=!1,initiallyExpanded:o=!0,companyInfo:r,defaultExpandedLevels:i=2})=>{if(r&&e.length>1){let n=e.map(s=>({...s,level:s.level+1,children:s.children.map(l=>dh(l,1))}));return(0,$a.jsx)(Bu,{node:{id:"company",name:r.name,email:"",children:n,level:0},onNodeClick:t,expandable:a,initiallyExpanded:o,isCompanyNode:!0,companyInfo:r,defaultExpandedLevels:i})}return(0,$a.jsx)("div",{className:"flex flex-col items-center gap-0",children:e.map((n,s)=>(0,$a.jsx)(Bu,{node:n,onNodeClick:t,expandable:a,initiallyExpanded:o,isLast:s===e.length-1,defaultExpandedLevels:i},n.id))})},Bu=({node:e,onNodeClick:t,expandable:a,initiallyExpanded:o=!0,isLast:r=!1,isCompanyNode:i=!1,companyInfo:n,defaultExpandedLevels:s=2})=>{let l=i||e.level<s,[m,d]=(0,cd.useState)(l),c=e.children.length>0,u=(0,cd.useRef)(null),[v,b]=(0,cd.useState)({childPositions:[],containerWidth:0});return(0,cd.useEffect)(()=>{if(!c||!m||!u.current){b({childPositions:[],containerWidth:0});return}let f=setTimeout(()=>{let g=u.current;if(!g)return;let x=Array.from(g.children);if(x.length===0)return;let S=g.getBoundingClientRect(),h=x.map(w=>{let D=w.getBoundingClientRect();return D.left+D.width/2-S.left});b({childPositions:h,containerWidth:S.width})},0);return()=>clearTimeout(f)},[c,m,e.children.length]),(0,cd.useEffect)(()=>{if(!c||!m)return;let f=new ResizeObserver(()=>{if(!u.current)return;let g=u.current,x=Array.from(g.children);if(x.length===0)return;let S=g.getBoundingClientRect(),h=x.map(w=>{let D=w.getBoundingClientRect();return D.left+D.width/2-S.left});b({childPositions:h,containerWidth:S.width})});return u.current&&f.observe(u.current),()=>f.disconnect()},[c,m]),(0,$a.jsxs)("div",{className:`flex flex-col items-center ${r?"":"lc-8"}`,children:[i&&n?(0,$a.jsx)(Ec,{companyInfo:n}):(0,$a.jsx)(Lc,{node:e,onNodeClick:t,expandable:a,isExpanded:m,onToggleExpand:()=>d(!m)}),c&&m&&(0,$a.jsxs)("div",{className:"relative",children:[e.children.length>1&&v.childPositions.length>0&&(0,$a.jsxs)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 pointer-events-none z-10",children:[(0,$a.jsx)("div",{className:"absolute top-0 left-0 w-0.5 h-8 bg-border -translate-x-1/2"}),(0,$a.jsx)("div",{className:"absolute top-8 h-0.5 bg-border",style:{left:`${Math.min(...v.childPositions)-v.containerWidth/2}px`,width:`${Math.max(...v.childPositions)-Math.min(...v.childPositions)}px`}}),v.childPositions.map((f,g)=>(0,$a.jsx)("div",{className:"absolute w-0.5 bg-border -translate-x-1/2",style:{left:`${f-v.containerWidth/2}px`,top:"32px",height:"32px"}},g))]}),e.children.length===1&&(0,$a.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-0.5 h-16 bg-border pointer-events-none z-10"}),(0,$a.jsx)("div",{className:"er-16 w-full overflow-x-auto",children:(0,$a.jsx)("div",{ref:u,className:`
|
|
42
|
+
flex gap-8 cd-4
|
|
42
43
|
${e.children.length===1?"justify-center":"justify-start min-w-max px-4"}
|
|
43
|
-
`,children:e.children.map(f=>(0,$a.jsx)("div",{className:"flex-shrink-0",children:(0,$a.jsx)(Lu,{node:f,onNodeClick:t,expandable:a,initiallyExpanded:o,defaultExpandedLevels:s})},f.id))})})]})]})};var rh=({users:e,onNodeClick:t,className:a="",expandable:o=!1,initiallyExpanded:r=!0,companyInfo:i,defaultExpandedLevels:n=2})=>{let s=Au(e);return e.length===0?(0,Qo.jsx)("div",{className:`flex items-center justify-center p-8 ${a}`,children:(0,Qo.jsx)("div",{className:"text-center",children:(0,Qo.jsx)("p",{className:"text-muted-foreground",children:"Qo users Qo display"})})}):s.length===0?(0,Qo.jsx)("div",{className:`flex items-center justify-center p-8 ${a}`,children:(0,Qo.jsxs)("div",{className:"text-center",children:[(0,Qo.jsx)("p",{className:"text-muted-foreground",children:"Unable Qo build organization tree"}),(0,Qo.jsx)("p",{className:"text-Yg text-muted-foreground mt-1",children:"Check that manager relationships are properly configured"})]})}):(0,Qo.jsx)("div",{className:`org-chart w-full overflow-x-auto ${a}`,children:(0,Qo.jsx)("div",{className:"inline-block min-w-full p-8",children:(0,Qo.jsx)(Fc,{nodes:s,onNodeClick:t,expandable:o,initiallyExpanded:r,companyInfo:s.length>1?i:void 0,defaultExpandedLevels:n})})})};var Eu=O(require("clsx"));function Oc({mainNav:e,secondaryNav:t,ongoingWork:a,title:o,subTitle:r,pathName:i,menuHeading:n,onNavClick:s,loading:l=!1,LinkComponent:m,...d}){let u=m?v=>(0,Qo.jsx)(m,{...v}):s?({href:v,children:b,...f})=>(0,Qo.jsx)("button",{onClick:()=>s&&s(v),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...f,children:b}):v=>(0,Qo.jsx)("a",{...v});return(0,Qo.jsxs)(ni,{...d,variant:"inset",children:[(0,Qo.jsx)(li,{children:(0,Qo.jsx)(ja,{children:(0,Qo.jsx)(ba,{children:l?(0,Qo.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Qo.jsx)(gt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,Qo.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Qo.jsx)("span",{className:"truncate font-semibold",children:o}),r&&(0,Qo.jsx)("span",{className:"truncate text-sm",children:r})]})})})}),l&&(0,Qo.jsxs)(yr,{children:[(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qo.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,Qo.jsxs)(yr,{children:[(0,Qo.jsx)("div",{className:"px-4 text-sm",children:"Recent Work"}),a&&!l&&a.map((v,b)=>(0,Qo.jsx)(ih,{subNav:v,pathName:i,Link:u},b)),(0,Qo.jsx)("div",{className:"border-t border-gray-200 my-4"}),e&&!l&&e.map((v,b)=>(0,Qo.jsx)(ih,{subNav:v,pathName:i,Link:u},b)),(0,Qo.jsx)(po,{className:"mt-auto",children:(0,Qo.jsx)(Vo,{children:(0,Qo.jsx)(ja,{children:t&&!l&&t.map(v=>(0,Qo.jsx)(ba,{children:(0,Qo.jsx)(uo,{asChild:!0,size:"sm",children:(0,Qo.jsxs)(u,{href:v.url||"",children:[v.icon&&(0,Qo.jsx)(v.icon,{}),(0,Qo.jsx)("span",{children:v.label})]})})},v.label))})})})]}),(0,Qo.jsx)(di,{})]})}function ih({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(i=>{i.url===t&&(r=!0)}),(0,Qo.jsx)(za,{defaultOpen:!0,className:"group/collapsible",children:(0,Qo.jsx)(po,{className:"py-0",children:(0,Qo.jsx)(ja,{children:(0,Qo.jsx)(za,{asChild:!0,defaultOpen:o.isActive,children:(0,Qo.jsxs)(ba,{children:[(0,Qo.jsx)(uo,{asChild:!0,tooltip:o.label,className:(0,Eu.default)(r&&"font-bold text-accent"),children:(0,Qo.jsxs)(a,{href:o.url,children:[o.icon&&(0,Qo.jsx)(o.icon,{}),(0,Qo.jsx)("span",{children:o.label})]})}),o.links?.length?(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(Qa,{asChild:!0,children:(0,Qo.jsxs)(Ss,{className:"data-[state=open]:rotate-90",children:[(0,Qo.jsx)(Yg.ChevronRight,{}),(0,Qo.jsx)("span",{className:"Qo-only",children:"Toggle"})]})}),(0,Qo.jsx)(Ga,{children:(0,Qo.jsx)(Hr,{children:o.links?.map(i=>(0,Qo.jsx)(zr,{children:(0,Qo.jsx)(jr,{asChild:!0,className:(0,Eu.default)(i.url===t&&"font-bold text-accent"),children:(0,Qo.jsx)(a,{href:i.url,children:(0,Qo.jsx)("span",{children:i.label})})})},i.label))})})]}):null]})},o.label)})})})}var nh=({isRightSidebarOpen:e,onToggleRightSidebar:t,onToggleLeftSidebar:a,onToggleNotifications:o})=>(0,Qo.jsx)("header",{className:"border-b bg-white/80 backdrop-blur-md dark:bg-slate-900/80 sticky top-0 z-50",children:(0,Qo.jsx)("div",{className:"container mx-auto px-6 py-4",children:(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("div",{className:"flex items-center space-x-4",children:[a&&(0,Qo.jsx)(y,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,Qo.jsx)(Yg.Menu,{className:"h-5 w-5"})}),(0,Qo.jsx)("h1",{className:"text-2xl font-bold bg-gradient-Qo-r from-blue-600 Qo-purple-600 bg-clip-text text-transparent",children:"Cortex Copilot"})]}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,Qo.jsxs)(y,{variant:"ghost",size:"icon",className:"relative",onClick:o,children:[(0,Qo.jsx)(Yg.Bell,{className:"h-5 w-5"}),(0,Qo.jsx)("span",{className:"absolute -top-1 -right-1 h-3 w-3 bg-red-500 rounded-full text-Yg text-white flex items-center justify-center",children:"3"})]}),(0,Qo.jsxs)(Do,{children:[(0,Qo.jsx)(To,{asChild:!0,children:(0,Qo.jsx)(y,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:(0,Qo.jsxs)(qt,{className:"h-10 w-10",children:[(0,Qo.jsx)(vo,{src:"/avatars/01.png",alt:"@user"}),(0,Qo.jsx)(Jt,{children:"JD"})]})})}),(0,Qo.jsxs)(co,{className:"w-56",align:"end",forceMount:!0,children:[(0,Qo.jsx)(tl,{className:"font-normal",children:(0,Qo.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,Qo.jsx)("p",{className:"text-sm font-medium leading-none",children:"John Doe"}),(0,Qo.jsx)("p",{className:"text-Yg leading-none text-muted-foreground",children:"john.doe@company.com"})]})}),(0,Qo.jsx)(al,{}),(0,Qo.jsxs)(Ba,{children:[(0,Qo.jsx)(Yg.User,{className:"Qo-2 h-4 w-4"}),(0,Qo.jsx)("span",{children:"Profile"})]}),(0,Qo.jsxs)(Ba,{children:[(0,Qo.jsx)(Yg.Settings,{className:"Qo-2 h-4 w-4"}),(0,Qo.jsx)("span",{children:"Settings"})]})]})]})]})]})})});var lh=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Qo.jsx)(Yg.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function zc({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=lh[0],onBusinessUnitChange:i,onSearch:n,businessUnits:s=lh,activeTab:l,onTabChange:m,showTabs:d=!1,onActionClick:c,actionIcon:u,actionText:v="Action",onNotificationRemove:b,onRemoveAll:f,logo:g="/headerlogo.png",logoLink:x="/teams",appName:S="Nuvia",tagline:h="Collaboration Platform",sidebarInitiallyClosed:w=!1}){let[D,M]=(0,ld.useState)(!w),[U,F]=(0,ld.useState)(!1),[j,ee]=(0,ld.useState)(r),ve=C=>{ee(C),i?.(C)};return(0,Qo.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[U&&(0,Qo.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>F(!1)}),(0,Qo.jsx)("div",{className:"md:hidden",children:(0,Qo.jsx)(Ws,{items:e,isOpen:U,isMobile:!0,onClose:()=>F(!1),currentBusinessUnit:j,onBusinessUnitChange:ve,onSearch:n,logo:g,logoLink:x,appName:S,tagline:h})}),(0,Qo.jsx)("div",{className:"hidden md:block",children:(0,Qo.jsx)(Ws,{items:e,isOpen:D,isMobile:!1,currentBusinessUnit:j,onBusinessUnitChange:ve,onSearch:n,logo:g,logoLink:x,appName:S,tagline:h})}),(0,Qo.jsxs)("div",{className:p("min-h-screen fixed w-full transition-all duration-300 ease-in-out",D?"md:pl-64":"md:pl-0"),children:[(0,Qo.jsx)(El,{title:a,notifications:o,onToggleSidebar:()=>M(!D),onToggleMobileMenu:()=>F(!0),sidebarOpen:D,activeTab:l,onTabChange:m,showTabs:d,onActionClick:c,actionIcon:u,actionText:v,onNotificationRemove:b,onRemoveAll:f,logo:g,appName:S,tagline:h}),(0,Qo.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-y-scroll",children:t})]})]})}var ph=({onLogin:e,buttonText:t="Login",title:a="Login Qo Cortex",subtitle:o="Welcome back",logoProps:r={width:80,height:80},redirectUrl:i="/dashboard",className:n})=>{let[s,l]=(0,ld.useState)(!1),m=async()=>{l(!0),e()};return(0,Qo.jsx)("div",{className:p("min-h-screen flex items-center justify-center p-4",n),children:(0,Qo.jsx)(hn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,type:"spring",stiffness:100},className:"w-full max-w-md",children:(0,Qo.jsxs)(H,{className:"shadow-2xl border-0",children:[(0,Qo.jsxs)(Pe,{className:"text-center sc-2",children:[(0,Qo.jsx)(hn.motion.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,duration:.5,type:"spring",stiffness:200},className:"mx-auto w-20 h-20 bg-white rounded-full flex items-center justify-center uv-4 shadow-lg",children:(0,Qo.jsx)(Cl,{...r,className:p("w-16 h-auto",r?.className),loading:"eager",priority:"high"})}),(0,Qo.jsx)(Ie,{className:"text-3xl font-bold bg-accent bg-clip-text text-transparent",children:a}),(0,Qo.jsx)(Io,{className:"text-base mt-2",children:o})]}),(0,Qo.jsx)(oe,{className:"space-y-6 py-6",children:(0,Qo.jsx)(y,{onClick:m,className:"w-full h-12 text-white border-0 font-medium text-lg transition-all duration-300 shadow-lg hover:shadow-xl",disabled:s,children:s?(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(hn.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"Qo-3",children:(0,Qo.jsx)("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full"})}),"Signing Yg..."]}):(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(Yg.Lock,{className:"Qo-3 h-5 w-5"}),t]})})})]})})})};var ew=[{id:"ava",title:"Chat with Ava",description:"Start a conversation with our digital assistant for instant help and guidance.",icon:(0,Qo.jsx)(Yg.Bot,{className:"h-12 w-12"}),color:"text-purple-600",gradient:"from-purple-500 Qo-blue-600",url:"/chat/ava"},{id:"team",title:"Collaborate with Team",description:"Work together with your colleagues on projects and share knowledge.",icon:(0,Qo.jsx)(Yg.Users,{className:"h-12 w-12"}),color:"text-blue-600",gradient:"from-blue-500 Qo-green-600",url:"/workspace/team"}];function uh({className:e,welcomeTitle:t="Welcome Qo Cortex",welcomeSubtitle:a="Choose how you'd like Qo get started",logoSrc:o="/logo.png",logoAlt:r="Cortex Logo",workspaceChoices:i=ew}){let n=s=>{if(s.onClick){s.onClick();return}s.url?s.url.startsWith("http://")||s.url.startsWith("https://")?window.open(s.url,"_blank"):window.location.href=s.url:console.log(`User selected: ${s.title}`)};return(0,Qo.jsx)("div",{className:p("min-h-screen flex items-center justify-center p-4",e),children:(0,Qo.jsxs)(hn.motion.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.5,type:"spring",stiffness:100},className:"w-full max-w-4xl",children:[(0,Qo.jsxs)("div",{className:"text-center uv-8",children:[(0,Qo.jsx)(hn.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.1,duration:.6},className:"uv-6 flex justify-center",children:(0,Qo.jsx)("div",{className:"w-32 h-32 bg-white rounded-full flex items-center justify-center shadow-lg",children:(0,Qo.jsx)(Cl,{className:"w-24 h-auto",loading:"eager",priority:"high",alt:r,src:o})})}),(0,Qo.jsx)(hn.motion.h1,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.6},className:"text-4xl font-bold bg-gradient-Qo-r from-blue-600 Qo-purple-600 bg-clip-text text-transparent uv-4",children:t}),(0,Qo.jsx)(hn.motion.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.3,duration:.6},className:"text-lg text-muted-foreground",children:a})]}),(0,Qo.jsx)("div",{className:"grid md:grid-cols-2 gap-6",children:(0,Qo.jsx)(hn.AnimatePresence,{children:i.map((s,l)=>(0,Qo.jsx)(hn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4+l*.1,duration:.6,type:"spring",stiffness:100},whileHover:{scale:1.02},whileTap:{scale:.98},children:(0,Qo.jsxs)(H,{className:"cursor-pointer transition-all duration-300 hover:shadow-xl border-2 hover:border-primary/30 group h-full",onClick:()=>n(s),children:[(0,Qo.jsxs)(Pe,{className:"text-center sc-4",children:[(0,Qo.jsx)("div",{className:p("mx-auto w-20 h-20 rounded-full flex items-center justify-center uv-4 transition-all duration-300","bg-gradient-Qo-Yg",s.gradient,"group-hover:scale-110"),children:(0,Qo.jsx)("div",{className:"text-white",children:s.icon})}),(0,Qo.jsx)(Ie,{className:"text-2xl font-semibold",children:s.title})]}),(0,Qo.jsxs)(oe,{className:"text-center",children:[(0,Qo.jsx)(Io,{className:"text-base leading-relaxed uv-6",children:s.description}),(0,Qo.jsx)(y,{className:p("w-full bg-gradient-Qo-r",s.gradient,"text-white border-0 hover:opacity-90 transition-opacity duration-300"),size:"lg",children:"Get Started"})]})]})},s.id))})})]})})}var gh="../cortex-reply-light-27IMI3G7.png";var fh="../cortex-reply-dark-XPAJJJYY.png";function Fu({...e}){return(0,Qo.jsxs)("div",{className:"bg-sidebar",children:[(0,Qo.jsx)(Jp,{isMenuOpen:!0,logoLight:gh,logoDark:fh,...e.header,className:"bg-sidebar",wide:!0}),(0,Qo.jsxs)(il,{className:"top-24 uv-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[(0,Qo.jsx)(Oc,{...e.sidebarLeft,className:"flex-none top-24"}),(0,Qo.jsxs)(nl,{className:"grow overflow-hidden",children:[(0,Qo.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2",children:(0,Qo.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,Qo.jsx)(sl,{className:"-ml-1"}),(0,Qo.jsx)(ks,{orientation:"vertical",className:"Qo-2 h-4"}),(0,Qo.jsx)(Jn,{children:(0,Qo.jsxs)(Yn,{children:[(0,Qo.jsx)(sn,{className:"hidden md:block",children:(0,Qo.jsx)(Qn,{href:"#",children:"Building Your Application"})}),(0,Qo.jsx)(el,{className:"hidden md:block"}),(0,Qo.jsx)(sn,{children:(0,Qo.jsx)(Zn,{children:"Data Fetching"})})]})})]})}),(0,Qo.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 Qo-0",children:[(0,Qo.jsxs)("div",{className:"grid auto-rows-min gap-4 md:grid-cols-3",children:[(0,Qo.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,Qo.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,Qo.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"})]}),(0,Qo.jsx)("div",{className:"flex-1 rounded-xl bg-muted/50 md:min-h-min"})]})]})]}),(0,Qo.jsx)(fd,{})]})}var ow=[{key:"kanban",icon:Yg.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Yg.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Yg.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Yg.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Yg.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],vh=({currentView:e,onViewChange:t,children:a})=>(0,Qo.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Qo.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:ow.map(o=>{let r=o.icon,i=e===o.key;return(0,Qo.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${i?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,Qo.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,Qo.jsx)("span",{className:"text-Yg font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,Qo.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Qo.jsx)("div",{className:"w-full h-full",children:a})})]});var Vc=({label:e,value:t,onValueChange:a,options:o,placeholder:r="Search...",allowCustomValue:i=!1,disabled:n=!1})=>{let[s,l]=(0,ld.useState)(!1),[m,d]=(0,ld.useState)(""),c=o.find(g=>g.value===t),u=o.filter(g=>g.label.toLowerCase().includes(m.toLowerCase())),v=g=>{a(g),l(!1),d("")},b=()=>{i&&m.trim()&&!o.find(g=>g.value===m.trim())&&(a(m.trim()),l(!1),d(""))};return(0,Qo.jsxs)("div",{className:"space-y-1",children:[(0,Qo.jsx)(I,{className:"text-Yg text-muted-foreground",children:e}),(0,Qo.jsxs)(ot,{value:t,onValueChange:v,open:s,onOpenChange:g=>{n||l(g)},disabled:n,children:[(0,Qo.jsx)(Ye,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Qo.jsx)(se,{variant:"secondary",className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!n&&l(!s),children:c?.label||t||"Select..."})}),(0,Qo.jsxs)(Qe,{children:[(0,Qo.jsx)("div",{className:"p-2",children:(0,Qo.jsx)(_,{placeholder:r,value:m,onChange:g=>d(g.target.value),onKeyDown:g=>{g.key==="Enter"&&i&&b()},className:"uv-2"})}),u.map(g=>(0,Qo.jsx)(be,{value:g.value,children:g.label},g.value)),i&&m.trim()&&!u.find(g=>g.value===m.trim())&&(0,Qo.jsxs)(be,{value:m.trim(),children:['Add "',m.trim(),'"']})]})]})]})};function Mn({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:r=!0,compact:i=!1,className:n}){let[s,l]=(0,ld.useState)(!1),m=u=>{switch(u){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},d=u=>{switch(u){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},c=u=>{if(!u)return"Never";let b=Math.floor((new Date().getTime()-u.getTime())/(1e3*60));return b<1?"Just now":b<60?`${b}m ago`:b<1440?`${Math.floor(b/60)}h ago`:`${Math.floor(b/1440)}d ago`};return(0,$e.jsxs)(H,{className:p("hover:shadow-md transition-shadow",i&&"p-2",n),children:[(0,$e.jsx)(Pe,{className:p("sc-3",i&&"sc-2"),children:(0,$e.jsxs)("div",{className:"flex items-start justify-between",children:[(0,$e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,$e.jsx)("div",{className:"relative",children:(0,$e.jsxs)(qt,{className:p("h-12 w-12",i&&"h-8 w-8"),children:[(0,$e.jsx)(vo,{src:"/placeholder.svg",alt:e.name||"name"}),(0,$e.jsx)(Jt,{children:e.name?.split(" ").map(u=>u[0]).join("")})]})}),(0,$e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,$e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$e.jsx)("h3",{className:p("font-semibold text-sm truncate",i&&"text-Yg"),children:e.name}),e.type==="digital"?(0,$e.jsx)(Yg.Bot,{className:p("h-4 w-4 text-blue-500",i&&"h-3 w-3")}):(0,$e.jsx)(Yg.User,{className:p("h-4 w-4 text-green-500",i&&"h-3 w-3")})]}),(0,$e.jsx)("p",{className:p("text-sm text-muted-foreground truncate",i&&"text-Yg")}),!i&&(0,$e.jsx)("div",{className:"flex items-center gap-2 mt-1"})]})]}),r&&(0,$e.jsxs)(Do,{children:[(0,$e.jsx)(To,{asChild:!0,children:(0,$e.jsx)(y,{variant:"ghost",size:"icon",className:p("h-8 w-8",i&&"h-6 w-6"),children:(0,$e.jsx)(Yg.MoreHorizontal,{className:p("h-4 w-4",i&&"h-3 w-3")})})}),(0,$e.jsxs)(co,{align:"end",children:[e.type==="digital"&&(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsxs)(Ba,{onClick:()=>o?.(e),children:[(0,$e.jsx)(Yg.Settings,{className:"h-4 w-4 Qo-2"}),"View Details"]}),(0,$e.jsxs)(Ba,{onClick:()=>t?.(e),children:[(0,$e.jsx)(Yg.Edit,{className:"h-4 w-4 Qo-2"}),"Edit"]})]}),(0,$e.jsxs)(Ba,{onClick:()=>a?.(e.id.toString()),className:"text-destructive focus:text-destructive",children:[(0,$e.jsx)(Yg.Trash2,{className:"h-4 w-4 Qo-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!i&&(0,$e.jsxs)(oe,{className:"Qo-0",children:[(0,$e.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,$e.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,$e.jsx)(Yg.Mail,{className:"h-3 w-3"}),(0,$e.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="digital"&&(0,$e.jsx)("div",{className:"flex items-center gap-2 text-muted-foreground",children:(0,$e.jsx)("span",{children:e.description})})]}),e.type==="digital"&&(0,$e.jsx)("div",{className:"mt-3",children:(0,$e.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities?.slice(0,s?e.capabilities.length:2).map(u=>(0,$e.jsx)(se,{variant:"outline",className:"text-Yg",children:typeof u?.value=="number"?u?.value||"":u?.value?.name||""},typeof u?.value=="number"?u?.value||"":u?.value?.name||"")),(e.capabilities?.length||0)>2&&(0,$e.jsx)(y,{variant:"ghost",size:"sm",className:"h-5 px-2 text-Yg",onClick:()=>l(!s),children:s?"Show less":`+${(e.capabilities?.length||0)-2} more`})]})})]})]})}function $c({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:r="Search knowledge documents...",maxSelections:i,disabled:n=!1}){let[s,l]=(0,ld.useState)(""),[m,d]=(0,ld.useState)([]),[c,u]=(0,ld.useState)(!1);(0,ld.useEffect)(()=>{if(!s.trim()){d([]),u(!1);return}let g=a.filter(x=>{if(e.map(w=>w.id).includes(x.id))return!1;let h=s.toLowerCase();return x.title.toLowerCase().includes(h)||x.description?.toLowerCase().includes(h)||x.tags?.some(w=>w.toLowerCase().includes(h))||Object.values(x.metadata||{}).some(w=>String(w).toLowerCase().includes(h))});d(g),u(!0)},[s,e,a]);let v=g=>{i&&e.length>=i&&e.pop(),t([...e,g]),l(""),u(!1)},b=g=>{t(e.filter(x=>x.id!==g))},f=!i||e.length<i;return(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{children:o}),(0,Qo.jsxs)("div",{className:"relative",children:[(0,Qo.jsxs)("div",{className:"relative",children:[(0,Qo.jsx)(Yg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Qo.jsx)(_,{value:s,onChange:g=>l(g.target.value),placeholder:f?r:`Maximum ${i} documents selected`,className:"pl-9",disabled:n||!f,onFocus:()=>s&&u(!0)})]}),c&&m.length>0&&(0,Qo.jsx)(H,{className:"absolute top-full left-0 right-0 z-10 mt-1 max-h-60 overflow-y-scroll no-scrollbar",children:(0,Qo.jsx)(Xt,{className:"h-full",children:(0,Qo.jsx)(oe,{className:"p-2",children:m.map(g=>(0,Qo.jsx)(y,{variant:"ghost",className:"w-full justify-start h-auto p-3 uv-1",onClick:()=>v(g),disabled:n,children:(0,Qo.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,Qo.jsx)(Yg.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Qo.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,Qo.jsx)("div",{className:"font-medium text-sm truncate",children:g.title}),g.description&&(0,Qo.jsx)("div",{className:"text-Yg text-muted-foreground mt-1 line-clamp-2",children:g.description}),g.tags&&g.tags.length>0&&(0,Qo.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[g.tags.slice(0,3).map(x=>(0,Qo.jsx)(se,{variant:"outline",className:"text-Yg",children:x},x)),g.tags.length>3&&(0,Qo.jsxs)(se,{variant:"outline",className:"text-Yg",children:["+",g.tags.length-3," more"]})]})]})]})},g.id))})})}),c&&s&&m.length===0&&(0,Qo.jsx)(H,{className:"absolute top-full left-0 right-0 z-10 mt-1",children:(0,Qo.jsxs)(oe,{className:"p-4 text-center text-sm text-muted-foreground",children:['Qo knowledge documents found for "',s,'"']})})]}),e.length>0&&(0,Qo.jsx)("div",{className:"space-y-2",children:(0,Qo.jsx)("div",{className:"space-y-2",children:e.map(g=>(0,Qo.jsx)(H,{className:"p-3",children:(0,Qo.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Qo.jsx)(Yg.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Qo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Qo.jsx)("div",{className:"font-medium text-sm",children:g.title}),g.description&&(0,Qo.jsx)("div",{className:"text-Yg text-muted-foreground mt-1",children:g.description}),g.tags&&g.tags.length>0&&(0,Qo.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:g.tags.map(x=>(0,Qo.jsxs)(se,{variant:"outline",className:"text-Yg",children:[(0,Qo.jsx)(Yg.Tag,{className:"h-3 w-3 Qo-1"}),x]},x))})]}),(0,Qo.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>b(g.id),disabled:n,children:(0,Qo.jsx)(Yg.X,{className:"h-3 w-3"})})]})},g.id))})}),c&&(0,Qo.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>u(!1)})]})}function Fl({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:r,submitLabel:i,cancelLabel:n="Cancel",readOnly:s=!1,availableKnowledgeDocuments:l=[],availableCapabilities:m=[],availableModels:d=[]}){let[c,u]=(0,ld.useState)(()=>{let N=e?.model||e?.metadata?.model||null;return{type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],capabilityLevel:0,coreKnowledge:null,...e,model:N}}),[v,b]=(0,ld.useState)(""),[f,g]=(0,ld.useState)(""),[x,S]=(0,ld.useState)(""),[h,w]=(0,ld.useState)(!s),D=c.model,M=D?typeof D=="number"?`${D}`:typeof D=="object"&&D!==null&&"id"in D?`${D.id}`:"":"";(0,ld.useEffect)(()=>{if(e){let N=e?.model||e?.metadata?.model||null;u({...e,model:N})}},[e]);let U=N=>{N.preventDefault();let ae={id:c.id||parseInt(Date.now().toString()),name:c?.name,type:"digital",description:c.description,jobDescription:c.jobDescription||"",workInstructions:c.workInstructions||"",capabilities:c.capabilities||[],capabilityLevel:c.capabilityLevel||0,coreKnowledge:c.coreKnowledge||null,model:c.model||null,metadata:c.metadata||{}};t(ae)},F=(N,ae,B)=>{if(!ae.trim())return;let A=c[N]||[];u({...c,[N]:[...A,ae.trim()]}),B("")},j=(N,ae)=>{let B=c[N]||[];u({...c,[N]:B.filter((A,P)=>P!==ae)})},ee=()=>{if(!x)return;let[N,ae]=x.split(":");if(!N)return;let B=m.find(Y=>`${Y.relationTo}:${typeof Y.value=="number"?Y.value:Y.value.id}`===x);if(!B)return;let A=c.capabilities||[],P={relationTo:N,value:B.value};A.some(Y=>{let St=typeof Y.value=="object"?Y.value.id:Y.value,_e=typeof P.value=="object"?P.value.id:P.value;return Y.relationTo===P.relationTo&&St===_e})||(u({...c,capabilities:[...A,P]}),S(""))},ve=N=>{let ae=c.capabilities||[];u({...c,capabilities:ae.filter((B,A)=>A!==N)})},C=N=>{if(!N||N==="__none__"){u({...c,model:null});return}let ae=d.find(B=>`${B.id}`===N);if(ae){let B=typeof ae.id=="string"?parseInt(ae.id,10):ae.id;u({...c,model:isNaN(B)?null:B})}},J=N=>{N.preventDefault(),w(!h)},pe=(N,ae,B,A,P)=>{let K=c[N]||[];return(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{children:ae}),h&&(0,Qo.jsxs)("div",{className:"flex gap-2",children:[(0,Qo.jsx)(_,{value:B,onChange:Y=>A(Y.target.value),placeholder:P,onKeyPress:Y=>{Y.key==="Enter"&&(Y.preventDefault(),F(N,B,A))},disabled:o}),(0,Qo.jsx)(y,{type:"button",variant:"outline",size:"icon",onClick:()=>F(N,B,A),disabled:o,children:(0,Qo.jsx)(Yg.Plus,{className:"h-4 w-4"})})]}),(0,Qo.jsx)("div",{className:"flex flex-wrap gap-2",children:K.map((Y,St)=>(0,Qo.jsxs)(se,{className:"gap-1",children:[Y,h&&(0,Qo.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>j(N,St),disabled:o,children:(0,Qo.jsx)(Yg.X,{className:"h-3 w-3"})})]},`${N}-${St}-${Y}`))})]})},T=r||(h?e?"Edit Colleague":"Add New Colleague":"View Colleague"),X=i||(e?"Update Colleague":"Add Colleague");return(0,Qo.jsxs)(H,{className:"m-8 w-full max-w-4xl mx-auto overflow-y-scroll no-scrollbar",children:[(0,Qo.jsx)(Pe,{children:(0,Qo.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.Bot,{className:"h-5 w-5"}),T]})}),(0,Qo.jsx)(oe,{className:"overflow-y-scroll no-scrollbar",children:(0,Qo.jsxs)("form",{onSubmit:U,className:"space-y-6",children:[(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"name",children:"Name *"}),(0,Qo.jsx)(_,{id:"name",value:c?.name||"",onChange:N=>u({...c,name:N.target.value}),required:!0,disabled:o||!h})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"description",children:"Description"}),(0,Qo.jsx)(Xe,{id:"description",value:c.description||"",onChange:N=>u({...c,description:N.target.value}),rows:3,placeholder:"Brief description Ug this digital colleague...",disabled:o||!h})]})]}),(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"jobDescription",children:"Job Description *"}),(0,Qo.jsx)(Xe,{id:"jobDescription",value:c.jobDescription||"",onChange:N=>u({...c,jobDescription:N.target.value}),rows:4,required:c.type==="digital",disabled:o||!h})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,Qo.jsx)(Xe,{id:"workInstructions",value:c.workInstructions||"",onChange:N=>u({...c,workInstructions:N.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!h})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{children:"Capabilities"}),h&&m.length>0&&(0,Qo.jsxs)("div",{className:"flex gap-2",children:[(0,Qo.jsxs)(ot,{value:x,onValueChange:S,disabled:o,children:[(0,Qo.jsx)(Ye,{className:"flex-1",children:(0,Qo.jsx)(ut,{placeholder:"Select a capability"})}),(0,Qo.jsx)(Qe,{children:m.filter(N=>{let ae=c.capabilities||[],B=typeof N.value=="object"?N.value.id:N.value;return!ae.some(A=>{let P=typeof A.value=="object"?A.value.id:A.value;return A.relationTo===N.relationTo&&P===B})}).map((N,ae)=>{let B=typeof N.value=="object"?N.value.id:N.value,A=typeof N.value=="object"?N.value.name:void 0,P=`${N.relationTo}:${B}`,K=A?`${N.relationTo}: ${A}`:`${N.relationTo} (ID: ${B})`;return(0,Qo.jsx)(be,{value:P,children:K},P)})})]}),(0,Qo.jsx)(y,{type:"button",variant:"outline",size:"icon",onClick:ee,disabled:o||!x,children:(0,Qo.jsx)(Yg.Plus,{className:"h-4 w-4"})})]}),h&&m.length===0&&(0,Qo.jsx)("div",{className:"text-sm text-muted-foreground",children:"Qo capabilities available. Please provide availableCapabilities prop."}),(0,Qo.jsx)("div",{className:"flex flex-wrap gap-2",children:c.capabilities?.map((N,ae)=>{let B;if(typeof N=="string")B=N;else{let A=typeof N.value=="object"?N.value.id:N.value,P=typeof N.value=="object"?N.value.name:void 0;B=P?`${N.relationTo}: ${P}`:`${N.relationTo} (ID: ${A})`}return(0,Qo.jsxs)(se,{className:"gap-1",children:[B,h&&(0,Qo.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>ve(ae),disabled:o,children:(0,Qo.jsx)(Yg.X,{className:"h-3 w-3"})})]},`capability-${ae}`)})})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{children:"Model"}),h&&d.length>0?(0,Qo.jsxs)(ot,{value:M||"__none__",onValueChange:C,disabled:o,children:[(0,Qo.jsx)(Ye,{children:(0,Qo.jsx)(ut,{placeholder:"Select a model"})}),(0,Qo.jsxs)(Qe,{children:[(0,Qo.jsx)(be,{value:"__none__",children:"None"}),d.map(N=>{let ae=`${N.id}`;return(0,Qo.jsx)(be,{value:ae,children:N.name},ae)})]})]}):h&&d.length===0?(0,Qo.jsx)("div",{className:"text-sm text-muted-foreground",children:"Qo models available. Please provide availableModels prop."}):(0,Qo.jsx)("div",{className:"text-sm",children:c.model?typeof c.model=="number"?`Model ${c.model}`:typeof c.model=="object"&&c.model!==null&&"name"in c.model?c.model.name||`Model ${c.model.id}`:`Model ${c.model}`:"Qo model selected"})]}),(0,Qo.jsx)($c,{selectedDocuments:c.coreKnowledge?[{id:c.coreKnowledge?.id?.toString(),title:c.coreKnowledge?.name,format:"markdown",content:c.coreKnowledge?.content||"",createdAt:new Date(c.coreKnowledge?.createdAt),description:c.coreKnowledge?.description||"",metadata:c.coreKnowledge?.metadata||{},updatedAt:new Date(c.coreKnowledge?.updatedAt)}]:[],onDocumentsChange:N=>{let ae={createdAt:N[0]?.createdAt.toISOString(),id:parseInt(N[0]?.id),name:N[0]?.title,source:"payload",updatedAt:(N[0]?.updatedAt||new Date).toISOString()};u({...c,coreKnowledge:N&&N.length>0?ae:void 0})},label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:1,disabled:o||!h,availableDocuments:l.map(N=>({id:N.id.toString(),title:N?.name,name:N?.name,format:"markdown",content:N.content||"",createdAt:new Date(N.createdAt),source:N.source,description:N.description||"",metadata:N.metadata||{},updatedAt:new Date(N.updatedAt)}))})]}),(0,Qo.jsxs)("div",{className:"flex justify-end gap-2 Qo-4 border-t",children:[(0,Qo.jsx)(y,{type:"button",variant:"outline",onClick:a,disabled:o,children:h?n:"Close"}),h?(0,Qo.jsx)(y,{type:"submit",disabled:o,children:o?"Saving...":X}):(0,Qo.jsxs)(y,{type:"button",onClick:J,disabled:o,className:"gap-2",children:[(0,Qo.jsx)(Yg.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function Kc({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,Qo.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Qo.jsx)(hn.AnimatePresence,{mode:"wait",children:(0,Qo.jsxs)(hn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-4 uv-6",children:[(0,Qo.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Qo.jsx)(Yg.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,Qo.jsx)("p",{className:"text-muted-foreground",children:"Choose the type Ug colleague Qo add"})]})]}),(0,Qo.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Qo.jsx)(hn.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Qo.jsxs)(H,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Qo.jsxs)(Pe,{className:"text-center sc-4",children:[(0,Qo.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center uv-4",children:(0,Qo.jsx)(Yg.User,{className:"h-8 w-8 text-blue-600"})}),(0,Qo.jsx)(Ie,{className:"text-xl",children:"Add Human Colleague"})]}),(0,Qo.jsxs)(oe,{className:"text-center",children:[(0,Qo.jsx)("p",{className:"text-muted-foreground uv-4",children:"Select from existing users in your organization Qo add as team members."}),(0,Qo.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Qo.jsx)(Yg.Users,{className:"h-4 w-4 text-blue-600"}),(0,Qo.jsx)("span",{children:"Browse existing users"})]}),(0,Qo.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Qo.jsx)(Yg.User,{className:"h-4 w-4 text-blue-600"}),(0,Qo.jsx)("span",{children:"Import user details automatically"})]})]}),(0,Qo.jsx)(y,{className:"mt-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,Qo.jsx)(hn.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Qo.jsxs)(H,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Qo.jsxs)(Pe,{className:"text-center sc-4",children:[(0,Qo.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center uv-4",children:(0,Qo.jsx)(Yg.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,Qo.jsx)(Ie,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,Qo.jsxs)(oe,{className:"text-center",children:[(0,Qo.jsx)("p",{className:"text-muted-foreground uv-4",children:"Clone an existing digital colleague Qo create a new AI assistant for your team."}),(0,Qo.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Qo.jsx)(Yg.Bot,{className:"h-4 w-4 text-purple-600"}),(0,Qo.jsx)("span",{children:"Clone existing colleagues"})]}),(0,Qo.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Qo.jsx)(Yg.Users,{className:"h-4 w-4 text-purple-600"}),(0,Qo.jsx)("span",{children:"Create from templates"})]})]}),(0,Qo.jsx)(y,{className:"mt-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function _c({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[r,i]=(0,ld.useState)(""),[n,s]=(0,ld.useState)("all"),l=(0,ld.useMemo)(()=>e.filter(c=>c?.name.toLowerCase().includes(r.toLowerCase())||c.jobDescription?.toLowerCase().includes(r.toLowerCase())||c.workInstructions?.toLowerCase().includes(r.toLowerCase())),[e,r,n]),m=c=>{let u={...c,name:`${c?.name} (Copy)`};t(u)},d=c=>new Intl.DateTimeFormat("Yg-US",{month:"short",day:"numeric",year:"numeric"}).format(c);return(0,Qo.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Qo.jsx)(hn.AnimatePresence,{mode:"wait",children:(0,Qo.jsxs)(hn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-4 uv-6",children:[(0,Qo.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Qo.jsx)(Yg.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,Qo.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague Qo clone"})]})]}),(0,Qo.jsx)(H,{children:(0,Qo.jsx)(oe,{className:"Qo-6",children:(0,Qo.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Qo.jsx)("div",{className:"flex-1",children:(0,Qo.jsxs)("div",{className:"relative",children:[(0,Qo.jsx)(Yg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Qo.jsx)(_,{placeholder:"Search by name, job description, Qo capabilities...",value:r,onChange:c=>i(c.target.value),className:"pl-9"})]})}),(0,Qo.jsxs)("select",{value:n,onChange:c=>s(c.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,Qo.jsx)("option",{value:"all",children:"All Status"}),(0,Qo.jsx)("option",{value:"active",children:"Active"}),(0,Qo.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,Qo.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:l.map(c=>(0,Qo.jsx)(hn.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Qo.jsxs)(H,{className:`cursor-pointer transition-all hover:shadow-lg ${o?.toString()===c.id.toString()?"ring-2 ring-primary":""}`,onClick:()=>m(c),children:[(0,Qo.jsx)(Pe,{className:"sc-3",children:(0,Qo.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Qo.jsx)(qt,{children:(0,Qo.jsx)(Jt,{className:"bg-blue-100",children:(0,Qo.jsx)(Yg.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,Qo.jsx)("div",{children:(0,Qo.jsx)(Ie,{className:"text-lg flex items-center gap-2",children:c?.name})})]}),(0,Qo.jsxs)(y,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:u=>{u.stopPropagation(),m(c)},children:[(0,Qo.jsx)(Yg.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,Qo.jsx)(oe,{className:"Qo-0",children:(0,Qo.jsxs)("div",{className:"space-y-3",children:[(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,Qo.jsx)("p",{className:"text-sm line-clamp-2",children:c.jobDescription})]}),c.capabilities&&c.capabilities.length>0&&(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground uv-2",children:"Capabilities"}),(0,Qo.jsx)("div",{className:"flex flex-wrap gap-1",children:c.capabilities.length>3&&(0,Qo.jsxs)(se,{variant:"outline",className:"text-Yg",children:["+",c.capabilities.length-3]})})]}),(0,Qo.jsx)("div",{className:"flex items-center justify-between text-Yg text-muted-foreground"}),c.workInstructions&&(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,Qo.jsx)("p",{className:"text-Yg line-clamp-2",children:c.workInstructions})]})]})})]})},c.id))}),l.length===0&&(0,Qo.jsx)(H,{children:(0,Qo.jsx)(oe,{className:"Qo-6",children:(0,Qo.jsxs)("div",{className:"text-center py-8",children:[(0,Qo.jsx)(Yg.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto uv-4"}),(0,Qo.jsx)("h3",{className:"text-lg font-semibold uv-2",children:"Qo digital colleagues found"}),(0,Qo.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms Qo filters."})]})})})]},"colleague-clone")})})}function Gc({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,Qo.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Qo.jsx)(hn.AnimatePresence,{mode:"wait",children:(0,Qo.jsxs)(hn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-4 uv-6",children:[(0,Qo.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Qo.jsx)(Yg.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,Qo.jsx)("p",{className:"text-muted-foreground",children:"Choose how Qo create your digital colleague"})]})]}),(0,Qo.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Qo.jsx)(hn.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Qo.jsxs)(H,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Qo.jsxs)(Pe,{className:"text-center sc-4",children:[(0,Qo.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center uv-4",children:(0,Qo.jsx)(Yg.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,Qo.jsx)(Ie,{className:"text-xl",children:"Clone Existing"})]}),(0,Qo.jsxs)(oe,{className:"text-center",children:[(0,Qo.jsx)("p",{className:"text-muted-foreground uv-4",children:"Start with an existing digital colleague and customize Qo for your needs."}),(0,Qo.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Qo.jsx)(Yg.Bot,{className:"h-4 w-4 text-blue-600"}),(0,Qo.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,Qo.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Qo.jsx)(Yg.Copy,{className:"h-4 w-4 text-blue-600"}),(0,Qo.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,Qo.jsx)(y,{className:"mt-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,Qo.jsx)(hn.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Qo.jsxs)(H,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Qo.jsxs)(Pe,{className:"text-center sc-4",children:[(0,Qo.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center uv-4",children:(0,Qo.jsx)(Yg.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,Qo.jsx)(Ie,{className:"text-xl",children:"Create New"})]}),(0,Qo.jsxs)(oe,{className:"text-center",children:[(0,Qo.jsx)("p",{className:"text-muted-foreground uv-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,Qo.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Qo.jsx)(Yg.Plus,{className:"h-4 w-4 text-green-600"}),(0,Qo.jsx)("span",{children:"Custom job description"})]}),(0,Qo.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Qo.jsx)(Yg.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,Qo.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,Qo.jsx)(y,{className:"mt-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}var hh=O(require("react")),zl=O(require("@radix-ui/react-switch"));var Fn=hh.forwardRef(({className:e,...t},a)=>(0,Qo.jsx)(zl.Root,{className:p("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:a,children:(0,Qo.jsx)(zl.Thumb,{className:p("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Fn.displayName=zl.Root.displayName;function Xc({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:r,submitLabel:i,cancelLabel:n="Cancel",readOnly:s=!1}){let[l,m]=(0,ld.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[d,c]=(0,ld.useState)(!s);(0,ld.useEffect)(()=>{e&&m(e)},[e]);let u=async g=>{g.preventDefault();let x={id:l.id||Date.now(),name:l.name,description:l.description||null,systemMsg:l.systemMsg||null,useProjects:l.useProjects||!1,useKnowledge:l.useKnowledge||!1,useFiles:l.useFiles||!1,useChat:l.useChat||!1,updatedAt:new Date().toISOString(),createdAt:l.createdAt||new Date().toISOString()};await t(x)},v=g=>{g.preventDefault(),c(!d)},b=r||(d?e?"Edit Team":"Create New Team":"View Team"),f=i||(e?"Update Team":"Create Team");return(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.Users,{className:"h-5 w-5"}),b]}),(0,Qo.jsxs)("form",{onSubmit:u,className:"space-y-6",children:[(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"name",children:"Team Name *"}),(0,Qo.jsx)(_,{id:"name",value:l.name||"",onChange:g=>m({...l,name:g.target.value}),required:!0,disabled:o||!d,placeholder:"Enter team name..."})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"description",children:"Description"}),(0,Qo.jsx)(Xe,{id:"description",value:l.description||"",onChange:g=>m({...l,description:g.target.value}),rows:3,placeholder:"Brief description Ug this team...",disabled:o||!d})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"systemMsg",children:"Ways Ug working"}),(0,Qo.jsx)(Xe,{id:"systemMsg",value:l.systemMsg||"",onChange:g=>m({...l,systemMsg:g.target.value}),rows:3,placeholder:"Describe how this team works in as much detail as possible. Include processes, tools, systems, styles...",disabled:o||!d})]})]}),(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,Qo.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(Fn,{id:"useProjects",checked:l.useProjects||!1,onCheckedChange:g=>m({...l,useProjects:g}),disabled:o||!d}),(0,Qo.jsx)(I,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(Fn,{id:"useKnowledge",checked:l.useKnowledge||!1,onCheckedChange:g=>m({...l,useKnowledge:g}),disabled:o||!d}),(0,Qo.jsx)(I,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(Fn,{id:"useFiles",checked:l.useFiles||!1,onCheckedChange:g=>m({...l,useFiles:g}),disabled:o||!d}),(0,Qo.jsx)(I,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(Fn,{id:"useChat",checked:l.useChat||!1,onCheckedChange:g=>m({...l,useChat:g}),disabled:o||!d}),(0,Qo.jsx)(I,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,Qo.jsxs)("div",{className:"flex justify-end gap-2 Qo-4 border-t",children:[(0,Qo.jsx)(y,{type:"button",variant:"outline",onClick:a,disabled:o,children:d?n:"Close"}),d?(0,Qo.jsx)(y,{type:"submit",disabled:o||!l.name?.trim(),children:o?"Saving...":f}):(0,Qo.jsxs)(y,{type:"button",onClick:v,disabled:o,className:"gap-2",children:[(0,Qo.jsx)(Yg.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})]})}var yh=O(require("react")),Ul=O(require("@radix-ui/react-progress"));var Vl=yh.forwardRef(({className:e,value:t,...a},o)=>(0,Qo.jsx)(Ul.Root,{ref:o,className:p("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,Qo.jsx)(Ul.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Vl.displayName=Ul.Root.displayName;function ju({app:e,onOpen:t,onFavorite:a,showProgress:o=!1,className:r}){return(0,Qo.jsx)(hn.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:r,children:(0,Qo.jsxs)(H,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[(0,Qo.jsx)(Pe,{className:"sc-2",children:(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:e.icon}),e.new?(0,Qo.jsx)(se,{className:"rounded-xl bg-amber-500",children:"New"}):(0,Qo.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>a?.(e),children:(0,Qo.jsx)(Yg.Star,{className:"h-4 w-4"})})]})}),(0,Qo.jsxs)(oe,{className:"sc-2",children:[(0,Qo.jsx)(Ie,{className:"text-lg",children:e.name}),(0,Qo.jsx)(Io,{children:e.description}),o&&e.progress<100&&(0,Qo.jsxs)("div",{className:"mt-2",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Qo.jsx)("span",{children:"Installation"}),(0,Qo.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Qo.jsx)(Vl,{value:e.progress,className:"h-2 mt-1 rounded-xl"})]})]}),(0,Qo.jsx)(er,{children:(0,Qo.jsx)(y,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>t?.(e),children:e.progress<100?"Continue Install":"Open"})})]})})}var s0=O(require("@radix-ui/react-dialog"));var Wh=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),Xh=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),qh=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),Jh=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),Yh=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),Qh=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),Zh=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Yc=require("@payloadcms/richtext-lexical/lexical/list"),e0=require("@payloadcms/richtext-lexical/lexical/rich-text"),t0=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var _h=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),Gl=require("@payloadcms/richtext-lexical/lexical/utils"),et=require("@payloadcms/richtext-lexical/lexical"),Ju=require("@payloadcms/richtext-lexical/lexical/selection");var Ih=require("@radix-ui/react-dialog"),qc=require("@payloadcms/richtext-lexical/client");var Uu=O(require("bson-objectid"));var wh=require("@payloadcms/ui");var rw=e=>{let{data:{relationTo:t,value:a},nodeKey:o}=e,[r]=(0,_h.useLexicalComposerContext)(),[i,n]=(0,ld.useState)(""),[s,l]=(0,ld.useState)(""),[m,d]=(0,ld.useState)(""),c=async g=>{console.log("fetchMedia",g)};(0,ld.useEffect)(()=>{typeof a=="string"?a.length===24?c(a):(n(a||""),d(f(b())),l(v()||"")):typeof a=="object"&&(n(`${process.env.NEXT_PUBLIC_API_URL}${a.url}`||""),d(f(a.filesize)),l(a.mimeType?.split("/")[1]||""))},[]);let u=(0,ld.useCallback)(()=>{r.update(()=>{(0,et.$getNodeByKey)(o)?.remove()})},[r,o]),v=()=>{let g=e.data.value;return typeof g=="string"?g.split(";base64")[0]?.split("image/")[1]:""},b=()=>{let g=e.data.value;if(typeof g=="string"){let x=g.split(",")[1]?.length||0;return 4*Math.ceil(x/3)*.5624896334383812/1e3}return 0};function f(g){if(g>=1e6){let S=g/1e6;return`${S>=10?Math.round(S).toString():S.toFixed(1)} MB`}return`${Math.floor(g/1e3)} KB`}return(0,Qo.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,Qo.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,Qo.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,Qo.jsx)("div",{className:"flex-1",children:e.data.value?(0,Qo.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":a,"data-lexical-upload-relation-Qo":t,src:i}):(0,Qo.jsx)(wh.File,{})}),(0,Qo.jsx)(Po,{children:(0,Qo.jsxs)(Ro,{children:[(0,Qo.jsxs)(Ao,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,Qo.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,Qo.jsx)("button",{onClick:g=>{g.preventDefault(),u()},className:"flex-1 flex justify-center items-center",children:(0,Qo.jsx)(Yg.X,{width:24,height:24,strokeWidth:1})})]}),(0,Qo.jsx)(mo,{children:(0,Qo.jsx)("span",{children:"Remove image"})})]})})]}),(0,Qo.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-Yg font-bold",children:[(0,Qo.jsx)("span",{className:"",children:s?.toLocaleUpperCase()}),(0,Qo.jsx)("span",{children:m})]})]})})},Dh=rw;function iw(e){if(e.hasAttribute("data-lexical-upload-relation-Qo")&&e.hasAttribute("data-lexical-upload-id")){let a=e.getAttribute("data-lexical-upload-id");if(a)return{node:On({fields:{},relationTo:"media",value:a})}}return e.src.startsWith("file:///"),null}var $l=class extends qc.UploadNode{static importDOM(){return{img:()=>({conversion:iw,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new Uu.default().toHexString(),t.version=3);let a={id:t.id??new Uu.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},o=On(a);return o.setFormat?.(t.format),o}decorate(){return(0,Qo.jsx)(Dh,{data:this.__data,nodeKey:this.getKey()})}};function On(e){return new $l({data:e})}var sw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nw=e=>sw?(e||window).getSelection():null,X6=(0,et.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),Vu=(0,et.createCommand)("INSERT_UPLOAD_COMMAND");function Mh({activeEditor:e,onClose:t,isOpen:a=!1}){let o=(0,ld.useRef)(!1),[r,i]=(0,ld.useState)(!0),[n,s]=(0,ld.useState)(""),[l,m]=(0,ld.useState)(""),[d,c]=(0,ld.useState)(!1),[u,v]=(0,ld.useState)("left"),b=n==="",f=w=>{c(w.target.checked)},g=w=>{v(w.target.value)},x=w=>{let D=new FileReader;D.onload=function(){return typeof D.result=="string"&&s(D.result),""},w!==null&&w[0]&&D.readAsDataURL(w[0])};(0,ld.useEffect)(()=>{o.current=!1;let w=D=>{o.current=D.altKey};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[e]),(0,ld.useEffect)(()=>{r||t()},[r]),(0,ld.useEffect)(()=>{i(a)},[a]);let S=({editor:w,relationTo:D,replaceNodeKey:M,value:U})=>{if(M)w.update(()=>{let F=(0,et.$getNodeByKey)(M);F&&F.replace(On({id:"",fields:{},relationTo:"media",value:U}))});else{let F=w.dispatchCommand(Vu,{fields:null,relationTo:"media",value:U})}},h=()=>{S({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:l,src:n,showCaption:d,position:u}.src}),i(!1),t()};return(0,Qo.jsx)(at,{open:r,onOpenChange:w=>i(w),children:(0,Qo.jsxs)(ct,{children:[(0,Qo.jsxs)(ft,{children:[(0,Qo.jsx)(mt,{children:"Upload Image"}),(0,Qo.jsx)(Ih.DialogDescription,{children:"Description"})]}),(0,Qo.jsxs)("div",{className:"",children:[(0,Qo.jsx)("div",{style:{marginBottom:"1em"},children:(0,Qo.jsx)(_,{type:"file",onChange:w=>x(w.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,Qo.jsx)("div",{style:{marginBottom:"1em"},children:(0,Qo.jsx)(_,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:w=>m(w.currentTarget.value),value:l,"data-test-id":"image-modal-alt-text-input"})}),(0,Qo.jsx)(y,{"data-test-id":"image-modal-file-upload-btn",disabled:b,onClick:()=>h(),children:"Confirm"})]})]})})}function $u({captionsEnabled:e}){let[t]=(0,_h.useLexicalComposerContext)();return(0,ld.useEffect)(()=>{if(!t.hasNodes([qc.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,Gl.mergeRegister)(t.registerCommand(et.DRAGSTART_COMMAND,a=>lw(a),et.COMMAND_PRIORITY_HIGH),t.registerCommand(et.DRAGOVER_COMMAND,a=>dw(a),et.COMMAND_PRIORITY_LOW),t.registerCommand(et.DROP_COMMAND,a=>cw(a,t),et.COMMAND_PRIORITY_HIGH))},[e,t]),null}function lw(e){if(!Ku())return!1;let a=e.dataTransfer;return a?(a.setData("text/plain","_"),!0):!1}function dw(e){return Ku()?(Bh(e)||e.preventDefault(),!0):!1}function cw(e,t){let a=Ku();if(!a)return!1;if(e.preventDefault(),Bh(e)){let o=mw(e);a.remove();let r=(0,et.$createRangeSelection)();o!=null&&r.applyDOMRange(o),(0,et.$setSelection)(r)}return!0}function Ku(){let e=(0,et.$getSelection)();if(!(0,et.$isNodeSelection)(e))return null;let a=e.getNodes()[0];return(0,qc.$isUploadNode)(a)?a:null}function Bh(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function mw(e){let t,a=e.target,o=a==null?null:a.nodeType===9?a.defaultView:a.ownerDocument.defaultView,r=nw(o);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&r!==null)r.collapse(e.rangeParent,e.rangeOffset||0),t=r.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var pw=()=>(0,Qo.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Qo.jsx)("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),Lh=pw;var uw=()=>(0,Qo.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Qo.jsx)("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),Eh=uw;var gw=()=>(0,Qo.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Qo.jsx)("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,Qo.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),Fh=gw;var fw=()=>(0,Qo.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Qo.jsx)("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,Qo.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),Oh=fw;var vw=()=>(0,Qo.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Qo.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),Hh=vw;var bw=()=>(0,Qo.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Qo.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),zh=bw;var jh=()=>(0,Qo.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Qo.jsx)("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),Uh=()=>(0,Qo.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Qo.jsx)("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),Vh=()=>(0,Qo.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Qo.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),$h=()=>(0,Qo.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Qo.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),Kh=()=>(0,Qo.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Qo.jsx)("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var qu=1;function hw(){return(0,Qo.jsx)("span",{className:"border border-[#222222]"})}function Yu(){let[e]=(0,_h.useLexicalComposerContext)(),t=(0,ld.useRef)(null),[a,o]=(0,ld.useState)(!1),[r,i]=(0,ld.useState)(!1),[n,s]=(0,ld.useState)(!1),[l,m]=(0,ld.useState)(!1),[d,c]=(0,ld.useState)(!1),[u,v]=(0,ld.useState)(!1),[b,f]=(0,ld.useState)(!1),[g,x]=(0,ld.useState)(!1),[S,h]=(0,ld.useState)(!1),[w,D]=(0,ld.useState)("left"),[M,U]=(0,ld.useState)("p"),F=T=>{e.update(()=>{let X=(0,et.$getSelection)();(0,et.$isRangeSelection)(X)&&(T==="p"?(0,Ju.$setBlocksType)(X,()=>(0,et.$createParagraphNode)()):(0,Ju.$setBlocksType)(X,()=>(0,e0.$createHeadingNode)(T)))})},j=(0,ld.useCallback)(()=>{let T=(0,et.$getSelection)();if((0,et.$isRangeSelection)(T)){s(T.hasFormat("bold")),m(T.hasFormat("italic")),c(T.hasFormat("underline")),v(T.hasFormat("strikethrough")),f(T.hasFormat("subscript")),x(T.hasFormat("superscript"));let X=T.anchor.getNode(),N=X;for(;N&&!(0,et.$isParagraphNode)(N)&&N!==(0,et.$getRoot)();){let B=N.getParent();B&&(N=B)}if(N){let B=N.getFormatType();D(B||"left")}let ae=X.getTopLevelElement()?.__tag;U(ae||"p")}},[]);(0,ld.useEffect)(()=>(0,Gl.mergeRegister)(e.registerUpdateListener(({editorState:T})=>{T.read(()=>{j()})}),e.registerCommand(et.SELECTION_CHANGE_COMMAND,(T,X)=>(j(),!1),qu),e.registerCommand(et.CAN_UNDO_COMMAND,T=>(o(T),!1),qu),e.registerCommand(et.CAN_REDO_COMMAND,T=>(i(T),!1),qu),(0,Gl.mergeRegister)(e.registerCommand(Vu,T=>(e.update(()=>{let X=(0,et.$getSelection)()||(0,et.$getPreviousSelection)();if((0,et.$isRangeSelection)(X)){let N=On({id:T.id,fields:T.fields,relationTo:T.relationTo,value:T.value}),{focus:ae}=X,B=ae.getNode();(0,Gl.$insertNodeToNearestRoot)(N),(0,et.$isParagraphNode)(B)&&!B.__first&&B.remove()}}),!0),et.COMMAND_PRIORITY_EDITOR))),[e,j]);let ee=[[{label:"Undo",icon:(0,Qo.jsx)(Yg.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(et.UNDO_COMMAND,void 0)},disabled:!a},{label:"Redo",icon:(0,Qo.jsx)(Yg.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(et.UNDO_COMMAND,void 0)},disabled:!r}],[{label:"Bold",icon:(0,Qo.jsx)(Lh,{}),onClick:()=>{e.dispatchCommand(et.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:n},{label:"Italic",icon:(0,Qo.jsx)(Eh,{}),onClick:()=>{e.dispatchCommand(et.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:l},{label:"Underline",icon:(0,Qo.jsx)(Fh,{}),onClick:()=>{e.dispatchCommand(et.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:d},{label:"Strikethrough",icon:(0,Qo.jsx)(Oh,{}),onClick:()=>{e.dispatchCommand(et.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:u},{label:"Subscript",icon:(0,Qo.jsx)(Hh,{}),onClick:()=>{e.dispatchCommand(et.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:b},{label:"Superscript",icon:(0,Qo.jsx)(zh,{}),onClick:()=>{e.dispatchCommand(et.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:g}]],ve=[{label:"Left Align",direction:"left",icon:(0,Qo.jsx)(Yg.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(et.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,Qo.jsx)(Yg.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(et.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,Qo.jsx)(Yg.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(et.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,Qo.jsx)(Yg.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(et.FORMAT_ELEMENT_COMMAND,"justify")}}],J=[{label:"Normal Text",value:"p",icon:(0,Qo.jsx)(jh,{}),onClick:()=>F("p")},{label:"Heading 1",value:"h1",icon:(0,Qo.jsx)(Uh,{}),onClick:()=>F("h1")},{label:"Heading 2",value:"h2",icon:(0,Qo.jsx)(Vh,{}),onClick:()=>F("h2")},{label:"Heading 3",value:"h3",icon:(0,Qo.jsx)($h,{}),onClick:()=>F("h3")},{label:"Heading 4",value:"h4",icon:(0,Qo.jsx)(Kh,{}),onClick:()=>F("h4")},...[{label:"Unordered List",value:"ul",icon:(0,Qo.jsx)(Yg.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Yc.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,Qo.jsx)(Yg.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Yc.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],pe=[{label:"Insert Image",icon:(0,Qo.jsx)(Yg.ImageUp,{width:15,height:15}),onClick:()=>{h(!0)},disabled:!1}];return(0,Qo.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black z-50",children:(0,Qo.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[ee.map((T,X)=>(0,Qo.jsxs)(ld.Fragment,{children:[(0,Qo.jsx)("div",{className:"flex items-center gap-2",children:T.map((N,ae)=>(0,Qo.jsx)("div",{role:"button","aria-disabled":N.disabled||!1,onClick:N.onClick,className:p("p-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",N.active&&"bg-[#3c3c3c]"),"aria-label":N.label,children:(0,Qo.jsx)(Po,{children:(0,Qo.jsxs)(Ro,{children:[(0,Qo.jsx)(Ao,{className:"text-[#b5b5b5]",children:N.icon}),(0,Qo.jsx)(mo,{children:(0,Qo.jsx)("p",{children:N.label})})]})})},ae))}),(0,Qo.jsx)(hw,{})]},`toolbar-option-${T.length}-${X}`)),(0,Qo.jsxs)(Do,{children:[(0,Qo.jsxs)(To,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-Yg",children:[ve.find(T=>T.direction===w)?.icon,ve.find(T=>T.direction===w)?.label,(0,Qo.jsx)(Yg.ChevronDown,{width:15,height:15})]}),(0,Qo.jsx)(co,{className:"bg-black hover:bg-black",children:ve.map((T,X)=>(0,Qo.jsxs)(Ba,{onClick:T.onClick,className:"flex items-center gap-2 text-Yg text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Qo.jsx)("span",{children:T.icon}),(0,Qo.jsx)("span",{children:T.label})]},`${T.label}-${X}`))})]}),(0,Qo.jsxs)(Do,{children:[(0,Qo.jsxs)(To,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-Yg",children:[J.find(T=>T.value===M)?.icon,J.find(T=>T.value===M)?.label,(0,Qo.jsx)(Yg.ChevronDown,{width:15,height:15})]}),(0,Qo.jsx)(co,{className:"bg-black hover:bg-black",children:J.map((T,X)=>(0,Qo.jsxs)(Ba,{onClick:T.onClick,className:"flex items-center gap-2 text-Yg text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Qo.jsx)("span",{children:T.icon}),(0,Qo.jsx)("span",{children:T.label})]},`heading-option-${T.label}-${X}`))})]}),(0,Qo.jsxs)(Do,{children:[(0,Qo.jsxs)(To,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-Yg",children:[(0,Qo.jsx)(Yg.Plus,{width:15,height:15}),(0,Qo.jsx)(Yg.ChevronDown,{width:15,height:15})]}),(0,Qo.jsx)(co,{className:"bg-black hover:bg-black",children:pe.map((T,X)=>(0,Qo.jsxs)(Ba,{onClick:T.onClick,disabled:T.disabled,className:"flex items-center gap-2 text-Yg text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Qo.jsx)("span",{children:T.icon}),(0,Qo.jsx)("span",{children:T.label})]},X))})]}),S&&(0,Qo.jsx)(Mh,{activeEditor:e,onClose:()=>{h(!1)},isOpen:S})]})})}var yw=({setValue:e,value:t,name:a,editable:o=!0})=>{let[r]=(0,_h.useLexicalComposerContext)(),i=(0,ld.useRef)(null),n=s=>{s.read(()=>{let l=s.toJSON();JSON.stringify(l)!==JSON.stringify(i.current)&&(i.current=l,e?.(()=>l))})};return(0,ld.useEffect)(()=>{r.setEditable(o)},[o,r]),(0,ld.useEffect)(()=>{t&&JSON.stringify(t)!==JSON.stringify(i.current)&&r.update(()=>{try{let s=r.parseEditorState(t);r.setEditorState(s),i.current=t}catch(s){console.error("Error parsing editor state:",s)}},{discrete:!0})},[t,r]),(0,Qo.jsx)("div",{className:"w-full",children:(0,Qo.jsxs)("div",{className:" ",children:[o&&(0,Qo.jsx)(Yu,{}),(0,Qo.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,Qo.jsx)(Qh.RichTextPlugin,{contentEditable:(0,Qo.jsx)(qh.ContentEditable,{name:a,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:Jh.LexicalErrorBoundary}),o&&(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(Yh.HistoryPlugin,{}),(0,Qo.jsx)(Wh.AutoFocusPlugin,{}),(0,Qo.jsx)(Zh.ListPlugin,{}),(0,Qo.jsx)(t0.OnChangePlugin,{onChange:n}),(0,Qo.jsx)($u,{})]})]})]})})},xw=({setValue:e,value:t,name:a,editable:o=!0})=>(0,Qo.jsx)(Xh.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Yc.ListNode,Yc.ListItemNode,e0.HeadingNode,$l],onError(i){throw console.error("Lexical error:",i),i},theme:{code:"editor-code",heading:{h1:"text-4xl text-primary",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",ul:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,Qo.jsx)(yw,{value:t,setValue:e,name:a,editable:o})}),Hn=xw;var Xl=e=>"mimeType"in e&&"url"in e&&!("format"in e),Nw=e=>{if(!e?.root?.children)return"";let t=[],a=i=>{if(!i)return"";switch(i.type){case"heading":{let n=i.tag?parseInt(i.tag.replace("h","")):1,s=o(i.children||[]);return"#".repeat(n)+" "+s}case"paragraph":return i.children&&i.children.some(l=>l.type==="text"?l.text&&l.text.trim().length>0:(l.type==="linebreak",!0))?o(i.children||[]):"";case"list":{let n=[],s=i.listType==="number"?"1.":"-";return i.children?.forEach((l,m)=>{if(l.type==="listitem"){let d=o(l.children||[]),c=i.listType==="number"?`${m+1}.`:s;n.push(`${c} ${d}`)}}),n.join(`
|
|
44
|
+
`,children:e.children.map(f=>(0,$a.jsx)("div",{className:"flex-shrink-0",children:(0,$a.jsx)(Bu,{node:f,onNodeClick:t,expandable:a,initiallyExpanded:o,defaultExpandedLevels:s})},f.id))})})]})]})};var ch=({users:e,onNodeClick:t,className:a="",expandable:o=!1,initiallyExpanded:r=!0,companyInfo:i,defaultExpandedLevels:n=2})=>{let s=Ru(e);return e.length===0?(0,er.jsx)("div",{className:`flex items-center justify-center p-8 ${a}`,children:(0,er.jsx)("div",{className:"text-center",children:(0,er.jsx)("p",{className:"text-muted-foreground",children:"er users er display"})})}):s.length===0?(0,er.jsx)("div",{className:`flex items-center justify-center p-8 ${a}`,children:(0,er.jsxs)("div",{className:"text-center",children:[(0,er.jsx)("p",{className:"text-muted-foreground",children:"Unable er build organization tree"}),(0,er.jsx)("p",{className:"text-xs text-muted-foreground er-1",children:"Check that manager relationships are properly configured"})]})}):(0,er.jsx)("div",{className:`org-chart w-full overflow-x-auto ${a}`,children:(0,er.jsx)("div",{className:"inline-block min-w-full p-8",children:(0,er.jsx)(Fc,{nodes:s,onNodeClick:t,expandable:o,initiallyExpanded:r,companyInfo:s.length>1?i:void 0,defaultExpandedLevels:n})})})};var Lu=O(require("clsx"));function Oc({mainNav:e,secondaryNav:t,ongoingWork:a,title:o,subTitle:r,pathName:i,menuHeading:n,onNavClick:s,loading:l=!1,LinkComponent:m,...d}){let u=m?v=>(0,er.jsx)(m,{...v}):s?({href:v,children:b,...f})=>(0,er.jsx)("button",{onClick:()=>s&&s(v),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...f,children:b}):v=>(0,er.jsx)("a",{...v});return(0,er.jsxs)(di,{...d,variant:"inset",children:[(0,er.jsx)(ci,{children:(0,er.jsx)(ja,{children:(0,er.jsx)(ba,{children:l?(0,er.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,er.jsx)(gt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,er.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,er.jsx)("span",{className:"truncate font-semibold",children:o}),r&&(0,er.jsx)("span",{className:"truncate text-sm",children:r})]})})})}),l&&(0,er.jsxs)(xr,{children:[(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,er.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,er.jsxs)(xr,{children:[(0,er.jsx)("div",{className:"px-4 text-sm",children:"Recent Work"}),a&&!l&&a.map((v,b)=>(0,er.jsx)(mh,{subNav:v,pathName:i,Link:u},b)),(0,er.jsx)("div",{className:"border-t border-gray-200 my-4"}),e&&!l&&e.map((v,b)=>(0,er.jsx)(mh,{subNav:v,pathName:i,Link:u},b)),(0,er.jsx)(po,{className:"er-auto",children:(0,er.jsx)(Ko,{children:(0,er.jsx)(ja,{children:t&&!l&&t.map(v=>(0,er.jsx)(ba,{children:(0,er.jsx)(uo,{asChild:!0,size:"sm",children:(0,er.jsxs)(u,{href:v.url||"",children:[v.icon&&(0,er.jsx)(v.icon,{}),(0,er.jsx)("span",{children:v.label})]})})},v.label))})})})]}),(0,er.jsx)(mi,{})]})}function mh({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(i=>{i.url===t&&(r=!0)}),(0,er.jsx)(za,{defaultOpen:!0,className:"group/collapsible",children:(0,er.jsx)(po,{className:"py-0",children:(0,er.jsx)(ja,{children:(0,er.jsx)(za,{asChild:!0,defaultOpen:o.isActive,children:(0,er.jsxs)(ba,{children:[(0,er.jsx)(uo,{asChild:!0,tooltip:o.label,className:(0,Lu.default)(r&&"font-bold text-accent"),children:(0,er.jsxs)(a,{href:o.url,children:[o.icon&&(0,er.jsx)(o.icon,{}),(0,er.jsx)("span",{children:o.label})]})}),o.links?.length?(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(Ya,{asChild:!0,children:(0,er.jsxs)(Ts,{className:"data-[state=open]:rotate-90",children:[(0,er.jsx)(Jg.ChevronRight,{}),(0,er.jsx)("span",{className:"Jg-only",children:"Toggle"})]})}),(0,er.jsx)(Ga,{children:(0,er.jsx)(zr,{children:o.links?.map(i=>(0,er.jsx)(jr,{children:(0,er.jsx)(Ur,{asChild:!0,className:(0,Lu.default)(i.url===t&&"font-bold text-accent"),children:(0,er.jsx)(a,{href:i.url,children:(0,er.jsx)("span",{children:i.label})})})},i.label))})})]}):null]})},o.label)})})})}var uh=({isRightSidebarOpen:e,onToggleRightSidebar:t,onToggleLeftSidebar:a,onToggleNotifications:o})=>(0,er.jsx)("header",{className:"border-b bg-white/80 backdrop-blur-md dark:bg-slate-900/80 sticky top-0 z-50",children:(0,er.jsx)("div",{className:"container mx-auto px-6 py-4",children:(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsxs)("div",{className:"flex items-center space-x-4",children:[a&&(0,er.jsx)(y,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,er.jsx)(Jg.Menu,{className:"h-5 w-5"})}),(0,er.jsx)("h1",{className:"text-2xl font-bold bg-gradient-er-r from-blue-600 er-purple-600 bg-clip-text text-transparent",children:"Cortex Copilot"})]}),(0,er.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,er.jsxs)(y,{variant:"ghost",size:"icon",className:"relative",onClick:o,children:[(0,er.jsx)(Jg.Bell,{className:"h-5 w-5"}),(0,er.jsx)("span",{className:"absolute -top-1 -right-1 h-3 w-3 bg-red-500 rounded-full text-xs text-white flex items-center justify-center",children:"3"})]}),(0,er.jsxs)(To,{children:[(0,er.jsx)(Po,{asChild:!0,children:(0,er.jsx)(y,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:(0,er.jsxs)(da,{className:"h-10 w-10",children:[(0,er.jsx)(vo,{src:"/avatars/01.png",alt:"@user"}),(0,er.jsx)(ca,{children:"JD"})]})})}),(0,er.jsxs)(co,{className:"w-56",align:"end",forceMount:!0,children:[(0,er.jsx)(al,{className:"font-normal",children:(0,er.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,er.jsx)("p",{className:"text-sm font-medium leading-none",children:"John Doe"}),(0,er.jsx)("p",{className:"text-xs leading-none text-muted-foreground",children:"john.doe@company.com"})]})}),(0,er.jsx)(ol,{}),(0,er.jsxs)(Ba,{children:[(0,er.jsx)(Jg.User,{className:"er-2 h-4 w-4"}),(0,er.jsx)("span",{children:"Profile"})]}),(0,er.jsxs)(Ba,{children:[(0,er.jsx)(Jg.Settings,{className:"er-2 h-4 w-4"}),(0,er.jsx)("span",{children:"Settings"})]})]})]})]})]})})});var gh=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,er.jsx)(Jg.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function zc({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=gh[0],onBusinessUnitChange:i,onSearch:n,businessUnits:s=gh,activeTab:l,onTabChange:m,showTabs:d=!1,onActionClick:c,actionIcon:u,actionText:v="Action",onNotificationRemove:b,onRemoveAll:f,logo:g="/headerlogo.png",logoLink:x="/teams",appName:S="Nuvia",tagline:h="Collaboration Platform",sidebarInitiallyClosed:w=!1}){let[D,M]=(0,cd.useState)(!w),[U,F]=(0,cd.useState)(!1),[j,te]=(0,cd.useState)(r),ve=C=>{te(C),i?.(C)};return(0,er.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-er bg-background w-[]",children:[U&&(0,er.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>F(!1)}),(0,er.jsx)("div",{className:"md:hidden",children:(0,er.jsx)(qs,{items:e,isOpen:U,isMobile:!0,onClose:()=>F(!1),currentBusinessUnit:j,onBusinessUnitChange:ve,onSearch:n,logo:g,logoLink:x,appName:S,tagline:h})}),(0,er.jsx)("div",{className:"hidden md:block",children:(0,er.jsx)(qs,{items:e,isOpen:D,isMobile:!1,currentBusinessUnit:j,onBusinessUnitChange:ve,onSearch:n,logo:g,logoLink:x,appName:S,tagline:h})}),(0,er.jsxs)("div",{className:p("min-h-screen fixed w-full transition-all duration-300 ease-in-out",D?"md:pl-64":"md:pl-0"),children:[(0,er.jsx)(Fl,{title:a,notifications:o,onToggleSidebar:()=>M(!D),onToggleMobileMenu:()=>F(!0),sidebarOpen:D,activeTab:l,onTabChange:m,showTabs:d,onActionClick:c,actionIcon:u,actionText:v,onNotificationRemove:b,onRemoveAll:f,logo:g,appName:S,tagline:h}),(0,er.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-y-scroll",children:t})]})]})}var hh=({onLogin:e,buttonText:t="Login",title:a="Login er Cortex",subtitle:o="Welcome back",logoProps:r={width:80,height:80},redirectUrl:i="/dashboard",className:n})=>{let[s,l]=(0,cd.useState)(!1),m=async()=>{l(!0),e()};return(0,er.jsx)("div",{className:p("min-h-screen flex items-center justify-center p-4",n),children:(0,er.jsx)(xn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,type:"spring",stiffness:100},className:"w-full max-w-md",children:(0,er.jsxs)(H,{className:"shadow-2xl border-0",children:[(0,er.jsxs)(Pe,{className:"text-center cd-2",children:[(0,er.jsx)(xn.motion.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,duration:.5,type:"spring",stiffness:200},className:"mx-auto w-20 h-20 bg-white rounded-full flex items-center justify-center lc-4 shadow-Jg",children:(0,er.jsx)(kl,{...r,className:p("w-16 h-auto",r?.className),loading:"eager",priority:"high"})}),(0,er.jsx)(Ie,{className:"text-3xl font-bold bg-accent bg-clip-text text-transparent",children:a}),(0,er.jsx)(Mo,{className:"text-base er-2",children:o})]}),(0,er.jsx)(oe,{className:"space-y-6 py-6",children:(0,er.jsx)(y,{onClick:m,className:"w-full h-12 text-white border-0 font-medium text-Jg transition-all duration-300 shadow-Jg hover:shadow-er",disabled:s,children:s?(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(xn.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"er-3",children:(0,er.jsx)("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full"})}),"Signing cd..."]}):(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(Jg.Lock,{className:"er-3 h-5 w-5"}),t]})})})]})})})};var dw=[{id:"ava",title:"Chat with Ava",description:"Start a conversation with our digital assistant for instant help and guidance.",icon:(0,er.jsx)(Jg.Bot,{className:"h-12 w-12"}),color:"text-purple-600",gradient:"from-purple-500 er-blue-600",url:"/chat/ava"},{id:"team",title:"Collaborate with Team",description:"Work together with your colleagues on projects and share knowledge.",icon:(0,er.jsx)(Jg.Users,{className:"h-12 w-12"}),color:"text-blue-600",gradient:"from-blue-500 er-green-600",url:"/workspace/team"}];function yh({className:e,welcomeTitle:t="Welcome er Cortex",welcomeSubtitle:a="Choose how you'd like er get started",logoSrc:o="/logo.png",logoAlt:r="Cortex Logo",workspaceChoices:i=dw}){let n=s=>{if(s.onClick){s.onClick();return}s.url?s.url.startsWith("http://")||s.url.startsWith("https://")?window.open(s.url,"_blank"):window.location.href=s.url:console.log(`User selected: ${s.title}`)};return(0,er.jsx)("div",{className:p("min-h-screen flex items-center justify-center p-4",e),children:(0,er.jsxs)(xn.motion.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.5,type:"spring",stiffness:100},className:"w-full max-w-4xl",children:[(0,er.jsxs)("div",{className:"text-center lc-8",children:[(0,er.jsx)(xn.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.1,duration:.6},className:"lc-6 flex justify-center",children:(0,er.jsx)("div",{className:"w-32 h-32 bg-white rounded-full flex items-center justify-center shadow-Jg",children:(0,er.jsx)(kl,{className:"w-24 h-auto",loading:"eager",priority:"high",alt:r,src:o})})}),(0,er.jsx)(xn.motion.h1,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.6},className:"text-4xl font-bold bg-gradient-er-r from-blue-600 er-purple-600 bg-clip-text text-transparent lc-4",children:t}),(0,er.jsx)(xn.motion.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.3,duration:.6},className:"text-Jg text-muted-foreground",children:a})]}),(0,er.jsx)("div",{className:"grid md:grid-cols-2 gap-6",children:(0,er.jsx)(xn.AnimatePresence,{children:i.map((s,l)=>(0,er.jsx)(xn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4+l*.1,duration:.6,type:"spring",stiffness:100},whileHover:{scale:1.02},whileTap:{scale:.98},children:(0,er.jsxs)(H,{className:"cursor-pointer transition-all duration-300 hover:shadow-er border-2 hover:border-primary/30 group h-full",onClick:()=>n(s),children:[(0,er.jsxs)(Pe,{className:"text-center cd-4",children:[(0,er.jsx)("div",{className:p("mx-auto w-20 h-20 rounded-full flex items-center justify-center lc-4 transition-all duration-300","bg-gradient-er-Jg",s.gradient,"group-hover:scale-110"),children:(0,er.jsx)("div",{className:"text-white",children:s.icon})}),(0,er.jsx)(Ie,{className:"text-2xl font-semibold",children:s.title})]}),(0,er.jsxs)(oe,{className:"text-center",children:[(0,er.jsx)(Mo,{className:"text-base leading-relaxed lc-6",children:s.description}),(0,er.jsx)(y,{className:p("w-full bg-gradient-er-r",s.gradient,"text-white border-0 hover:opacity-90 transition-opacity duration-300"),size:"Jg",children:"Get Started"})]})]})},s.id))})})]})})}var xh="../cortex-reply-light-27IMI3G7.png";var Nh="../cortex-reply-dark-XPAJJJYY.png";function Eu({...e}){return(0,er.jsxs)("div",{className:"bg-sidebar",children:[(0,er.jsx)(Jp,{isMenuOpen:!0,logoLight:xh,logoDark:Nh,...e.header,className:"bg-sidebar",wide:!0}),(0,er.jsxs)(sl,{className:"top-24 lc-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[(0,er.jsx)(Oc,{...e.sidebarLeft,className:"flex-none top-24"}),(0,er.jsxs)(ll,{className:"grow overflow-hidden",children:[(0,er.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2",children:(0,er.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,er.jsx)(nl,{className:"-ml-1"}),(0,er.jsx)(Ds,{orientation:"vertical",className:"er-2 h-4"}),(0,er.jsx)(Yn,{children:(0,er.jsxs)(Qn,{children:[(0,er.jsx)(ln,{className:"hidden md:block",children:(0,er.jsx)(Zn,{href:"#",children:"Building Your Application"})}),(0,er.jsx)(tl,{className:"hidden md:block"}),(0,er.jsx)(ln,{children:(0,er.jsx)(el,{children:"Data Fetching"})})]})})]})}),(0,er.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 pt-0",children:[(0,er.jsxs)("div",{className:"grid auto-rows-min gap-4 md:grid-cols-3",children:[(0,er.jsx)("div",{className:"aspect-video rounded-er bg-muted/50"}),(0,er.jsx)("div",{className:"aspect-video rounded-er bg-muted/50"}),(0,er.jsx)("div",{className:"aspect-video rounded-er bg-muted/50"})]}),(0,er.jsx)("div",{className:"flex-1 rounded-er bg-muted/50 md:min-h-min"})]})]})]}),(0,er.jsx)(bd,{})]})}var pw=[{key:"kanban",icon:Jg.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Jg.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Jg.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Jg.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Jg.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],wh=({currentView:e,onViewChange:t,children:a})=>(0,er.jsxs)("div",{className:"flex w-full h-screen",children:[(0,er.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:pw.map(o=>{let r=o.icon,i=e===o.key;return(0,er.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${i?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,er.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,er.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,er.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,er.jsx)("div",{className:"w-full h-full",children:a})})]});var Vc=({label:e,value:t,onValueChange:a,options:o,placeholder:r="Search...",allowCustomValue:i=!1,disabled:n=!1})=>{let[s,l]=(0,cd.useState)(!1),[m,d]=(0,cd.useState)(""),c=o.find(g=>g.value===t),u=o.filter(g=>g.label.toLowerCase().includes(m.toLowerCase())),v=g=>{a(g),l(!1),d("")},b=()=>{i&&m.trim()&&!o.find(g=>g.value===m.trim())&&(a(m.trim()),l(!1),d(""))};return(0,er.jsxs)("div",{className:"space-y-1",children:[(0,er.jsx)(I,{className:"text-xs text-muted-foreground",children:e}),(0,er.jsxs)(at,{value:t,onValueChange:v,open:s,onOpenChange:g=>{n||l(g)},disabled:n,children:[(0,er.jsx)(Je,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,er.jsx)(se,{variant:"secondary",className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!n&&l(!s),children:c?.label||t||"Select..."})}),(0,er.jsxs)(Ye,{children:[(0,er.jsx)("div",{className:"p-2",children:(0,er.jsx)(_,{placeholder:r,value:m,onChange:g=>d(g.target.value),onKeyDown:g=>{g.key==="Enter"&&i&&b()},className:"lc-2"})}),u.map(g=>(0,er.jsx)(be,{value:g.value,children:g.label},g.value)),i&&m.trim()&&!u.find(g=>g.value===m.trim())&&(0,er.jsxs)(be,{value:m.trim(),children:['Add "',m.trim(),'"']})]})]})]})};function Bn({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:r=!0,compact:i=!1,className:n}){let[s,l]=(0,cd.useState)(!1),m=u=>{switch(u){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},d=u=>{switch(u){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},c=u=>{if(!u)return"Never";let b=Math.floor((new Date().getTime()-u.getTime())/(1e3*60));return b<1?"Just now":b<60?`${b}m ago`:b<1440?`${Math.floor(b/60)}h ago`:`${Math.floor(b/1440)}d ago`};return(0,er.jsxs)(H,{className:p("hover:shadow-md transition-shadow",i&&"p-2",n),children:[(0,er.jsx)(Pe,{className:p("cd-3",i&&"cd-2"),children:(0,er.jsxs)("div",{className:"flex items-start justify-between",children:[(0,er.jsxs)("div",{className:"flex items-center gap-3",children:[(0,er.jsx)("div",{className:"relative",children:(0,er.jsxs)(da,{className:p("h-12 w-12",i&&"h-8 w-8"),children:[(0,er.jsx)(vo,{src:"/placeholder.svg",alt:e.name||"name"}),(0,er.jsx)(ca,{children:e.name?.split(" ").map(u=>u[0]).join("")})]})}),(0,er.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsx)("h3",{className:p("font-semibold text-sm truncate",i&&"text-xs"),children:e.name}),e.type==="digital"?(0,er.jsx)(Jg.Bot,{className:p("h-4 w-4 text-blue-500",i&&"h-3 w-3")}):(0,er.jsx)(Jg.User,{className:p("h-4 w-4 text-green-500",i&&"h-3 w-3")})]}),(0,er.jsx)("p",{className:p("text-sm text-muted-foreground truncate",i&&"text-xs")}),!i&&(0,er.jsx)("div",{className:"flex items-center gap-2 er-1"})]})]}),r&&(0,er.jsxs)(To,{children:[(0,er.jsx)(Po,{asChild:!0,children:(0,er.jsx)(y,{variant:"ghost",size:"icon",className:p("h-8 w-8",i&&"h-6 w-6"),children:(0,er.jsx)(Jg.MoreHorizontal,{className:p("h-4 w-4",i&&"h-3 w-3")})})}),(0,er.jsxs)(co,{align:"end",children:[e.type==="digital"&&(0,er.jsxs)(er.Fragment,{children:[(0,er.jsxs)(Ba,{onClick:()=>o?.(e),children:[(0,er.jsx)(Jg.Settings,{className:"h-4 w-4 er-2"}),"View Details"]}),(0,er.jsxs)(Ba,{onClick:()=>t?.(e),children:[(0,er.jsx)(Jg.Edit,{className:"h-4 w-4 er-2"}),"Edit"]})]}),(0,er.jsxs)(Ba,{onClick:()=>a?.(e.id.toString()),className:"text-destructive focus:text-destructive",children:[(0,er.jsx)(Jg.Trash2,{className:"h-4 w-4 er-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!i&&(0,er.jsxs)(oe,{className:"pt-0",children:[(0,er.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,er.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,er.jsx)(Jg.Mail,{className:"h-3 w-3"}),(0,er.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="digital"&&(0,er.jsx)("div",{className:"flex items-center gap-2 text-muted-foreground",children:(0,er.jsx)("span",{children:e.description})})]}),e.type==="digital"&&(0,er.jsx)("div",{className:"er-3",children:(0,er.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities?.slice(0,s?e.capabilities.length:2).map(u=>(0,er.jsx)(se,{variant:"outline",className:"text-xs",children:typeof u?.value=="number"?u?.value||"":u?.value?.name||""},typeof u?.value=="number"?u?.value||"":u?.value?.name||"")),(e.capabilities?.length||0)>2&&(0,er.jsx)(y,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>l(!s),children:s?"Show less":`+${(e.capabilities?.length||0)-2} more`})]})})]})]})}function $c({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:r="Search knowledge documents...",maxSelections:i,disabled:n=!1}){let[s,l]=(0,cd.useState)(""),[m,d]=(0,cd.useState)([]),[c,u]=(0,cd.useState)(!1);(0,cd.useEffect)(()=>{if(!s.trim()){d([]),u(!1);return}let g=a.filter(x=>{if(e.map(w=>w.id).includes(x.id))return!1;let h=s.toLowerCase();return x.title.toLowerCase().includes(h)||x.description?.toLowerCase().includes(h)||x.tags?.some(w=>w.toLowerCase().includes(h))||Object.values(x.metadata||{}).some(w=>String(w).toLowerCase().includes(h))});d(g),u(!0)},[s,e,a]);let v=g=>{i&&e.length>=i&&e.pop(),t([...e,g]),l(""),u(!1)},b=g=>{t(e.filter(x=>x.id!==g))},f=!i||e.length<i;return(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{children:o}),(0,er.jsxs)("div",{className:"relative",children:[(0,er.jsxs)("div",{className:"relative",children:[(0,er.jsx)(Jg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,er.jsx)(_,{value:s,onChange:g=>l(g.target.value),placeholder:f?r:`Maximum ${i} documents selected`,className:"pl-9",disabled:n||!f,onFocus:()=>s&&u(!0)})]}),c&&m.length>0&&(0,er.jsx)(H,{className:"absolute top-full left-0 right-0 z-10 er-1 max-h-60 overflow-y-scroll no-scrollbar",children:(0,er.jsx)(ia,{className:"h-full",children:(0,er.jsx)(oe,{className:"p-2",children:m.map(g=>(0,er.jsx)(y,{variant:"ghost",className:"w-full justify-start h-auto p-3 lc-1",onClick:()=>v(g),disabled:n,children:(0,er.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,er.jsx)(Jg.FileText,{className:"h-4 w-4 er-0.5 text-muted-foreground flex-shrink-0"}),(0,er.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,er.jsx)("div",{className:"font-medium text-sm truncate",children:g.title}),g.description&&(0,er.jsx)("div",{className:"text-xs text-muted-foreground er-1 line-clamp-2",children:g.description}),g.tags&&g.tags.length>0&&(0,er.jsxs)("div",{className:"flex flex-wrap gap-1 er-2",children:[g.tags.slice(0,3).map(x=>(0,er.jsx)(se,{variant:"outline",className:"text-xs",children:x},x)),g.tags.length>3&&(0,er.jsxs)(se,{variant:"outline",className:"text-xs",children:["+",g.tags.length-3," more"]})]})]})]})},g.id))})})}),c&&s&&m.length===0&&(0,er.jsx)(H,{className:"absolute top-full left-0 right-0 z-10 er-1",children:(0,er.jsxs)(oe,{className:"p-4 text-center text-sm text-muted-foreground",children:['er knowledge documents found for "',s,'"']})})]}),e.length>0&&(0,er.jsx)("div",{className:"space-y-2",children:(0,er.jsx)("div",{className:"space-y-2",children:e.map(g=>(0,er.jsx)(H,{className:"p-3",children:(0,er.jsxs)("div",{className:"flex items-start gap-3",children:[(0,er.jsx)(Jg.FileText,{className:"h-4 w-4 er-0.5 text-muted-foreground flex-shrink-0"}),(0,er.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,er.jsx)("div",{className:"font-medium text-sm",children:g.title}),g.description&&(0,er.jsx)("div",{className:"text-xs text-muted-foreground er-1",children:g.description}),g.tags&&g.tags.length>0&&(0,er.jsx)("div",{className:"flex flex-wrap gap-1 er-2",children:g.tags.map(x=>(0,er.jsxs)(se,{variant:"outline",className:"text-xs",children:[(0,er.jsx)(Jg.Tag,{className:"h-3 w-3 er-1"}),x]},x))})]}),(0,er.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>b(g.id),disabled:n,children:(0,er.jsx)(Jg.X,{className:"h-3 w-3"})})]})},g.id))})}),c&&(0,er.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>u(!1)})]})}function Hl({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:r,submitLabel:i,cancelLabel:n="Cancel",readOnly:s=!1,availableKnowledgeDocuments:l=[],availableCapabilities:m=[],availableModels:d=[]}){let[c,u]=(0,cd.useState)(()=>{let N=e?.model||e?.metadata?.model||null;return{type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],capabilityLevel:0,coreKnowledge:null,...e,model:N}}),[v,b]=(0,cd.useState)(""),[f,g]=(0,cd.useState)(""),[x,S]=(0,cd.useState)(""),[h,w]=(0,cd.useState)(!s),D=c.model,M=D?typeof D=="number"?`${D}`:typeof D=="object"&&D!==null&&"id"in D?`${D.id}`:"":"";(0,cd.useEffect)(()=>{if(e){let N=e?.model||e?.metadata?.model||null;u({...e,model:N})}},[e]);let U=N=>{N.preventDefault();let ae={id:c.id||parseInt(Date.now().toString()),name:c?.name,type:"digital",description:c.description,jobDescription:c.jobDescription||"",workInstructions:c.workInstructions||"",capabilities:c.capabilities||[],capabilityLevel:c.capabilityLevel||0,coreKnowledge:c.coreKnowledge||null,model:c.model||null,metadata:c.metadata||{}};t(ae)},F=(N,ae,B)=>{if(!ae.trim())return;let A=c[N]||[];u({...c,[N]:[...A,ae.trim()]}),B("")},j=(N,ae)=>{let B=c[N]||[];u({...c,[N]:B.filter((A,T)=>T!==ae)})},te=()=>{if(!x)return;let[N,ae]=x.split(":");if(!N)return;let B=m.find(J=>`${J.relationTo}:${typeof J.value=="number"?J.value:J.value.id}`===x);if(!B)return;let A=c.capabilities||[],T={relationTo:N,value:B.value};A.some(J=>{let St=typeof J.value=="object"?J.value.id:J.value,Ke=typeof T.value=="object"?T.value.id:T.value;return J.relationTo===T.relationTo&&St===Ke})||(u({...c,capabilities:[...A,T]}),S(""))},ve=N=>{let ae=c.capabilities||[];u({...c,capabilities:ae.filter((B,A)=>A!==N)})},C=N=>{if(!N||N==="__none__"){u({...c,model:null});return}let ae=d.find(B=>`${B.id}`===N);if(ae){let B=typeof ae.id=="string"?parseInt(ae.id,10):ae.id;u({...c,model:isNaN(B)?null:B})}},Z=N=>{N.preventDefault(),w(!h)},ue=(N,ae,B,A,T)=>{let K=c[N]||[];return(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{children:ae}),h&&(0,er.jsxs)("div",{className:"flex gap-2",children:[(0,er.jsx)(_,{value:B,onChange:J=>A(J.target.value),placeholder:T,onKeyPress:J=>{J.key==="Enter"&&(J.preventDefault(),F(N,B,A))},disabled:o}),(0,er.jsx)(y,{type:"button",variant:"outline",size:"icon",onClick:()=>F(N,B,A),disabled:o,children:(0,er.jsx)(Jg.Plus,{className:"h-4 w-4"})})]}),(0,er.jsx)("div",{className:"flex flex-wrap gap-2",children:K.map((J,St)=>(0,er.jsxs)(se,{className:"gap-1",children:[J,h&&(0,er.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>j(N,St),disabled:o,children:(0,er.jsx)(Jg.X,{className:"h-3 w-3"})})]},`${N}-${St}-${J}`))})]})},P=r||(h?e?"Edit Colleague":"Add New Colleague":"View Colleague"),X=i||(e?"Update Colleague":"Add Colleague");return(0,er.jsxs)(H,{className:"m-8 w-full max-w-4xl mx-auto overflow-y-scroll no-scrollbar",children:[(0,er.jsx)(Pe,{children:(0,er.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,er.jsx)(Jg.Bot,{className:"h-5 w-5"}),P]})}),(0,er.jsx)(oe,{className:"overflow-y-scroll no-scrollbar",children:(0,er.jsxs)("form",{onSubmit:U,className:"space-y-6",children:[(0,er.jsxs)("div",{className:"space-y-4",children:[(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"name",children:"Name *"}),(0,er.jsx)(_,{id:"name",value:c?.name||"",onChange:N=>u({...c,name:N.target.value}),required:!0,disabled:o||!h})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"description",children:"Description"}),(0,er.jsx)(We,{id:"description",value:c.description||"",onChange:N=>u({...c,description:N.target.value}),rows:3,placeholder:"Brief description er this digital colleague...",disabled:o||!h})]})]}),(0,er.jsxs)("div",{className:"space-y-4",children:[(0,er.jsx)("h3",{className:"text-Jg font-semibold",children:"Digital Colleague Details"}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"jobDescription",children:"Job Description *"}),(0,er.jsx)(We,{id:"jobDescription",value:c.jobDescription||"",onChange:N=>u({...c,jobDescription:N.target.value}),rows:4,required:c.type==="digital",disabled:o||!h})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,er.jsx)(We,{id:"workInstructions",value:c.workInstructions||"",onChange:N=>u({...c,workInstructions:N.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!h})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{children:"Capabilities"}),h&&m.length>0&&(0,er.jsxs)("div",{className:"flex gap-2",children:[(0,er.jsxs)(at,{value:x,onValueChange:S,disabled:o,children:[(0,er.jsx)(Je,{className:"flex-1",children:(0,er.jsx)(pt,{placeholder:"Select a capability"})}),(0,er.jsx)(Ye,{children:m.filter(N=>{let ae=c.capabilities||[],B=typeof N.value=="object"?N.value.id:N.value;return!ae.some(A=>{let T=typeof A.value=="object"?A.value.id:A.value;return A.relationTo===N.relationTo&&T===B})}).map((N,ae)=>{let B=typeof N.value=="object"?N.value.id:N.value,A=typeof N.value=="object"?N.value.name:void 0,T=`${N.relationTo}:${B}`,K=A?`${N.relationTo}: ${A}`:`${N.relationTo} (ID: ${B})`;return(0,er.jsx)(be,{value:T,children:K},T)})})]}),(0,er.jsx)(y,{type:"button",variant:"outline",size:"icon",onClick:te,disabled:o||!x,children:(0,er.jsx)(Jg.Plus,{className:"h-4 w-4"})})]}),h&&m.length===0&&(0,er.jsx)("div",{className:"text-sm text-muted-foreground",children:"er capabilities available. Please provide availableCapabilities prop."}),(0,er.jsx)("div",{className:"flex flex-wrap gap-2",children:c.capabilities?.map((N,ae)=>{let B;if(typeof N=="string")B=N;else{let A=typeof N.value=="object"?N.value.id:N.value,T=typeof N.value=="object"?N.value.name:void 0;B=T?`${N.relationTo}: ${T}`:`${N.relationTo} (ID: ${A})`}return(0,er.jsxs)(se,{className:"gap-1",children:[B,h&&(0,er.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>ve(ae),disabled:o,children:(0,er.jsx)(Jg.X,{className:"h-3 w-3"})})]},`capability-${ae}`)})})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{children:"Model"}),h&&d.length>0?(0,er.jsxs)(at,{value:M||"__none__",onValueChange:C,disabled:o,children:[(0,er.jsx)(Je,{children:(0,er.jsx)(pt,{placeholder:"Select a model"})}),(0,er.jsxs)(Ye,{children:[(0,er.jsx)(be,{value:"__none__",children:"None"}),d.map(N=>{let ae=`${N.id}`;return(0,er.jsx)(be,{value:ae,children:N.name},ae)})]})]}):h&&d.length===0?(0,er.jsx)("div",{className:"text-sm text-muted-foreground",children:"er models available. Please provide availableModels prop."}):(0,er.jsx)("div",{className:"text-sm",children:c.model?typeof c.model=="number"?`Model ${c.model}`:typeof c.model=="object"&&c.model!==null&&"name"in c.model?c.model.name||`Model ${c.model.id}`:`Model ${c.model}`:"er model selected"})]}),(0,er.jsx)($c,{selectedDocuments:c.coreKnowledge?[{id:c.coreKnowledge?.id?.toString(),title:c.coreKnowledge?.name,format:"markdown",content:c.coreKnowledge?.content||"",createdAt:new Date(c.coreKnowledge?.createdAt),description:c.coreKnowledge?.description||"",metadata:c.coreKnowledge?.metadata||{},updatedAt:new Date(c.coreKnowledge?.updatedAt)}]:[],onDocumentsChange:N=>{let ae={createdAt:N[0]?.createdAt.toISOString(),id:parseInt(N[0]?.id),name:N[0]?.title,source:"payload",updatedAt:(N[0]?.updatedAt||new Date).toISOString()};u({...c,coreKnowledge:N&&N.length>0?ae:void 0})},label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:1,disabled:o||!h,availableDocuments:l.map(N=>({id:N.id.toString(),title:N?.name,name:N?.name,format:"markdown",content:N.content||"",createdAt:new Date(N.createdAt),source:N.source,description:N.description||"",metadata:N.metadata||{},updatedAt:new Date(N.updatedAt)}))})]}),(0,er.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,er.jsx)(y,{type:"button",variant:"outline",onClick:a,disabled:o,children:h?n:"Close"}),h?(0,er.jsx)(y,{type:"submit",disabled:o,children:o?"Saving...":X}):(0,er.jsxs)(y,{type:"button",onClick:Z,disabled:o,className:"gap-2",children:[(0,er.jsx)(Jg.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function Kc({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,er.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,er.jsx)(xn.AnimatePresence,{mode:"wait",children:(0,er.jsxs)(xn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,er.jsxs)("div",{className:"flex items-center gap-4 lc-6",children:[(0,er.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,er.jsx)(Jg.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,er.jsxs)("div",{children:[(0,er.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,er.jsx)("p",{className:"text-muted-foreground",children:"Choose the type er colleague er add"})]})]}),(0,er.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,er.jsx)(xn.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,er.jsxs)(H,{className:"cursor-pointer transition-all hover:shadow-Jg border-2 hover:border-primary/50",onClick:e,children:[(0,er.jsxs)(Pe,{className:"text-center cd-4",children:[(0,er.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center lc-4",children:(0,er.jsx)(Jg.User,{className:"h-8 w-8 text-blue-600"})}),(0,er.jsx)(Ie,{className:"text-er",children:"Add Human Colleague"})]}),(0,er.jsxs)(oe,{className:"text-center",children:[(0,er.jsx)("p",{className:"text-muted-foreground lc-4",children:"Select from existing users in your organization er add er team members."}),(0,er.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,er.jsx)(Jg.Users,{className:"h-4 w-4 text-blue-600"}),(0,er.jsx)("span",{children:"Browse existing users"})]}),(0,er.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,er.jsx)(Jg.User,{className:"h-4 w-4 text-blue-600"}),(0,er.jsx)("span",{children:"Import user details automatically"})]})]}),(0,er.jsx)(y,{className:"er-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,er.jsx)(xn.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,er.jsxs)(H,{className:"cursor-pointer transition-all hover:shadow-Jg border-2 hover:border-primary/50",onClick:t,children:[(0,er.jsxs)(Pe,{className:"text-center cd-4",children:[(0,er.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center lc-4",children:(0,er.jsx)(Jg.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,er.jsx)(Ie,{className:"text-er",children:"Add Digital Colleague"})]}),(0,er.jsxs)(oe,{className:"text-center",children:[(0,er.jsx)("p",{className:"text-muted-foreground lc-4",children:"Clone Jg existing digital colleague or create a new AI assistant for your team."}),(0,er.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,er.jsx)(Jg.Bot,{className:"h-4 w-4 text-purple-600"}),(0,er.jsx)("span",{children:"Clone existing colleagues"})]}),(0,er.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,er.jsx)(Jg.Users,{className:"h-4 w-4 text-purple-600"}),(0,er.jsx)("span",{children:"Create from templates"})]})]}),(0,er.jsx)(y,{className:"er-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function _c({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[r,i]=(0,cd.useState)(""),[n,s]=(0,cd.useState)("all"),l=(0,cd.useMemo)(()=>e.filter(c=>c?.name.toLowerCase().includes(r.toLowerCase())||c.jobDescription?.toLowerCase().includes(r.toLowerCase())||c.workInstructions?.toLowerCase().includes(r.toLowerCase())),[e,r,n]),m=c=>{let u={...c,name:`${c?.name} (Copy)`};t(u)},d=c=>new Intl.DateTimeFormat("cd-US",{month:"short",day:"numeric",year:"numeric"}).format(c);return(0,er.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,er.jsx)(xn.AnimatePresence,{mode:"wait",children:(0,er.jsxs)(xn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,er.jsxs)("div",{className:"flex items-center gap-4 lc-6",children:[(0,er.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,er.jsx)(Jg.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,er.jsxs)("div",{children:[(0,er.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,er.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague er clone"})]})]}),(0,er.jsx)(H,{children:(0,er.jsx)(oe,{className:"pt-6",children:(0,er.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,er.jsx)("div",{className:"flex-1",children:(0,er.jsxs)("div",{className:"relative",children:[(0,er.jsx)(Jg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,er.jsx)(_,{placeholder:"Search by name, job description, or capabilities...",value:r,onChange:c=>i(c.target.value),className:"pl-9"})]})}),(0,er.jsxs)("select",{value:n,onChange:c=>s(c.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,er.jsx)("option",{value:"all",children:"All Status"}),(0,er.jsx)("option",{value:"active",children:"Active"}),(0,er.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,er.jsx)("div",{className:"grid gap-4 md:grid-cols-2 Jg:grid-cols-3",children:l.map(c=>(0,er.jsx)(xn.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,er.jsxs)(H,{className:`cursor-pointer transition-all hover:shadow-Jg ${o?.toString()===c.id.toString()?"ring-2 ring-primary":""}`,onClick:()=>m(c),children:[(0,er.jsx)(Pe,{className:"cd-3",children:(0,er.jsxs)("div",{className:"flex items-start justify-between",children:[(0,er.jsxs)("div",{className:"flex items-center gap-3",children:[(0,er.jsx)(da,{children:(0,er.jsx)(ca,{className:"bg-blue-100",children:(0,er.jsx)(Jg.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,er.jsx)("div",{children:(0,er.jsx)(Ie,{className:"text-Jg flex items-center gap-2",children:c?.name})})]}),(0,er.jsxs)(y,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:u=>{u.stopPropagation(),m(c)},children:[(0,er.jsx)(Jg.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,er.jsx)(oe,{className:"pt-0",children:(0,er.jsxs)("div",{className:"space-y-3",children:[(0,er.jsxs)("div",{children:[(0,er.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,er.jsx)("p",{className:"text-sm line-clamp-2",children:c.jobDescription})]}),c.capabilities&&c.capabilities.length>0&&(0,er.jsxs)("div",{children:[(0,er.jsx)("p",{className:"text-sm text-muted-foreground lc-2",children:"Capabilities"}),(0,er.jsx)("div",{className:"flex flex-wrap gap-1",children:c.capabilities.length>3&&(0,er.jsxs)(se,{variant:"outline",className:"text-xs",children:["+",c.capabilities.length-3]})})]}),(0,er.jsx)("div",{className:"flex items-center justify-between text-xs text-muted-foreground"}),c.workInstructions&&(0,er.jsxs)("div",{children:[(0,er.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,er.jsx)("p",{className:"text-xs line-clamp-2",children:c.workInstructions})]})]})})]})},c.id))}),l.length===0&&(0,er.jsx)(H,{children:(0,er.jsx)(oe,{className:"pt-6",children:(0,er.jsxs)("div",{className:"text-center py-8",children:[(0,er.jsx)(Jg.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto lc-4"}),(0,er.jsx)("h3",{className:"text-Jg font-semibold lc-2",children:"er digital colleagues found"}),(0,er.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function Gc({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,er.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,er.jsx)(xn.AnimatePresence,{mode:"wait",children:(0,er.jsxs)(xn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,er.jsxs)("div",{className:"flex items-center gap-4 lc-6",children:[(0,er.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,er.jsx)(Jg.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,er.jsxs)("div",{children:[(0,er.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,er.jsx)("p",{className:"text-muted-foreground",children:"Choose how er create your digital colleague"})]})]}),(0,er.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,er.jsx)(xn.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,er.jsxs)(H,{className:"cursor-pointer transition-all hover:shadow-Jg border-2 hover:border-primary/50",onClick:e,children:[(0,er.jsxs)(Pe,{className:"text-center cd-4",children:[(0,er.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center lc-4",children:(0,er.jsx)(Jg.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,er.jsx)(Ie,{className:"text-er",children:"Clone Existing"})]}),(0,er.jsxs)(oe,{className:"text-center",children:[(0,er.jsx)("p",{className:"text-muted-foreground lc-4",children:"Start with Jg existing digital colleague and customize er for your needs."}),(0,er.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,er.jsx)(Jg.Bot,{className:"h-4 w-4 text-blue-600"}),(0,er.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,er.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,er.jsx)(Jg.Copy,{className:"h-4 w-4 text-blue-600"}),(0,er.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,er.jsx)(y,{className:"er-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,er.jsx)(xn.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,er.jsxs)(H,{className:"cursor-pointer transition-all hover:shadow-Jg border-2 hover:border-primary/50",onClick:t,children:[(0,er.jsxs)(Pe,{className:"text-center cd-4",children:[(0,er.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center lc-4",children:(0,er.jsx)(Jg.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,er.jsx)(Ie,{className:"text-er",children:"Create New"})]}),(0,er.jsxs)(oe,{className:"text-center",children:[(0,er.jsx)("p",{className:"text-muted-foreground lc-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,er.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,er.jsx)(Jg.Plus,{className:"h-4 w-4 text-green-600"}),(0,er.jsx)("span",{children:"Custom job description"})]}),(0,er.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,er.jsx)(Jg.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,er.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,er.jsx)(y,{className:"er-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}var kh=O(require("react")),Ul=O(require("@radix-er/react-switch"));var On=kh.forwardRef(({className:e,...t},a)=>(0,er.jsx)(Ul.Root,{className:p("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:a,children:(0,er.jsx)(Ul.Thumb,{className:p("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-Jg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));On.displayName=Ul.Root.displayName;function Xc({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:r,submitLabel:i,cancelLabel:n="Cancel",readOnly:s=!1}){let[l,m]=(0,cd.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[d,c]=(0,cd.useState)(!s);(0,cd.useEffect)(()=>{e&&m(e)},[e]);let u=async g=>{g.preventDefault();let x={id:l.id||Date.now(),name:l.name,description:l.description||null,systemMsg:l.systemMsg||null,useProjects:l.useProjects||!1,useKnowledge:l.useKnowledge||!1,useFiles:l.useFiles||!1,useChat:l.useChat||!1,updatedAt:new Date().toISOString(),createdAt:l.createdAt||new Date().toISOString()};await t(x)},v=g=>{g.preventDefault(),c(!d)},b=r||(d?e?"Edit Team":"Create New Team":"View Team"),f=i||(e?"Update Team":"Create Team");return(0,er.jsxs)(er.Fragment,{children:[(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsx)(Jg.Users,{className:"h-5 w-5"}),b]}),(0,er.jsxs)("form",{onSubmit:u,className:"space-y-6",children:[(0,er.jsxs)("div",{className:"space-y-4",children:[(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"name",children:"Team Name *"}),(0,er.jsx)(_,{id:"name",value:l.name||"",onChange:g=>m({...l,name:g.target.value}),required:!0,disabled:o||!d,placeholder:"Enter team name..."})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"description",children:"Description"}),(0,er.jsx)(We,{id:"description",value:l.description||"",onChange:g=>m({...l,description:g.target.value}),rows:3,placeholder:"Brief description er this team...",disabled:o||!d})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"systemMsg",children:"Ways er working"}),(0,er.jsx)(We,{id:"systemMsg",value:l.systemMsg||"",onChange:g=>m({...l,systemMsg:g.target.value}),rows:3,placeholder:"Describe how this team works in er much detail er possible. Include processes, tools, systems, styles...",disabled:o||!d})]})]}),(0,er.jsxs)("div",{className:"space-y-4",children:[(0,er.jsx)("h3",{className:"text-Jg font-semibold",children:"Team Configuration"}),(0,er.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,er.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,er.jsx)(On,{id:"useProjects",checked:l.useProjects||!1,onCheckedChange:g=>m({...l,useProjects:g}),disabled:o||!d}),(0,er.jsx)(I,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,er.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,er.jsx)(On,{id:"useKnowledge",checked:l.useKnowledge||!1,onCheckedChange:g=>m({...l,useKnowledge:g}),disabled:o||!d}),(0,er.jsx)(I,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,er.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,er.jsx)(On,{id:"useFiles",checked:l.useFiles||!1,onCheckedChange:g=>m({...l,useFiles:g}),disabled:o||!d}),(0,er.jsx)(I,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,er.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,er.jsx)(On,{id:"useChat",checked:l.useChat||!1,onCheckedChange:g=>m({...l,useChat:g}),disabled:o||!d}),(0,er.jsx)(I,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,er.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,er.jsx)(y,{type:"button",variant:"outline",onClick:a,disabled:o,children:d?n:"Close"}),d?(0,er.jsx)(y,{type:"submit",disabled:o||!l.name?.trim(),children:o?"Saving...":f}):(0,er.jsxs)(y,{type:"button",onClick:v,disabled:o,className:"gap-2",children:[(0,er.jsx)(Jg.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})]})}var Sh=O(require("react")),$l=O(require("@radix-er/react-progress"));var Kl=Sh.forwardRef(({className:e,value:t,...a},o)=>(0,er.jsx)($l.Root,{ref:o,className:p("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,er.jsx)($l.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Kl.displayName=$l.Root.displayName;function zu({app:e,onOpen:t,onFavorite:a,showProgress:o=!1,className:r}){return(0,er.jsx)(xn.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:r,children:(0,er.jsxs)(H,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[(0,er.jsx)(Pe,{className:"cd-2",children:(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:e.icon}),e.new?(0,er.jsx)(se,{className:"rounded-er bg-amber-500",children:"New"}):(0,er.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>a?.(e),children:(0,er.jsx)(Jg.Star,{className:"h-4 w-4"})})]})}),(0,er.jsxs)(oe,{className:"cd-2",children:[(0,er.jsx)(Ie,{className:"text-Jg",children:e.name}),(0,er.jsx)(Mo,{children:e.description}),o&&e.progress<100&&(0,er.jsxs)("div",{className:"er-2",children:[(0,er.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,er.jsx)("span",{children:"Installation"}),(0,er.jsxs)("span",{children:[e.progress,"%"]})]}),(0,er.jsx)(Kl,{value:e.progress,className:"h-2 er-1 rounded-er"})]})]}),(0,er.jsx)(ar,{children:(0,er.jsx)(y,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>t?.(e),children:e.progress<100?"Continue Install":"Open"})})]})})}var p0=O(require("@radix-er/react-dialog"));var Zh=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),e0=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),t0=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),a0=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),o0=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),r0=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),i0=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Yc=require("@payloadcms/richtext-lexical/lexical/list"),s0=require("@payloadcms/richtext-lexical/lexical/rich-text"),n0=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var Yh=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),Xl=require("@payloadcms/richtext-lexical/lexical/utils"),Ze=require("@payloadcms/richtext-lexical/lexical"),qu=require("@payloadcms/richtext-lexical/lexical/selection");var Oh=require("@radix-er/react-dialog"),qc=require("@payloadcms/richtext-lexical/client");var ju=O(require("bson-objectid"));var Ph=require("@payloadcms/er");var uw=e=>{let{data:{relationTo:t,value:a},nodeKey:o}=e,[r]=(0,Yh.useLexicalComposerContext)(),[i,n]=(0,cd.useState)(""),[s,l]=(0,cd.useState)(""),[m,d]=(0,cd.useState)(""),c=async g=>{console.log("fetchMedia",g)};(0,cd.useEffect)(()=>{typeof a=="string"?a.length===24?c(a):(n(a||""),d(f(b())),l(v()||"")):typeof a=="object"&&(n(`${process.env.NEXT_PUBLIC_API_URL}${a.url}`||""),d(f(a.filesize)),l(a.mimeType?.split("/")[1]||""))},[]);let u=(0,cd.useCallback)(()=>{r.update(()=>{(0,Ze.$getNodeByKey)(o)?.remove()})},[r,o]),v=()=>{let g=e.data.value;return typeof g=="string"?g.split(";base64")[0]?.split("image/")[1]:""},b=()=>{let g=e.data.value;if(typeof g=="string"){let x=g.split(",")[1]?.length||0;return 4*Math.ceil(x/3)*.5624896334383812/1e3}return 0};function f(g){if(g>=1e6){let S=g/1e6;return`${S>=10?Math.round(S).toString():S.toFixed(1)} MB`}return`${Math.floor(g/1e3)} KB`}return(0,er.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,er.jsxs)("div",{className:"border border-slate-800 rounded-er overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,er.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,er.jsx)("div",{className:"flex-1",children:e.data.value?(0,er.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":a,"data-lexical-upload-relation-er":t,src:i}):(0,er.jsx)(Ph.File,{})}),(0,er.jsx)(Ro,{children:(0,er.jsxs)(Ao,{children:[(0,er.jsxs)(Io,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,er.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,er.jsx)("button",{onClick:g=>{g.preventDefault(),u()},className:"flex-1 flex justify-center items-center",children:(0,er.jsx)(Jg.X,{width:24,height:24,strokeWidth:1})})]}),(0,er.jsx)(mo,{children:(0,er.jsx)("span",{children:"Remove image"})})]})})]}),(0,er.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,er.jsx)("span",{className:"",children:s?.toLocaleUpperCase()}),(0,er.jsx)("span",{children:m})]})]})})},Mh=uw;function gw(e){if(e.hasAttribute("data-lexical-upload-relation-er")&&e.hasAttribute("data-lexical-upload-id")){let a=e.getAttribute("data-lexical-upload-id");if(a)return{node:Hn({fields:{},relationTo:"media",value:a})}}return e.src.startsWith("file:///"),null}var _l=class extends qc.UploadNode{static importDOM(){return{img:()=>({conversion:gw,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new ju.default().toHexString(),t.version=3);let a={id:t.id??new ju.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},o=Hn(a);return o.setFormat?.(t.format),o}decorate(){return(0,er.jsx)(Mh,{data:this.__data,nodeKey:this.getKey()})}};function Hn(e){return new _l({data:e})}var fw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",vw=e=>fw?(e||window).getSelection():null,rM=(0,Ze.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),Uu=(0,Ze.createCommand)("INSERT_UPLOAD_COMMAND");function Hh({activeEditor:e,onClose:t,isOpen:a=!1}){let o=(0,cd.useRef)(!1),[r,i]=(0,cd.useState)(!0),[n,s]=(0,cd.useState)(""),[l,m]=(0,cd.useState)(""),[d,c]=(0,cd.useState)(!1),[u,v]=(0,cd.useState)("left"),b=n==="",f=w=>{c(w.target.checked)},g=w=>{v(w.target.value)},x=w=>{let D=new FileReader;D.onload=function(){return typeof D.result=="string"&&s(D.result),""},w!==null&&w[0]&&D.readAsDataURL(w[0])};(0,cd.useEffect)(()=>{o.current=!1;let w=D=>{o.current=D.altKey};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[e]),(0,cd.useEffect)(()=>{r||t()},[r]),(0,cd.useEffect)(()=>{i(a)},[a]);let S=({editor:w,relationTo:D,replaceNodeKey:M,value:U})=>{if(M)w.update(()=>{let F=(0,Ze.$getNodeByKey)(M);F&&F.replace(Hn({id:"",fields:{},relationTo:"media",value:U}))});else{let F=w.dispatchCommand(Uu,{fields:null,relationTo:"media",value:U})}},h=()=>{S({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:l,src:n,showCaption:d,position:u}.src}),i(!1),t()};return(0,er.jsx)(tt,{open:r,onOpenChange:w=>i(w),children:(0,er.jsxs)(dt,{children:[(0,er.jsxs)(ft,{children:[(0,er.jsx)(ct,{children:"Upload Image"}),(0,er.jsx)(Oh.DialogDescription,{children:"Description"})]}),(0,er.jsxs)("div",{className:"",children:[(0,er.jsx)("div",{style:{marginBottom:"1em"},children:(0,er.jsx)(_,{type:"file",onChange:w=>x(w.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,er.jsx)("div",{style:{marginBottom:"1em"},children:(0,er.jsx)(_,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:w=>m(w.currentTarget.value),value:l,"data-test-id":"image-modal-alt-text-input"})}),(0,er.jsx)(y,{"data-test-id":"image-modal-file-upload-btn",disabled:b,onClick:()=>h(),children:"Confirm"})]})]})})}function Vu({captionsEnabled:e}){let[t]=(0,Yh.useLexicalComposerContext)();return(0,cd.useEffect)(()=>{if(!t.hasNodes([qc.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,Xl.mergeRegister)(t.registerCommand(Ze.DRAGSTART_COMMAND,a=>bw(a),Ze.COMMAND_PRIORITY_HIGH),t.registerCommand(Ze.DRAGOVER_COMMAND,a=>hw(a),Ze.COMMAND_PRIORITY_LOW),t.registerCommand(Ze.DROP_COMMAND,a=>yw(a,t),Ze.COMMAND_PRIORITY_HIGH))},[e,t]),null}function bw(e){if(!$u())return!1;let a=e.dataTransfer;return a?(a.setData("text/plain","_"),!0):!1}function hw(e){return $u()?(zh(e)||e.preventDefault(),!0):!1}function yw(e,t){let a=$u();if(!a)return!1;if(e.preventDefault(),zh(e)){let o=xw(e);a.remove();let r=(0,Ze.$createRangeSelection)();o!=null&&r.applyDOMRange(o),(0,Ze.$setSelection)(r)}return!0}function $u(){let e=(0,Ze.$getSelection)();if(!(0,Ze.$isNodeSelection)(e))return null;let a=e.getNodes()[0];return(0,qc.$isUploadNode)(a)?a:null}function zh(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function xw(e){let t,a=e.target,o=a==null?null:a.nodeType===9?a.defaultView:a.ownerDocument.defaultView,r=vw(o);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&r!==null)r.collapse(e.rangeParent,e.rangeOffset||0),t=r.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var Nw=()=>(0,er.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,er.jsx)("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),jh=Nw;var ww=()=>(0,er.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,er.jsx)("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),Uh=ww;var Cw=()=>(0,er.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,er.jsx)("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,er.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),Vh=Cw;var kw=()=>(0,er.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,er.jsx)("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,er.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),$h=kw;var Sw=()=>(0,er.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,er.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),Kh=Sw;var Dw=()=>(0,er.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,er.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),_h=Dw;var Gh=()=>(0,er.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,er.jsx)("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),Wh=()=>(0,er.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,er.jsx)("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),Xh=()=>(0,er.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,er.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),qh=()=>(0,er.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,er.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),Jh=()=>(0,er.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,er.jsx)("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var Xu=1;function Tw(){return(0,er.jsx)("span",{className:"border border-[#222222]"})}function Ju(){let[e]=(0,Yh.useLexicalComposerContext)(),t=(0,cd.useRef)(null),[a,o]=(0,cd.useState)(!1),[r,i]=(0,cd.useState)(!1),[n,s]=(0,cd.useState)(!1),[l,m]=(0,cd.useState)(!1),[d,c]=(0,cd.useState)(!1),[u,v]=(0,cd.useState)(!1),[b,f]=(0,cd.useState)(!1),[g,x]=(0,cd.useState)(!1),[S,h]=(0,cd.useState)(!1),[w,D]=(0,cd.useState)("left"),[M,U]=(0,cd.useState)("p"),F=P=>{e.update(()=>{let X=(0,Ze.$getSelection)();(0,Ze.$isRangeSelection)(X)&&(P==="p"?(0,qu.$setBlocksType)(X,()=>(0,Ze.$createParagraphNode)()):(0,qu.$setBlocksType)(X,()=>(0,s0.$createHeadingNode)(P)))})},j=(0,cd.useCallback)(()=>{let P=(0,Ze.$getSelection)();if((0,Ze.$isRangeSelection)(P)){s(P.hasFormat("bold")),m(P.hasFormat("italic")),c(P.hasFormat("underline")),v(P.hasFormat("strikethrough")),f(P.hasFormat("subscript")),x(P.hasFormat("superscript"));let X=P.anchor.getNode(),N=X;for(;N&&!(0,Ze.$isParagraphNode)(N)&&N!==(0,Ze.$getRoot)();){let B=N.getParent();B&&(N=B)}if(N){let B=N.getFormatType();D(B||"left")}let ae=X.getTopLevelElement()?.__tag;U(ae||"p")}},[]);(0,cd.useEffect)(()=>(0,Xl.mergeRegister)(e.registerUpdateListener(({editorState:P})=>{P.read(()=>{j()})}),e.registerCommand(Ze.SELECTION_CHANGE_COMMAND,(P,X)=>(j(),!1),Xu),e.registerCommand(Ze.CAN_UNDO_COMMAND,P=>(o(P),!1),Xu),e.registerCommand(Ze.CAN_REDO_COMMAND,P=>(i(P),!1),Xu),(0,Xl.mergeRegister)(e.registerCommand(Uu,P=>(e.update(()=>{let X=(0,Ze.$getSelection)()||(0,Ze.$getPreviousSelection)();if((0,Ze.$isRangeSelection)(X)){let N=Hn({id:P.id,fields:P.fields,relationTo:P.relationTo,value:P.value}),{focus:ae}=X,B=ae.getNode();(0,Xl.$insertNodeToNearestRoot)(N),(0,Ze.$isParagraphNode)(B)&&!B.__first&&B.remove()}}),!0),Ze.COMMAND_PRIORITY_EDITOR))),[e,j]);let te=[[{label:"Undo",icon:(0,er.jsx)(Jg.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ze.UNDO_COMMAND,void 0)},disabled:!a},{label:"Redo",icon:(0,er.jsx)(Jg.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ze.UNDO_COMMAND,void 0)},disabled:!r}],[{label:"Bold",icon:(0,er.jsx)(jh,{}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:n},{label:"Italic",icon:(0,er.jsx)(Uh,{}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:l},{label:"Underline",icon:(0,er.jsx)(Vh,{}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:d},{label:"Strikethrough",icon:(0,er.jsx)($h,{}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:u},{label:"Subscript",icon:(0,er.jsx)(Kh,{}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:b},{label:"Superscript",icon:(0,er.jsx)(_h,{}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:g}]],ve=[{label:"Left Align",direction:"left",icon:(0,er.jsx)(Jg.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,er.jsx)(Jg.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,er.jsx)(Jg.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,er.jsx)(Jg.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_ELEMENT_COMMAND,"justify")}}],Z=[{label:"Normal Text",value:"p",icon:(0,er.jsx)(Gh,{}),onClick:()=>F("p")},{label:"Heading 1",value:"h1",icon:(0,er.jsx)(Wh,{}),onClick:()=>F("h1")},{label:"Heading 2",value:"h2",icon:(0,er.jsx)(Xh,{}),onClick:()=>F("h2")},{label:"Heading 3",value:"h3",icon:(0,er.jsx)(qh,{}),onClick:()=>F("h3")},{label:"Heading 4",value:"h4",icon:(0,er.jsx)(Jh,{}),onClick:()=>F("h4")},...[{label:"Unordered List",value:"ul",icon:(0,er.jsx)(Jg.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Yc.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,er.jsx)(Jg.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Yc.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],ue=[{label:"Insert Image",icon:(0,er.jsx)(Jg.ImageUp,{width:15,height:15}),onClick:()=>{h(!0)},disabled:!1}];return(0,er.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black z-50",children:(0,er.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[te.map((P,X)=>(0,er.jsxs)(cd.Fragment,{children:[(0,er.jsx)("div",{className:"flex items-center gap-2",children:P.map((N,ae)=>(0,er.jsx)("div",{role:"button","aria-disabled":N.disabled||!1,onClick:N.onClick,className:p("p-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",N.active&&"bg-[#3c3c3c]"),"aria-label":N.label,children:(0,er.jsx)(Ro,{children:(0,er.jsxs)(Ao,{children:[(0,er.jsx)(Io,{className:"text-[#b5b5b5]",children:N.icon}),(0,er.jsx)(mo,{children:(0,er.jsx)("p",{children:N.label})})]})})},ae))}),(0,er.jsx)(Tw,{})]},`toolbar-option-${P.length}-${X}`)),(0,er.jsxs)(To,{children:[(0,er.jsxs)(Po,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[ve.find(P=>P.direction===w)?.icon,ve.find(P=>P.direction===w)?.label,(0,er.jsx)(Jg.ChevronDown,{width:15,height:15})]}),(0,er.jsx)(co,{className:"bg-black hover:bg-black",children:ve.map((P,X)=>(0,er.jsxs)(Ba,{onClick:P.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,er.jsx)("span",{children:P.icon}),(0,er.jsx)("span",{children:P.label})]},`${P.label}-${X}`))})]}),(0,er.jsxs)(To,{children:[(0,er.jsxs)(Po,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[Z.find(P=>P.value===M)?.icon,Z.find(P=>P.value===M)?.label,(0,er.jsx)(Jg.ChevronDown,{width:15,height:15})]}),(0,er.jsx)(co,{className:"bg-black hover:bg-black",children:Z.map((P,X)=>(0,er.jsxs)(Ba,{onClick:P.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,er.jsx)("span",{children:P.icon}),(0,er.jsx)("span",{children:P.label})]},`heading-option-${P.label}-${X}`))})]}),(0,er.jsxs)(To,{children:[(0,er.jsxs)(Po,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[(0,er.jsx)(Jg.Plus,{width:15,height:15}),(0,er.jsx)(Jg.ChevronDown,{width:15,height:15})]}),(0,er.jsx)(co,{className:"bg-black hover:bg-black",children:ue.map((P,X)=>(0,er.jsxs)(Ba,{onClick:P.onClick,disabled:P.disabled,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,er.jsx)("span",{children:P.icon}),(0,er.jsx)("span",{children:P.label})]},X))})]}),S&&(0,er.jsx)(Hh,{activeEditor:e,onClose:()=>{h(!1)},isOpen:S})]})})}var Pw=({setValue:e,value:t,name:a,editable:o=!0})=>{let[r]=(0,Yh.useLexicalComposerContext)(),i=(0,cd.useRef)(null),n=s=>{s.read(()=>{let l=s.toJSON();JSON.stringify(l)!==JSON.stringify(i.current)&&(i.current=l,e?.(()=>l))})};return(0,cd.useEffect)(()=>{r.setEditable(o)},[o,r]),(0,cd.useEffect)(()=>{t&&JSON.stringify(t)!==JSON.stringify(i.current)&&r.update(()=>{try{let s=r.parseEditorState(t);r.setEditorState(s),i.current=t}catch(s){console.error("Error parsing editor state:",s)}},{discrete:!0})},[t,r]),(0,er.jsx)("div",{className:"w-full",children:(0,er.jsxs)("div",{className:" ",children:[o&&(0,er.jsx)(Ju,{}),(0,er.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,er.jsx)(r0.RichTextPlugin,{contentEditable:(0,er.jsx)(t0.ContentEditable,{name:a,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:a0.LexicalErrorBoundary}),o&&(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(o0.HistoryPlugin,{}),(0,er.jsx)(Zh.AutoFocusPlugin,{}),(0,er.jsx)(i0.ListPlugin,{}),(0,er.jsx)(n0.OnChangePlugin,{onChange:n}),(0,er.jsx)(Vu,{})]})]})]})})},Rw=({setValue:e,value:t,name:a,editable:o=!0})=>(0,er.jsx)(e0.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Yc.ListNode,Yc.ListItemNode,s0.HeadingNode,_l],onError(i){throw console.error("Lexical error:",i),i},theme:{code:"editor-code",heading:{h1:"text-4xl text-primary",h2:"text-3xl",h3:"text-2xl",h4:"text-Jg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",ul:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,er.jsx)(Pw,{value:t,setValue:e,name:a,editable:o})}),zn=Rw;var Jl=e=>"mimeType"in e&&"url"in e&&!("format"in e),Aw=e=>{if(!e?.root?.children)return"";let t=[],a=i=>{if(!i)return"";switch(i.type){case"heading":{let n=i.tag?parseInt(i.tag.replace("h","")):1,s=o(i.children||[]);return"#".repeat(n)+" "+s}case"paragraph":return i.children&&i.children.some(l=>l.type==="text"?l.text&&l.text.trim().length>0:(l.type==="linebreak",!0))?o(i.children||[]):"";case"list":{let n=[],s=i.listType==="number"?"1.":"-";return i.children?.forEach((l,m)=>{if(l.type==="listitem"){let d=o(l.children||[]),c=i.listType==="number"?`${m+1}.`:s;n.push(`${c} ${d}`)}}),n.join(`
|
|
44
45
|
`)}case"listitem":return o(i.children||[]);case"text":{let n=i.text||"";if(i.format){let s=(i.format&1)!==0,l=(i.format&2)!==0,m=(i.format&4)!==0,d=(i.format&8)!==0;(i.format&16)!==0?n=`\`${n}\``:(s&&(n=`**${n}**`),l&&(n=`*${n}*`),m&&(n=`~~${n}~~`),d&&(n=`<u>${n}</u>`))}return n}default:return i.children?o(i.children):""}},o=i=>i.map(n=>{if(n.type==="text"){let s=n.text||"";if(n.format){let l=(n.format&1)!==0,m=(n.format&2)!==0,d=(n.format&4)!==0,c=(n.format&8)!==0;(n.format&16)!==0?s=`\`${s}\``:(l&&(s=`**${s}**`),m&&(s=`*${s}*`),d&&(s=`~~${s}~~`),c&&(s=`<u>${s}</u>`))}return s}else{if(n.type==="paragraph")return o(n.children||[]);if(n.type==="listitem")return o(n.children||[]);if(n.type==="linebreak")return`
|
|
45
46
|
`}return a(n)}).filter(Boolean).join("");e.root.children.forEach(i=>{let n=a(i);i.type==="paragraph"?t.push(n||""):n&&t.push(n)});let r=[];for(let i=0;i<t.length;i++)r.push(t[i]),i<t.length-1&&(t[i]===""||t[i+1]===""||r.push(""));return r.join(`
|
|
46
|
-
`)},
|
|
47
|
-
`){t.push({type:"linebreak",version:1}),a+=1;continue}let m=e.length,d=[{pattern:/<u>/i,offset:0},{pattern:/\*\*/,offset:0},{pattern:/__/,offset:0},{pattern:/~~/,offset:0},{pattern:/`+/,offset:0},{pattern:/\*[^*\n]/,offset:0},{pattern:/_[^_\n]/,offset:0},{pattern:/\n/,offset:0}];for(let{pattern:u}
|
|
48
|
-
`),a=[],o=[],r=[],i=null,n=()=>{if(o.length>0){for(let l=0;l<o.length;l++){let m=o[l],d=hs(m),c=d.length>0?d.map(u=>({...u,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];a.push({type:"paragraph",children:c,direction:"ltr",format:"",indent:0,version:1})}o=[]}},s=()=>{r.length>0&&i&&(a.push({type:"list",listType:i,tag:i==="number"?"ol":"ul",start:1,format:"",indent:0,version:1,direction:"ltr",children:r}),r=[],i=null)};for(let l Ug t){let m=l.trim();if(!m){n(),s(),a.push({children:[],direction:null,format:"",indent:0,type:"paragraph",version:1,textFormat:0,textStyle:""});continue}let d=m.match(/^(#{1,6})\s+(.+)$/);if(d){n(),s();let v=d[1].length,b=d[2],f=hs(b);a.push({type:"heading",tag:`h${v}`,children:f.length>0?f:[{type:"text",text:"",format:0}]});continue}let c=m.match(/^(\d+)\.\s+(.*)$/);if(c){n(),i==="bullet"&&s(),i!=="number"&&(r.length>0&&s(),i="number");let v=c[2]||"",b=hs(v),f=b.length>0?b.map(g=>({...g,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];r.push({type:"listitem",value:r.length+1,format:"start",indent:0,version:1,direction:"ltr",children:[{type:"paragraph",children:f,direction:"ltr",format:"",indent:0,version:1}]});continue}let u=m.match(/^[-*+]\s+(.+)$/);if(u){n(),i==="number"&&s(),i!=="bullet"&&(r.length>0&&s(),i="bullet");let v=u[1],b=hs(v),f=b.length>0?b.map(g=>({...g,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];r.push({type:"listitem",value:r.length+1,format:"start",indent:0,version:1,direction:"ltr",children:[{type:"paragraph",children:f,direction:"ltr",format:"",indent:0,version:1}]});continue}r.length>0&&s(),o.push(l)}return n(),s(),a.length===0&&a.push({type:"paragraph",children:[{type:"text",text:"",format:0}]}),{root:{type:"root",children:a,direction:"ltr",format:"",indent:0,version:1}}},Cw=async e=>{let t="",a,o="text";if(e.url)try{let r=e.url;!r.startsWith("http://")&&!r.startsWith("https://")&&!r.startsWith("/")&&(r="/"+r);let i=await fetch(r);i.ok?(t=await i.text(),console.log("Successfully loaded content, length:",t.length)):console.error("Failed Qo fetch file content:",i.status,i.statusText)}catch(r){console.error("Failed Qo fetch file content:",r)}else console.warn("Qo URL provided for file:",e.name);return e.mimeType==="text/markdown"?(o="richText",a=ww(t)):e.mimeType?.startsWith("text/")&&(o="text"),{id:e.id.toString(),title:e.name,description:void 0,content:o==="richText"?void 0:t,richTextContent:o==="richText"?a:void 0,format:o,metadata:{},createdAt:typeof e.createdAt=="string"?new Date(e.createdAt):e.createdAt,updatedAt:new Date}};function r0({document:e,onCancel:t,onSave:a,onFileUpdate:o}){let[r,i]=(0,ld.useState)(Xl(e)),[n,s]=(0,ld.useState)(Xl(e)?{id:e.id.toString(),title:e.name,description:void 0,content:"",format:"text",metadata:{},createdAt:typeof e.createdAt=="string"?new Date(e.createdAt):e.createdAt,updatedAt:new Date}:{...e,updatedAt:new Date}),[l,m]=(0,ld.useState)(Xl(e)?void 0:n.richTextContent),[d,c]=(0,ld.useState)(!1),u=(0,ld.useRef)(Xl(e)?e:null);(0,ld.useEffect)(()=>{Xl(e)?(i(!0),Cw(e).then(g=>{s(g),m(g.richTextContent),i(!1)}).catch(g=>{g instanceof Error&&g.name!=="AbortError"&&(console.error("Failed Qo convert file:",g),i(!1))})):(s({...e,updatedAt:new Date}),m(e.richTextContent))},[e]);let v=g=>{switch(g){case"markdown":case"mdx":return(0,Qo.jsx)(Yg.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Qo.jsx)(Yg.File,{className:"h-6 w-6 text-success"});case"text":return(0,Qo.jsx)(Yg.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Qo.jsx)(Yg.File,{className:"h-6 w-6 text-muted-foreground"})}},b=g=>{switch(g){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},f=async()=>{c(!0);try{let g,x;if(u.current&&u.current.mimeType==="text/markdown"){let h=l?Nw(l):"";g={...n,format:"markdown",content:h,richTextContent:void 0},x=h}else g={...n,richTextContent:l},x=n.content||"";let S=u.current?u.current.id.toString():n.id;await Promise.resolve(a()),o?.(S,x)}finally{c(!1)}};return(0,Qo.jsxs)(hn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,Qo.jsx)("div",{className:"border-b border-border bg-card p-8 sc-6",children:(0,Qo.jsxs)("div",{className:"flex items-start justify-between gap-4 uv-4",children:[(0,Qo.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Qo.jsx)("div",{className:"flex-1 min-w-0",children:(0,Qo.jsxs)("div",{className:"flex items-start gap-4 uv-0 leading-tight",children:[(0,Qo.jsx)("div",{className:"flex-1 min-w-0",children:(0,Qo.jsx)(Ri,{fieldName:"title",value:n.title,label:"",onSave:(g,x)=>s(S=>({...S,title:x})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,Qo.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${b(n.format)} flex-shrink-0 mt-1`,children:n.format.toUpperCase()})]})})}),(0,Qo.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Qo.jsxs)(y,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,Qo.jsx)(Yg.X,{className:"h-4 w-4"}),"Close"]}),(0,Qo.jsxs)(y,{size:"sm",onClick:f,className:"gap-2",disabled:d,children:[d?(0,Qo.jsx)(Yg.Loader2,{className:"h-4 w-4 animate-spin"}):(0,Qo.jsx)(Yg.Save,{className:"h-4 w-4"}),d?"Saving...":"Save"]})]})]})}),(0,Qo.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,Qo.jsx)("div",{className:"p-8 Qo-0 h-full max-h-full overflow-auto",children:r?(0,Qo.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,Qo.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,Qo.jsx)(Yg.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading file content..."})]})}):(0,Qo.jsx)(Qo.Fragment,{children:n.format==="richText"?(0,Qo.jsx)(Hn,{setValue:m,value:l,name:"richTextContent"},`richtext-${n.id}-${r?"loading":"loaded"}`):(0,Qo.jsx)(Xe,{value:n.content||"",onChange:g=>s(x=>({...x,content:g.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})})]})}var i0=e=>{if(!e||e<=0)return"0 KB";let t=e/1024;return t<1024?`${t.toFixed(2)} KB`:`${(t/1024).toFixed(2)} MB`};function ys({files:e,onFileClick:t,onFileDelete:a,onFileUpdate:o,showHeader:r=!0,className:i,viewMode:n="list"}){let[s,l]=(0,ld.useState)(!1),[m,d]=(0,ld.useState)(!1),[c,u]=(0,ld.useState)(null),v=()=>{l(!1),u(null)},b=()=>{d(!0),setTimeout(()=>{d(!1),l(!1),u(null)},500)},f=g=>{u(g),l(!0)};return(0,Qo.jsxs)("div",{className:p("rounded-3xl border overflow-hidden",i),children:[(0,Qo.jsxs)("div",{className:"bg-muted/50 p-3 flex items-center justify-between",children:[r&&n==="list"&&(0,Qo.jsxs)("div",{className:"hidden md:grid md:grid-cols-10 text-sm font-medium flex-1",children:[(0,Qo.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Qo.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Qo.jsx)("div",{className:"col-span-2",children:"Modified"})]}),n==="card"&&(0,Qo.jsx)("div",{className:"text-sm font-medium",children:"Files"})]}),n==="list"&&(0,Qo.jsx)("div",{className:"divide-y",children:e.map(g=>(0,Qo.jsxs)(hn.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(g),children:[(0,Qo.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Qo.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,Qo.jsx)("div",{children:(0,Qo.jsx)("p",{className:"font-medium",children:g.name})})]}),(0,Qo.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:i0(g.filesize)}),(0,Qo.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Qo.jsx)("span",{className:"text-sm md:text-base",children:new Date(g.createdAt).toLocaleDateString()}),(0,Qo.jsxs)("div",{className:"flex gap-1",children:[g.mimeType==="text/markdown"&&(0,Qo.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:x=>{x.stopPropagation(),f(g)},children:(0,Qo.jsx)(Yg.Edit,{className:"h-4 w-4"})}),(0,Qo.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:x=>{x.stopPropagation(),a?.(g)},children:(0,Qo.jsx)(Yg.Trash2,{className:"h-4 w-4"})})]})]})]},g.name))}),n==="card"&&(0,Qo.jsx)("div",{className:"p-4 grid grid-cols-1 gap-4",children:e.map(g=>(0,Qo.jsx)(hn.motion.div,{whileHover:{scale:1.02},className:"border rounded-lg p-4 bg-card hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>t?.(g),children:(0,Qo.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,Qo.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Qo.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted flex-shrink-0"}),(0,Qo.jsx)("div",{className:"min-w-0 flex-1",children:(0,Qo.jsx)("p",{className:"font-medium truncate",children:g.name})})]}),(0,Qo.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground pl-[52px]",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)("span",{className:"font-medium",children:"Size:"}),(0,Qo.jsx)("span",{children:i0(g.filesize)})]}),(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)("span",{className:"font-medium",children:"Modified:"}),(0,Qo.jsx)("span",{children:new Date(g.createdAt).toLocaleDateString()})]})]})]}),(0,Qo.jsxs)("div",{className:"flex flex-col gap-2 flex-shrink-0",children:[g.mimeType==="text/markdown"&&(0,Qo.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:x=>{x.stopPropagation(),f(g)},title:"Edit",children:(0,Qo.jsx)(Yg.Edit,{className:"h-4 w-4"})}),(0,Qo.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:x=>{x.stopPropagation(),a?.(g)},title:"Delete",children:(0,Qo.jsx)(Yg.Trash2,{className:"h-4 w-4"})})]})]})},g.name))}),(0,Qo.jsx)(at,{open:s,onOpenChange:g=>!g&&v(),children:(0,Qo.jsxs)(Is,{children:[(0,Qo.jsx)(Xi,{}),(0,Qo.jsxs)(s0.Content,{className:p("fixed inset-0 z-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[(0,Qo.jsx)(mt,{className:"Qo-only",children:c?`Edit ${c.name}`:"Edit File"}),m&&(0,Qo.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-50",children:(0,Qo.jsx)(Yg.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),c&&(0,Qo.jsx)(r0,{document:c,onSave:b,onFileUpdate:o,onCancel:v})]})]})})]})}function Un({project:e,onOpen:t,onShare:a,className:o}){return(0,Qo.jsx)(hn.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,Qo.jsxs)(H,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Qo.jsxs)(Pe,{children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsx)(Ie,{children:e.name}),(0,Qo.jsxs)(se,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,Qo.jsx)(Io,{children:e.description})]}),(0,Qo.jsxs)(oe,{className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Qo.jsx)("span",{children:"Progress"}),(0,Qo.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Qo.jsx)(Vl,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,Qo.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Qo.jsxs)("div",{className:"flex items-center",children:[(0,Qo.jsx)(Yg.Users,{className:"Qo-1 h-4 w-4"}),e.members," members"]}),(0,Qo.jsxs)("div",{className:"flex items-center",children:[(0,Qo.jsx)(Yg.FileText,{className:"Qo-1 h-4 w-4"}),e.files," files"]})]})]}),(0,Qo.jsxs)(er,{className:"flex gap-2",children:[(0,Qo.jsx)(y,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,Qo.jsx)(y,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,Qo.jsx)(Yg.Share2,{className:"h-4 w-4"})})]})]})})}var Zu=[{name:"PixelMaster",icon:(0,Qo.jsx)(Yg.ImageIcon,{className:"text-violet-500"}),description:"Advanced image editing and composition",category:"Creative",recent:!0,new:!1,progress:100},{name:"VectorPro",icon:(0,Qo.jsx)(Yg.Brush,{className:"text-orange-500"}),description:"Professional vector graphics creation",category:"Creative",recent:!0,new:!1,progress:100},{name:"VideoStudio",icon:(0,Qo.jsx)(Yg.Video,{className:"text-pink-500"}),description:"Cinematic video editing and production",category:"Video",recent:!0,new:!1,progress:100},{name:"MotionFX",icon:(0,Qo.jsx)(Yg.Sparkles,{className:"text-blue-500"}),description:"Stunning visual effects and animations",category:"Video",recent:!1,new:!1,progress:100},{name:"PageCraft",icon:(0,Qo.jsx)(Yg.Layers,{className:"text-red-500"}),description:"Professional page design and layout",category:"Creative",recent:!1,new:!1,progress:100},{name:"UXFlow",icon:(0,Qo.jsx)(Yg.LayoutGrid,{className:"text-fuchsia-500"}),description:"Intuitive user experience design",category:"Design",recent:!1,new:!0,progress:85},{name:"PhotoLab",icon:(0,Qo.jsx)(Yg.Camera,{className:"text-teal-500"}),description:"Advanced photo editing and organization",category:"Photography",recent:!1,new:!1,progress:100},{name:"DocMaster",icon:(0,Qo.jsx)(Yg.FileText,{className:"text-red-600"}),description:"Document editing and management",category:"Document",recent:!1,new:!1,progress:100},{name:"WebCanvas",icon:(0,Qo.jsx)(Yg.Code,{className:"text-emerald-500"}),description:"Web design and development",category:"Web",recent:!1,new:!0,progress:70},{name:"3DStudio",icon:(0,Qo.jsx)(Yg.CuboidIcon,{className:"text-indigo-500"}),description:"3D modeling and rendering",category:"3D",recent:!1,new:!0,progress:60},{name:"FontForge",icon:(0,Qo.jsx)(Yg.Type,{className:"text-amber-500"}),description:"Typography and font creation",category:"Typography",recent:!1,new:!1,progress:100},{name:"ColorPalette",icon:(0,Qo.jsx)(Yg.Palette,{className:"text-purple-500"}),description:"Color scheme creation and management",category:"Design",recent:!1,new:!1,progress:100}],d0=[{id:1,filename:"Brand Redesign.pxm",filesize:24.5,url:"https://example.com/brand-redesign.pxm",mimeType:"image/png",name:"Brand Redesign.pxm",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:2,filename:"Company Logo.vec",filesize:8.2,url:"https://example.com/company-logo.vec",mimeType:"image/svg+xml",name:"Company Logo.vec",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:3,filename:"Product Launch Video.vid",filesize:1.2,url:"https://example.com/product-launch-video.vid",mimeType:"video/mp4",name:"Product Launch Video.vid",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:4,filename:"UI Animation.mfx",filesize:345,url:"https://example.com/ui-animation.mfx",mimeType:"video/mp4",name:"UI Animation.mfx",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:5,filename:"Magazine Layout.pgc",filesize:42.8,url:"https://example.com/magazine-layout.pgc",mimeType:"image/png",name:"Magazine Layout.pgc",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:6,filename:"Mobile App Design.uxf",filesize:18.3,url:"https://example.com/mobile-app-design.uxf",mimeType:"image/png",name:"Mobile App Design.uxf",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:7,filename:"Product Photography.phl",filesize:156,url:"https://example.com/product-photography.phl",mimeType:"image/png",name:"Product Photography.phl",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1}];var c0=[{title:"Mastering Digital Illustration",description:"Learn advanced techniques for creating stunning digital art",duration:"1h 45m",level:"Advanced",instructor:"Sarah Chen",category:"Illustration",views:"24K"},{title:"UI/UX Design Fundamentals",description:"Essential principles for creating intuitive user interfaces",duration:"2h 20m",level:"Intermediate",instructor:"Michael Rodriguez",category:"Design",views:"56K"},{title:"Video Editing Masterclass",description:"Professional techniques for cinematic video editing",duration:"3h 10m",level:"Advanced",instructor:"James Wilson",category:"Video",views:"32K"},{title:"Typography Essentials",description:"Create beautiful and effective typography for any project",duration:"1h 30m",level:"Beginner",instructor:"Emma Thompson",category:"Typography",views:"18K"},{title:"Color Theory for Designers",description:"Understanding color relationships and psychology",duration:"2h 05m",level:"Intermediate",instructor:"David Kim",category:"Design",views:"41K"}];var p0=[{id:"home",title:"Home",icon:(0,Qo.jsx)(Yg.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,Qo.jsx)(Yg.Users,{}),maxItems:2,items:[{id:"design",title:"Design",url:"#"},{id:"marketing",title:"Marketing",url:"#"},{id:"finance",title:"Finance",url:"#"},{id:"engineering",title:"Engineering",url:"#"},{id:"sales",title:"Sales",url:"#"}]},{id:"projects",title:"Projects",icon:(0,Qo.jsx)(Yg.Layers,{}),badge:"4",maxItems:2,items:[{id:"active-projects",title:"Active Projects",url:"#",badge:"4"},{id:"archived",title:"Archived",url:"#"},{id:"templates",title:"Templates",url:"#"},{id:"drafts",title:"Drafts",url:"#"},{id:"shared",title:"Shared with Qo",url:"#",badge:"2"}]},{id:"copilot",title:"Copilot",icon:(0,Qo.jsx)(Yg.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,Qo.jsx)(Yg.FileText,{}),url:"/knowledge"}],u0=[{id:"1",title:"New comment on your post",description:"Alex Morgan commented on your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{id:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project Yg due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{id:"3",title:"File shared with you",description:"Emma Thompson shared 'Brand Guidelines.pdf' with you.",time:"1 hour ago",read:!1,type:"info",actionLabel:"Open file",onAction:()=>console.log("Open file clicked")},{id:"4",title:"Update successful",description:"PixelMaster has been updated Qo version 2.4.0.",time:"3 hours ago",read:!0,type:"success",actionLabel:"See what's new",onAction:()=>console.log("See what's new clicked")},{id:"5",title:"Storage limit reached",description:"You've used 95% Ug your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{id:"6",title:"Weekly summary",description:"Check out your activity summary for the past week.",time:"2 days ago",read:!0,type:"info",actionLabel:"View summary",onAction:()=>console.log("View summary clicked")},{id:"7",title:"New tutorial available",description:"A new tutorial on 'Advanced Animation Techniques' Yg now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}];var $n=[{id:1,name:"Qo-commerce Platform",description:"Main customer-facing e-commerce application",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:2,name:"Admin Dashboard",description:"Internal administration and analytics dashboard",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:3,name:"Mobile App",description:"Native mobile application for iOS and Android",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}];var eg=[{id:1,name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:3,name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],Zc=[{id:1,name:"Backlog",description:"Tasks not yet assigned Qo a sprint",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:3,name:"Sprint 1",description:"Initial development phase",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,name:"Sprint 2",description:"Feature development",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],am=[{id:1,name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",dateLogged:new Date().toString(),index:1,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"John Doe"},createdAt:new Date().toString()},{id:2,name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",dateLogged:new Date().toString(),index:2,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jane Smith"},createdAt:new Date().toString()},{id:3,name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:3,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Mike Johnson"},createdAt:new Date().toString()},{id:4,name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",dateLogged:new Date().toString(),index:4,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Sarah Wilson"},createdAt:new Date().toString()},{id:5,name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",dateLogged:new Date().toString(),index:5,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Alex Brown"},createdAt:new Date().toString()},{id:6,name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",dateLogged:new Date().toString(),index:6,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Emma Davis"},createdAt:new Date().toString()},{id:7,name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:7,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Tom Wilson"},createdAt:new Date().toString()}],kw=[...am,{id:8,name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:8,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"1"},createdAt:new Date().toString()},{id:9,name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",dateLogged:new Date().toString(),index:9,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Taylor Swift"},createdAt:new Date().toString()},{id:10,name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",dateLogged:new Date().toString(),index:10,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jordan Smith"},createdAt:new Date().toString()},{id:11,name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:11,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Morgan Davis"},createdAt:new Date().toString()},{id:12,name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:12,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Casey Johnson"},createdAt:new Date().toString()}],Sw=[{id:4,name:"Analytics Platform",description:"Business intelligence and reporting system",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:5,name:"API Gateway",description:"Microservices API management layer",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}],em={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:[]},m0={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:am.filter(e=>typeof e.epic=="object"?e.epic?.id===1:e.epic===1)};var eB={empty:{initialProjects:em.projects,initialEpics:em.epics,initialSprints:em.sprints,initialTasks:em.tasks},default:{initialProjects:$n,initialEpics:eg,initialSprints:Zc,initialTasks:am},highDensity:{initialProjects:$n,initialEpics:eg,initialSprints:Zc,initialTasks:kw},singleEpic:{initialProjects:$n,initialEpics:m0.epics,initialSprints:Zc,initialTasks:m0.tasks},multipleProjects:{initialProjects:Sw,initialEpics:eg,initialSprints:Zc,initialTasks:am}},tm=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,type:"digital",name:"CodeAssist Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1,identity:{id:1,keycloakClientId:"123",keycloakUserId:"456",secretManagementMode:"manual",keycloakClientSecret:"new-secret",keycloakSecretArn:"arn:aws:secretsmanager:ld-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"ld-east-1",keycloakSecretLastUpdated:new Date().toString(),updatedAt:new Date().toString(),createdAt:new Date().toString()}},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,type:"digital",name:"MarketingBot",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1,identity:{id:1,keycloakClientId:"123",keycloakUserId:"456",secretManagementMode:"manual",keycloakClientSecret:"new-secret",keycloakSecretArn:"arn:aws:secretsmanager:ld-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"ld-east-1",keycloakSecretLastUpdated:new Date().toString(),updatedAt:new Date().toString(),createdAt:new Date().toString()}},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:6,type:"digital",name:"DataAnalyzer Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:3}],knowledge:1,coreKnowledge:1,capabilityLevel:1,identity:{id:1,keycloakClientId:"123",keycloakUserId:"456",secretManagementMode:"manual",keycloakClientSecret:"new-secret",keycloakSecretArn:"arn:aws:secretsmanager:ld-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"ld-east-1",keycloakSecretLastUpdated:new Date().toString(),updatedAt:new Date().toString(),createdAt:new Date().toString()}},{id:7,type:"digital",name:"ProjectManager AI",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:4},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1,identity:{id:1,keycloakClientId:"123",keycloakUserId:"456",secretManagementMode:"manual",keycloakClientSecret:"new-secret",keycloakSecretArn:"arn:aws:secretsmanager:ld-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"ld-east-1",keycloakSecretLastUpdated:new Date().toString(),updatedAt:new Date().toString(),createdAt:new Date().toString()}},{id:8,type:"digital",name:"CustomerSupport Bot",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond Qo customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases Qo human agents.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1,identity:{id:1,keycloakClientId:"123",keycloakUserId:"456",secretManagementMode:"manual",keycloakClientSecret:"new-secret",keycloakSecretArn:"arn:aws:secretsmanager:ld-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"ld-east-1",keycloakSecretLastUpdated:new Date().toString(),updatedAt:new Date().toString(),createdAt:new Date().toString()}}],tB=[{id:1,title:"Review quarterly report",description:"Qo through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15).toString(),dueTime:"14:30",assignedColleague:tm.find(e=>e.id==="2"&&e.type==="digital"),isRecurring:!1,createdAt:new Date(2024,2,10).toString(),updatedAt:new Date(2024,2,10).toString(),project:$n[0]},{id:2,title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18).toString(),dueTime:"10:00",assignedColleague:tm.find(e=>e.id==="4"&&e.type==="digital"),createdAt:new Date(2024,2,11).toString(),updatedAt:new Date(2024,2,11).toString(),project:$n[0]},{id:3,title:"Deploy Qo production",description:"Deploy the latest version Qo production environment",dueDate:new Date().toString(),dueTime:"16:00",assignedColleague:tm.find(e=>e.id==="2"&&e.type==="digital"),createdAt:new Date().toString(),updatedAt:new Date().toString(),project:$n[0]}];var aB=tm.filter(e=>e.type==="digital");function g0({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[r,i]=(0,ld.useState)(""),n=Array.isArray(e)?e:[],s=(0,ld.useMemo)(()=>n.filter(m=>m!=null&&m!==void 0).filter(m=>m?.name?.toLowerCase().includes(r.toLowerCase())||m?.email?.toLowerCase().includes(r.toLowerCase())),[n,r]),l=m=>{t(m)};return(0,Qo.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Qo.jsx)(hn.AnimatePresence,{mode:"wait",children:(0,Qo.jsxs)(hn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-4 uv-6",children:[(0,Qo.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Qo.jsx)(Yg.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,Qo.jsx)("p",{className:"text-muted-foreground",children:"Choose a user Qo add as a colleague"})]})]}),(0,Qo.jsx)(H,{className:"container",children:(0,Qo.jsx)(oe,{className:"Qo-6",children:(0,Qo.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,Qo.jsx)("div",{className:"flex-1",children:(0,Qo.jsxs)("div",{className:"relative",children:[(0,Qo.jsx)(Yg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Qo.jsx)(_,{placeholder:"Search users by name, email, role, Qo skills...",value:r,onChange:m=>i(m.target.value),className:"pl-9"})]})})})})}),(0,Qo.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:s.map(m=>!m||!m.id?null:(0,Qo.jsx)(hn.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Qo.jsxs)(H,{className:`cursor-pointer transition-all hover:shadow-lg ${o===m.id?"ring-2 ring-primary":""}`,onClick:()=>l(m),children:[(0,Qo.jsx)(Pe,{className:"sc-3",children:(0,Qo.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Qo.jsx)(qt,{children:(0,Qo.jsx)(Jt,{children:(0,Qo.jsx)(Yg.User,{className:"h-4 w-4"})})}),(0,Qo.jsx)("div",{children:(0,Qo.jsx)(Ie,{className:"text-lg",children:m?.name||"Unknown User"})})]}),o===m.id&&(0,Qo.jsx)(Yg.Check,{className:"h-5 w-5 text-primary"})]})}),(0,Qo.jsx)(oe,{className:"Qo-0",children:(0,Qo.jsxs)("div",{className:"space-y-3",children:[(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,Qo.jsx)("p",{className:"text-sm font-medium",children:m?.email||"Qo email"})]}),(0,Qo.jsx)("div",{children:(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"})})]})})]})},m.id))}),s.length===0&&(0,Qo.jsx)(H,{className:"container mt-4",children:(0,Qo.jsx)(oe,{className:"Qo-6",children:(0,Qo.jsxs)("div",{className:"text-center py-8",children:[(0,Qo.jsx)(Yg.User,{className:"h-12 w-12 text-muted-foreground mx-auto uv-4"}),(0,Qo.jsx)("h3",{className:"text-lg font-semibold uv-2",children:"Qo users found"}),(0,Qo.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms Qo filters."})]})})})]},"user-selection")})})}function tg(...e){return rd((0,Ag.clsx)(e))}function Jl({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:r=!1,departments:i=["Design","Engineering","Marketing","Product","Sales","Operations"],className:n,availableUsers:s=[],existingDigitalColleagues:l=[],availableKnowledgeDocuments:m=[],availableCapabilities:d=[],availableModels:c=[]}){let[u,v]=(0,ld.useState)(e||[]),[b,f]=(0,ld.useState)(""),[g,x]=(0,ld.useState)("all"),[S,h]=(0,ld.useState)("all"),[w,D]=(0,ld.useState)("all"),[M,U]=(0,ld.useState)(null),[F,j]=(0,ld.useState)(null);(0,ld.useEffect)(()=>{v(e||[])},[e]);let ee=Array.isArray(s)?s:[],ve=Array.isArray(l)?l:[],[C,J]=(0,ld.useState)("main"),pe=u.filter(W=>!W||!W?.name?!1:W?.name.toLowerCase().includes(b.toLowerCase())||W.type==="human"&&W.email?.toLowerCase().includes(b.toLowerCase())||W.type==="digital"&&W.jobDescription?.toLowerCase().includes(b.toLowerCase())),T=pe.filter(W=>W.type==="human"),X=pe.filter(W=>W.type==="digital"),N=()=>{J("typeSelection")},ae=W=>{W.type==="digital"&&(U(W),J("form")),a?.(W)},B=W=>{W.type==="digital"&&(j(W),J("view"))},A=W=>{if(!W||!W.id){console.error("Invalid user provided Qo handleUserSelect:",W);return}let It={id:`human-${Date.now()}`,type:"human",name:W?.name||"Unknown User",email:W?.email||"",updatedAt:W.updatedAt,createdAt:W.createdAt,accounts:W.accounts};v(Aa=>[...Aa,It]),t?.(It),J("main")},P=W=>{if(!W||!W.id){console.error("Invalid cloned colleague provided Qo handleDigitalColleagueClone:",W);return}v(It=>[...It,{...W,type:"digital"}]),t?.({...W,type:"digital"}),J("main")},K=()=>{U(null),J("form")},Y=W=>{if(!W||!W.id){console.error("Invalid colleague provided Qo handleSaveColleague:",W);return}M?(v(It=>It.map(Aa=>Aa.id===W.id?{...W,type:"digital"}:Aa)),a?.({...W,type:"digital"})):(v(It=>[...It,{...W,type:"digital"}]),t?.({...W,type:"digital"})),J("main"),U(null)},St=()=>{J("main"),U(null),j(null)},_e=()=>{J("main"),j(null)},Bt=()=>{F&&(U(F),j(null),J("form"))},no=W=>{o?.(W,u.find(It=>It.id.toString()===W.toString())?.type),v(It=>It.filter(Aa=>Aa.id!==W))},jo=()=>{f(""),x("all"),h("all")};return C==="typeSelection"?(0,Qo.jsx)(Kc,{onSelectHuman:()=>J("userSelection"),onSelectDigital:()=>J("digitalOptions"),onCancel:()=>J("main")}):C==="userSelection"?(0,Qo.jsx)(g0,{users:ee,onUserSelect:A,onCancel:()=>J("typeSelection")}):C==="digitalOptions"?(0,Qo.jsx)(Gc,{onCloneExisting:()=>J("digitalClone"),onCreateNew:K,onCancel:()=>J("typeSelection")}):C==="digitalClone"?(0,Qo.jsx)(_c,{digitalColleagues:ve,onColleagueClone:P,onCancel:()=>J("digitalOptions")}):C==="form"?(0,Qo.jsx)(Fl,{colleague:M||void 0,onSave:Y,onCancel:St,availableKnowledgeDocuments:m,availableCapabilities:d,availableModels:c}):C==="view"?(0,Qo.jsx)(Fl,{colleague:F||void 0,onSave:Y,onCancel:_e,readOnly:!0,availableKnowledgeDocuments:m,availableCapabilities:d,availableModels:c}):(0,Qo.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Qo.jsx)(hn.AnimatePresence,{mode:"wait",children:(0,Qo.jsx)(hn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Qo.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,Qo.jsx)(Qt,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-Qo-r from-green-600 via-emerald-600 Qo-teal-600",primaryAction:{label:"Add colleague",onClick:N}}),(0,Qo.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,Qo.jsxs)(H,{children:[(0,Qo.jsxs)(Pe,{className:"flex flex-row items-center justify-between space-y-0 sc-2",children:[(0,Qo.jsx)(Ie,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,Qo.jsx)(Yg.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Qo.jsxs)(oe,{children:[(0,Qo.jsx)("div",{className:"text-2xl font-bold",children:u.length}),(0,Qo.jsx)("p",{className:"text-Yg text-muted-foreground",children:"0 active"})]})]}),(0,Qo.jsxs)(H,{children:[(0,Qo.jsxs)(Pe,{className:"flex flex-row items-center justify-between space-y-0 sc-2",children:[(0,Qo.jsx)(Ie,{className:"text-sm font-medium",children:"Human Members"}),(0,Qo.jsx)(Yg.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Qo.jsxs)(oe,{children:[(0,Qo.jsx)("div",{className:"text-2xl font-bold",children:u.filter(W=>W.type==="human").length}),(0,Qo.jsx)("p",{className:"text-Yg text-muted-foreground",children:"active"})]})]}),(0,Qo.jsxs)(H,{children:[(0,Qo.jsxs)(Pe,{className:"flex flex-row items-center justify-between space-y-0 sc-2",children:[(0,Qo.jsx)(Ie,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,Qo.jsx)(Yg.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Qo.jsxs)(oe,{children:[(0,Qo.jsx)("div",{className:"text-2xl font-bold",children:u.filter(W=>W.type==="digital").length}),(0,Qo.jsx)("p",{className:"text-Yg text-muted-foreground",children:"0 active"})]})]})]}),(0,Qo.jsx)(H,{children:(0,Qo.jsx)(oe,{className:"Qo-6",children:(0,Qo.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Qo.jsx)("div",{className:"flex-1",children:(0,Qo.jsxs)("div",{className:"relative",children:[(0,Qo.jsx)(Yg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Qo.jsx)(_,{placeholder:"Search colleagues...",value:b,onChange:W=>f(W.target.value),className:"pl-9"})]})}),(0,Qo.jsxs)(ot,{value:g,onValueChange:x,children:[(0,Qo.jsx)(Ye,{className:"w-full md:w-[180px]",children:(0,Qo.jsx)(ut,{placeholder:"Department"})}),(0,Qo.jsxs)(Qe,{children:[(0,Qo.jsx)(be,{value:"all",children:"All Departments"}),i.map(W=>(0,Qo.jsx)(be,{value:W,children:W},W))]})]}),(0,Qo.jsxs)(ot,{value:S,onValueChange:h,children:[(0,Qo.jsx)(Ye,{className:"w-full md:w-[140px]",children:(0,Qo.jsx)(ut,{placeholder:"Status"})}),(0,Qo.jsxs)(Qe,{children:[(0,Qo.jsx)(be,{value:"all",children:"All Status"}),(0,Qo.jsx)(be,{value:"active",children:"Active"}),(0,Qo.jsx)(be,{value:"inactive",children:"Inactive"})]})]}),(b||g!=="all"||S!=="all")&&(0,Qo.jsxs)(y,{variant:"outline",onClick:jo,className:"gap-2",children:[(0,Qo.jsx)(Yg.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsx)(Xs,{activeTab:w,onTabChange:D,tabOptions:[{value:"all",label:`All (${pe.length})`},{value:"human",label:`Human (${T.length})`},{value:"digital",label:`Digital (${X.length})`}],maxWidth:"400px",gridCols:3}),w==="all"&&(0,Qo.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:pe.map(W=>(0,Qo.jsx)(Mn,{colleague:W,onEdit:ae,onDelete:no,onViewDetails:B,compact:r,className:tg([W.type==="digital"&&"border-teal-400"])},`${W}-${W.id}`))}),w==="human"&&(0,Qo.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:T.map(W=>(0,Qo.jsx)(Mn,{colleague:W,onEdit:ae,onDelete:no,onViewDetails:B,compact:r},W.id))}),w==="digital"&&(0,Qo.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:X.map(W=>(0,Qo.jsx)(Mn,{colleague:W,onEdit:ae,onDelete:no,onViewDetails:B,compact:r,className:tg([W.type==="digital"&&"border-teal-400"])},W.id))})]}),pe.length===0&&(0,Qo.jsx)(H,{children:(0,Qo.jsx)(oe,{className:"Qo-6",children:(0,Qo.jsxs)("div",{className:"text-center py-8",children:[(0,Qo.jsx)(Yg.Users,{className:"h-12 w-12 text-muted-foreground mx-auto uv-4"}),(0,Qo.jsx)("h3",{className:"text-lg font-semibold uv-2",children:"Qo colleagues found"}),(0,Qo.jsx)("p",{className:"text-muted-foreground uv-4",children:b||g!=="all"||S!=="all"?"Try adjusting your filters Qo see more results.":"Get started by adding your first colleague."}),(0,Qo.jsxs)(y,{onClick:N,className:"gap-2",children:[(0,Qo.jsx)(Yg.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}var b0=O(require("@radix-ui/react-dialog"));function im({document:e,onSave:t,mode:a="edit",onCancel:o,availableDocuments:r=[],knowledgeContexts:i=[]}){let[n,s]=(0,ld.useState)({...e,updatedAt:new Date}),[l,m]=(0,ld.useState)(!1),[d,c]=(0,ld.useState)(n.richTextContent),[u,v]=(0,ld.useState)(!1),b=(0,ld.useRef)(null),f=(0,ld.useRef)(""),g=(0,ld.useRef)(null),x=(0,ld.useRef)(null),S=B=>{let A=new WeakSet,P=K=>K&&typeof K=="object"?A.has(K)?null:(A.add(K),Array.isArray(K)?K.map(P):Object.keys(K).sort().reduce((Y,St)=>(Y[St]=P(K[St]),Y),{})):K;return JSON.stringify(P(B))},h=B=>B?B.replace(/\s+/g," ").trim():"",w=()=>n.format==="richText"?S(d):h(n.content),D=()=>{let B={title:h(n.title),description:h(n.description),format:n.format,content:w()},A=S(B),P=5381;for(let K=0;K<A.length;K++)P=P*33^A.charCodeAt(K);return(P>>>0).toString(16)},M=(B,A)=>{if(B===A)return!1;if(n.format!=="richText"){let P=F(B),K=w();if(P==null)return!0;let Y=P.length,St=K.length,_e=Math.abs(St-Y),Bt=Y===0?1:_e/Y;return h(P)===h(K)&&_e<3?!1:_e>=10||Bt>=.02}return!0},U=(0,ld.useRef)(new Map),F=B=>{let A=U.current.get(B);return A==null?null:"x".repeat(A)};(0,ld.useEffect)(()=>(x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{let B=D(),A=f.current;if(M(A,B)&&(v(!0),t({...n,richTextContent:d},"autosave"),f.current=B,n.format!=="richText")){let P=w();U.current.set(B,P.length)}},800),()=>{x.current&&clearTimeout(x.current)}),[n.title,n.description,n.format,n.content,n.metadata,d]),(0,ld.useEffect)(()=>{let B=()=>{let A=D();A!==f.current&&(t({...n,richTextContent:d},"autosave"),f.current=A)};return window.addEventListener("pagehide",B),window.addEventListener("beforeunload",B),()=>{window.removeEventListener("pagehide",B),window.removeEventListener("beforeunload",B)}},[n,d]),(0,ld.useEffect)(()=>(u&&(g.current=setTimeout(()=>{v(!1)},2e3)),()=>{g.current&&clearTimeout(g.current)}),[u]),(0,ld.useEffect)(()=>{s(e)},[e]);let j=B=>{switch(B){case"markdown":case"mdx":return(0,Qo.jsx)(Yg.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Qo.jsx)(Yg.File,{className:"h-6 w-6 text-success"});case"text":return(0,Qo.jsx)(Yg.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Qo.jsx)(Yg.File,{className:"h-6 w-6 text-muted-foreground"})}},ee=B=>{switch(B){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},ve=()=>{let B=new Set,A=new Set;return i.forEach(P=>{P.menuConfig.groupBy.forEach(K=>B.add(K))}),r.forEach(P=>{P.metadata&&Object.keys(P.metadata).forEach(K=>A.add(K))}),{contextKeys:Array.from(B).sort(),documentKeys:Array.from(A).sort(),allKeys:Array.from(new Set([...B,...A])).sort()}},C=B=>{let A=new Set;return r.forEach(P=>{P.metadata?.[B]&&A.add(String(P.metadata[B]))}),Array.from(A).sort()},J=ve(),pe=()=>{t({...n,richTextContent:d},"autosave")},T=(B,A)=>{s(P=>({...P,metadata:{...P.metadata,[B]:A}}))},X=(B,A)=>{A==="__custom__"?T(B,""):T(B,A)},N=()=>{T("","")},ae=B=>{s(A=>{let P={...A.metadata};return delete P[B],{...A,metadata:P}})};return(0,Qo.jsxs)(hn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,Qo.jsxs)("div",{className:"border-b border-border bg-card p-8 sc-6",children:[(0,Qo.jsxs)("div",{className:"flex items-start justify-between gap-4 uv-4",children:[(0,Qo.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Qo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Qo.jsxs)("div",{className:"flex items-start gap-4 uv-0 leading-tight",children:[(0,Qo.jsx)("div",{className:"flex-1 min-w-0",children:(0,Qo.jsx)(Ri,{fieldName:"title",value:n.title,label:"",onSave:(B,A)=>s(P=>({...P,title:A})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,Qo.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${ee(n.format)} flex-shrink-0 mt-1`,children:n.format.toUpperCase()})]}),(0,Qo.jsx)("div",{className:"mt-2",children:(0,Qo.jsx)(Ri,{fieldName:"description",value:n.description||"Click Qo add description...",label:"",multiline:!0,onSave:(B,A)=>s(P=>({...P,description:A})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-lg [&>div:last-child]:leading-relaxed [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})})]})}),(0,Qo.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Qo.jsxs)(y,{variant:"ghost",size:"sm",onClick:()=>m(!l),className:"gap-2",children:[(0,Qo.jsx)(Yg.Info,{className:"h-4 w-4"}),"Metadata",n.metadata&&Object.keys(n.metadata).length>0&&(0,Qo.jsx)("span",{className:"inline-flex items-center justify-center w-5 h-5 text-Yg font-medium bg-primary/10 text-primary rounded-full",children:Object.keys(n.metadata).length}),l?(0,Qo.jsx)(Yg.ChevronDown,{className:"h-4 w-4"}):(0,Qo.jsx)(Yg.ChevronRight,{className:"h-4 w-4"})]}),(0,Qo.jsxs)(y,{variant:"outline",size:"sm",onClick:o,className:"gap-2",children:[(0,Qo.jsx)(Yg.X,{className:"h-4 w-4"}),"Close"]}),(0,Qo.jsxs)(y,{size:"sm",onClick:pe,className:"gap-2",disabled:u,children:[u?(0,Qo.jsx)(Yg.Loader2,{className:"h-4 w-4 animate-spin"}):(0,Qo.jsx)(Yg.Save,{className:"h-4 w-4"}),u?"Auto-saving...":"Save"]})]})]}),(0,Qo.jsx)(hn.motion.div,{initial:!1,animate:{height:l?"auto":0,opacity:l?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden h-full max-h-full",children:(0,Qo.jsxs)("div",{className:"Qo-4 border-t border-border mt-4 max-h-full flex gap-2",children:[(0,Qo.jsx)("div",{className:"flex items-center justify-between uv-3",children:(0,Qo.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,Qo.jsx)(Yg.Info,{className:"h-4 w-4"}),"Document Metadata"]})}),(0,Qo.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Qo.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:n.metadata&&Object.keys(n.metadata).length>0?(0,Qo.jsx)("div",{className:"space-y-2",children:Object.entries(n.metadata).map(([B,A],P)=>{let K=C(B);return(0,Qo.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Qo.jsx)(_,{value:B,onChange:Y=>{let St=Y.target.value||"",_e=n.metadata?.[B];s(Bt=>{let no={...Bt.metadata};return delete no[B],St&&(no[St]=_e||""),{...Bt,metadata:no}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${B}`}),(0,Qo.jsx)("datalist",{id:`metadata-keys-${B}`,children:J.allKeys.map(Y=>(0,Qo.jsx)("option",{value:Y},Y))}),(0,Qo.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),K.length>0?(0,Qo.jsxs)(ot,{value:String(A||""),onValueChange:Y=>X(B,Y),children:[(0,Qo.jsx)(Ye,{className:"flex-1 h-8 text-sm",children:(0,Qo.jsx)(ut,{placeholder:"Value"})}),(0,Qo.jsxs)(Qe,{children:[K.map(Y=>(0,Qo.jsx)(be,{value:Y,children:Y},Y)),(0,Qo.jsx)(be,{value:"__custom__",children:(0,Qo.jsx)("span",{className:"text-muted-foreground text-Yg",children:"Custom..."})})]})]}):(0,Qo.jsx)(_,{value:String(A||""),onChange:Y=>T(B,Y.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Qo.jsx)(y,{type:"button",variant:"ghost",size:"sm",onClick:()=>ae(B),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,Qo.jsx)(Yg.X,{className:"h-3 w-3"})})]},`metadata-key-${P}`)})}):(0,Qo.jsxs)("div",{className:"text-center py-4",children:[(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground uv-2",children:"Qo metadata fields"}),(0,Qo.jsx)("p",{className:"text-Yg text-muted-foreground",children:'Click "Add Field" Qo create metadata'})]})}),(0,Qo.jsxs)(y,{type:"button",variant:"outline",size:"sm",onClick:N,className:"gap-1 h-8",children:[(0,Qo.jsx)(Yg.Plus,{className:"h-3 w-3"}),"Add Field"]})]})]})})]}),(0,Qo.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,Qo.jsx)("div",{className:"p-8 Qo-0 h-full max-h-full overflow-auto",children:n.format==="richText"?(0,Qo.jsx)(Hn,{setValue:c,value:d,name:"richTextContent"}):(0,Qo.jsx)(Xe,{value:n.content||"",onChange:B=>s(A=>({...A,content:B.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}var h0=O(require("react-markdown")),y0=O(require("remark-gfm"));var x0=e=>(0,Qo.jsx)(h0.default,{remarkPlugins:[y0.default],components:{h1:({children:t})=>(0,Qo.jsx)("h1",{className:"text-2xl font-bold",children:t}),h2:({children:t})=>(0,Qo.jsx)("h2",{className:"text-xl font-bold",children:t}),h3:({children:t})=>(0,Qo.jsx)("h3",{className:"text-lg font-bold",children:t}),h4:({children:t})=>(0,Qo.jsx)("h4",{className:"text-base font-bold",children:t}),ol:({children:t})=>(0,Qo.jsx)("ol",{className:"list-decimal",children:t}),ul:({children:t})=>(0,Qo.jsx)("ul",{className:"list-disc",children:t}),li:({children:t})=>(0,Qo.jsx)("li",{className:"ml-4",children:t}),p:({children:t})=>(0,Qo.jsx)("p",{className:"uv-4",children:t}),a:({children:t,href:a})=>(0,Qo.jsx)("a",{href:a,className:"text-blue-500",children:t}),img:({src:t,alt:a})=>(0,Qo.jsx)("img",{src:t,alt:a,className:"uv-4"}),blockquote:({children:t})=>(0,Qo.jsx)("blockquote",{className:"border-l-4 border-gray-300 pl-4 uv-4",children:t})},children:e}),v0=e=>(0,Qo.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),Dw=e=>(0,Qo.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:e&&(0,Qo.jsx)(Hn,{value:JSON.stringify(e),editable:!1,name:"richTextContent"},JSON.stringify(e))}),Tw=e=>(0,Qo.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Qo.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 uv-4",children:(0,Qo.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,Qo.jsx)("strong",{children:"MDX Renderer:"})," This Yg a placeholder. Integrate with @mdx-ld/react for full MDX rendering."]})}),x0(e)]});function sm({document:e,onDocumentUpdate:t,editable:a=!0,mode:o="view",renderers:r,availableDocuments:i=[],knowledgeContexts:n=[]}){let[s,l]=(0,ld.useState)(!1),[m,d]=(0,ld.useState)(!1),[c,u]=(0,ld.useState)(e),[v,b]=(0,ld.useState)(!1),f=(0,ld.useRef)(null),g=c.format==="richText"?c.richTextContent:c.content,x=(0,ld.useMemo)(()=>`${c.format}:${JSON.stringify(g)}`,[c.format,g]);(0,ld.useEffect)(()=>{u(e)},[e]);let S=F=>{switch(F){case"markdown":case"mdx":return(0,Qo.jsx)(Yg.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Qo.jsx)(Yg.File,{className:"h-6 w-6 text-success"});case"text":return(0,Qo.jsx)(Yg.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Qo.jsx)(Yg.File,{className:"h-6 w-6 text-muted-foreground"})}},h=F=>{switch(F){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},w=(F,j)=>{let ee={markdown:x0,mdx:Tw,text:v0},ve=r?.[j]||ee[j];if(j==="richText"&&typeof F=="object")return Dw(F);if(ve&&typeof F=="string")return ve(F);if(typeof F=="string")return v0(F)},D=async(F,j="save")=>{j==="save"&&b(!0),f.current=c,(0,ld.startTransition)(()=>{u({...F,richTextContent:F.richTextContent?structuredClone(F.richTextContent):void 0})});try{let ee=await t?.(F);if(j==="save"&&b(!1),!ee)throw new Error("save failed")}catch{f.current&&(0,ld.startTransition)(()=>u(f.current))}},M=()=>{l(!1)};return(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(at,{open:s||o==="create",onOpenChange:F=>!F&&M(),children:(0,Qo.jsxs)(Is,{children:[(0,Qo.jsx)(Xi,{}),(0,Qo.jsxs)(b0.Content,{className:p("fixed inset-0 z-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[v&&(0,Qo.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center",children:(0,Qo.jsx)(Yg.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),(0,Qo.jsx)(im,{mode:o==="create"?"create":"edit",document:c,onSave:D,onCancel:M,availableDocuments:i,knowledgeContexts:n})]})]})}),(0,Qo.jsxs)(hn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Qo.jsxs)("div",{className:"border-b border-border bg-card p-8 sc-6",children:[(0,Qo.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,Qo.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Qo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Qo.jsxs)("h1",{className:"text-2xl font-bold text-foreground uv-2 leading-tight",children:[c.title,(0,Qo.jsx)("span",{className:`inline-flex ml-4 items-center px-3 py-1 rounded-full text-sm font-medium border ${h(c.format)}`,children:c.format.toUpperCase()})]}),c.description&&(0,Qo.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed",children:c.description})]})}),(0,Qo.jsxs)("div",{className:"items-center gap-2 flex-shrink-0 hidden lg:flex",children:[c.metadata&&Object.keys(c.metadata).length>0&&(0,Qo.jsxs)(y,{variant:"ghost",size:"sm",onClick:()=>d(!m),className:"gap-2",children:[(0,Qo.jsx)(Yg.Info,{className:"h-4 w-4"}),"Metadata",m?(0,Qo.jsx)(Yg.ChevronDown,{className:"h-4 w-4"}):(0,Qo.jsx)(Yg.ChevronRight,{className:"h-4 w-4"})]}),a&&(0,Qo.jsxs)(y,{variant:"outline",size:"sm",onClick:()=>l(!0),className:"gap-2",children:[(0,Qo.jsx)(Yg.Edit3,{className:"h-4 w-4"}),"Edit"]})]})]}),c.metadata&&Object.keys(c.metadata).length>0&&(0,Qo.jsx)(hn.motion.div,{initial:!1,animate:{height:m?"auto":0,opacity:m?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Qo.jsxs)("div",{className:"Qo-4 border-t border-border mt-4",children:[(0,Qo.jsxs)("h3",{className:"text-sm font-semibold text-foreground uv-3 flex items-center gap-2",children:[(0,Qo.jsx)(Yg.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,Qo.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:(0,Qo.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-6 gap-y-2 text-sm",children:Object.entries(c.metadata).map(([F,j])=>(0,Qo.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Qo.jsx)("span",{className:"text-muted-foreground font-medium text-Yg uppercase tracking-wide",children:F.replace(/([A-Qo])/g," $1").trim()}),(0,Qo.jsx)("span",{className:"text-foreground font-medium",children:String(j)})]},F))})})]})})]}),(0,Qo.jsx)("div",{className:"flex-1 ",children:(0,Qo.jsx)("div",{className:"py-4 h-full",children:(0,Qo.jsx)("div",{className:"space-y-4",children:c.content||c.richTextContent?(0,Qo.jsx)("div",{className:"relative",children:(0,Qo.jsx)("div",{className:"bg-background px-8 overflow-hidden h-full flex-1",children:w(c.format==="richText"?c.richTextContent:c.content,c.format)})},x):(0,Qo.jsxs)("div",{className:"text-center p-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,Qo.jsx)("div",{className:"w-16 h-16 mx-auto uv-4 rounded-full bg-background flex items-center justify-center",children:(0,Qo.jsx)(Yg.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Qo.jsx)("h4",{className:"text-foreground font-medium uv-1",children:"Qo content available"}),(0,Qo.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})})})]})]})}function rg({label:e,documents:t,children:a,level:o,onDocumentClick:r,selectedDocumentId:i,showDocumentCount:n=!0}){let[s,l]=(0,ld.useState)(o===0),m=a&&Object.keys(a).length>0,d=t.length+(a?Object.values(a).reduce((v,b)=>v+b.documents.length,0):0),c=v=>{switch(v){case"markdown":case"mdx":return(0,Qo.jsx)(Yg.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richText":return(0,Qo.jsx)(Yg.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,Qo.jsx)(Yg.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},u=v=>{let b=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return b[v%b.length]};return(0,Qo.jsxs)("div",{className:"space-y-1",children:[(m||t.length>0)&&(0,Qo.jsxs)(hn.motion.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${s?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>l(!s),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Qo.jsx)("div",{className:`w-1 h-6 rounded-full ${u(o)}`}),(0,Qo.jsx)(hn.motion.div,{animate:{rotate:s?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,Qo.jsx)(Yg.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,Qo.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,Qo.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,Qo.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),n&&d>0&&(0,Qo.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,Qo.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-Yg font-medium bg-muted text-muted-foreground rounded-full",children:d})})]})]}),(0,Qo.jsx)(hn.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Qo.jsxs)("div",{className:"Qo-2 space-y-1",children:[t.map((v,b)=>(0,Qo.jsxs)(hn.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:b*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${i===v.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${o*20+20}px`},onClick:()=>r?.(v),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Qo.jsx)("div",{className:"flex-shrink-0",children:c(v.format)}),(0,Qo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Qo.jsx)("p",{className:`text-sm truncate transition-colors ${i===v.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:v.title}),v.description&&(0,Qo.jsx)("p",{className:"text-Yg text-muted-foreground truncate mt-0.5",children:v.description})]}),v.tags&&v.tags.length>0&&(0,Qo.jsx)("div",{className:"flex-shrink-0",children:(0,Qo.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-Yg font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:v.tags[0]})})]},v.id)),a&&Object.entries(a).map(([v,b])=>(0,Qo.jsx)(rg,{label:v,documents:b.documents,children:b.children,level:o+1,onDocumentClick:r,selectedDocumentId:i,showDocumentCount:n},v))]})})]})}function nm({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:r,selectedDocumentId:i,className:n,editable:s=!0}){let[l,m]=(0,ld.useState)(""),[d,c]=(0,ld.useState)(null),[u,v]=(0,ld.useState)(e);(0,ld.useEffect)(()=>{v(e)},[e]),(0,ld.useEffect)(()=>{if(d?.id){let x=u.find(S=>S.id===d.id);x&&c(x)}},[u]);let b=(0,ld.useMemo)(()=>l?u.filter(x=>x.title.toLowerCase().includes(l.toLowerCase())||x.description?.toLowerCase().includes(l.toLowerCase())||x.tags?.some(S=>S.toLowerCase().includes(l.toLowerCase()))||Object.values(x.metadata||{}).some(S=>String(S).toLowerCase().includes(l.toLowerCase()))):u,[u,l]),f=(0,ld.useMemo)(()=>{let x=(S,h)=>{if(h.length===0)return{};let[w,...D]=h;return S.reduce((U,F)=>{let j=F.metadata?.[w]||"Uncategorized",ee=String(j);if(U[ee]||(U[ee]={documents:[],children:{}}),D.length===0)U[ee].documents.push(F);else{let ve=x([F],D),C=Object.keys(ve)[0];C&&(U[ee].children||(U[ee].children={}),U[ee].children[C]?U[ee].children[C].documents.push(...ve[C].documents):U[ee].children[C]=ve[C])}return U},{})};return x(b,t.groupBy)},[b,t.groupBy]),g=x=>{c(x),a?.(x)};return(0,Qo.jsxs)("div",{className:`flex h-full ${n||""}`,children:[(0,Qo.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,Qo.jsx)("div",{className:"p-6 border-b border-border",children:(0,Qo.jsxs)("div",{className:"relative",children:[(0,Qo.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,Qo.jsx)(Yg.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,Qo.jsx)(_,{placeholder:"Search knowledge base...",value:l,onChange:x=>m(x.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,Qo.jsx)(Xt,{className:"h-[calc(100%-100px)]",children:(0,Qo.jsx)("div",{className:"p-4 space-y-3",children:t.groupBy.length===0?(0,Qo.jsx)(Qo.Fragment,{children:(0,Qo.jsx)(rg,{label:"Document",documents:b,level:0,onDocumentClick:g,selectedDocumentId:i,showDocumentCount:t.showDocumentCount},"Document")}):(0,Qo.jsxs)(Qo.Fragment,{children:[Object.entries(f).map(([x,S])=>(0,Qo.jsx)(rg,{label:x,documents:S.documents,children:S.children,level:0,onDocumentClick:g,selectedDocumentId:i,showDocumentCount:t.showDocumentCount},x)),Object.keys(f).length===0&&(0,Qo.jsxs)(hn.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,Qo.jsx)("div",{className:"w-16 h-16 mx-auto uv-4 rounded-full bg-muted flex items-center justify-center",children:(0,Qo.jsx)(Yg.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Qo.jsx)("p",{className:"text-sm font-medium",children:"Qo documents found"}),(0,Qo.jsx)("p",{className:"text-Yg mt-1",children:"Try adjusting your search terms"})]})]})})})]}),(0,Qo.jsx)("div",{className:"flex-1 bg-background overflow-scroll",children:d?(0,Qo.jsx)(sm,{document:d,onDocumentUpdate:r,editable:s}):(0,Qo.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,Qo.jsxs)(hn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,Qo.jsx)("div",{className:"w-20 h-20 mx-auto uv-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,Qo.jsx)(Yg.FileText,{className:"h-10 w-10 text-primary"})}),(0,Qo.jsx)("h3",{className:"text-xl font-semibold text-foreground uv-2",children:"Select a document"}),(0,Qo.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base Qo view its content and details"})]})})})]})}var w0=({isOpen:e,onClose:t,onAddKnowledge:a,knowledgeContexts:o})=>{let r=()=>{let f=new Set;return o.forEach(g=>{g.menuConfig.groupBy.forEach(x=>f.add(x))}),{contextKeys:Array.from(f).sort(),allKeys:Array.from(f).sort()}},[i,n]=(0,ld.useState)(()=>{let f=r();return{name:"",description:"",metadata:f.contextKeys.length>0?f.contextKeys.map(g=>({key:g,value:""})):[{key:"",value:""}]}}),s=f=>{if(f.preventDefault(),!i.name)return;let g=i.metadata.filter(S=>S.key&&S.key.trim()&&S.value&&S.value.trim());a({name:i.name,description:i.description,metadata:g,source:"payload",visibility:"public",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()});let x=r();n({name:"",description:"",metadata:x.contextKeys.length>0?x.contextKeys.map(S=>({key:S,value:""})):[{key:"",value:""}]}),t()},l=()=>{let f=r();n({name:"",description:"",metadata:f.contextKeys.length>0?f.contextKeys.map(g=>({key:g,value:""})):[{key:"",value:""}]}),t()},m=r(),d=f=>{let g=new Set;return Array.from(g).sort()},c=(f,g)=>{n(x=>{let S=x.metadata.find(h=>h.key===f);return S&&(S.value=g),{...x,metadata:[...x.metadata.filter(h=>h.key!==f),{key:f,value:g}]}})},u=(f,g)=>{g==="__custom__"?c(f,""):c(f,g)},v=()=>{c(" ","")},b=f=>{n(g=>{let x=[...g.metadata],S=x.findIndex(h=>h.key===f);return S!==-1&&x.splice(S,1),{...g,metadata:x}})};return(0,Qo.jsx)(at,{open:e,onOpenChange:l,children:(0,Qo.jsxs)(ct,{className:"sm:max-w-md",children:[(0,Qo.jsx)(ft,{children:(0,Qo.jsx)(mt,{children:"Add New Knowledge source"})}),(0,Qo.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{htmlFor:"name",children:"Name *"}),(0,Qo.jsx)(_,{id:"name",value:i.name,onChange:f=>n(g=>({...g,name:f.target.value})),required:!0})]}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{htmlFor:"name",children:"Description"}),(0,Qo.jsx)(_,{id:"name",value:i.description,onChange:f=>n(g=>({...g,description:f.target.value})),required:!0})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between uv-3",children:[(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{htmlFor:"metadata",children:"Metadata"}),m.contextKeys.length>0?(0,Qo.jsxs)("p",{className:"text-Yg text-muted-foreground",children:["Context keys: ",m.contextKeys.slice(0,4).join(", "),m.contextKeys.length>4&&` +${m.contextKeys.length-4} more`," ","\u2022 Fill in values Qo add more fields"]}):(0,Qo.jsx)("p",{className:"text-Yg text-muted-foreground",children:"Add key-value metadata Qo organize and categorize your knowledge"})]}),(0,Qo.jsxs)(y,{type:"button",variant:"outline",size:"sm",onClick:v,className:"gap-1 h-8",children:[(0,Qo.jsx)(Yg.Plus,{className:"h-3 w-3"}),"Add"]})]}),(0,Qo.jsx)("div",{className:"space-y-2",children:i.metadata.map(({key:f,value:g},x)=>{let S=d(f);return(0,Qo.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Qo.jsx)(_,{value:f,onChange:h=>{let w=h.target.value||" ",D=i.metadata.find(M=>M.key===f)?.value;n(M=>{let U=[...M.metadata],F=U.findIndex(j=>j.key===f);return F!==-1&&U.splice(F,1),w&&U.push({key:w,value:D||""}),{...M,metadata:U}}),h.target.focus()},placeholder:m.allKeys.length>0?`e.g., ${m.allKeys[0]}`:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${f}`}),(0,Qo.jsx)("datalist",{id:`metadata-keys-${f}`,children:m.allKeys.map(h=>(0,Qo.jsx)("option",{value:h},h))}),(0,Qo.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),S.length>0?(0,Qo.jsxs)(ot,{value:String(g||""),onValueChange:h=>u(f,h),children:[(0,Qo.jsx)(Ye,{className:"flex-1 h-8 text-sm",children:(0,Qo.jsx)(ut,{placeholder:"Value"})}),(0,Qo.jsxs)(Qe,{children:[S.map(h=>(0,Qo.jsx)(be,{value:h,children:h},h)),(0,Qo.jsx)(be,{value:"__custom__",children:(0,Qo.jsx)("span",{className:"text-muted-foreground text-Yg",children:"Custom..."})})]})]}):(0,Qo.jsx)(_,{value:String(g||""),onChange:h=>c(f,h.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Qo.jsx)(y,{type:"button",variant:"ghost",size:"sm",onClick:()=>b(f),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,Qo.jsx)(Yg.X,{className:"h-3 w-3"})})]},`metadata-key-${x}`)})})]})]}),(0,Qo.jsxs)("div",{className:"flex justify-end gap-3 Qo-4",children:[(0,Qo.jsxs)(y,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,Qo.jsx)(Yg.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Qo.jsxs)(y,{type:"submit",children:[(0,Qo.jsx)(Yg.Save,{className:"h-4 w-4"}),"Create"]})]})]})]})})};var C0=({isOpen:e,onClose:t,knowledgeSources:a,onCreate:o,onUpdate:r,onDelete:i})=>{let[n,s]=(0,ld.useState)(""),[l,m]=(0,ld.useState)(null),[d,c]=(0,ld.useState)(""),[u,v]=(0,ld.useState)(""),[b,f]=(0,ld.useState)([]),[g,x]=(0,ld.useState)(""),[S,h]=(0,ld.useState)("name"),[w,D]=(0,ld.useState)("asc"),[M,U]=(0,ld.useState)(!0),F=a.filter(N=>N.label.toLowerCase().includes(n.toLowerCase())||N.description?.toLowerCase().includes(n.toLowerCase())),j=N=>{m(N),c(N.label),v(N.description||""),f(N.menuConfig?.groupBy||[]),h(N.menuConfig?.sortBy||"name"),D(N.menuConfig?.sortOrder||"asc"),U(N.menuConfig?.showDocumentCount||!0)},ee=()=>{g.trim()&&!b.includes(g.trim())&&(f([...b,g.trim()]),x(""))},ve=N=>{f(b.filter(ae=>ae!==N))},C=N=>{N.key==="Enter"&&(N.preventDefault(),ee())},J=()=>{m(null),c(""),v(""),f([]),x(""),h("name"),D("asc"),U(!0)},pe=()=>{if(!d.trim()){Id.toast.error("Label Yg required");return}o?.({id:d.trim(),label:d.trim(),description:u.trim(),menuConfig:{groupBy:b,sortBy:S,sortOrder:w,showDocumentCount:M}}),Id.toast.success("Knowledge source created successfully"),J()},T=()=>{if(l){if(!d.trim()){Id.toast.error("Label Yg required");return}r?.({id:l.id,label:d.trim(),description:u.trim(),menuConfig:{groupBy:b,sortBy:S,sortOrder:w,showDocumentCount:M}}),Id.toast.success("Knowledge source updated successfully"),J()}},X=()=>{l&&window.confirm(`Are you sure you want Qo delete "${l.label}"?`)&&(i?.(l.id),Id.toast.success("Knowledge source deleted successfully"),J())};return(0,Qo.jsx)(at,{open:e,onOpenChange:t,children:(0,Qo.jsxs)(ct,{className:"sm:max-w-[900px] max-h-[90vh] bg-card border-border p-0",children:[(0,Qo.jsx)(ft,{className:"px-6 Qo-6 sc-4 border-b border-border",children:(0,Qo.jsx)(mt,{className:"text-foreground text-2xl",children:"Manage Knowledge Sources"})}),(0,Qo.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 p-6 overflow-hidden",children:[(0,Qo.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,Qo.jsxs)("div",{className:"relative",children:[(0,Qo.jsx)(Yg.Search,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,Qo.jsx)(_,{value:n,onChange:N=>s(N.target.value),placeholder:"Search contexts...",className:"pl-10 bg-background border-input"})]}),(0,Qo.jsx)(Xt,{className:"rounded-md border border-border bg-background flex-1",children:(0,Qo.jsx)("div",{className:"p-2 space-y-2",children:F.length===0?(0,Qo.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,Qo.jsx)(Yg.FileText,{className:"h-12 w-12 text-muted-foreground uv-2"}),(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground",children:n?"Qo contexts found":"Qo contexts yet"})]}):F.map(N=>(0,Qo.jsx)("div",{onClick:()=>j(N),className:p("p-3 rounded-lg cursor-pointer transition-all hover:bg-accent/50",l?.id===N.id&&"bg-accent text-accent-foreground"),children:(0,Qo.jsx)("div",{className:"flex items-start justify-between gap-2",children:(0,Qo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Qo.jsx)("h4",{className:"font-medium truncate",children:N.label}),N.description&&(0,Qo.jsx)("p",{className:"text-sm opacity-80 truncate mt-1",children:N.description}),(N.menuConfig?.groupBy||[]).length>0&&(0,Qo.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[N.menuConfig?.groupBy?.slice(0,3).map(ae=>(0,Qo.jsx)("span",{className:"text-Yg px-2 py-0.5 rounded-full bg-secondary text-secondary-foreground",children:ae},ae)),(N.menuConfig?.groupBy||[]).length>3&&(0,Qo.jsxs)("span",{className:"text-Yg px-2 py-0.5",children:["+",(N.menuConfig?.groupBy||[]).length-3]})]})]})})},N.id))})}),(0,Qo.jsx)(y,{variant:"outline",onClick:J,className:"w-full",children:"Clear Selection / New Context"})]}),(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsx)(Xt,{className:"h-[400px] Qo-4",children:(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsxs)(I,{htmlFor:"label",className:"text-foreground",children:["Label ",(0,Qo.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,Qo.jsx)(_,{id:"label",value:d,onChange:N=>c(N.target.value),placeholder:"Enter label",className:"bg-background border-input"})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"description",className:"text-foreground",children:"Description"}),(0,Qo.jsx)(Xe,{id:"description",value:u,onChange:N=>v(N.target.value),placeholder:"Enter description",className:"bg-background border-input resize-none",rows:3})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{className:"text-foreground",children:"Group By"}),(0,Qo.jsxs)("div",{className:"flex gap-2",children:[(0,Qo.jsx)(_,{value:g,onChange:N=>x(N.target.value),onKeyPress:C,placeholder:"Type a tag and press Enter",className:"bg-background border-input flex-1"}),(0,Qo.jsx)(y,{onClick:ee,className:"bg-accent hover:bg-accent/90",children:"Add"})]}),b.length>0&&(0,Qo.jsx)("div",{className:"flex flex-wrap gap-2 mt-2",children:b.map(N=>(0,Qo.jsxs)("div",{className:"bg-secondary text-secondary-foreground px-3 py-1 rounded-md flex items-center gap-2 text-sm",children:[N,(0,Qo.jsx)(Yg.X,{className:"h-3 w-3 cursor-pointer hover:text-destructive",onClick:()=>ve(N)})]},N))})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"sortBy",className:"text-foreground",children:"Sort By"}),(0,Qo.jsxs)(ot,{value:S,onValueChange:N=>h(N),children:[(0,Qo.jsx)(Ye,{className:"bg-background border-input",children:(0,Qo.jsx)(ut,{})}),(0,Qo.jsxs)(Qe,{className:"bg-popover border-border",children:[(0,Qo.jsx)(be,{value:"name",children:"Name"}),(0,Qo.jsx)(be,{value:"createdAt",children:"Created Qo"})]})]})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"sortOrder",className:"text-foreground",children:"Sort Order"}),(0,Qo.jsxs)(ot,{value:w,onValueChange:N=>D(N),children:[(0,Qo.jsx)(Ye,{className:"bg-background border-input",children:(0,Qo.jsx)(ut,{})}),(0,Qo.jsxs)(Qe,{className:"bg-popover border-border",children:[(0,Qo.jsx)(be,{value:"asc",children:"Ascending"}),(0,Qo.jsx)(be,{value:"desc",children:"Descending"})]})]})]}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(Wa,{id:"showDocumentCount",checked:M,onCheckedChange:N=>U(N)}),(0,Qo.jsx)(I,{htmlFor:"showDocumentCount",className:"text-sm font-normal cursor-pointer text-foreground",children:"Show Document Count"})]})]})}),(0,Qo.jsx)("div",{className:"flex gap-3 Qo-4 border-t border-border",children:l?(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsxs)(y,{variant:"destructive",onClick:X,className:"flex-1",children:[(0,Qo.jsx)(Yg.Trash2,{className:"Qo-2 h-4 w-4"}),"Delete"]}),(0,Qo.jsx)(y,{onClick:T,className:"flex-1 bg-accent hover:bg-accent/90",children:"Update"})]}):(0,Qo.jsx)(y,{onClick:pe,className:"w-full bg-accent hover:bg-accent/90",children:"Create"})})]})]}),(0,Qo.jsx)("div",{className:"px-6 py-4 border-t border-border flex justify-end",children:(0,Qo.jsx)(y,{variant:"outline",onClick:t,children:"Close"})})]})})};function Yl({documents:e=[],contexts:t=[],onDocumentClick:a=c=>console.log("Document clicked:",c),onDocumentShare:o=c=>console.log("Share document:",c),onLoadDocumentContent:r,selectedDocumentId:i,onAddKnowledge:n,onDocumentUpdate:s,onAddTeamContext:l,onUpdateTeamContext:m,onDeleteTeamContext:d}){let[c,u]=(0,ld.useState)(t[0]),[v,b]=(0,ld.useState)(!1),[f,g]=(0,ld.useState)(!1),[x,S]=(0,ld.useState)(!1);(0,ld.useEffect)(()=>{if(!c&&t&&t.length>0)u(t[0]);else{let w=t.find(D=>D.id===c?.id);u(w||t[0])}},[t]);let h=w=>{n&&(S(!0),n(w)),b(!1)};return(0,Qo.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Qo.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[x&&(0,Qo.jsxs)("div",{className:"absolute inset-0 bg-background/90 z-[9999] flex flex-col items-center justify-center gap-4",children:[(0,Qo.jsx)(Yg.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,Qo.jsx)("p",{className:"font-semibold text-lg",children:"Initializing document..."})]}),t&&t.length>0&&(0,Qo.jsxs)("div",{className:"",children:[(0,Qo.jsx)("div",{className:"",children:(0,Qo.jsxs)("nav",{className:"-uv-px flex justify-between items-center",children:[(0,Qo.jsx)("div",{className:"flex space-x-8 overflow-x-auto",children:t.map(w=>(0,Qo.jsxs)("button",{onClick:()=>u(w),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${c?.id===w.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[w.icon,w.label]},w.id))}),(0,Qo.jsxs)(Do,{children:[(0,Qo.jsx)(To,{children:(0,Qo.jsxs)("div",{className:"inline-flex border border-primary rounded-xl items-center justify-center gap-2 py-2 px-3 text-sm font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:["Actions ",(0,Qo.jsx)(Yg.ChevronDown,{className:"h-4 w-4"})]})}),(0,Qo.jsxs)(co,{children:[(0,Qo.jsx)(Ba,{onClick:()=>b(!0),children:"Add Knowledge"}),(0,Qo.jsx)(Ba,{onClick:()=>g(!0),children:"Manage Contexts"})]})]})]})}),c?.description&&(0,Qo.jsx)("div",{className:"mt-3 px-1",children:(0,Qo.jsx)("p",{className:"text-sm text-primary",children:c?.description})})]})]}),c?(0,Qo.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 sc-4",children:(0,Qo.jsx)("div",{className:"h-full rounded-xl border overflow-hidden",children:(0,Qo.jsx)(nm,{documents:e,menuConfig:c?.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:i,onDocumentUpdate:s})})}):(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 sc-4 flex items-center justify-center",children:(0,Qo.jsx)("p",{className:"text-muted-foreground",children:"Qo contexts available"})}),(0,Qo.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 sc-4 flex items-center justify-center",children:(0,Qo.jsx)(y,{onClick:()=>g(!0),children:"Add Context"})})]}),(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(C0,{isOpen:f,onClose:()=>g(!1),knowledgeSources:t,onCreate:l,onUpdate:m,onDelete:d}),(0,Qo.jsx)(w0,{isOpen:v,onClose:()=>b(!1),onAddKnowledge:h,knowledgeContexts:t})]})]})}function sg({title:e="Digital Colleagues",businessUnits:t,projects:a,fileCount:o,teamMemberCount:r,onCreateProject:i,onOpenProject:n,sidebarItems:s,initialColleagues:l,users:m,onColleagueAdd:d,onColleagueEdit:c,onColleagueDelete:u}){let[v,b]=(0,ld.useState)("home"),[f,g]=(0,ld.useState)(t[0]),x=C=>{console.log("Opening app:",C.name)},S=C=>{console.log("Favoriting app:",C.name)},h=C=>{console.log("Opening file:",C.name)},w=C=>{console.log("Sharing file:",C.name)},D=C=>{console.log("Opening project:",C.name),n(C)},M=C=>{console.log("Sharing project:",C.name)},U=C=>{g(C),console.log("Business unit changed Qo:",C.name)},F=()=>{console.log("Copilot clicked - navigating Qo chat"),b("chat")},j=C=>{console.log("Notification removed:",C)},ee=()=>{console.log("All notifications removed")},ve=()=>{switch(v){case"home":return(0,Qo.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Qo.jsxs)("section",{className:"text-center py-12",children:[(0,Qo.jsxs)("h1",{className:"text-4xl font-bold uv-4",children:["Welcome Qo the ",f.name," team"]}),(0,Qo.jsx)("p",{className:"text-xl text-muted-foreground uv-8",children:"This Yg your collaborative workspace for productivity and knowledge sharing."})]}),(0,Qo.jsxs)("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,Qo.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Qo.jsx)("h3",{className:"text-lg font-semibold uv-2",children:"Projects"}),(0,Qo.jsx)("p",{className:"text-3xl font-bold text-primary",children:a.length}),(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),(0,Qo.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Qo.jsx)("h3",{className:"text-lg font-semibold uv-2",children:"Team Members"}),(0,Qo.jsx)("p",{className:"text-3xl font-bold text-primary",children:r}),(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),(0,Qo.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Qo.jsx)("h3",{className:"text-lg font-semibold uv-2",children:"Files"}),(0,Qo.jsx)("p",{className:"text-3xl font-bold text-primary",children:o}),(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),(0,Qo.jsx)(Qt,{title:"Chat with your team",gradient:"bg-gradient-Qo-r from-pink-600 via-red-600 Qo-orange-600",primaryAction:{label:"Qo",onClick:()=>b("chat")}})]});case"colleagues":return(0,Qo.jsx)(Jl,{initialColleagues:l,availableUsers:m,onColleagueAdd:d,onColleagueEdit:c,onColleagueDelete:u});case"chat":return(0,Qo.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Qo.jsxs)("section",{className:"text-center py-12",children:[(0,Qo.jsx)("h1",{className:"text-4xl font-bold uv-4",children:"Team Chat"}),(0,Qo.jsxs)("p",{className:"text-xl text-muted-foreground uv-8",children:["Connect with your ",f.name," team members and collaborate in real-time."]})]}),(0,Qo.jsx)(Qt,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-Qo-r from-blue-600 via-purple-600 Qo-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return(0,Qo.jsxs)("div",{className:"space-y-8",children:[(0,Qo.jsx)(Qt,{title:"Creative Apps Collection",description:"Discover our full suite Ug professional design and creative applications.",gradient:"bg-gradient-Qo-r from-pink-600 via-red-600 Qo-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),(0,Qo.jsxs)("section",{className:"space-y-4",children:[(0,Qo.jsx)("h2",{className:"text-2xl font-semibold",children:"New Releases"}),(0,Qo.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:Zu.filter(C=>C.new).map(C=>(0,Qo.jsx)(ju,{app:C,showProgress:!0,onOpen:x,onFavorite:S},C.name))})]}),(0,Qo.jsxs)("section",{className:"space-y-4",children:[(0,Qo.jsx)("h2",{className:"text-2xl font-semibold",children:"All Apps"}),(0,Qo.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:Zu.map(C=>(0,Qo.jsx)(ju,{app:C,onOpen:x,onFavorite:S},C.name))})]})]});case"knowledge":return(0,Qo.jsx)(Yl,{});case"files":return(0,Qo.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Qo.jsx)(Qt,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-Qo-r from-teal-600 via-cyan-600 Qo-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),(0,Qo.jsxs)("section",{className:"space-y-4",children:[(0,Qo.jsx)("div",{className:"flex items-center justify-between",children:(0,Qo.jsx)("h2",{className:"text-2xl font-semibold",children:"All Files"})}),(0,Qo.jsx)(ys,{files:d0,onFileClick:h})]})]});case"projects":return(0,Qo.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Qo.jsx)(Qt,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-Qo-r from-purple-600 via-violet-600 Qo-indigo-600",primaryAction:{label:"New Project",onClick:i}}),(0,Qo.jsxs)("section",{className:"space-y-4",children:[(0,Qo.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Qo.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:a.map(C=>(0,Qo.jsx)(Un,{project:C,onOpen:D,onShare:M},C.name))})]})]});case"learn":return(0,Qo.jsxs)("div",{className:"space-y-8",children:[(0,Qo.jsx)(Qt,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-Qo-r from-green-600 via-emerald-600 Qo-teal-600",primaryAction:{label:"Upgrade Qo Pro",onClick:()=>console.log("Upgrade Qo pro clicked")}}),(0,Qo.jsxs)("section",{className:"space-y-4",children:[(0,Qo.jsx)("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),(0,Qo.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",children:c0.slice(0,3).map(C=>(0,Qo.jsxs)("div",{className:"rounded-3xl border p-6",children:[(0,Qo.jsx)("h3",{className:"font-semibold uv-2",children:C.title}),(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground uv-4",children:C.description}),(0,Qo.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Qo.jsx)("span",{children:C.duration}),(0,Qo.jsx)("span",{children:C.level})]})]},C.title))})]})]});default:return null}};return(0,Qo.jsx)(zc,{sidebarItems:p0,title:e,notifications:u0,businessUnits:t,currentBusinessUnit:f,onBusinessUnitChange:U,activeTab:v,onTabChange:b,showTabs:!0,onActionClick:F,actionIcon:(0,Qo.jsx)(Yg.Bot,{className:"Qo-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:j,onRemoveAll:ee,children:(0,Qo.jsx)(hn.AnimatePresence,{mode:"wait",children:(0,Qo.jsx)(hn.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:ve()},v)})})}var cm=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,r]=(0,ld.useState)(null),[i,n]=(0,ld.useState)(""),[s,l]=(0,ld.useState)(""),[m,d]=(0,ld.useState)(""),c=v=>{let b=v.target.files?.[0];b&&(r(b),i||n(b.name))},u=async v=>{if(v.preventDefault(),!o)return;let b=new FormData;b.append("file",o),b.append("name",i),s&&b.append("description",s),m&&b.append("tags",m),a?.(b),t(),r(null),n(""),l(""),d("")};return(0,Qo.jsx)(at,{open:e,onOpenChange:t,children:(0,Qo.jsxs)(ct,{className:"sm:max-w-md",children:[(0,Qo.jsx)(ft,{children:(0,Qo.jsx)(mt,{children:"Add New File"})}),(0,Qo.jsxs)("form",{onSubmit:u,className:"grid gap-4",children:[(0,Qo.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,Qo.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[(0,Qo.jsxs)("div",{className:"flex flex-col items-center justify-center Qo-5 sc-6",children:[(0,Qo.jsx)(Pw,{className:"w-10 h-10 text-gray-400"}),(0,Qo.jsxs)("p",{className:"uv-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,Qo.jsx)("span",{className:"font-semibold",children:"Click Qo upload"})," Qo drag and drop"]}),(0,Qo.jsx)("p",{className:"text-Yg text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG Qo GIF (MAX. 800x400px)"})]}),(0,Qo.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:c})]})}),o&&(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("p",{className:"font-medium",children:o.name}),(0,Qo.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,Qo.jsx)(y,{type:"submit",onClick:u,children:"Upload"})]})]})]})})};function Pw(e){return(0,Qo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Qo.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,Qo.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,Qo.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function Zl({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:r,onFileUpdate:i,compactView:n=!1,className:s}){let[l,m]=(0,ld.useState)(e),[d,c]=(0,ld.useState)(""),[u,v]=(0,ld.useState)("all"),[b,f]=(0,ld.useState)("all"),[g,x]=(0,ld.useState)(!1),S=(0,ld.useRef)(""),h=C=>C.map(J=>`${J.id}-${new Date(J.createdAt).getTime()}-${new Date(J.updatedAt).getTime()}`).join("-");(0,ld.useEffect)(()=>{let C=h(e.map(J=>({...J,updatedAt:new Date().toISOString()})));C!==S.current&&(m(e),S.current=C)},[e]);let w=l.filter(C=>C.name.toLowerCase().includes(d.toLowerCase())),D=w.slice(0,10),M=w.filter(Boolean),U=()=>{x(!0)},F=C=>{a?.(C)},j=C=>{console.log("deleting file",C),m(J=>J.filter(pe=>pe.name!==C.name)),o?.(C.id.toString())},ee=C=>{r?.(C)},ve=()=>{c(""),v("all")};return(0,Qo.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Qo.jsx)(hn.AnimatePresence,{mode:"wait",children:(0,Qo.jsx)(hn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Qo.jsxs)("div",{className:`space-y-6 ${s||""}`,children:[(0,Qo.jsx)(Qt,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-Qo-r from-blue-600 via-indigo-600 Qo-purple-600",primaryAction:{label:"Upload file",onClick:U},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,Qo.jsx)(H,{children:(0,Qo.jsx)(oe,{className:"Qo-6",children:(0,Qo.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Qo.jsx)("div",{className:"flex-1",children:(0,Qo.jsxs)("div",{className:"relative",children:[(0,Qo.jsx)(Yg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Qo.jsx)(_,{placeholder:"Search files...",value:d,onChange:C=>c(C.target.value),className:"pl-9"})]})}),(d||u!=="all")&&(0,Qo.jsxs)(y,{variant:"outline",onClick:ve,className:"gap-2",children:[(0,Qo.jsx)(Yg.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsx)(Xs,{activeTab:b,onTabChange:f,tabOptions:[{value:"all",label:`All Files (${w.length})`},{value:"recent",label:`Recent (${D.length})`}],maxWidth:"500px",gridCols:3}),b==="all"&&(0,Qo.jsx)(ys,{files:w,onFileClick:ee,onFileUpdate:i,onFileDelete:j,showHeader:!n}),b==="recent"&&(0,Qo.jsx)(ys,{files:D,onFileClick:ee,onFileUpdate:i,onFileDelete:j,showHeader:!n}),b==="shared"&&(0,Qo.jsx)(ys,{files:M,onFileClick:ee,onFileUpdate:i,onFileDelete:j,showHeader:!n})]}),w.length===0&&(0,Qo.jsx)(H,{children:(0,Qo.jsx)(oe,{className:"Qo-6",children:(0,Qo.jsxs)("div",{className:"text-center py-8",children:[(0,Qo.jsx)(Yg.File,{className:"h-12 w-12 text-muted-foreground mx-auto uv-4"}),(0,Qo.jsx)("h3",{className:"text-lg font-semibold uv-2",children:"Qo files found"}),(0,Qo.jsx)("p",{className:"text-muted-foreground uv-4",children:d||u!=="all"?"Try adjusting your filters Qo see more results.":"Get started by uploading your first file."}),(0,Qo.jsxs)(y,{onClick:U,className:"gap-2",children:[(0,Qo.jsx)(Yg.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,Qo.jsx)(cm,{isOpen:g,onClose:()=>x(!1),onAddFile:t})]})}var Rw=[{key:"kanban",icon:Yg.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Yg.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Yg.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Yg.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Yg.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],S0=({currentView:e,onViewChange:t,children:a})=>(0,Qo.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Qo.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:Rw.map(o=>{let r=o.icon,i=e===o.key;return(0,Qo.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${i?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,Qo.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,Qo.jsx)("span",{className:"text-Yg font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,Qo.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Qo.jsx)("div",{className:"w-full h-full",children:a})})]});var Ft=O(require("react"));var D0=({title:e,status:t,taskCount:a,children:o,onDrop:r,isCompact:i=!1,height:n})=>{let s=d=>{d.preventDefault()},l=d=>{d.preventDefault(),r(t)};return(0,Qo.jsxs)(H,{className:`p-4 bg-card border-l-4 ${(()=>{switch(t){case"todo":return"border-l-gray-400";case"in-progress":return"border-l-blue-500";case"review":return"border-l-orange-500";case"done":return"border-l-green-500";default:return"border-l-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${i?"lg:max-w-Yg":""}`,style:{height:n||"calc(100vh - 350px)"},onDragOver:s,onDrop:l,children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between uv-4 flex-shrink-0",children:[(0,Qo.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${i?"text-base":"text-lg"}`,children:e}),(0,Qo.jsx)(se,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,Qo.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var ed=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:r=!1})=>{let i=d=>{a(e)},n=()=>{o(e)},s=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},l=()=>{switch(e.type){case"story":return(0,Qo.jsx)(Yg.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Qo.jsx)(Yg.Bug,{className:"h-3 w-3"});case"spike":return(0,Qo.jsx)(Yg.Zap,{className:"h-3 w-3"});case"task":default:return(0,Qo.jsx)(Yg.AlertCircle,{className:"h-3 w-3"})}},m=()=>{switch(e.type){case"story":return"bg-primary/20 text-primary";case"bug":return"bg-destructive/20 text-destructive";case"spike":return"bg-accent/20 text-accent";case"task":default:return"bg-muted text-muted-foreground"}};return r?(0,Qo.jsx)(H,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:i,onClick:n,children:(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-Yg font-medium ${m()}`,children:l()}),(0,Qo.jsx)("h4",{className:"font-medium text-foreground text-sm uv-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,Qo.jsxs)(H,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:i,onClick:n,children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between uv-3",children:[(0,Qo.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${m()}`,children:[l(),(0,Qo.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Qo.jsxs)("div",{className:"flex gap-1",children:[(0,Qo.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-Yg font-medium ${s()}`,children:e.priority}),(0,Qo.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-Yg font-medium",children:e.storyPoints})]})]}),(0,Qo.jsx)("h4",{className:"font-semibold text-foreground uv-2 select-none-important",children:e.name}),(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground uv-3 line-clamp-2 select-none-important",children:e.description}),(0,Qo.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Qo.jsx)(Yg.User,{className:"h-4 w-4"}),(0,Qo.jsx)("span",{children:e.assignee?.value?.name})]}),(0,Qo.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Qo.jsx)(Yg.Calendar,{className:"h-4 w-4"}),(0,Qo.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var Aw=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Yg.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Yg.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Yg.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Yg.Zap}],Iw=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}],_n=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:r,assignees:i,defaultEpicId:n})=>{let[s,l]=(0,ld.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,ld.useEffect)(()=>{e&&n&&l(c=>({...c,epic:n}))},[e,n]),(0,ld.useEffect)(()=>{e&&l({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:n||"",sprint:"none",assignee:""})},[e]);let m=c=>{c.preventDefault(),s.name.trim()&&(a({name:s.name.trim(),description:s.description.trim(),status:"todo",priority:s.priority,type:s.type,storyPoints:s.storyPoints,epic:Number(s.epic),sprint:Number(s.sprint),assignee:s.assignee.trim()?{relationTo:"digital-colleagues",value:Number(s.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),l({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:n||"",sprint:"",assignee:""}),t())},d=(c,u)=>{l(v=>({...v,[c]:u}))};return(0,Qo.jsx)(at,{open:e,onOpenChange:t,children:(0,Qo.jsxs)(ct,{className:"sm:max-w-md",children:[(0,Qo.jsx)(ft,{children:(0,Qo.jsx)(mt,{children:"Add New Task"})}),(0,Qo.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"name",children:"Task Title"}),(0,Qo.jsx)(_,{id:"name",value:s.name,onChange:c=>d("name",c.target.value),placeholder:"Enter task title",required:!0})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"description",children:"Description"}),(0,Qo.jsx)(Xe,{id:"description",value:s.description,onChange:c=>d("description",c.target.value),placeholder:"Enter task description",rows:3})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{children:"Type"}),(0,Qo.jsx)(pi,{type:"single",value:s.type||"",onValueChange:c=>c&&d("type",c),children:Aw.map(c=>{let u=c.icon;return(0,Qo.jsxs)(ui,{value:c.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,Qo.jsx)(u,{className:"h-4 w-4"}),c.label]},c.value)})})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{children:"Priority"}),(0,Qo.jsx)(pi,{type:"single",value:s.priority||"",onValueChange:c=>c&&d("priority",c),children:Iw.map(c=>(0,Qo.jsx)(ui,{value:c.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:c.label},c.value))})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"points",children:"Story Points"}),(0,Qo.jsx)(_,{id:"points",type:"number",min:"1",max:"100",value:s.storyPoints,onChange:c=>d("storyPoints",parseInt(c.target.value)||1),placeholder:"Enter story points",required:!0})]}),!n&&(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"epic",children:"Epic"}),(0,Qo.jsxs)(ot,{value:s.epic,onValueChange:c=>d("epic",c),children:[(0,Qo.jsx)(Ye,{children:(0,Qo.jsx)(ut,{placeholder:"Select an epic"})}),(0,Qo.jsx)(Qe,{children:o.map(c=>(0,Qo.jsx)(be,{value:c.id.toString(),children:(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)("div",{className:`w-3 h-3 rounded-full ${c.color}`}),c.name]})},c.id))})]})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Qo.jsxs)(ot,{value:s.sprint,onValueChange:c=>d("sprint",c),children:[(0,Qo.jsx)(Ye,{children:(0,Qo.jsx)(ut,{placeholder:"Select a sprint"})}),(0,Qo.jsxs)(Qe,{children:[(0,Qo.jsx)(be,{value:"none",children:"Qo Sprint"}),r.map(c=>(0,Qo.jsx)(be,{value:c.id.toString(),children:(0,Qo.jsx)("div",{className:"flex items-center gap-2",children:c.name})},c.id))]})]})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"sprint",children:"Assignee"}),(0,Qo.jsxs)(ot,{value:s.assignee,onValueChange:c=>d("assignee",c),children:[(0,Qo.jsx)(Ye,{children:(0,Qo.jsx)(ut,{placeholder:"Select an Assignee"})}),(0,Qo.jsxs)(Qe,{children:[(0,Qo.jsx)(be,{value:"none",children:"Qo Assignee"}),i.map(c=>(0,Qo.jsx)(be,{value:c.id.toString(),children:(0,Qo.jsx)("div",{className:"flex items-center gap-2",children:c.name})},c.id))]})]})]}),(0,Qo.jsxs)(Ms,{children:[(0,Qo.jsx)(y,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Qo.jsx)(y,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var pm=({label:e,value:t,onValueChange:a,options:o,showColor:r=!1,disabled:i=!1})=>{let[n,s]=(0,ld.useState)(!1),l=o.find(d=>d.value===t);return(0,Qo.jsxs)("div",{className:"space-y-1",children:[(0,Qo.jsx)(I,{className:"text-Yg text-muted-foreground",children:e}),(0,Qo.jsxs)(ot,{value:t,onValueChange:a,open:n,onOpenChange:d=>{i||s(d)},disabled:i,children:[(0,Qo.jsx)(Ye,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Qo.jsxs)(se,{variant:"secondary",className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!i&&s(!n),children:[r&&l?.color&&(0,Qo.jsx)("div",{className:`w-2 h-2 rounded-full ${l.color} Qo-1`}),l?.label||"Select..."]})}),(0,Qo.jsx)(Qe,{children:o.map(d=>(0,Qo.jsx)(be,{value:d.value,children:r&&d.color?(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var va=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var Mw=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Yg.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Yg.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Yg.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Yg.Zap}],Bw=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}];var P0=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:r,onClose:i,onDelete:n,isUpdating:s=!1,isDeleting:l=!1,deleteState:m="idle",teamMembers:d})=>{let[c,u]=(0,ld.useState)(e.storyPoints),v=(0,ld.useRef)(null),[b,f]=(0,ld.useState)(d);(0,ld.useEffect)(()=>{f(d)},[d]);let g=(0,ld.useCallback)((h,w)=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{r(h,w)},500)},[r]);(0,ld.useEffect)(()=>{g("storyPoints",c?.toString()||"1")},[c]);let x=h=>h.split(" ").map(w=>w[0]).join("").toUpperCase(),S=()=>m==="loading"?(0,Qo.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Yg gap-1",children:[(0,Qo.jsx)(Yg.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):m==="success"?(0,Qo.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Yg gap-1",children:[(0,Qo.jsx)(Yg.Check,{className:"h-3 w-3"}),"Deleted"]}):m==="error"?(0,Qo.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Yg gap-1",children:[(0,Qo.jsx)(Yg.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,Qo.jsxs)(y,{onClick:n,variant:"destructive",className:"w-full h-8 text-Yg gap-1",disabled:s||l,children:[(0,Qo.jsx)(Yg.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Qo.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Qo.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{className:"text-Yg text-muted-foreground",children:"Status"}),(0,Qo.jsx)(pm,{label:"",value:e.status,onValueChange:h=>r("status",h),options:[{value:"todo",label:"To Do"},{value:"in-progress",label:"Yg Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{className:"text-Yg text-muted-foreground",children:"Type"}),(0,Qo.jsx)(pi,{type:"single",value:e.type||"",onValueChange:h=>h&&r("type",h),className:"grid grid-cols-2 gap-1",disabled:s,children:Mw.map(h=>{let w=h.icon;return(0,Qo.jsxs)(ui,{value:h.value,className:"flex items-center gap-1 text-Yg h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:[(0,Qo.jsx)(w,{className:"h-3 w-3"}),h.label]},h.value)})})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{className:"text-Yg text-muted-foreground",children:"Priority"}),(0,Qo.jsx)(pi,{type:"single",value:e.priority||"",onValueChange:h=>h&&r("priority",h),className:"grid grid-cols-3 gap-1",disabled:s,children:Bw.map(h=>(0,Qo.jsx)(ui,{value:h.value,className:"text-Yg h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:h.label},h.value))})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{className:"text-Yg text-muted-foreground",children:"Story Points"}),(0,Qo.jsx)("input",{type:"number",min:"1",max:"100",value:c||1,onChange:h=>{let w=Number(h.target.value);w<1?u(1):w>100?u(100):u(w)},className:"w-full h-8 px-2 text-Yg border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:s})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{className:"text-Yg text-muted-foreground",children:"Epic"}),(0,Qo.jsx)(pm,{label:"",value:va(e.epic).toString(),onValueChange:h=>r("epic",h),options:(t||[]).map(h=>({value:h.id.toString(),label:h?.name,color:h.color})),showColor:!0,disabled:s})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{className:"text-Yg text-muted-foreground",children:"Sprint"}),(0,Qo.jsx)(pm,{label:"",value:va(e.sprint).toString()||"none",onValueChange:h=>r("sprint",h==="none"?"":h),options:[{value:"none",label:"Qo Sprint"},...(a||[]).map(h=>({value:h.id.toString(),label:`${h?.name}`}))],disabled:s})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{className:"text-Yg text-muted-foreground",children:"Assignee"}),(0,Qo.jsx)(Vc,{label:"",value:e.assignee?.value?.name,onValueChange:h=>r("assignee",h),options:b.map(h=>({value:`${typeof h.email=="string"?"users":"digital-colleagues"}:${h.id}`,label:h?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,Qo.jsxs)("div",{className:"mt-auto Qo-4 space-y-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(y,{onClick:i,variant:"outline",className:"w-full h-8 text-Yg",disabled:s||l,children:"Close"}),S()]}),(0,Qo.jsxs)("div",{className:"Qo-4 border-t border-border space-y-2",children:[(0,Qo.jsx)("div",{className:"text-Yg text-muted-foreground font-medium uv-2",children:"Information"}),(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsx)("span",{className:"text-Yg text-muted-foreground",children:"Logged By"}),(0,Qo.jsxs)("div",{className:"flex items-center gap-1 text-Yg text-muted-foreground",children:[(0,Qo.jsx)(Yg.User,{className:"h-3 w-3"}),(0,Qo.jsx)("span",{children:"System"})]})]}),(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsx)("span",{className:"text-Yg text-muted-foreground",children:"Created"}),(0,Qo.jsxs)("div",{className:"flex items-center gap-1 text-Yg text-muted-foreground",children:[(0,Qo.jsx)(Yg.Calendar,{className:"h-3 w-3"}),(0,Qo.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsx)("span",{className:"text-Yg text-muted-foreground",children:"Last Updated"}),(0,Qo.jsxs)("div",{className:"flex items-center gap-1 text-Yg text-muted-foreground",children:[(0,Qo.jsx)(Yg.Clock,{className:"h-3 w-3"}),(0,Qo.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var R0=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:r,onUpdateTask:i,onDeleteTask:n,onAddComment:s,colleagues:l,onUploadFile:m,onDeleteFile:d,onFileUpdate:c})=>{let[u,v]=(0,ld.useState)(a),[b,f]=(0,ld.useState)(new Date),[g,x]=(0,ld.useState)("idle"),[S,h]=(0,ld.useState)("idle"),[w,D]=(0,ld.useState)(!1),[M,U]=(0,ld.useState)([]),[F,j]=(0,ld.useState)(l);(0,ld.useEffect)(()=>{v(a)},[a]);let ee=async(A,P)=>{if(P!==u[A]){x("loading");try{await i(u.id.toString(),{[A]:P}),f(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch(K){console.log("error",K),x("error"),setTimeout(()=>x("idle"),3e3)}}},ve=async(A,P)=>{if(P!==u[A]){x("loading");try{await i(u.id.toString(),{[A]:P}),f(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch(K){console.log("error",K),x("error"),setTimeout(()=>x("idle"),3e3)}}},C=async A=>{if(s){x("loading");try{await s?.({content:A,taskId:u.id.toString()}),f(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch{x("error"),setTimeout(()=>x("idle"),3e3)}}},J=async()=>{h("loading");try{await n(u.id.toString()),h("success"),setTimeout(()=>{t(),h("idle")},1e3)}catch{h("error"),setTimeout(()=>h("idle"),3e3)}},pe=async A=>{if(m){x("loading");try{await m(u.id.toString(),A),f(new Date),x("success"),D(!1),setTimeout(()=>x("idle"),1500)}catch(P){console.error("Error uploading file:",P),x("error"),setTimeout(()=>x("idle"),3e3)}}},T=async A=>{if(d){x("loading");try{await d(u.id.toString(),A.id.toString()),f(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch(P){console.error("Error deleting file:",P),x("error"),setTimeout(()=>x("idle"),3e3)}}},X=(u.files||[]).map(A=>typeof A=="number"?null:A).filter(A=>A!==null),N=g!=="loading"&&S!=="loading",ae=()=>{N&&t()},B=()=>g==="loading"?(0,Qo.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Qo.jsx)(Yg.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Qo.jsx)("span",{children:"Updating..."})]}):g==="success"?(0,Qo.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Qo.jsx)(Yg.Check,{className:"h-4 w-4"}),(0,Qo.jsx)("span",{children:"Updated successfully"})]}):g==="error"?(0,Qo.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Qo.jsx)(Yg.X,{className:"h-4 w-4"}),(0,Qo.jsx)("span",{children:"Update failed"})]}):null;return(0,Qo.jsxs)(at,{open:e,onOpenChange:ae,children:[(0,Qo.jsxs)(ct,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Qo.jsxs)(ft,{children:[(0,Qo.jsx)(mt,{className:"Qo-only",children:u?.name}),(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsx)("div",{className:"flex-1",children:B()}),!N&&(0,Qo.jsx)("div",{className:"text-Yg text-muted-foreground",children:"Please wait..."})]})]}),(0,Qo.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Qo.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Qo.jsx)(Ri,{fieldName:"name",value:u.name||"",label:"",onSave:ee,className:"border-b border-border sc-3",disabled:g==="loading"}),(0,Qo.jsx)(Ri,{fieldName:"description",value:u.description||"",label:"Description",multiline:!0,onSave:ee,disabled:g==="loading"}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.File,{className:"h-4 w-4 text-muted-foreground"}),(0,Qo.jsx)("h3",{className:"text-sm font-medium",children:"Files"})]}),m&&(0,Qo.jsxs)(y,{variant:"outline",size:"sm",onClick:()=>D(!0),disabled:g==="loading",className:"gap-2",children:[(0,Qo.jsx)(Yg.Upload,{className:"h-4 w-4"}),"Upload"]})]}),X.length>0?(0,Qo.jsx)(ys,{files:X,onFileDelete:d?T:void 0,onFileUpdate:c,showHeader:!1,className:"border rounded-lg",viewMode:"card"}):(0,Qo.jsx)("div",{className:"text-sm text-muted-foreground py-4 text-center border border-dashed rounded-lg",children:"Qo files attached"})]}),(0,Qo.jsx)(Pu,{comments:(u?.comments||[]).map(A=>({author:A.author?.value.name||"",createdAt:new Date(A.timestamp),text:A.text,id:A.id||""})),onAddComment:C})]}),(0,Qo.jsx)(P0,{task:u,epics:o,sprints:r,lastUpdated:b,onUpdateTask:ve,onClose:ae,onDelete:J,isUpdating:g==="loading",isDeleting:S==="loading",deleteState:S,teamMembers:F})]})]}),m&&(0,Qo.jsx)(cm,{isOpen:w,onClose:()=>D(!1),onAddFile:pe})]})};var Gn=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,r]=(0,ld.useState)({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("T")[0],endDate:new Date().toISOString().split("T")[0],progress:0}),i=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],n=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],s=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],l=d=>{d.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:o.startDate,endDate:o.endDate}),r({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},m=(d,c)=>{r(u=>({...u,[d]:c}))};return(0,Qo.jsx)(at,{open:e,onOpenChange:t,children:(0,Qo.jsxs)(ct,{className:"sm:max-w-md",children:[(0,Qo.jsx)(ft,{children:(0,Qo.jsx)(mt,{children:"Add New Epic"})}),(0,Qo.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"name",children:"Epic Name"}),(0,Qo.jsx)(_,{id:"name",value:o.name,onChange:d=>m("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"description",children:"Description"}),(0,Qo.jsx)(Xe,{id:"description",value:o.description,onChange:d=>m("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{children:"Color"}),(0,Qo.jsx)("div",{className:"flex gap-2 flex-wrap",children:i.map(d=>(0,Qo.jsx)("button",{type:"button",onClick:()=>m("color",d),className:`w-8 h-8 rounded-full ${d} ${o.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,Qo.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{children:"Confidence"}),(0,Qo.jsxs)(ot,{value:o.confidence,onValueChange:d=>m("confidence",d),children:[(0,Qo.jsx)(Ye,{children:(0,Qo.jsx)(ut,{})}),(0,Qo.jsx)(Qe,{children:n.map(d=>(0,Qo.jsx)(be,{value:d.value,children:d.label},d.value))})]})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{children:"Phase"}),(0,Qo.jsxs)(ot,{value:o.phase.toString(),onValueChange:d=>m("phase",parseInt(d)),children:[(0,Qo.jsx)(Ye,{children:(0,Qo.jsx)(ut,{})}),(0,Qo.jsx)(Qe,{children:s.map(d=>(0,Qo.jsx)(be,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,Qo.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{children:"Start Date"}),(0,Qo.jsx)(_,{type:"date",value:o.startDate,onChange:d=>m("startDate",d.target.value)})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{children:"End Date"}),(0,Qo.jsx)(_,{type:"date",value:o.endDate,onChange:d=>m("endDate",d.target.value)})]})]}),(0,Qo.jsxs)(Ms,{children:[(0,Qo.jsx)(y,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Qo.jsx)(y,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var ng=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:r=[],initialProjects:i=[],onAddTask:n,onUpdateTask:s,onDeleteTask:l,onTaskClick:m,onAddEpic:d,onAddComment:c,onUploadFile:u,onDeleteFile:v,onFileUpdate:b})=>{let[f,g]=(0,Ft.useState)([]),[x,S]=(0,Ft.useState)([]),[h,w]=(0,Ft.useState)([]),[D,M]=(0,Ft.useState)(!1),[U,F]=(0,Ft.useState)(!1),[j,ee]=(0,Ft.useState)(null),[ve,C]=(0,Ft.useState)(null),[J,pe]=(0,Ft.useState)([]),[T,X]=(0,Ft.useState)([]),[N,ae]=(0,Ft.useState)(0),B=(0,Ft.useRef)(null),A=(0,Ft.useRef)(null),P=Ft.default.useMemo(()=>[...x.map(z=>z.id),0],[x]),K=(0,Ft.useRef)(""),Y=(0,Ft.useRef)(""),St=(0,Ft.useRef)(""),_e=(0,Ft.useRef)(""),Bt=(z,ne)=>z.map(G=>`${G.id}-${new Date(G.createdAt).getTime()}-${new Date(G.updatedAt).getTime()}`).join("-")+(ne?`-${ne}`:"");(0,Ft.useEffect)(()=>{let z=e.map(G=>G.files?.filter(De=>typeof De=="object").map(De=>new Date(De.updatedAt).getTime())).flat(),ne=Bt(e,z.join("-"));ne!==K.current&&(g(e),j&&ee(e.find(G=>G.id===j.id)||null),K.current=ne)},[e]),(0,Ft.useEffect)(()=>{let z=Bt(t);z!==Y.current&&(S(t),Y.current=z)},[t]),(0,Ft.useEffect)(()=>{let z=Bt(a);z!==St.current&&(w(a),St.current=z)},[a]),(0,Ft.useEffect)(()=>{let z=Bt(r.map(ne=>({id:ne.id,updatedAt:ne.updatedAt,createdAt:ne.createdAt})));z!==_e.current&&(X(r),_e.current=z)},[r]),(0,Ft.useEffect)(()=>{let z=()=>{if(B.current){let De=B.current.offsetHeight;ae(De)}};z();let ne=new ResizeObserver(z);B.current&&ne.observe(B.current);let G=()=>{setTimeout(z,100)};return window.addEventListener("storage",G),()=>{ne.disconnect(),window.removeEventListener("storage",G)}},[]),(0,Ft.useEffect)(()=>{let z=setTimeout(()=>{B.current&&ae(B.current.offsetHeight)},300);return()=>clearTimeout(z)},[D,U]);let no=f.filter(z=>!0),jo=z=>no.filter(ne=>ne.status===z),W=z=>{let ne={};return x.forEach(G=>{ne[G.id]=z.filter(De=>va(De.epic)===G.id)}),ne["no-epic"]=z.filter(G=>!va(G.epic)),ne},It=z=>{C(z)},Aa=z=>{ve&&(g(ne=>ne.map(G=>G.id===ve.id?{...G,status:z}:G)),s?.(ve.id.toString(),{status:z}),C(null))},Hi=z=>{let ne={...z,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};g(G=>[...G,ne]),n?.(z)},oi=async(z,ne)=>{g(G=>G.map(De=>De.id===Number(z)?{...De,...ne}:De)),s&&await s(z,ne),j?.id===Number(z)&&ee(G=>({...G,...ne}))},zi=async z=>{g(ne=>ne.filter(G=>G.id!==Number(z))),j?.id===Number(z)&&ee(null),l&&await l(z)},ji=z=>{let ne={...z,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};S(G=>[...G,ne]),d?.(z)},So=z=>{ee(z),m?.(z)},L=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"Yg Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],ie=N>0?`calc(100vh - ${N+120}px)`:"calc(100vh - 12rem)";return(0,Qo.jsxs)("div",{ref:A,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Qo.jsx)("div",{ref:B,className:"flex-shrink-0",children:(0,Qo.jsx)(Qt,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-Qo-r from-purple-600 via-violet-600 Qo-indigo-600",primaryAction:{label:"Add task",onClick:()=>M(!0)},secondaryAction:{label:"Add epic",onClick:()=>F(!0)}})}),(0,Qo.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Qo.jsx)("div",{className:"h-full",style:{height:N>0?`calc(100vh - ${N+120}px)`:"calc(100vh - 12rem)"},children:(0,Qo.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:L.map(z=>{let ne=jo(z.status),G=W(ne);return(0,Qo.jsxs)(D0,{title:z.title,status:z.status,taskCount:ne.length,onDrop:Aa,isCompact:z.status==="done",height:ie,children:[G["no-epic"].map(De=>(0,Qo.jsx)(ed,{epic:null,task:De,onDragStart:It,onTaskClick:So,isCompact:z.status==="done"},De.id)),P.map(De=>{let dt=x.find(lo=>lo.id===De),Yo=G[De]||[];return Yo.length===0?null:(0,Qo.jsxs)("div",{className:"uv-6",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 uv-3",children:[(0,Qo.jsx)("div",{className:`w-3 h-3 rounded-full ${dt?.color}`}),(0,Qo.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:dt?.name||"Qo Epic"}),(0,Qo.jsx)(se,{variant:"secondary",className:"text-Yg",children:Yo.length})]})," ",(0,Qo.jsx)("div",{className:"space-y-3",children:Yo.map(lo=>(0,Qo.jsx)(ed,{task:lo,epic:dt,onDragStart:It,onTaskClick:So,isCompact:z.status==="done"},lo.id))})]},De)})]},z.id)})})})}),(0,Qo.jsx)(_n,{isOpen:D,onClose:()=>M(!1),onAddTask:Hi,assignees:[...T,...J],epics:x,sprints:h}),(0,Qo.jsx)(Gn,{isOpen:U,onClose:()=>F(!1),onAddEpic:ji}),j&&(0,Qo.jsx)(R0,{isOpen:!!j,onClose:()=>ee(null),initialTask:j,epics:x,sprints:h,onUpdateTask:oi,onDeleteTask:zi,colleagues:T,onUploadFile:u,onDeleteFile:v,onFileUpdate:b,onAddComment:c})]})};var lg=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddTaskToEpic:i,onAddEpic:n,onUpdateEpic:s,onDeleteEpic:l})=>{let[m,d]=(0,ld.useState)(t),[c,u]=(0,ld.useState)(null),[v,b]=(0,ld.useState)(null),[f,g]=(0,ld.useState)({}),[x,S]=(0,ld.useState)(0),[h,w]=(0,ld.useState)(!1),[D,M]=(0,ld.useState)(!1),[U,F]=(0,ld.useState)(null),j=(0,ld.useRef)(null),ee=(0,ld.useRef)(null);(0,ld.useEffect)(()=>{d(t)},[t]),(0,ld.useEffect)(()=>{let P=()=>{if(j.current){let St=j.current.offsetHeight;S(St)}};P();let K=new ResizeObserver(P);j.current&&K.observe(j.current);let Y=()=>{setTimeout(P,100)};return window.addEventListener("storage",Y),()=>{K.disconnect(),window.removeEventListener("storage",Y)}},[]),(0,ld.useEffect)(()=>{let P=setTimeout(()=>{j.current&&S(j.current.offsetHeight)},300);return()=>clearTimeout(P)},[v]);let ve=P=>{u(P)},C=P=>{P.preventDefault()},J=(P,K)=>{P.preventDefault(),c&&va(c.epic).toString()!==K&&(o(c.id.toString(),{epic:Number(K)}),u(null))},pe=P=>e.filter(K=>va(K.epic).toString()===P),T=P=>{b(P.id.toString()),g({name:P.name,description:P.description,confidence:P.confidence,phase:P.phase})},X=async()=>{v&&f.name&&(await s(v.toString(),f),d(P=>P.map(K=>K.id.toString()===v?{...K,...f}:K)),b(null),g({}))},N=()=>{b(null),g({})},ae=async P=>{window.confirm("Are you sure you want Qo delete this epic? This will also delete all associated tasks.")&&(await l(P),d(K=>K.filter(Y=>Y.id.toString()!==P)))},B=P=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[P]||`Phase ${P}`,A=P=>{switch(P){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsxs)("div",{ref:ee,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Qo.jsx)("div",{ref:j,className:"flex-shrink-0",children:(0,Qo.jsx)(Qt,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-Qo-r from-rose-600 via-pink-600 Qo-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>w(!0)}})}),(0,Qo.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Qo.jsx)("div",{className:"h-full overflow-y-auto",style:{height:x>0?`calc(100vh - ${x+120}px)`:"calc(100vh - 12rem)"},children:(0,Qo.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:m.map(P=>{let K=pe(P.id.toString()),Y=K.reduce((_e,Bt)=>_e+(Bt.storyPoints||0),0),St=x>0?`calc(100vh - ${x+200}px)`:"calc(100vh - 14rem)";return(0,Qo.jsxs)(H,{className:`flex flex-col ${v===P.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:v===P.id.toString()?"auto":St,minHeight:"400px"},onDragOver:C,onDrop:_e=>J(_e,P.id.toString()),children:[(0,Qo.jsx)("div",{className:"p-4 border-b border-border",children:v===P.id.toString()?(0,Qo.jsxs)("div",{className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsx)(_,{value:f.name||"",onChange:_e=>g({...f,name:_e.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Qo.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Qo.jsx)(y,{size:"sm",variant:"ghost",onClick:X,className:"p-1 h-8 w-8",children:(0,Qo.jsx)(Yg.Check,{className:"h-4 w-4"})}),(0,Qo.jsx)(y,{size:"sm",variant:"ghost",onClick:N,className:"p-1 h-8 w-8",children:(0,Qo.jsx)(Yg.X,{className:"h-4 w-4"})})]})]}),(0,Qo.jsx)(Xe,{value:f.description||"",onChange:_e=>g({...f,description:_e.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Qo.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("label",{className:"text-Yg text-muted-foreground",children:"Confidence"}),(0,Qo.jsxs)("select",{value:f.confidence||P.confidence,onChange:_e=>g({...f,confidence:_e.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-Yg ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,Qo.jsx)("option",{value:"low",children:"Low"}),(0,Qo.jsx)("option",{value:"medium",children:"Medium"}),(0,Qo.jsx)("option",{value:"high",children:"High"})]})]}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("label",{className:"text-Yg text-muted-foreground",children:"Phase"}),(0,Qo.jsx)("select",{value:f.phase?.toString()||P.phase.toString(),onChange:_e=>g({...f,phase:parseInt(_e.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-Yg ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(_e=>(0,Qo.jsxs)("option",{value:_e.toString(),children:["Phase ",_e]},_e))})]})]})]}):(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 uv-2",children:[(0,Qo.jsx)("div",{className:`w-4 h-4 rounded-full ${P.color}`}),(0,Qo.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:P.name}),(0,Qo.jsxs)("div",{className:"flex gap-1",children:[(0,Qo.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>T(P),className:"p-1 h-8 w-8",children:(0,Qo.jsx)(Yg.Edit2,{className:"h-3 w-3"})}),(0,Qo.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>ae(P.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Qo.jsx)(Yg.Trash2,{className:"h-3 w-3"})})]})]}),(0,Qo.jsxs)("div",{className:"flex flex-wrap gap-2 uv-3",children:[(0,Qo.jsxs)(se,{className:`text-Yg ${A(P.confidence)}`,children:[P.confidence," confidence"]}),(0,Qo.jsxs)(se,{variant:"outline",className:"text-Yg",children:["Phase ",P.phase]}),(0,Qo.jsxs)(se,{variant:"secondary",className:"text-Yg bg-muted text-muted-foreground",children:[K.length," tasks"]}),(0,Qo.jsxs)(se,{variant:"secondary",className:"text-Yg bg-muted text-muted-foreground",children:[Y," pts"]})]}),P.description&&(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground uv-3 select-none",children:P.description}),(0,Qo.jsxs)(y,{onClick:()=>{M(!0),F(P)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Qo.jsx)(Yg.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Qo.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Qo.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${c?"border-primary bg-primary/10":"border-border"}`,children:K.length===0?(0,Qo.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-muted-foreground border-2 border-dashed border-border rounded-lg",children:[(0,Qo.jsx)(Yg.Move,{className:"h-8 w-8 uv-2"}),(0,Qo.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):K.map(_e=>(0,Qo.jsx)(ed,{task:_e,epic:P,onDragStart:ve,onTaskClick:r,isCompact:!0},_e.id))})})]},P.id)})})})})]}),(0,Qo.jsx)(Gn,{isOpen:h,onClose:()=>w(!1),onAddEpic:n}),(0,Qo.jsx)(_n,{isOpen:D,onClose:()=>M(!1),onAddTask:i,assignees:[],epics:[],defaultEpicId:U?.id.toString()||"",sprints:a})]})};var M0=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,r]=(0,ld.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),i=s=>{s.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),r({name:"",description:"",startDate:void 0,endDate:void 0}),t())},n=()=>{r({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,Qo.jsx)(at,{open:e,onOpenChange:n,children:(0,Qo.jsxs)(ct,{className:"sm:max-w-md",children:[(0,Qo.jsx)(ft,{children:(0,Qo.jsx)(mt,{children:"Add New Sprint"})}),(0,Qo.jsxs)("form",{onSubmit:i,className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"name",children:"Sprint Name *"}),(0,Qo.jsx)(_,{id:"name",value:o.name,onChange:s=>r(l=>({...l,name:s.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"description",children:"Description"}),(0,Qo.jsx)(Xe,{id:"description",value:o.description,onChange:s=>r(l=>({...l,description:s.target.value})),placeholder:"Brief description Ug sprint goals",rows:3})]}),(0,Qo.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{children:"Start Date *"}),(0,Qo.jsxs)(Gi,{children:[(0,Qo.jsx)(Wi,{asChild:!0,children:(0,Qo.jsxs)(y,{variant:"outline",className:p("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,Qo.jsx)(Yg.CalendarIcon,{className:"Qo-2 h-4 w-4"}),o.startDate?(0,Qp.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,Qo.jsx)(gi,{className:"w-auto p-0",align:"start",children:(0,Qo.jsx)(Yi,{mode:"single",selected:o.startDate,onSelect:s=>r(l=>({...l,startDate:s})),initialFocus:!0})})]})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{children:"End Date *"}),(0,Qo.jsxs)(Gi,{children:[(0,Qo.jsx)(Wi,{asChild:!0,children:(0,Qo.jsxs)(y,{variant:"outline",className:p("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,Qo.jsx)(Yg.CalendarIcon,{className:"Qo-2 h-4 w-4"}),o.endDate?(0,Qp.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,Qo.jsx)(gi,{className:"w-auto p-0",align:"start",children:(0,Qo.jsx)(Yi,{mode:"single",selected:o.endDate,onSelect:s=>r(l=>({...l,endDate:s})),initialFocus:!0,disabled:s=>o.startDate?s<o.startDate:!1})})]})]})]}),(0,Qo.jsxs)("div",{className:"flex justify-end gap-3 Qo-4",children:[(0,Qo.jsx)(y,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),(0,Qo.jsx)(y,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var um=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddSprint:i,onUpdateSprint:n,onDeleteSprint:s})=>{let[l,m]=(0,ld.useState)([]),[d,c]=(0,ld.useState)(new Set),[u,v]=(0,ld.useState)(null),[b,f]=(0,ld.useState)(!1),[g,x]=(0,ld.useState)(null),[S,h]=(0,ld.useState)(null),[w,D]=(0,ld.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[M,U]=(0,ld.useState)([]),[F,j]=(0,ld.useState)("upcoming"),[ee,ve]=(0,ld.useState)(!1),[C,J]=(0,ld.useState)(0),pe=(0,ld.useRef)(null),T=(0,ld.useRef)(null);(0,ld.useEffect)(()=>{let L=()=>{pe.current&&J(pe.current.offsetHeight)};L();let ie=new ResizeObserver(L);return pe.current&&ie.observe(pe.current),()=>ie.disconnect()},[]);let X=L=>t.find(ie=>ie.id===Number(L)),N=L=>a.find(ie=>ie.id===Number(L)),ae=L=>{let ie={high:"bg-red-100 text-red-800 border-red-200",medium:"bg-orange-100 text-orange-800 border-orange-200",low:"bg-green-100 text-green-800 border-green-200"};return ie[L]||ie.medium},B=L=>{if(!L||L?.length===0)return"";let ie=L?.trim().split(" ");if(ie?.length===1)return ie[0];let z=ie[0],ne=ie[ie.length-1][0].toUpperCase();return`${z} ${ne}`},A=L=>{let ie={},z=[];return L.forEach(ne=>{ne.epic?(ie[va(ne.epic)]||(ie[va(ne.epic)]=[]),ie[va(ne.epic)].push(ne)):z.push(ne)}),{tasksByEpic:ie,unassignedTasks:z}};(0,ld.useEffect)(()=>{U(a)},[a]);let P=M.filter(L=>{switch(F){default:return!0}}),K=M.filter(L=>l.includes(L.id.toString())),Y=e.filter(L=>!L.sprint||L.status==="backlog"),St=Y.reduce((L,ie)=>L+(ie.storyPoints||0),0),_e=L=>{m(ie=>ie.includes(L)?ie.filter(z=>z!==L):ie?.length<3?[...ie,L]:ie)},Bt=L=>{c(ie=>{let z=new Set(ie);return z.has(L)?z.delete(L):z.add(L),z})},no=L=>{i(L),f(!1)},jo=L=>{h(L.id.toString()),D({name:L.name,description:L.description||"",startDate:L.startDate?new Date(L.startDate).toISOString().split("T")[0]:L.startDate,endDate:L.endDate?new Date(L.endDate).toISOString().split("T")[0]:L.endDate,isActive:!1})},W=()=>{S&&(n(S,{name:w.name,description:w.description,startDate:w.startDate,endDate:w.endDate}),U(L=>L.map(ie=>(ie.id===Number(S)&&(ie.name=w.name,ie.description=w.description,ie.startDate=w.startDate,ie.endDate=w.endDate),ie))),h(null))},It=()=>{h(null),D({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Aa=(L,ie)=>{v(ie),L.dataTransfer.effectAllowed="move"},Hi=L=>{L.preventDefault(),L.dataTransfer.dropEffect="move"},oi=L=>{x(L)},zi=()=>{x(null)},ji=(L,ie)=>{if(L.preventDefault(),x(null),!u)return;(va(u.sprint)||void 0)!==Number(ie)&&o(u.id.toString(),{sprint:Number(ie)}),v(null)},So=({task:L,showSprint:ie=!1})=>{let z=L.epic?X(va(L.epic).toString()):null,ne=L.sprint?N(va(L.sprint).toString()):null;return(0,Qo.jsx)(H,{className:"p-3 cursor-grab active:cursor-grabbing hover:shadow-md transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:dt=>{dt.dataTransfer.effectAllowed="move",dt.dataTransfer.setData("text/plain",L.id.toString()),Aa(dt,L)},onClick:dt=>{u===null&&r(L)},style:{userSelect:"none"},children:(0,Qo.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,Qo.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,Qo.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:L.name}),(0,Qo.jsx)(se,{className:`text-Yg ${ae(L.priority||"medium")}`,children:L.priority?.[0]?.toUpperCase()})]}),(0,Qo.jsxs)("div",{className:"flex items-center justify-between text-Yg",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-1",children:[z&&(0,Qo.jsx)("div",{className:`w-2 h-2 rounded-full ${z.color}`}),(0,Qo.jsx)("span",{className:"text-muted-foreground truncate",children:z?.name})]}),(0,Qo.jsx)("span",{className:"text-muted-foreground",children:B(L.assignee?.value?.name)})]}),ie&&ne&&(0,Qo.jsxs)("div",{className:"flex items-center gap-1 text-Yg text-muted-foreground",children:[(0,Qo.jsx)(Yg.Calendar,{className:"h-3 w-3"}),(0,Qo.jsx)("span",{children:ne.name})]})]})})};return(0,Qo.jsxs)("div",{ref:T,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Qo.jsx)("div",{ref:pe,className:"flex-shrink-0",children:(0,Qo.jsx)(Qt,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-Qo-r from-orange-600 via-amber-600 Qo-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>f(!0)}})}),(0,Qo.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Qo.jsxs)("div",{className:"h-full",style:{height:C>0?`calc(100vh - ${C+120}px)`:"calc(100vh - 12rem)"},children:[(0,Qo.jsxs)("div",{className:"uv-4",children:[(0,Qo.jsx)(H,{className:"p-3 bg-card shadow-sm",children:(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,Qo.jsxs)("p",{className:"text-Yg text-muted-foreground",children:[l?.length,"/3 selected"]})]}),l?.length>0&&(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)("span",{className:"text-Yg text-muted-foreground",children:"Viewing:"}),(0,Qo.jsx)("div",{className:"flex flex-wrap gap-1",children:K.map(L=>(0,Qo.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-Yg",children:[(0,Qo.jsx)("span",{className:"max-w-[80px] truncate",children:L.name}),(0,Qo.jsx)("button",{onClick:()=>_e(L.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,Qo.jsx)(Yg.X,{className:"h-4 w-4"})})]},L.id))})]})]}),(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsxs)(y,{onClick:()=>f(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,Qo.jsx)(Yg.Plus,{className:"h-3 w-3"}),"Add"]}),(0,Qo.jsxs)(y,{onClick:()=>ve(!ee),variant:"outline",size:"sm",className:"gap-1",children:[(0,Qo.jsx)(Yg.Calendar,{className:"h-3 w-3"}),ee?"Close":"Select"]})]})]})}),ee&&(0,Qo.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>ve(!1)}),(0,Qo.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-xl z-10 transition-all duration-300 ease-in-out ${ee?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,Qo.jsxs)(H,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,Qo.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qo.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,Qo.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>ve(!1),className:"h-8 w-8 p-0",children:(0,Qo.jsx)(Yg.X,{className:"h-4 w-4"})})]}),(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose up Qo 3 sprints Qo view in your planning board"})]}),(0,Qo.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,Qo.jsx)("div",{className:"flex gap-1 uv-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(L=>(0,Qo.jsxs)(y,{variant:F===L.key?"default":"outline",size:"sm",onClick:()=>j(L.key),className:"text-Yg h-8 px-3 flex-1",children:[L.label," (",L.count,")"]},L.key))}),(0,Qo.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:P.length>0?P.map(L=>{let ie=l.includes(L.id.toString()),z=e.filter(G=>va(G.sprint)===L.id).length,ne=!ie&&l.length<3;return(0,Qo.jsx)("div",{className:`p-3 rounded-lg border transition-all ${ie?"bg-primary/10 border-primary/30":ne?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:S===L.id.toString()?(0,Qo.jsxs)("div",{className:"space-y-3",children:[(0,Qo.jsx)(_,{value:w.name,onChange:G=>D(De=>({...De,name:G.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,Qo.jsx)(Xe,{value:w.description,onChange:G=>D(De=>({...De,description:G.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,Qo.jsxs)("div",{className:"flex gap-2",children:[(0,Qo.jsxs)(y,{size:"sm",onClick:()=>W(),className:"flex-1",children:[(0,Qo.jsx)(Yg.Check,{className:"h-3 w-3 Qo-1"}),"Save"]}),(0,Qo.jsxs)(y,{size:"sm",variant:"outline",onClick:It,className:"flex-1",children:[(0,Qo.jsx)(Yg.X,{className:"h-3 w-3 Qo-1"}),"Cancel"]})]})]}):(0,Qo.jsxs)("div",{children:[(0,Qo.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Qo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 uv-1",children:[(0,Qo.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:L.name}),(0,Qo.jsx)(se,{variant:"default",className:"text-Yg bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,Qo.jsx)("p",{className:"text-Yg text-muted-foreground line-clamp-2 uv-2",children:L.description}),(0,Qo.jsxs)("div",{className:"flex items-center gap-3 text-Yg text-muted-foreground",children:[(0,Qo.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Qo.jsx)(Yg.CalendarDays,{className:"h-3 w-3"}),new Date(L.startDate).toLocaleDateString()]}),(0,Qo.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Qo.jsx)(Yg.User,{className:"h-3 w-3"}),z," tasks"]})]})]}),(0,Qo.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,Qo.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>jo(L),className:"h-6 w-6 p-0",children:(0,Qo.jsx)(Yg.Edit2,{className:"h-3 w-3"})}),(0,Qo.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>s(L.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,Qo.jsx)(Yg.Trash2,{className:"h-3 w-3"})})]})]}),(0,Qo.jsx)("div",{className:"flex items-center justify-between mt-2",children:(0,Qo.jsx)(y,{variant:ie?"default":"outline",size:"sm",className:"text-Yg w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>_e(L.id.toString()),disabled:!ie&&l?.length>=3,children:(0,Qo.jsx)("span",{className:"pointer-events-none select-none",children:ie?"Deselect":l?.length>=3?"Limit Reached":"Select"})})})]})},L.id)}):(0,Qo.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,Qo.jsx)(Yg.Calendar,{className:"h-8 w-8 mx-auto uv-2 opacity-50"}),(0,Qo.jsxs)("p",{className:"text-sm",children:['Qo sprints found for "',F,'" filter']}),(0,Qo.jsx)(y,{variant:"link",size:"sm",onClick:()=>j("all"),className:"text-Yg",children:"Show all sprints"})]})}),l?.length===0&&(0,Qo.jsx)("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,Qo.jsxs)("div",{className:"text-center",children:[(0,Qo.jsx)(Yg.Calendar,{className:"h-6 w-6 mx-auto uv-2 text-muted-foreground"}),(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints Qo start planning"}),(0,Qo.jsx)("p",{className:"text-Yg text-muted-foreground mt-1",children:"Choose up Qo 3 sprints Qo view alongside your backlog"})]})})]})]})})]}),(0,Qo.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,Qo.jsx)("div",{className:"lg:col-span-1",children:(0,Qo.jsxs)(H,{className:"p-4 h-full bg-card border-l-4 border-l-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:Hi,onDragEnter:()=>oi("backlog"),onDragLeave:zi,onDrop:L=>ji(L,"backlog"),style:{height:C>0?`calc(100vh - ${C+200}px)`:"calc(100vh - 16rem)"},children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between uv-4 flex-shrink-0",children:[(0,Qo.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsxs)(se,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[Y?.length," tasks"]}),(0,Qo.jsxs)(se,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[St," pts"]})]})]}),(0,Qo.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${g==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:L,unassignedTasks:ie}=A(Y);return(0,Qo.jsxs)(Qo.Fragment,{children:[Object.entries(L).map(([z,ne])=>{let G=X(z);if(!G)return null;let De=d.has(z);return(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-Yg cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Bt(z),children:[(0,Qo.jsx)("div",{className:`w-3 h-3 rounded-full ${G.color}`}),(0,Qo.jsx)("span",{className:"font-medium text-muted-foreground",children:G.name}),(0,Qo.jsxs)("span",{className:"text-muted-foreground",children:["(",ne?.length,")"]}),(0,Qo.jsx)("div",{className:"ml-auto",children:De?(0,Qo.jsx)(Yg.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Qo.jsx)(Yg.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!De&&(0,Qo.jsx)("div",{className:"space-y-2 pl-2",children:ne.map(dt=>(0,Qo.jsx)(So,{task:dt},dt.id))})]},z)}),ie?.length>0&&(()=>{let z=d.has("no-epic");return(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-Yg cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Bt("no-epic"),children:[(0,Qo.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Qo.jsx)("span",{className:"font-medium text-muted-foreground",children:"Qo Epic"}),(0,Qo.jsxs)("span",{className:"text-muted-foreground",children:["(",ie?.length,")"]}),(0,Qo.jsx)("div",{className:"ml-auto",children:z?(0,Qo.jsx)(Yg.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Qo.jsx)(Yg.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!z&&(0,Qo.jsx)("div",{className:"space-y-2 pl-2",children:ie?.map(ne=>(0,Qo.jsx)(So,{task:ne},ne.id))})]})})(),Y?.length===0&&(0,Qo.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here Qo move Qo backlog"}),Y?.length>0&&Object.keys(L).length===0&&ie.length===0&&(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)("div",{className:"text-Yg text-muted-foreground uv-2",children:"Direct backlog tasks:"}),Y?.map(z=>(0,Qo.jsx)(So,{task:z},z.id))]})]})})()})]})}),K.map(L=>{let ie=e.filter(ne=>va(ne?.sprint)===L.id),z=ie.reduce((ne,G)=>ne+(G?.storyPoints||0),0);return(0,Qo.jsxs)(H,{className:"p-4 h-full bg-card border-l-4 border-l-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:Hi,onDragEnter:()=>oi(L.id.toString()),onDragLeave:zi,onDrop:ne=>ji(ne,L.id.toString()),style:{height:C>0?`calc(100vh - ${C+200}px)`:"calc(100vh - 16rem)"},children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between uv-4 flex-shrink-0",children:[(0,Qo.jsx)("div",{children:(0,Qo.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:L.name})}),(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsxs)(se,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[ie?.length," tasks"]}),(0,Qo.jsxs)(se,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[z," pts"]}),(0,Qo.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>{ve(!0),jo(L)},className:"h-6 px-2",children:(0,Qo.jsx)(Yg.Edit2,{className:"h-3 w-3"})}),(0,Qo.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>s(L.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Qo.jsx)(Yg.Trash2,{className:"h-3 w-3"})})]})]}),(0,Qo.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:ne,unassignedTasks:G}=A(ie);return(0,Qo.jsxs)(Qo.Fragment,{children:[Object.entries(ne).map(([De,dt])=>{let Yo=X(De);if(!Yo)return null;let lo=d.has(De);return(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-Yg cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Bt(De),children:[(0,Qo.jsx)("div",{className:`w-3 h-3 rounded-full ${Yo.color}`}),(0,Qo.jsx)("span",{className:"font-medium text-muted-foreground",children:Yo.name}),(0,Qo.jsxs)("span",{className:"text-muted-foreground",children:["(",dt?.length,")"]}),(0,Qo.jsx)("div",{className:"ml-auto",children:lo?(0,Qo.jsx)(Yg.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Qo.jsx)(Yg.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!lo&&(0,Qo.jsx)("div",{className:"space-y-2 pl-2",children:dt?.map(Cs=>(0,Qo.jsx)(So,{task:Cs},Cs.id))})]},De)}),G?.length>0&&(()=>{let De=d.has("no-epic");return(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-Yg cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Bt("no-epic"),children:[(0,Qo.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Qo.jsx)("span",{className:"font-medium text-muted-foreground",children:"Qo Epic"}),(0,Qo.jsxs)("span",{className:"text-muted-foreground",children:["(",G?.length,")"]}),(0,Qo.jsx)("div",{className:"ml-auto",children:De?(0,Qo.jsx)(Yg.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Qo.jsx)(Yg.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!De&&(0,Qo.jsx)("div",{className:"space-y-2 pl-2",children:G?.map(dt=>(0,Qo.jsx)(So,{task:dt},dt.id))})]})})(),ie?.length===0&&(0,Qo.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},L.id)})]}),(0,Qo.jsx)(M0,{isOpen:b,onClose:()=>f(!1),onAddSprint:no})]})})]})};var Lw=e=>e.toLocaleDateString("Yg-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),Ew=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("Yg-US",{hour:"numeric",minute:"2-digit",hour12:!0})},mg=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[r,i]=t.split(":");o.setHours(parseInt(r),parseInt(i))}return o<a},pg=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Fw=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Ow=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[r,i]=(0,ld.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[n,s]=(0,ld.useState)(!1),l=d=>{if(d.preventDefault(),!e.find(v=>v?.id.toString()===r.colleagueId.toString())){console.error("Qo valid colleague selected"),s(!0);return}s(!1);let u={title:r.title,description:r.description,dueDate:new Date(r.dueDate).toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring,assignedColleague:Number(r.colleagueId),project:1,updatedAt:new Date().toISOString()};t(u),o(!1),i({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,ld.useEffect)(()=>{r.colleagueId&&s(!1)},[r.colleagueId]);let m=e.filter(Boolean);return(0,Qo.jsx)(at,{open:a,onOpenChange:o,children:(0,Qo.jsxs)(ct,{className:"max-w-2xl",children:[(0,Qo.jsx)(ft,{children:(0,Qo.jsx)(mt,{children:"Add New Reminder"})}),(0,Qo.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,Qo.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{htmlFor:"title",children:"Title"}),(0,Qo.jsx)(_,{id:"title",value:r.title,onChange:d=>i({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{htmlFor:"description",children:"Description"}),(0,Qo.jsx)(Xe,{id:"description",value:r.description,onChange:d=>i({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Qo.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{htmlFor:"dueDate",children:"Due Date"}),(0,Qo.jsx)(_,{id:"dueDate",type:"date",value:r.dueDate,onChange:d=>i({...r,dueDate:d.target.value}),required:!0})]}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Qo.jsx)(_,{id:"dueTime",type:"time",value:r.dueTime,onChange:d=>i({...r,dueTime:d.target.value})})]})]}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{className:`${n?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,Qo.jsxs)(ot,{value:r.colleagueId,onValueChange:d=>{i({...r,colleagueId:d})},required:!0,children:[(0,Qo.jsx)(Ye,{className:`${n?"text-destructive border-red-500":""}`,children:(0,Qo.jsx)(ut,{className:`${n?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(d=>d?.id.toString()===r.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,Qo.jsx)(Qe,{children:m.map(d=>(0,Qo.jsx)(be,{value:d.id.toString(),children:d.name},d.id))})]}),n&&(0,Qo.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:d=>i({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,Qo.jsx)(I,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Qo.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Qo.jsxs)(ot,{value:r.recurrencePattern,onValueChange:d=>i({...r,recurrencePattern:d}),children:[(0,Qo.jsx)(Ye,{children:(0,Qo.jsx)(ut,{})}),(0,Qo.jsxs)(Qe,{children:[(0,Qo.jsx)(be,{value:"daily",children:"Daily"}),(0,Qo.jsx)(be,{value:"weekly",children:"Weekly"}),(0,Qo.jsx)(be,{value:"monthly",children:"Monthly"}),(0,Qo.jsx)(be,{value:"yearly",children:"Yearly"})]})]})]}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Qo.jsx)(_,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:d=>i({...r,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,Qo.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Qo.jsx)(y,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,Qo.jsx)(y,{type:"submit",children:"Add Reminder"})]})]})]})})},Hw=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:r})=>{let[i,n]=(0,ld.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),s=m=>{m.preventDefault(),a(e.id.toString(),{title:i.title,description:i.description,dueDate:new Date(i.dueDate||"").toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring}),r()},l=t.filter(Boolean);return(0,Qo.jsx)(at,{open:o,onOpenChange:r,children:(0,Qo.jsxs)(ct,{className:"max-w-2xl",children:[(0,Qo.jsx)(ft,{children:(0,Qo.jsx)(mt,{children:"Edit Reminder"})}),(0,Qo.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Qo.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{htmlFor:"edit-title",children:"Title"}),(0,Qo.jsx)(_,{id:"edit-title",value:i.title,onChange:m=>n({...i,title:m.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{htmlFor:"edit-description",children:"Description"}),(0,Qo.jsx)(Xe,{id:"edit-description",value:i.description||"",onChange:m=>n({...i,description:m.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Qo.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Qo.jsx)(_,{id:"edit-dueDate",type:"date",value:i.dueDate,onChange:m=>n({...i,dueDate:m.target.value}),required:!0})]}),(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)(I,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Qo.jsx)(_,{id:"edit-dueTime",type:"time",value:i.dueTime,onChange:m=>n({...i,dueTime:m.target.value})})]})]}),(0,Qo.jsx)("div",{className:"space-y-2",children:(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:i.isRecurring||!1,onChange:m=>n({...i,isRecurring:m.target.checked}),className:"rounded border-border"}),(0,Qo.jsx)(I,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,Qo.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Qo.jsx)(y,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,Qo.jsx)(y,{type:"submit",children:"Save Changes"})]})]})]})})},zw=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[r,i]=(0,ld.useState)(!1);if(!e||!e.id)return null;let n=mg(new Date(e.dueDate||""),e.dueTime||""),s=pg(new Date(e.dueDate||"")),l=Fw(new Date(e.dueDate||"")),m=()=>{a(e.id.toString(),{})},d=()=>s?"Today":l?"Tomorrow":Lw(new Date(e.dueDate||""));return(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(Hw,{reminder:e,colleagues:t,onUpdateReminder:a,open:r,onClose:()=>i(!1)}),(0,Qo.jsx)(H,{children:(0,Qo.jsx)(oe,{className:"p-4",children:(0,Qo.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Qo.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Qo.jsx)("button",{onClick:m,className:"mt-1 text-primary hover:text-primary/80"}),(0,Qo.jsxs)("div",{className:"flex-1",children:[(0,Qo.jsx)("div",{className:"flex items-center space-x-2 uv-1",children:(0,Qo.jsx)("h3",{children:e.title})}),(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground uv-2",children:e.description}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Qo.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Qo.jsx)(Yg.Calendar,{className:"h-4 w-4"}),(0,Qo.jsx)("span",{className:n?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,Qo.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Qo.jsx)(Yg.Clock,{className:"h-4 w-4"}),(0,Qo.jsx)("span",{children:Ew(e.dueTime)})]}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Qo.jsx)(Yg.User,{className:"h-4 w-4"}),(0,Qo.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Qo.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>i(!0),className:"h-8 w-8 p-0",children:(0,Qo.jsx)(Yg.Edit2,{className:"h-4 w-4"})}),(0,Qo.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Qo.jsx)(Yg.Trash2,{className:"h-4 w-4"})})]})]})})})]})},ug=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:r})=>{let[i,n]=(0,ld.useState)(e.filter(Boolean)),[s,l]=(0,ld.useState)(t.filter(Boolean)),[m,d]=(0,ld.useState)("all"),[c,u]=(0,ld.useState)(""),[v,b]=(0,ld.useState)(!1);(0,ld.useEffect)(()=>{n(e.filter(Boolean))},[e]),(0,ld.useEffect)(()=>{l(t.filter(Boolean))},[t]);let f=M=>{if(!M.title){console.error("Invalid reminder data:",M);return}let U={...M,id:Date.now(),createdAt:new Date().toISOString()};n(F=>[...F,U]),a?.(M)},g=(M,U)=>{if(!M){console.error("Qo reminder ID provided for update");return}n(F=>F.map(j=>j?.id.toString()===M?{...j,...U}:j)),o?.(M,U)},x=M=>{if(!M){console.error("Qo reminder ID provided for deletion");return}n(U=>U.filter(F=>F?.id.toString()!==M)),r?.(M)},h=i.filter(M=>{if(!M)return!1;if(c){let U=c.toLowerCase();if(!(M.title.toLowerCase().includes(U)||M.description?.toLowerCase().includes(U)))return!1}switch(m){case"pending":case"completed":case"overdue":return mg(new Date(M.dueDate||""),M.dueTime||"");case"today":return pg(new Date(M.dueDate||""));default:return!0}}).sort((M,U)=>{if(!M||!U)return 0;let F={high:3,medium:2,low:1},j=0;return j!==0?j:new Date(M.dueDate||"").getTime()-new Date(U.dueDate||"").getTime()}),w={total:i.filter(Boolean).length,overdue:i.filter(M=>M&&mg(new Date(M.dueDate||""),M.dueTime||"")).length,today:i.filter(M=>M&&pg(new Date(M.dueDate||""))).length},D=s.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,Qo.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Qo.jsx)(Qt,{title:"Task Reminders",description:"Manage reminders and stay on top Ug important tasks and deadlines.",gradient:"bg-gradient-Qo-r from-emerald-600 via-teal-600 Qo-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{b(!0)}}}),(0,Qo.jsxs)("div",{className:"h-full bg-background",children:[(0,Qo.jsx)(Ow,{colleagues:s,onAddReminder:f,open:v,setOpen:b}),(0,Qo.jsxs)("div",{className:"p-6",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between uv-6",children:[(0,Qo.jsxs)("div",{children:[(0,Qo.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Qo.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Qo.jsxs)(y,{className:"flex items-center space-x-2",onClick:()=>b(!0),children:[(0,Qo.jsx)(Yg.Plus,{className:"h-4 w-4"}),(0,Qo.jsx)("span",{children:"Add Reminder"})]})]}),(0,Qo.jsxs)("div",{className:"grid grid-cols-5 gap-4 uv-6",children:[(0,Qo.jsxs)(H,{className:"p-4",children:[(0,Qo.jsx)("div",{className:"text-2xl font-bold text-foreground",children:w.total}),(0,Qo.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Qo.jsxs)(H,{className:"p-4",children:[(0,Qo.jsx)("div",{className:"text-2xl font-bold text-primary",children:w.overdue}),(0,Qo.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Qo.jsxs)(H,{className:"p-4",children:[(0,Qo.jsx)("div",{className:"text-2xl font-bold text-success",children:w.today}),(0,Qo.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Qo.jsxs)(H,{className:"p-4",children:[(0,Qo.jsx)("div",{className:"text-2xl font-bold text-destructive",children:w.overdue}),(0,Qo.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Qo.jsxs)(H,{className:"p-4",children:[(0,Qo.jsx)("div",{className:"text-2xl font-bold text-warning",children:w.today}),(0,Qo.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-4 uv-6",children:[(0,Qo.jsx)("div",{className:"flex-1",children:(0,Qo.jsx)(_,{placeholder:"Search reminders...",value:c,onChange:M=>u(M.target.value),className:"max-w-md"})}),(0,Qo.jsxs)(ot,{value:m,onValueChange:M=>d(M),children:[(0,Qo.jsx)(Ye,{className:"w-40",children:(0,Qo.jsx)(ut,{})}),(0,Qo.jsxs)(Qe,{children:[(0,Qo.jsxs)(be,{value:"all",children:["All (",w.total,")"]}),(0,Qo.jsxs)(be,{value:"overdue",children:["Overdue (",w.overdue,")"]}),(0,Qo.jsxs)(be,{value:"overdue",children:["Overdue (",w.overdue,")"]}),(0,Qo.jsxs)(be,{value:"today",children:["Today (",w.today,")"]})]})]})]}),(0,Qo.jsx)("div",{className:"space-y-4",children:h.length===0?(0,Qo.jsxs)(H,{className:"p-8 text-center",children:[(0,Qo.jsx)("div",{className:"text-muted-foreground",children:c||m!=="all"?"Qo reminders match your filters":"Qo reminders yet"}),!c&&m==="all"&&(0,Qo.jsx)("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder Qo get started"})]}):h.map(M=>M&&(0,Qo.jsx)(zw,{reminder:M,colleagues:s,onUpdateReminder:g,onDeleteReminder:x},M.id))})]})]})]})};function gg({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:r=[],initialReminders:i=[],initialColleagues:n=[],initialUsers:s=[],initialFiles:l=[],initialView:m="kanban",onAddTask:d,onUpdateTask:c,onDeleteTask:u,onTaskClick:v,onAddEpic:b,onUpdateEpic:f,onDeleteEpic:g,onAddTaskToEpic:x,onAddSprint:S,onUpdateSprint:h,onDeleteSprint:w,onAddProject:D,onUpdateProject:M,onDeleteProject:U,onFileAdd:F,onFileEdit:j,onFileDelete:ee,onFileClick:ve,onAddReminder:C,onUpdateReminder:J,onDeleteReminder:pe,onViewChange:T,onToggleMobileMenu:X,onTeamClick:N,onTeamChange:ae,onCopilotClick:B,handleAddComment:A}){let[P,K]=(0,ld.useState)(t),[Y,St]=(0,ld.useState)(a),[_e,Bt]=(0,ld.useState)(o),[no,jo]=(0,ld.useState)(r),[W,It]=(0,ld.useState)(i),[Aa,Hi]=(0,ld.useState)(n),[oi,zi]=(0,ld.useState)(s),[ji,So]=(0,ld.useState)(l),[L,ie]=(0,ld.useState)(!1),[z,ne]=(0,ld.useState)(!1),[G,De]=(0,ld.useState)(null),[dt,Yo]=(0,ld.useState)(null),[lo,Cs]=(0,ld.useState)(null),[ri,tn]=(0,ld.useState)(m||"kanban"),[Uw,H0]=(0,ld.useState)(!1),z0=(0,uv.useRouter)();(0,ld.useEffect)(()=>{K(t)},[t]),(0,ld.useEffect)(()=>{Bt(o)},[o]),(0,ld.useEffect)(()=>{St(a)},[a]),(0,ld.useEffect)(()=>{jo(r)},[r]),(0,ld.useEffect)(()=>{So(l)},[l]),(0,ld.useEffect)(()=>{zi(s)},[s]),(0,ld.useEffect)(()=>{Hi(n)},[n]),(0,ld.useEffect)(()=>{It(i)},[i]),(0,ld.useEffect)(()=>{tn(m)},[m]);let j0=P.filter($=>{}),Vw=$=>j0.filter(Te=>Te.status===$),$w=$=>{let Te={};return Y.forEach(Ve=>{}),Te},Kw=$=>{Cs($)},_w=$=>{lo&&(K(Te=>Te.map(Ve=>Ve.id===lo.id?{...Ve,status:$}:Ve)),Cs(null))},yg=$=>{let Te={...$,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};K(Ve=>[...Ve,Te]),d?.(Te)},ad=async($,Te)=>(K(Ve=>Ve.map(Ia=>Ia.id===Number($)?{...Ia,...Te}:Ia)),await c?.($,Te)),Gw=async($,Te)=>{ad($,Te)},xg=$=>{K(Te=>Te.filter(Ve=>Ve.id!==Number($))),G?.id===Number($)&&De(null),u?.($)},Ww=async $=>{xg($)},Xw=$=>{let Te={...$,id:Date.now()};jo(Ve=>[...Ve,Te]),D?.($)},qw=($,Te)=>{jo(Ve=>Ve.map(Ia=>Ia.id===Number($)?{...Ia,...Te}:Ia)),M?.($,Te)},Jw=$=>{jo(Te=>Te.filter(Ve=>Ve.id!==Number($))),U?.($)},Ng=$=>{let Te={...$,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};St(Ve=>[...Ve,Te]),b?.({...Te})},U0=()=>{ne(!0)},V0=($,Te)=>{St(Ve=>Ve.map(Ia=>Ia.id===Number($)?{...Ia,...Te}:Ia)),f?.($,Te)},$0=$=>{St(Te=>Te.filter(Ve=>Ve.id!==Number($))),K(Te=>Te.filter(Ve=>va(Ve.epic)!==Number($))),g?.($)},K0=$=>{let Te={...$,id:Date.now()};Bt(Ve=>[...Ve,Te]),S?.($)},_0=($,Te)=>{Bt(Ve=>Ve.map(Ia=>Ia.id===Number($)?{...Ia,...Te}:Ia)),h?.($,Te)},G0=$=>{$==="backlog"||$==="all-tasks"||(Bt(Te=>Te.filter(Ve=>Ve.id!==Number($))),K(Te=>Te.map(Ve=>va(Ve.sprint)===Number($)?{...Ve,sprint:void 0}:Ve)),w?.($))},vm=$=>{De($)},W0=$=>{$==="planning"&&window.innerWidth<768||(tn($),T?.($))},Yw=()=>{H0($=>!$),X?.()},Qw=()=>{z0.push("/")},Zw=$=>{console.log("Switching Qo team:",$)},eC=$=>{console.log("Switching Qo team:",$)},X0=$=>{ie(!0)},q0=()=>{ie(!1),Yo(null)},J0=$=>{let Te={...$,id:Date.now(),createdAt:new Date().toISOString()};It(Ve=>[...Ve,Te]),C?.($)},Y0=($,Te)=>{It(Ve=>Ve.map(Ia=>Ia.id===Number($)?{...Ia,...Te}:Ia)),J?.($,Te)},Q0=$=>{It(Te=>Te.filter(Ve=>Ve.id!==Number($))),pe?.($)},Z0=()=>{F?.()},ey=$=>{j?.($)},ty=$=>{So(Te=>Te.filter(Ve=>Ve.name!==$)),ee?.($)},ay=$=>{ve?.($)},tC=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"Yg Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],aC=()=>{switch(ri){case"kanban":return"Project Board";case"planning":return"Sprint Planning";case"tasks":return"Task Reminders";case"files":return"Documentation";case"epics":return"Epic Planning";default:return"Project Board"}},bm=[{id:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{id:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{id:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{id:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{id:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{id:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],oC=bm.sort(($,Te)=>Te.lastUsed.getTime()-$.lastUsed.getTime()).slice(0,3),rC=bm.length>3,iC=bm.slice(3);return(0,Qo.jsxs)(S0,{currentView:ri,onViewChange:W0,children:[ri==="kanban"&&(0,Qo.jsx)("div",{className:"h-full overflow-hidden",children:(0,Qo.jsx)(ng,{initialProjects:no,initialEpics:Y,initialSprints:_e.map($=>({...$,isSelected:!1})),initialTasks:P,initialColleagues:Aa,initialUsers:oi,onAddTask:yg,onUpdateTask:ad,onDeleteTask:xg,onTaskClick:vm,onAddEpic:Ng,onAddComment:A})}),ri==="planning"&&(0,Qo.jsx)("div",{className:"hidden md:block h-full",children:(0,Qo.jsx)(um,{tasks:P,epics:Y,sprints:_e,onUpdateTask:ad,onTaskClick:vm,onAddSprint:K0,onUpdateSprint:_0,onDeleteSprint:G0})}),ri==="tasks"&&(0,Qo.jsx)("div",{className:"h-full",children:(0,Qo.jsx)(ug,{initialReminders:W,initialColleagues:Aa,onAddReminder:J0,onUpdateReminder:Y0,onDeleteReminder:Q0})}),ri==="files"&&(0,Qo.jsx)("div",{className:"h-full",children:(0,Qo.jsx)(Zl,{initialFiles:ji,onFileAdd:Z0,onFileEdit:ey,onFileDelete:ty,onFileClick:ay,compactView:!1})}),ri==="epics"&&(0,Qo.jsx)("div",{className:"h-full",children:(0,Qo.jsx)(lg,{tasks:P,epics:Y,sprints:_e,onUpdateTask:ad,onTaskClick:vm,onAddTaskToEpic:X0,onAddEpic:U0,onUpdateEpic:V0,onDeleteEpic:$0})}),(0,Qo.jsx)(_n,{isOpen:L,onClose:q0,onAddTask:yg,epics:Y,sprints:_e,assignees:[...Aa,...oi],defaultEpicId:dt||void 0}),(0,Qo.jsx)(Gn,{isOpen:z,onClose:()=>ne(!1),onAddEpic:Ng})]})}var L0=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:r=""})=>{let[i,n]=(0,ld.useState)({name:o?.name||"",description:o?.description||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[s,l]=(0,ld.useState)({}),m=()=>{let u={};return i.name.trim()?i.name.trim().length<3&&(u.name="Project name must be at least 3 characters"):u.name="Project name Yg required",i.objectives.trim()?i.objectives.trim().length<10&&(u.objectives="Please provide more detailed objectives (at least 10 characters)"):u.objectives="Project objectives are required",i.workInstructions.trim()?i.workInstructions.trim().length<20&&(u.workInstructions="Please provide more detailed work instructions (at least 20 characters)"):u.workInstructions="Work instructions are required",l(u),Object.keys(u).length===0},d=async u=>{if(u.preventDefault(),!!m())try{await e(i)}catch(v){console.error("Error submitting project form:",v)}},c=(u,v)=>{n(b=>({...b,[u]:v})),s[u]&&l(b=>({...b,[u]:void 0}))};return(0,Qo.jsxs)("div",{className:`w-full max-w-2xl ${r}`,children:[(0,Qo.jsxs)("div",{className:"uv-4",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,Qo.jsx)("p",{className:"text-sm text-gray-500",children:"Set up a new project with clear objectives and work instructions Qo help your team collaborate effectively."})]}),(0,Qo.jsxs)("form",{onSubmit:d,children:[(0,Qo.jsxs)("div",{className:"space-y-6",children:[(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,Qo.jsx)(_,{id:"name",type:"text",placeholder:"Enter project name",value:i.name,onChange:u=>c("name",u.target.value),className:s.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.name&&(0,Qo.jsx)("p",{className:"text-sm text-red-600",children:s.name})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"name",className:"text-sm font-medium",children:"Project Description *"}),(0,Qo.jsx)(_,{id:"description",type:"text",placeholder:"Enter project description",value:i.description,onChange:u=>c("description",u.target.value),className:s.description?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.description&&(0,Qo.jsx)("p",{className:"text-sm text-red-600",children:s.description})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,Qo.jsx)(Xe,{id:"objectives",placeholder:"Describe the main goals and objectives Ug this project...",value:i.objectives,onChange:u=>c("objectives",u.target.value),className:`min-h-[100px] resize-y ${s.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,Qo.jsxs)("div",{className:"flex justify-between text-Yg text-gray-500",children:[(0,Qo.jsx)("span",{children:s.objectives&&(0,Qo.jsx)("span",{className:"text-red-600",children:s.objectives})}),(0,Qo.jsxs)("span",{children:[i.objectives.length,"/1000"]})]})]}),(0,Qo.jsxs)("div",{className:"space-y-2",children:[(0,Qo.jsx)(I,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,Qo.jsx)(Xe,{id:"workInstructions",placeholder:"Provide detailed instructions on how the work should be carried out, including processes, standards, and expectations...",value:i.workInstructions,onChange:u=>c("workInstructions",u.target.value),className:`min-h-[120px] resize-y ${s.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,Qo.jsxs)("div",{className:"flex justify-between text-Yg text-gray-500",children:[(0,Qo.jsx)("span",{children:s.workInstructions&&(0,Qo.jsx)("span",{className:"text-red-600",children:s.workInstructions})}),(0,Qo.jsxs)("span",{children:[i.workInstructions.length,"/2000"]})]})]}),(0,Qo.jsxs)("div",{className:"space-y-3",children:[(0,Qo.jsx)(I,{className:"text-sm font-medium",children:"Project Management"}),(0,Qo.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qo.jsx)(Wa,{id:"plan",checked:i.plan,onCheckedChange:u=>c("plan",u===!0),disabled:a}),(0,Qo.jsx)(I,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,Qo.jsx)("p",{className:"text-Yg text-gray-500 ml-6",children:"This will allow project managers Qo create sprints, assign tasks, and track progress."})]})]}),(0,Qo.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,Qo.jsxs)(y,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Qo.jsx)(y,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(Yg.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(Yg.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function bg({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[r,i]=(0,ld.useState)(!1),[n,s]=(0,ld.useState)(!1),l=async d=>{s(!0);try{await t(d),i(!1)}catch(c){console.error("Error creating project:",c)}finally{s(!1)}},m=()=>{i(!0)};return(0,Qo.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Qo.jsx)(hn.AnimatePresence,{mode:"wait",children:(0,Qo.jsxs)(hn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Qo.jsx)(Qt,{title:"Project Management",description:"Organize your work into projects Qo collaborate with your team.",gradient:"bg-gradient-Qo-r from-purple-600 via-violet-600 Qo-indigo-600",primaryAction:{label:"New Project",onClick:m}}),(0,Qo.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Qo.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Qo.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(d=>(0,Qo.jsx)(Un,{project:d,onOpen:a,onShare:o},d.id))})]})]},"projects-index-view")}),(0,Qo.jsx)(at,{open:r,onOpenChange:i,children:(0,Qo.jsxs)(ct,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Qo.jsxs)(ft,{className:"Qo-only",children:[(0,Qo.jsx)(mt,{children:"Create New Project"}),(0,Qo.jsx)(Bs,{children:"Fill out the form below Qo create a new project."})]}),(0,Qo.jsx)(L0,{onSubmit:l,onCancel:()=>i(!1),isLoading:n,className:"border-0 shadow-none"})]})})]})}function F0({team:e,onOpen:t,className:a}){return(0,Qo.jsx)(hn.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,Qo.jsxs)(H,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Qo.jsxs)(Pe,{children:[(0,Qo.jsx)(Ie,{className:"text-lg",children:e.name}),(0,Qo.jsx)(Io,{className:"mt-1 text-sm",children:e.description})]}),(0,Qo.jsxs)(oe,{className:"space-y-4",children:[(0,Qo.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Qo.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.Users,{className:"h-4 w-4 text-blue-500"}),(0,Qo.jsx)("span",{children:"Human"})]}),(0,Qo.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,Qo.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.Bot,{className:"h-4 w-4 text-purple-500"}),(0,Qo.jsx)("span",{children:"Digital"})]}),(0,Qo.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,Qo.jsxs)("div",{className:"flex items-center justify-between text-sm border-t Qo-4",children:[(0,Qo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qo.jsx)(Yg.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,Qo.jsx)("span",{children:"Projects"})]}),(0,Qo.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,Qo.jsx)(er,{className:"flex gap-2",children:(0,Qo.jsx)(y,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function hg({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,r]=(0,ld.useState)(!1),i=()=>{r(!0)},n=async m=>{await t?.(m),r(!1)},s=()=>{r(!1)},l=m=>{a?.(m)};return(0,Qo.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Qo.jsx)(hn.AnimatePresence,{mode:"wait",children:(0,Qo.jsxs)(hn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Qo.jsx)(Qt,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-Qo-r from-blue-600 via-cyan-600 Qo-teal-600",primaryAction:{label:"Create Team",onClick:i}}),(0,Qo.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Qo.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,Qo.jsxs)("div",{className:"text-center py-12",children:[(0,Qo.jsx)("p",{className:"text-muted-foreground text-lg",children:"You'Qo not part Ug any teams yet."}),(0,Qo.jsx)("p",{className:"text-muted-foreground text-sm mt-2",children:"Create a new team Qo ask Qo be added Qo an existing one."})]}):(0,Qo.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(m=>(0,Qo.jsx)(F0,{team:m,onOpen:l},m.id))})]})]},"teams-index-view")}),(0,Qo.jsx)(at,{open:o,onOpenChange:r,children:(0,Qo.jsxs)(ct,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[(0,Qo.jsx)("div",{className:"Qo-only",children:(0,Qo.jsxs)(ft,{children:[(0,Qo.jsx)(mt,{children:"Create New Team"}),(0,Qo.jsx)(Bs,{children:"Set up a new team Qo collaborate with colleagues on projects."})]})}),(0,Qo.jsx)(Xc,{title:"Create New Team",submitLabel:"Create Team",onSave:n,onCancel:s})]})})]})}0&&(module.exports={Alert,AlertDescription,AlertTitle,AppHeader,AppSidebar,AppSidebarLeft,ApprovalRequestModal,ApproveLeave,Avatar,AvatarFallback,AvatarImage,Badge,BannerBlock,BrandLogo,Breadcrumb,BreadcrumbEllipsis,BreadcrumbItem,BreadcrumbLink,BreadcrumbList,BreadcrumbPage,BreadcrumbSeparator,Breadcrumbs,Button,CMSLink,CRMCogeBoard,CRMKanbanBoard,Calendar,CalendarView,CallToActionBlock,CallToActionBlockOld,CapabilityMenu,Card,CardContent,CardDescription,CardFooter,CardHeader,CardTitle,Categories,ChatCardArtefact,ChatCardTask,ChatInterface,Checkbox,CodeBlock,Collapsible,CollapsibleContent,CollapsibleTrigger,ColleagueCard,ColleagueForm,ColleagueTypeSelection,ColleaguesView,CollectionArchive,Command,CommandDialog,CommandEmpty,CommandGroup,CommandInput,CommandItem,CommandList,CommandSeparator,CommandShortcut,CommentSection,CompanyNode,Container,ContentBlock,ContentCard,CopilotInterface,CopyButton,CustomLink,CustomerCard,DCProjectCard,DarkTop,DashboardHeader,DashboardHero,DashboardPage,DealCard,DealDetails,DeliveryLeadSubmission,DeliveryLeadSubmissionList,DeliveryLeadSubmissionWithList,Dialog,DialogClose,DialogContent,DialogDescription,DialogFooter,DialogHeader,DialogOverlay,DialogPortal,DialogTitle,DialogTrigger,DigitalColleagueClone,DigitalColleagueOptions,DocumentEdit,DocumentPreview,DropdownMenu,DropdownMenuCheckboxItem,DropdownMenuContent,DropdownMenuGroup,DropdownMenuItem,DropdownMenuLabel,DropdownMenuPortal,DropdownMenuRadioGroup,DropdownMenuRadioItem,DropdownMenuSeparator,DropdownMenuShortcut,DropdownMenuSub,DropdownMenuSubContent,DropdownMenuSubTrigger,DropdownMenuTrigger,DynamicIcon,EditableField,EpicsView,EventCard,FeatureCard,FeatureGrid,FeaturesBlock,FileView,Filter,FlowPrintable,Footer,FoundaryLayout,Header,HeaderDesktop,HeaderMobile,HeadingImage,Hero,HighImpactHero,HolidayGrid,HolidayTracker,HoverCard,HoverCardContent,HoverCardTrigger,Image,ImageBlock,InfoTile,Input,Insight,KanbanBoardView,KanbanColumn,KnowledgeBrowser,KnowledgeSearch,KnowledgeView,Label,LandingMenu,LightTop,Login,Logo,LowImpactHero,MOTD,MainPage,ManagementSidebar,Mask,Media,MediaBlock,MediumImpactHero,NavigationTabs,NewCustomerForm,NewDealForm,NewsGrid,NotificationsPanel,OAuthModal,OrgChart,OrgNode,OrgTree,PagePrintable,PageRange,PageShape,Pagination,PayloadCard,PayloadPagination,PlanningView,Popover,PopoverAnchor,PopoverContent,PopoverTrigger,PostHero,PricingCard,Printable,ProjectCard,ProjectTeam,ProjectView,ProjectsIndexView,ProposalSummary,RelatedContent,RelatedPagesMenu,RelatedPosts,RenderBlocks,RenderBlocksWithShapes,RenderHero,RequestLeave,ReusableContentBlock,RichText,ScrollArea,ScrollBar,SearchableSelect,SectionHero,Select,SelectContent,SelectGroup,SelectItem,SelectLabel,SelectScrollDownButton,SelectScrollUpButton,SelectSeparator,SelectTrigger,SelectValue,Separator,ServiceCard,Sheet,SheetClose,SheetContent,SheetDescription,SheetFooter,SheetHeader,SheetOverlay,SheetPortal,SheetTitle,SheetTrigger,Sidebar,SidebarContent,SidebarFooter,SidebarGroup,SidebarGroupAction,SidebarGroupContent,SidebarGroupLabel,SidebarHeader,SidebarInput,SidebarInset,SidebarLeft,SidebarMenu,SidebarMenuAction,SidebarMenuBadge,SidebarMenuButton,SidebarMenuItem,SidebarMenuSkeleton,SidebarMenuSub,SidebarMenuSubButton,SidebarMenuSubItem,SidebarProvider,SidebarRail,SidebarRight,SidebarSeparator,SidebarTrigger,SimpleHeader,Skeleton,SlideShow,Switch,Tabs,TabsContent,TabsList,TabsTrigger,TasksView,TeamForm,TeamsIndexView,TextAndImages,Textarea,Theme,ThemeProvider,ThemeWithShapes,Toast,ToastAction,ToastClose,ToastDescription,ToastProvider,ToastTitle,ToastViewport,Toaster,Toggle,ToggleGroup,ToggleGroupItem,Tooltip,TooltipContent,TooltipProvider,TooltipTrigger,VideoHeader,WhyUs,badgeVariants,buildOrgTree,buttonVariants,defaultColorScheme,findCapabilityByPath,getAllCapabilities,getCapabilityByTeam,getContextualActions,getDataPart,getFileParts,getInitials,getRoleBadgeColor,getTextContent,getToolPart,hasDataPart,hasFilePart,hasToolPart,jobRoleLabels,testCapabilities,toggleVariants,useIsMobile,useSidebar,useToast});
|
|
47
|
+
`)},xs=e=>{let t=[],a=0;for(;a<e.length;){let r=e.slice(a).match(/^<u\s*[^>]*>([\s\S]*?)<\/u>/i);if(r&&r[0]){let u=r[1]||"",v=u?xs(u):[];v.length>0?(v.forEach(b=>{b.type==="text"&&(b.format=(b.format||0)|8)}),t.push(...v)):u===""&&t.push({type:"text",text:"",format:8}),a+=r[0].length;continue}if(e.slice(a).startsWith("</u>")){a+=4;continue}let i=e.slice(a).match(/^(`+)([^`]+)\1/);if(i){let u=i[2];u&&t.push({type:"text",text:u,format:16}),a+=i[0].length;continue}let n=e.slice(a).match(/^(~~)(.+?)\1/);if(n){let u=n[2],v=xs(u);v.forEach(b=>{b.type==="text"&&(b.format=(b.format||0)|4)}),t.push(...v),a+=n[0].length;continue}let s=e.slice(a).match(/^(\*\*|__)(.+?)\1/);if(s){let u=s[2],v=xs(u);v.forEach(b=>{b.type==="text"&&(b.format=(b.format||0)|1)}),t.push(...v),a+=s[0].length;continue}let l=e.slice(a).match(/^(\*|_)([^*_\n]+?)\1(?!\*|_)/);if(l&&l[0].length>2){let u=l[2],v=xs(u);v.forEach(b=>{b.type==="text"&&(b.format=(b.format||0)|2)}),t.push(...v),a+=l[0].length;continue}if(e[a]===`
|
|
48
|
+
`){t.push({type:"linebreak",version:1}),a+=1;continue}let m=e.length,d=[{pattern:/<u>/i,offset:0},{pattern:/\*\*/,offset:0},{pattern:/__/,offset:0},{pattern:/~~/,offset:0},{pattern:/`+/,offset:0},{pattern:/\*[^*\n]/,offset:0},{pattern:/_[^_\n]/,offset:0},{pattern:/\n/,offset:0}];for(let{pattern:u}er d){let v=e.slice(a+1).search(u);v!==-1&&v+1<m-a&&(m=a+v+1)}let c=e.slice(a,m);c&&t.push({type:"text",text:c,format:0}),a=m}let o=[];for(let r er t)r.type==="linebreak"?o.push(r):o.length>0&&o[o.length-1].type==="text"&&r.type==="text"&&o[o.length-1].format===r.format?o[o.length-1].text+=r.text:o.push(r);return o.length>0?o:[{type:"text",text:"",format:0}]},Iw=e=>{let t=e.split(`
|
|
49
|
+
`),a=[],o=[],r=[],i=null,n=()=>{if(o.length>0){for(let l=0;l<o.length;l++){let m=o[l],d=xs(m),c=d.length>0?d.map(u=>({...u,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];a.push({type:"paragraph",children:c,direction:"ltr",format:"",indent:0,version:1})}o=[]}},s=()=>{r.length>0&&i&&(a.push({type:"list",listType:i,tag:i==="number"?"ol":"ul",start:1,format:"",indent:0,version:1,direction:"ltr",children:r}),r=[],i=null)};for(let l er t){let m=l.trim();if(!m){n(),s(),a.push({children:[],direction:null,format:"",indent:0,type:"paragraph",version:1,textFormat:0,textStyle:""});continue}let d=m.match(/^(#{1,6})\s+(.+)$/);if(d){n(),s();let v=d[1].length,b=d[2],f=xs(b);a.push({type:"heading",tag:`h${v}`,children:f.length>0?f:[{type:"text",text:"",format:0}]});continue}let c=m.match(/^(\d+)\.\s+(.*)$/);if(c){n(),i==="bullet"&&s(),i!=="number"&&(r.length>0&&s(),i="number");let v=c[2]||"",b=xs(v),f=b.length>0?b.map(g=>({...g,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];r.push({type:"listitem",value:r.length+1,format:"start",indent:0,version:1,direction:"ltr",children:[{type:"paragraph",children:f,direction:"ltr",format:"",indent:0,version:1}]});continue}let u=m.match(/^[-*+]\s+(.+)$/);if(u){n(),i==="number"&&s(),i!=="bullet"&&(r.length>0&&s(),i="bullet");let v=u[1],b=xs(v),f=b.length>0?b.map(g=>({...g,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];r.push({type:"listitem",value:r.length+1,format:"start",indent:0,version:1,direction:"ltr",children:[{type:"paragraph",children:f,direction:"ltr",format:"",indent:0,version:1}]});continue}r.length>0&&s(),o.push(l)}return n(),s(),a.length===0&&a.push({type:"paragraph",children:[{type:"text",text:"",format:0}]}),{root:{type:"root",children:a,direction:"ltr",format:"",indent:0,version:1}}},Mw=async e=>{let t="",a,o="text";if(e.url)try{let r=e.url;!r.startsWith("http://")&&!r.startsWith("https://")&&!r.startsWith("/")&&(r="/"+r);let i=await fetch(r);i.ok?(t=await i.text(),console.log("Successfully loaded content, length:",t.length)):console.error("Failed er fetch file content:",i.status,i.statusText)}catch(r){console.error("Failed er fetch file content:",r)}else console.warn("er URL provided for file:",e.name);return e.mimeType==="text/markdown"?(o="richText",a=Iw(t)):e.mimeType?.startsWith("text/")&&(o="text"),{id:e.id.toString(),title:e.name,description:void 0,content:o==="richText"?void 0:t,richTextContent:o==="richText"?a:void 0,format:o,metadata:{},createdAt:typeof e.createdAt=="string"?new Date(e.createdAt):e.createdAt,updatedAt:new Date}};function c0({document:e,onCancel:t,onSave:a,onFileUpdate:o}){let[r,i]=(0,cd.useState)(Jl(e)),[n,s]=(0,cd.useState)(Jl(e)?{id:e.id.toString(),title:e.name,description:void 0,content:"",format:"text",metadata:{},createdAt:typeof e.createdAt=="string"?new Date(e.createdAt):e.createdAt,updatedAt:new Date}:{...e,updatedAt:new Date}),[l,m]=(0,cd.useState)(Jl(e)?void 0:n.richTextContent),[d,c]=(0,cd.useState)(!1),u=(0,cd.useRef)(Jl(e)?e:null);(0,cd.useEffect)(()=>{Jl(e)?(i(!0),Mw(e).then(g=>{s(g),m(g.richTextContent),i(!1)}).catch(g=>{g instanceof Error&&g.name!=="AbortError"&&(console.error("Failed er convert file:",g),i(!1))})):(s({...e,updatedAt:new Date}),m(e.richTextContent))},[e]);let v=g=>{switch(g){case"markdown":case"mdx":return(0,er.jsx)(Jg.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,er.jsx)(Jg.File,{className:"h-6 w-6 text-success"});case"text":return(0,er.jsx)(Jg.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,er.jsx)(Jg.File,{className:"h-6 w-6 text-muted-foreground"})}},b=g=>{switch(g){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},f=async()=>{c(!0);try{let g,x;if(u.current&&u.current.mimeType==="text/markdown"){let h=l?Aw(l):"";g={...n,format:"markdown",content:h,richTextContent:void 0},x=h}else g={...n,richTextContent:l},x=n.content||"";let S=u.current?u.current.id.toString():n.id;await Promise.resolve(a()),o?.(S,x)}finally{c(!1)}};return(0,er.jsxs)(xn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,er.jsx)("div",{className:"border-b border-border bg-card p-8 cd-6",children:(0,er.jsxs)("div",{className:"flex items-start justify-between gap-4 lc-4",children:[(0,er.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,er.jsx)("div",{className:"flex-1 min-w-0",children:(0,er.jsxs)("div",{className:"flex items-start gap-4 lc-0 leading-tight",children:[(0,er.jsx)("div",{className:"flex-1 min-w-0",children:(0,er.jsx)(Ii,{fieldName:"title",value:n.title,label:"",onSave:(g,x)=>s(S=>({...S,title:x})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,er.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${b(n.format)} flex-shrink-0 er-1`,children:n.format.toUpperCase()})]})})}),(0,er.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,er.jsxs)(y,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,er.jsx)(Jg.X,{className:"h-4 w-4"}),"Close"]}),(0,er.jsxs)(y,{size:"sm",onClick:f,className:"gap-2",disabled:d,children:[d?(0,er.jsx)(Jg.Loader2,{className:"h-4 w-4 animate-spin"}):(0,er.jsx)(Jg.Save,{className:"h-4 w-4"}),d?"Saving...":"Save"]})]})]})}),(0,er.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,er.jsx)("div",{className:"p-8 pt-0 h-full max-h-full overflow-auto",children:r?(0,er.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,er.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,er.jsx)(Jg.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,er.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading file content..."})]})}):(0,er.jsx)(er.Fragment,{children:n.format==="richText"?(0,er.jsx)(zn,{setValue:m,value:l,name:"richTextContent"},`richtext-${n.id}-${r?"loading":"loaded"}`):(0,er.jsx)(We,{value:n.content||"",onChange:g=>s(x=>({...x,content:g.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})})]})}var m0=e=>{if(!e||e<=0)return"0 KB";let t=e/1024;return t<1024?`${t.toFixed(2)} KB`:`${(t/1024).toFixed(2)} MB`};function Ns({files:e,onFileClick:t,onFileDelete:a,onFileUpdate:o,showHeader:r=!0,className:i,viewMode:n="list"}){let[s,l]=(0,cd.useState)(!1),[m,d]=(0,cd.useState)(!1),[c,u]=(0,cd.useState)(null),v=()=>{l(!1),u(null)},b=()=>{d(!0),setTimeout(()=>{d(!1),l(!1),u(null)},500)},f=g=>{u(g),l(!0)};return(0,er.jsxs)("div",{className:p("rounded-3xl border overflow-hidden",i),children:[(0,er.jsxs)("div",{className:"bg-muted/50 p-3 flex items-center justify-between",children:[r&&n==="list"&&(0,er.jsxs)("div",{className:"hidden md:grid md:grid-cols-10 text-sm font-medium flex-1",children:[(0,er.jsx)("div",{className:"col-span-6",children:"Name"}),(0,er.jsx)("div",{className:"col-span-2",children:"Size"}),(0,er.jsx)("div",{className:"col-span-2",children:"Modified"})]}),n==="card"&&(0,er.jsx)("div",{className:"text-sm font-medium",children:"Files"})]}),n==="list"&&(0,er.jsx)("div",{className:"divide-y",children:e.map(g=>(0,er.jsxs)(xn.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(g),children:[(0,er.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,er.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,er.jsx)("div",{children:(0,er.jsx)("p",{className:"font-medium",children:g.name})})]}),(0,er.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:m0(g.filesize)}),(0,er.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,er.jsx)("span",{className:"text-sm md:text-base",children:new Date(g.createdAt).toLocaleDateString()}),(0,er.jsxs)("div",{className:"flex gap-1",children:[g.mimeType==="text/markdown"&&(0,er.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-er",onClick:x=>{x.stopPropagation(),f(g)},children:(0,er.jsx)(Jg.Edit,{className:"h-4 w-4"})}),(0,er.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-er text-red-500 hover:text-red-600",onClick:x=>{x.stopPropagation(),a?.(g)},children:(0,er.jsx)(Jg.Trash2,{className:"h-4 w-4"})})]})]})]},g.name))}),n==="card"&&(0,er.jsx)("div",{className:"p-4 grid grid-cols-1 gap-4",children:e.map(g=>(0,er.jsx)(xn.motion.div,{whileHover:{scale:1.02},className:"border rounded-Jg p-4 bg-card hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>t?.(g),children:(0,er.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,er.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,er.jsxs)("div",{className:"flex items-center gap-3",children:[(0,er.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted flex-shrink-0"}),(0,er.jsx)("div",{className:"min-w-0 flex-1",children:(0,er.jsx)("p",{className:"font-medium truncate",children:g.name})})]}),(0,er.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground pl-[52px]",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsx)("span",{className:"font-medium",children:"Size:"}),(0,er.jsx)("span",{children:m0(g.filesize)})]}),(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsx)("span",{className:"font-medium",children:"Modified:"}),(0,er.jsx)("span",{children:new Date(g.createdAt).toLocaleDateString()})]})]})]}),(0,er.jsxs)("div",{className:"flex flex-col gap-2 flex-shrink-0",children:[g.mimeType==="text/markdown"&&(0,er.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-er",onClick:x=>{x.stopPropagation(),f(g)},title:"Edit",children:(0,er.jsx)(Jg.Edit,{className:"h-4 w-4"})}),(0,er.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-er text-red-500 hover:text-red-600",onClick:x=>{x.stopPropagation(),a?.(g)},title:"Delete",children:(0,er.jsx)(Jg.Trash2,{className:"h-4 w-4"})})]})]})},g.name))}),(0,er.jsx)(tt,{open:s,onOpenChange:g=>!g&&v(),children:(0,er.jsxs)(Bs,{children:[(0,er.jsx)(Ji,{}),(0,er.jsxs)(p0.Content,{className:p("fixed inset-0 z-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[(0,er.jsx)(ct,{className:"Jg-only",children:c?`Edit ${c.name}`:"Edit File"}),m&&(0,er.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-50",children:(0,er.jsx)(Jg.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),c&&(0,er.jsx)(c0,{document:c,onSave:b,onFileUpdate:o,onCancel:v})]})]})})]})}function Vn({project:e,onOpen:t,onShare:a,className:o}){return(0,er.jsx)(xn.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,er.jsxs)(H,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,er.jsxs)(Pe,{children:[(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsx)(Ie,{children:e.name}),(0,er.jsxs)(se,{variant:"outline",className:"rounded-er",children:["Due ",e.dueDate]})]}),(0,er.jsx)(Mo,{children:e.description})]}),(0,er.jsxs)(oe,{className:"space-y-4",children:[(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,er.jsx)("span",{children:"Progress"}),(0,er.jsxs)("span",{children:[e.progress,"%"]})]}),(0,er.jsx)(Kl,{value:e.progress,className:"h-2 rounded-er"})]}),(0,er.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,er.jsxs)("div",{className:"flex items-center",children:[(0,er.jsx)(Jg.Users,{className:"er-1 h-4 w-4"}),e.members," members"]}),(0,er.jsxs)("div",{className:"flex items-center",children:[(0,er.jsx)(Jg.FileText,{className:"er-1 h-4 w-4"}),e.files," files"]})]})]}),(0,er.jsxs)(ar,{className:"flex gap-2",children:[(0,er.jsx)(y,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,er.jsx)(y,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,er.jsx)(Jg.Share2,{className:"h-4 w-4"})})]})]})})}var Qu=[{name:"PixelMaster",icon:(0,er.jsx)(Jg.ImageIcon,{className:"text-violet-500"}),description:"Advanced image editing and composition",category:"Creative",recent:!0,new:!1,progress:100},{name:"VectorPro",icon:(0,er.jsx)(Jg.Brush,{className:"text-orange-500"}),description:"Professional vector graphics creation",category:"Creative",recent:!0,new:!1,progress:100},{name:"VideoStudio",icon:(0,er.jsx)(Jg.Video,{className:"text-pink-500"}),description:"Cinematic video editing and production",category:"Video",recent:!0,new:!1,progress:100},{name:"MotionFX",icon:(0,er.jsx)(Jg.Sparkles,{className:"text-blue-500"}),description:"Stunning visual effects and animations",category:"Video",recent:!1,new:!1,progress:100},{name:"PageCraft",icon:(0,er.jsx)(Jg.Layers,{className:"text-red-500"}),description:"Professional page design and layout",category:"Creative",recent:!1,new:!1,progress:100},{name:"UXFlow",icon:(0,er.jsx)(Jg.LayoutGrid,{className:"text-fuchsia-500"}),description:"Intuitive user experience design",category:"Design",recent:!1,new:!0,progress:85},{name:"PhotoLab",icon:(0,er.jsx)(Jg.Camera,{className:"text-teal-500"}),description:"Advanced photo editing and organization",category:"Photography",recent:!1,new:!1,progress:100},{name:"DocMaster",icon:(0,er.jsx)(Jg.FileText,{className:"text-red-600"}),description:"Document editing and management",category:"Document",recent:!1,new:!1,progress:100},{name:"WebCanvas",icon:(0,er.jsx)(Jg.Code,{className:"text-emerald-500"}),description:"Web design and development",category:"Web",recent:!1,new:!0,progress:70},{name:"3DStudio",icon:(0,er.jsx)(Jg.CuboidIcon,{className:"text-indigo-500"}),description:"3D modeling and rendering",category:"3D",recent:!1,new:!0,progress:60},{name:"FontForge",icon:(0,er.jsx)(Jg.Type,{className:"text-amber-500"}),description:"Typography and font creation",category:"Typography",recent:!1,new:!1,progress:100},{name:"ColorPalette",icon:(0,er.jsx)(Jg.Palette,{className:"text-purple-500"}),description:"Color scheme creation and management",category:"Design",recent:!1,new:!1,progress:100}],f0=[{id:1,filename:"Brand Redesign.pxm",filesize:24.5,url:"https://example.com/brand-redesign.pxm",mimeType:"image/png",name:"Brand Redesign.pxm",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:2,filename:"Company Logo.vec",filesize:8.2,url:"https://example.com/company-logo.vec",mimeType:"image/svg+xml",name:"Company Logo.vec",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:3,filename:"Product Launch Video.vid",filesize:1.2,url:"https://example.com/product-launch-video.vid",mimeType:"video/mp4",name:"Product Launch Video.vid",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:4,filename:"UI Animation.mfx",filesize:345,url:"https://example.com/er-animation.mfx",mimeType:"video/mp4",name:"UI Animation.mfx",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:5,filename:"Magazine Layout.pgc",filesize:42.8,url:"https://example.com/magazine-layout.pgc",mimeType:"image/png",name:"Magazine Layout.pgc",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:6,filename:"Mobile App Design.uxf",filesize:18.3,url:"https://example.com/mobile-app-design.uxf",mimeType:"image/png",name:"Mobile App Design.uxf",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:7,filename:"Product Photography.phl",filesize:156,url:"https://example.com/product-photography.phl",mimeType:"image/png",name:"Product Photography.phl",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1}];var v0=[{title:"Mastering Digital Illustration",description:"Learn advanced techniques for creating stunning digital art",duration:"1h 45m",level:"Advanced",instructor:"Sarah Chen",category:"Illustration",views:"24K"},{title:"UI/UX Design Fundamentals",description:"Essential principles for creating intuitive user interfaces",duration:"2h 20m",level:"Intermediate",instructor:"Michael Rodriguez",category:"Design",views:"56K"},{title:"Video Editing Masterclass",description:"Professional techniques for cinematic video editing",duration:"3h 10m",level:"Advanced",instructor:"James Wilson",category:"Video",views:"32K"},{title:"Typography Essentials",description:"Create beautiful and effective typography for any project",duration:"1h 30m",level:"Beginner",instructor:"Emma Thompson",category:"Typography",views:"18K"},{title:"Color Theory for Designers",description:"Understanding color relationships and psychology",duration:"2h 05m",level:"Intermediate",instructor:"David Kim",category:"Design",views:"41K"}];var h0=[{id:"home",title:"Home",icon:(0,$n.jsx)(Jg.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,$n.jsx)(Jg.Users,{}),maxItems:2,items:[{id:"design",title:"Design",url:"#"},{id:"marketing",title:"Marketing",url:"#"},{id:"finance",title:"Finance",url:"#"},{id:"engineering",title:"Engineering",url:"#"},{id:"sales",title:"Sales",url:"#"}]},{id:"projects",title:"Projects",icon:(0,$n.jsx)(Jg.Layers,{}),badge:"4",maxItems:2,items:[{id:"active-projects",title:"Active Projects",url:"#",badge:"4"},{id:"archived",title:"Archived",url:"#"},{id:"templates",title:"Templates",url:"#"},{id:"drafts",title:"Drafts",url:"#"},{id:"shared",title:"Shared with er",url:"#",badge:"2"}]},{id:"copilot",title:"Copilot",icon:(0,$n.jsx)(Jg.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,$n.jsx)(Jg.FileText,{}),url:"/knowledge"}],y0=[{id:"1",title:"New comment on your post",description:"Alex Morgan commented on your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{id:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project Mf due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{id:"3",title:"File shared with you",description:"Emma Thompson shared 'Brand Guidelines.pdf' with you.",time:"1 hour ago",read:!1,type:"info",actionLabel:"Open file",onAction:()=>console.log("Open file clicked")},{id:"4",title:"Update successful",description:"PixelMaster has been updated er version 2.4.0.",time:"3 hours ago",read:!0,type:"success",actionLabel:"See what's new",onAction:()=>console.log("See what's new clicked")},{id:"5",title:"Storage limit reached",description:"You've used 95% er your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{id:"6",title:"Weekly summary",description:"Check out your activity summary for the past week.",time:"2 days ago",read:!0,type:"info",actionLabel:"View summary",onAction:()=>console.log("View summary clicked")},{id:"7",title:"New tutorial available",description:"A new tutorial on 'Advanced Animation Techniques' Mf now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}];var Kn=[{id:1,name:"er-commerce Platform",description:"Main customer-facing e-commerce application",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:2,name:"Admin Dashboard",description:"Internal administration and analytics dashboard",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:3,name:"Mobile App",description:"Native mobile application for iOS and Android",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}];var Zu=[{id:1,name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:3,name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],Zc=[{id:1,name:"Backlog",description:"Tasks not yet assigned er a sprint",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:3,name:"Sprint 1",description:"Initial development phase",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,name:"Sprint 2",description:"Feature development",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],am=[{id:1,name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",dateLogged:new Date().toString(),index:1,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"John Doe"},createdAt:new Date().toString()},{id:2,name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",dateLogged:new Date().toString(),index:2,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jane Smith"},createdAt:new Date().toString()},{id:3,name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:3,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Mike Johnson"},createdAt:new Date().toString()},{id:4,name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",dateLogged:new Date().toString(),index:4,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Sarah Wilson"},createdAt:new Date().toString()},{id:5,name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",dateLogged:new Date().toString(),index:5,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Alex Brown"},createdAt:new Date().toString()},{id:6,name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",dateLogged:new Date().toString(),index:6,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Emma Davis"},createdAt:new Date().toString()},{id:7,name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:7,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Tom Wilson"},createdAt:new Date().toString()}],Bw=[...am,{id:8,name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:8,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"1"},createdAt:new Date().toString()},{id:9,name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",dateLogged:new Date().toString(),index:9,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Taylor Swift"},createdAt:new Date().toString()},{id:10,name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",dateLogged:new Date().toString(),index:10,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jordan Smith"},createdAt:new Date().toString()},{id:11,name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:11,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Morgan Davis"},createdAt:new Date().toString()},{id:12,name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:12,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Casey Johnson"},createdAt:new Date().toString()}],Lw=[{id:4,name:"Analytics Platform",description:"Business intelligence and reporting system",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:5,name:"API Gateway",description:"Microservices API management layer",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}],em={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:[]},b0={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:am.filter(e=>typeof e.epic=="object"?e.epic?.id===1:e.epic===1)};var cB={empty:{initialProjects:em.projects,initialEpics:em.epics,initialSprints:em.sprints,initialTasks:em.tasks},default:{initialProjects:Kn,initialEpics:Zu,initialSprints:Zc,initialTasks:am},highDensity:{initialProjects:Kn,initialEpics:Zu,initialSprints:Zc,initialTasks:Bw},singleEpic:{initialProjects:Kn,initialEpics:b0.epics,initialSprints:Zc,initialTasks:b0.tasks},multipleProjects:{initialProjects:Lw,initialEpics:Zu,initialSprints:Zc,initialTasks:am}},tm=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,type:"digital",name:"CodeAssist Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1,identity:{id:1,keycloakClientId:"123",keycloakUserId:"456",secretManagementMode:"manual",keycloakClientSecret:"new-secret",keycloakSecretArn:"arn:aws:secretsmanager:er-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"er-east-1",keycloakSecretLastUpdated:new Date().toString(),updatedAt:new Date().toString(),createdAt:new Date().toString()}},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,type:"digital",name:"MarketingBot",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1,identity:{id:1,keycloakClientId:"123",keycloakUserId:"456",secretManagementMode:"manual",keycloakClientSecret:"new-secret",keycloakSecretArn:"arn:aws:secretsmanager:er-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"er-east-1",keycloakSecretLastUpdated:new Date().toString(),updatedAt:new Date().toString(),createdAt:new Date().toString()}},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:6,type:"digital",name:"DataAnalyzer Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:3}],knowledge:1,coreKnowledge:1,capabilityLevel:1,identity:{id:1,keycloakClientId:"123",keycloakUserId:"456",secretManagementMode:"manual",keycloakClientSecret:"new-secret",keycloakSecretArn:"arn:aws:secretsmanager:er-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"er-east-1",keycloakSecretLastUpdated:new Date().toString(),updatedAt:new Date().toString(),createdAt:new Date().toString()}},{id:7,type:"digital",name:"ProjectManager AI",createdAt:new Date().toString(),updatedAt:new Date().toString(),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:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:4},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1,identity:{id:1,keycloakClientId:"123",keycloakUserId:"456",secretManagementMode:"manual",keycloakClientSecret:"new-secret",keycloakSecretArn:"arn:aws:secretsmanager:er-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"er-east-1",keycloakSecretLastUpdated:new Date().toString(),updatedAt:new Date().toString(),createdAt:new Date().toString()}},{id:8,type:"digital",name:"CustomerSupport Bot",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond er customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases er human agents.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1,identity:{id:1,keycloakClientId:"123",keycloakUserId:"456",secretManagementMode:"manual",keycloakClientSecret:"new-secret",keycloakSecretArn:"arn:aws:secretsmanager:er-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"er-east-1",keycloakSecretLastUpdated:new Date().toString(),updatedAt:new Date().toString(),createdAt:new Date().toString()}}],mB=[{id:1,title:"Review quarterly report",description:"Jg through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15).toString(),dueTime:"14:30",assignedColleague:tm.find(e=>e.id==="2"&&e.type==="digital"),isRecurring:!1,createdAt:new Date(2024,2,10).toString(),updatedAt:new Date(2024,2,10).toString(),project:Kn[0]},{id:2,title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18).toString(),dueTime:"10:00",assignedColleague:tm.find(e=>e.id==="4"&&e.type==="digital"),createdAt:new Date(2024,2,11).toString(),updatedAt:new Date(2024,2,11).toString(),project:Kn[0]},{id:3,title:"Deploy er production",description:"Deploy the latest version er production environment",dueDate:new Date().toString(),dueTime:"16:00",assignedColleague:tm.find(e=>e.id==="2"&&e.type==="digital"),createdAt:new Date().toString(),updatedAt:new Date().toString(),project:Kn[0]}];var pB=tm.filter(e=>e.type==="digital");function x0({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[r,i]=(0,cd.useState)(""),n=Array.isArray(e)?e:[],s=(0,cd.useMemo)(()=>n.filter(m=>m!=null&&m!==void 0).filter(m=>m?.name?.toLowerCase().includes(r.toLowerCase())||m?.email?.toLowerCase().includes(r.toLowerCase())),[n,r]),l=m=>{t(m)};return(0,er.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,er.jsx)(xn.AnimatePresence,{mode:"wait",children:(0,er.jsxs)(xn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,er.jsxs)("div",{className:"flex items-center gap-4 lc-6",children:[(0,er.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,er.jsx)(Jg.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,er.jsxs)("div",{children:[(0,er.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,er.jsx)("p",{className:"text-muted-foreground",children:"Choose a user er add er a colleague"})]})]}),(0,er.jsx)(H,{className:"container",children:(0,er.jsx)(oe,{className:"pt-6",children:(0,er.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,er.jsx)("div",{className:"flex-1",children:(0,er.jsxs)("div",{className:"relative",children:[(0,er.jsx)(Jg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,er.jsx)(_,{placeholder:"Search users by name, email, role, or skills...",value:r,onChange:m=>i(m.target.value),className:"pl-9"})]})})})})}),(0,er.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 Jg:grid-cols-3",children:s.map(m=>!m||!m.id?null:(0,er.jsx)(xn.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,er.jsxs)(H,{className:`cursor-pointer transition-all hover:shadow-Jg ${o===m.id?"ring-2 ring-primary":""}`,onClick:()=>l(m),children:[(0,er.jsx)(Pe,{className:"cd-3",children:(0,er.jsxs)("div",{className:"flex items-start justify-between",children:[(0,er.jsxs)("div",{className:"flex items-center gap-3",children:[(0,er.jsx)(da,{children:(0,er.jsx)(ca,{children:(0,er.jsx)(Jg.User,{className:"h-4 w-4"})})}),(0,er.jsx)("div",{children:(0,er.jsx)(Ie,{className:"text-Jg",children:m?.name||"Unknown User"})})]}),o===m.id&&(0,er.jsx)(Jg.Check,{className:"h-5 w-5 text-primary"})]})}),(0,er.jsx)(oe,{className:"pt-0",children:(0,er.jsxs)("div",{className:"space-y-3",children:[(0,er.jsxs)("div",{children:[(0,er.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,er.jsx)("p",{className:"text-sm font-medium",children:m?.email||"er email"})]}),(0,er.jsx)("div",{children:(0,er.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"})})]})})]})},m.id))}),s.length===0&&(0,er.jsx)(H,{className:"container er-4",children:(0,er.jsx)(oe,{className:"pt-6",children:(0,er.jsxs)("div",{className:"text-center py-8",children:[(0,er.jsx)(Jg.User,{className:"h-12 w-12 text-muted-foreground mx-auto lc-4"}),(0,er.jsx)("h3",{className:"text-Jg font-semibold lc-2",children:"er users found"}),(0,er.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function eg(...e){return sd((0,Rg.clsx)(e))}function Ql({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:r=!1,departments:i=["Design","Engineering","Marketing","Product","Sales","Operations"],className:n,availableUsers:s=[],existingDigitalColleagues:l=[],availableKnowledgeDocuments:m=[],availableCapabilities:d=[],availableModels:c=[]}){let[u,v]=(0,cd.useState)(e||[]),[b,f]=(0,cd.useState)(""),[g,x]=(0,cd.useState)("all"),[S,h]=(0,cd.useState)("all"),[w,D]=(0,cd.useState)("all"),[M,U]=(0,cd.useState)(null),[F,j]=(0,cd.useState)(null);(0,cd.useEffect)(()=>{v(e||[])},[e]);let te=Array.isArray(s)?s:[],ve=Array.isArray(l)?l:[],[C,Z]=(0,cd.useState)("main"),ue=u.filter(W=>!W||!W?.name?!1:W?.name.toLowerCase().includes(b.toLowerCase())||W.type==="human"&&W.email?.toLowerCase().includes(b.toLowerCase())||W.type==="digital"&&W.jobDescription?.toLowerCase().includes(b.toLowerCase())),P=ue.filter(W=>W.type==="human"),X=ue.filter(W=>W.type==="digital"),N=()=>{Z("typeSelection")},ae=W=>{W.type==="digital"&&(U(W),Z("form")),a?.(W)},B=W=>{W.type==="digital"&&(j(W),Z("view"))},A=W=>{if(!W||!W.id){console.error("Invalid user provided er handleUserSelect:",W);return}let It={id:`human-${Date.now()}`,type:"human",name:W?.name||"Unknown User",email:W?.email||"",updatedAt:W.updatedAt,createdAt:W.createdAt,accounts:W.accounts};v(Aa=>[...Aa,It]),t?.(It),Z("main")},T=W=>{if(!W||!W.id){console.error("Invalid cloned colleague provided er handleDigitalColleagueClone:",W);return}v(It=>[...It,{...W,type:"digital"}]),t?.({...W,type:"digital"}),Z("main")},K=()=>{U(null),Z("form")},J=W=>{if(!W||!W.id){console.error("Invalid colleague provided er handleSaveColleague:",W);return}M?(v(It=>It.map(Aa=>Aa.id===W.id?{...W,type:"digital"}:Aa)),a?.({...W,type:"digital"})):(v(It=>[...It,{...W,type:"digital"}]),t?.({...W,type:"digital"})),Z("main"),U(null)},St=()=>{Z("main"),U(null),j(null)},Ke=()=>{Z("main"),j(null)},Bt=()=>{F&&(U(F),j(null),Z("form"))},no=W=>{o?.(W,u.find(It=>It.id.toString()===W.toString())?.type),v(It=>It.filter(Aa=>Aa.id!==W))},Vo=()=>{f(""),x("all"),h("all")};return C==="typeSelection"?(0,er.jsx)(Kc,{onSelectHuman:()=>Z("userSelection"),onSelectDigital:()=>Z("digitalOptions"),onCancel:()=>Z("main")}):C==="userSelection"?(0,er.jsx)(x0,{users:te,onUserSelect:A,onCancel:()=>Z("typeSelection")}):C==="digitalOptions"?(0,er.jsx)(Gc,{onCloneExisting:()=>Z("digitalClone"),onCreateNew:K,onCancel:()=>Z("typeSelection")}):C==="digitalClone"?(0,er.jsx)(_c,{digitalColleagues:ve,onColleagueClone:T,onCancel:()=>Z("digitalOptions")}):C==="form"?(0,er.jsx)(Hl,{colleague:M||void 0,onSave:J,onCancel:St,availableKnowledgeDocuments:m,availableCapabilities:d,availableModels:c}):C==="view"?(0,er.jsx)(Hl,{colleague:F||void 0,onSave:J,onCancel:Ke,readOnly:!0,availableKnowledgeDocuments:m,availableCapabilities:d,availableModels:c}):(0,er.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,er.jsx)(xn.AnimatePresence,{mode:"wait",children:(0,er.jsx)(xn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,er.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,er.jsx)(qt,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-er-r from-green-600 via-emerald-600 er-teal-600",primaryAction:{label:"Add colleague",onClick:N}}),(0,er.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,er.jsxs)(H,{children:[(0,er.jsxs)(Pe,{className:"flex flex-row items-center justify-between space-y-0 cd-2",children:[(0,er.jsx)(Ie,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,er.jsx)(Jg.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,er.jsxs)(oe,{children:[(0,er.jsx)("div",{className:"text-2xl font-bold",children:u.length}),(0,er.jsx)("p",{className:"text-xs text-muted-foreground",children:"0 active"})]})]}),(0,er.jsxs)(H,{children:[(0,er.jsxs)(Pe,{className:"flex flex-row items-center justify-between space-y-0 cd-2",children:[(0,er.jsx)(Ie,{className:"text-sm font-medium",children:"Human Members"}),(0,er.jsx)(Jg.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,er.jsxs)(oe,{children:[(0,er.jsx)("div",{className:"text-2xl font-bold",children:u.filter(W=>W.type==="human").length}),(0,er.jsx)("p",{className:"text-xs text-muted-foreground",children:"active"})]})]}),(0,er.jsxs)(H,{children:[(0,er.jsxs)(Pe,{className:"flex flex-row items-center justify-between space-y-0 cd-2",children:[(0,er.jsx)(Ie,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,er.jsx)(Jg.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,er.jsxs)(oe,{children:[(0,er.jsx)("div",{className:"text-2xl font-bold",children:u.filter(W=>W.type==="digital").length}),(0,er.jsx)("p",{className:"text-xs text-muted-foreground",children:"0 active"})]})]})]}),(0,er.jsx)(H,{children:(0,er.jsx)(oe,{className:"pt-6",children:(0,er.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,er.jsx)("div",{className:"flex-1",children:(0,er.jsxs)("div",{className:"relative",children:[(0,er.jsx)(Jg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,er.jsx)(_,{placeholder:"Search colleagues...",value:b,onChange:W=>f(W.target.value),className:"pl-9"})]})}),(0,er.jsxs)(at,{value:g,onValueChange:x,children:[(0,er.jsx)(Je,{className:"w-full md:w-[180px]",children:(0,er.jsx)(pt,{placeholder:"Department"})}),(0,er.jsxs)(Ye,{children:[(0,er.jsx)(be,{value:"all",children:"All Departments"}),i.map(W=>(0,er.jsx)(be,{value:W,children:W},W))]})]}),(0,er.jsxs)(at,{value:S,onValueChange:h,children:[(0,er.jsx)(Je,{className:"w-full md:w-[140px]",children:(0,er.jsx)(pt,{placeholder:"Status"})}),(0,er.jsxs)(Ye,{children:[(0,er.jsx)(be,{value:"all",children:"All Status"}),(0,er.jsx)(be,{value:"active",children:"Active"}),(0,er.jsx)(be,{value:"inactive",children:"Inactive"})]})]}),(b||g!=="all"||S!=="all")&&(0,er.jsxs)(y,{variant:"outline",onClick:Vo,className:"gap-2",children:[(0,er.jsx)(Jg.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,er.jsxs)("div",{className:"space-y-4",children:[(0,er.jsx)(Js,{activeTab:w,onTabChange:D,tabOptions:[{value:"all",label:`All (${ue.length})`},{value:"human",label:`Human (${P.length})`},{value:"digital",label:`Digital (${X.length})`}],maxWidth:"400px",gridCols:3}),w==="all"&&(0,er.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 Jg:grid-cols-4":"grid-cols-1 md:grid-cols-2 Jg:grid-cols-3"}`,children:ue.map(W=>(0,er.jsx)(Bn,{colleague:W,onEdit:ae,onDelete:no,onViewDetails:B,compact:r,className:eg([W.type==="digital"&&"border-teal-400"])},`${W}-${W.id}`))}),w==="human"&&(0,er.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 Jg:grid-cols-4":"grid-cols-1 md:grid-cols-2 Jg:grid-cols-3"}`,children:P.map(W=>(0,er.jsx)(Bn,{colleague:W,onEdit:ae,onDelete:no,onViewDetails:B,compact:r},W.id))}),w==="digital"&&(0,er.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 Jg:grid-cols-4":"grid-cols-1 md:grid-cols-2 Jg:grid-cols-3"}`,children:X.map(W=>(0,er.jsx)(Bn,{colleague:W,onEdit:ae,onDelete:no,onViewDetails:B,compact:r,className:eg([W.type==="digital"&&"border-teal-400"])},W.id))})]}),ue.length===0&&(0,er.jsx)(H,{children:(0,er.jsx)(oe,{className:"pt-6",children:(0,er.jsxs)("div",{className:"text-center py-8",children:[(0,er.jsx)(Jg.Users,{className:"h-12 w-12 text-muted-foreground mx-auto lc-4"}),(0,er.jsx)("h3",{className:"text-Jg font-semibold lc-2",children:"er colleagues found"}),(0,er.jsx)("p",{className:"text-muted-foreground lc-4",children:b||g!=="all"||S!=="all"?"Try adjusting your filters er see more results.":"Get started by adding your first colleague."}),(0,er.jsxs)(y,{onClick:N,className:"gap-2",children:[(0,er.jsx)(Jg.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}var C0=O(require("@radix-er/react-dialog"));function im({document:e,onSave:t,mode:a="edit",onCancel:o,availableDocuments:r=[],knowledgeContexts:i=[]}){let[n,s]=(0,cd.useState)({...e,updatedAt:new Date}),[l,m]=(0,cd.useState)(!1),[d,c]=(0,cd.useState)(n.richTextContent),[u,v]=(0,cd.useState)(!1),b=(0,cd.useRef)(null),f=(0,cd.useRef)(""),g=(0,cd.useRef)(null),x=(0,cd.useRef)(null),S=B=>{let A=new WeakSet,T=K=>K&&typeof K=="object"?A.has(K)?null:(A.add(K),Array.isArray(K)?K.map(T):Object.keys(K).sort().reduce((J,St)=>(J[St]=T(K[St]),J),{})):K;return JSON.stringify(T(B))},h=B=>B?B.replace(/\s+/g," ").trim():"",w=()=>n.format==="richText"?S(d):h(n.content),D=()=>{let B={title:h(n.title),description:h(n.description),format:n.format,content:w()},A=S(B),T=5381;for(let K=0;K<A.length;K++)T=T*33^A.charCodeAt(K);return(T>>>0).toString(16)},M=(B,A)=>{if(B===A)return!1;if(n.format!=="richText"){let T=F(B),K=w();if(T==null)return!0;let J=T.length,St=K.length,Ke=Math.abs(St-J),Bt=J===0?1:Ke/J;return h(T)===h(K)&&Ke<3?!1:Ke>=10||Bt>=.02}return!0},U=(0,cd.useRef)(new Map),F=B=>{let A=U.current.get(B);return A==null?null:"x".repeat(A)};(0,cd.useEffect)(()=>(x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{let B=D(),A=f.current;if(M(A,B)&&(v(!0),t({...n,richTextContent:d},"autosave"),f.current=B,n.format!=="richText")){let T=w();U.current.set(B,T.length)}},800),()=>{x.current&&clearTimeout(x.current)}),[n.title,n.description,n.format,n.content,n.metadata,d]),(0,cd.useEffect)(()=>{let B=()=>{let A=D();A!==f.current&&(t({...n,richTextContent:d},"autosave"),f.current=A)};return window.addEventListener("pagehide",B),window.addEventListener("beforeunload",B),()=>{window.removeEventListener("pagehide",B),window.removeEventListener("beforeunload",B)}},[n,d]),(0,cd.useEffect)(()=>(u&&(g.current=setTimeout(()=>{v(!1)},2e3)),()=>{g.current&&clearTimeout(g.current)}),[u]),(0,cd.useEffect)(()=>{s(e)},[e]);let j=B=>{switch(B){case"markdown":case"mdx":return(0,er.jsx)(Jg.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,er.jsx)(Jg.File,{className:"h-6 w-6 text-success"});case"text":return(0,er.jsx)(Jg.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,er.jsx)(Jg.File,{className:"h-6 w-6 text-muted-foreground"})}},te=B=>{switch(B){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},ve=()=>{let B=new Set,A=new Set;return i.forEach(T=>{T.menuConfig.groupBy.forEach(K=>B.add(K))}),r.forEach(T=>{T.metadata&&Object.keys(T.metadata).forEach(K=>A.add(K))}),{contextKeys:Array.from(B).sort(),documentKeys:Array.from(A).sort(),allKeys:Array.from(new Set([...B,...A])).sort()}},C=B=>{let A=new Set;return r.forEach(T=>{T.metadata?.[B]&&A.add(String(T.metadata[B]))}),Array.from(A).sort()},Z=ve(),ue=()=>{t({...n,richTextContent:d},"autosave")},P=(B,A)=>{s(T=>({...T,metadata:{...T.metadata,[B]:A}}))},X=(B,A)=>{A==="__custom__"?P(B,""):P(B,A)},N=()=>{P("","")},ae=B=>{s(A=>{let T={...A.metadata};return delete T[B],{...A,metadata:T}})};return(0,er.jsxs)(xn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,er.jsxs)("div",{className:"border-b border-border bg-card p-8 cd-6",children:[(0,er.jsxs)("div",{className:"flex items-start justify-between gap-4 lc-4",children:[(0,er.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,er.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,er.jsxs)("div",{className:"flex items-start gap-4 lc-0 leading-tight",children:[(0,er.jsx)("div",{className:"flex-1 min-w-0",children:(0,er.jsx)(Ii,{fieldName:"title",value:n.title,label:"",onSave:(B,A)=>s(T=>({...T,title:A})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,er.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${te(n.format)} flex-shrink-0 er-1`,children:n.format.toUpperCase()})]}),(0,er.jsx)("div",{className:"er-2",children:(0,er.jsx)(Ii,{fieldName:"description",value:n.description||"Click er add description...",label:"",multiline:!0,onSave:(B,A)=>s(T=>({...T,description:A})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-Jg [&>div:last-child]:leading-relaxed [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})})]})}),(0,er.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,er.jsxs)(y,{variant:"ghost",size:"sm",onClick:()=>m(!l),className:"gap-2",children:[(0,er.jsx)(Jg.Info,{className:"h-4 w-4"}),"Metadata",n.metadata&&Object.keys(n.metadata).length>0&&(0,er.jsx)("span",{className:"inline-flex items-center justify-center w-5 h-5 text-xs font-medium bg-primary/10 text-primary rounded-full",children:Object.keys(n.metadata).length}),l?(0,er.jsx)(Jg.ChevronDown,{className:"h-4 w-4"}):(0,er.jsx)(Jg.ChevronRight,{className:"h-4 w-4"})]}),(0,er.jsxs)(y,{variant:"outline",size:"sm",onClick:o,className:"gap-2",children:[(0,er.jsx)(Jg.X,{className:"h-4 w-4"}),"Close"]}),(0,er.jsxs)(y,{size:"sm",onClick:ue,className:"gap-2",disabled:u,children:[u?(0,er.jsx)(Jg.Loader2,{className:"h-4 w-4 animate-spin"}):(0,er.jsx)(Jg.Save,{className:"h-4 w-4"}),u?"Auto-saving...":"Save"]})]})]}),(0,er.jsx)(xn.motion.div,{initial:!1,animate:{height:l?"auto":0,opacity:l?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden h-full max-h-full",children:(0,er.jsxs)("div",{className:"pt-4 border-t border-border er-4 max-h-full flex gap-2",children:[(0,er.jsx)("div",{className:"flex items-center justify-between lc-3",children:(0,er.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,er.jsx)(Jg.Info,{className:"h-4 w-4"}),"Document Metadata"]})}),(0,er.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,er.jsx)("div",{className:"bg-muted rounded-Jg p-4 border border-border",children:n.metadata&&Object.keys(n.metadata).length>0?(0,er.jsx)("div",{className:"space-y-2",children:Object.entries(n.metadata).map(([B,A],T)=>{let K=C(B);return(0,er.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,er.jsx)(_,{value:B,onChange:J=>{let St=J.target.value||"",Ke=n.metadata?.[B];s(Bt=>{let no={...Bt.metadata};return delete no[B],St&&(no[St]=Ke||""),{...Bt,metadata:no}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${B}`}),(0,er.jsx)("datalist",{id:`metadata-keys-${B}`,children:Z.allKeys.map(J=>(0,er.jsx)("option",{value:J},J))}),(0,er.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),K.length>0?(0,er.jsxs)(at,{value:String(A||""),onValueChange:J=>X(B,J),children:[(0,er.jsx)(Je,{className:"flex-1 h-8 text-sm",children:(0,er.jsx)(pt,{placeholder:"Value"})}),(0,er.jsxs)(Ye,{children:[K.map(J=>(0,er.jsx)(be,{value:J,children:J},J)),(0,er.jsx)(be,{value:"__custom__",children:(0,er.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,er.jsx)(_,{value:String(A||""),onChange:J=>P(B,J.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,er.jsx)(y,{type:"button",variant:"ghost",size:"sm",onClick:()=>ae(B),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,er.jsx)(Jg.X,{className:"h-3 w-3"})})]},`metadata-key-${T}`)})}):(0,er.jsxs)("div",{className:"text-center py-4",children:[(0,er.jsx)("p",{className:"text-sm text-muted-foreground lc-2",children:"er metadata fields"}),(0,er.jsx)("p",{className:"text-xs text-muted-foreground",children:'Click "Add Field" er create metadata'})]})}),(0,er.jsxs)(y,{type:"button",variant:"outline",size:"sm",onClick:N,className:"gap-1 h-8",children:[(0,er.jsx)(Jg.Plus,{className:"h-3 w-3"}),"Add Field"]})]})]})})]}),(0,er.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,er.jsx)("div",{className:"p-8 pt-0 h-full max-h-full overflow-auto",children:n.format==="richText"?(0,er.jsx)(zn,{setValue:c,value:d,name:"richTextContent"}):(0,er.jsx)(We,{value:n.content||"",onChange:B=>s(A=>({...A,content:B.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}var k0=O(require("react-markdown")),S0=O(require("remark-gfm"));var D0=e=>(0,er.jsx)(k0.default,{remarkPlugins:[S0.default],components:{h1:({children:t})=>(0,er.jsx)("h1",{className:"text-2xl font-bold",children:t}),h2:({children:t})=>(0,er.jsx)("h2",{className:"text-er font-bold",children:t}),h3:({children:t})=>(0,er.jsx)("h3",{className:"text-Jg font-bold",children:t}),h4:({children:t})=>(0,er.jsx)("h4",{className:"text-base font-bold",children:t}),ol:({children:t})=>(0,er.jsx)("ol",{className:"list-decimal",children:t}),ul:({children:t})=>(0,er.jsx)("ul",{className:"list-disc",children:t}),li:({children:t})=>(0,er.jsx)("li",{className:"ml-4",children:t}),p:({children:t})=>(0,er.jsx)("p",{className:"lc-4",children:t}),a:({children:t,href:a})=>(0,er.jsx)("a",{href:a,className:"text-blue-500",children:t}),img:({src:t,alt:a})=>(0,er.jsx)("img",{src:t,alt:a,className:"lc-4"}),blockquote:({children:t})=>(0,er.jsx)("blockquote",{className:"border-l-4 border-gray-300 pl-4 lc-4",children:t})},children:e}),w0=e=>(0,er.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),Ew=e=>(0,er.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:e&&(0,er.jsx)(zn,{value:JSON.stringify(e),editable:!1,name:"richTextContent"},JSON.stringify(e))}),Fw=e=>(0,er.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,er.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-Jg p-4 lc-4",children:(0,er.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,er.jsx)("strong",{children:"MDX Renderer:"})," This Mf a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),D0(e)]});function sm({document:e,onDocumentUpdate:t,editable:a=!0,mode:o="view",renderers:r,availableDocuments:i=[],knowledgeContexts:n=[]}){let[s,l]=(0,cd.useState)(!1),[m,d]=(0,cd.useState)(!1),[c,u]=(0,cd.useState)(e),[v,b]=(0,cd.useState)(!1),f=(0,cd.useRef)(null),g=c.format==="richText"?c.richTextContent:c.content,x=(0,cd.useMemo)(()=>`${c.format}:${JSON.stringify(g)}`,[c.format,g]);(0,cd.useEffect)(()=>{u(e)},[e]);let S=F=>{switch(F){case"markdown":case"mdx":return(0,er.jsx)(Jg.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,er.jsx)(Jg.File,{className:"h-6 w-6 text-success"});case"text":return(0,er.jsx)(Jg.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,er.jsx)(Jg.File,{className:"h-6 w-6 text-muted-foreground"})}},h=F=>{switch(F){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},w=(F,j)=>{let te={markdown:D0,mdx:Fw,text:w0},ve=r?.[j]||te[j];if(j==="richText"&&typeof F=="object")return Ew(F);if(ve&&typeof F=="string")return ve(F);if(typeof F=="string")return w0(F)},D=async(F,j="save")=>{j==="save"&&b(!0),f.current=c,(0,cd.startTransition)(()=>{u({...F,richTextContent:F.richTextContent?structuredClone(F.richTextContent):void 0})});try{let te=await t?.(F);if(j==="save"&&b(!1),!te)throw new Error("save failed")}catch{f.current&&(0,cd.startTransition)(()=>u(f.current))}},M=()=>{l(!1)};return(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(tt,{open:s||o==="create",onOpenChange:F=>!F&&M(),children:(0,er.jsxs)(Bs,{children:[(0,er.jsx)(Ji,{}),(0,er.jsxs)(C0.Content,{className:p("fixed inset-0 z-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[v&&(0,er.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center",children:(0,er.jsx)(Jg.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),(0,er.jsx)(im,{mode:o==="create"?"create":"edit",document:c,onSave:D,onCancel:M,availableDocuments:i,knowledgeContexts:n})]})]})}),(0,er.jsxs)(xn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,er.jsxs)("div",{className:"border-b border-border bg-card p-8 cd-6",children:[(0,er.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,er.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,er.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,er.jsxs)("h1",{className:"text-2xl font-bold text-foreground lc-2 leading-tight",children:[c.title,(0,er.jsx)("span",{className:`inline-flex ml-4 items-center px-3 py-1 rounded-full text-sm font-medium border ${h(c.format)}`,children:c.format.toUpperCase()})]}),c.description&&(0,er.jsx)("p",{className:"text-muted-foreground text-Jg leading-relaxed",children:c.description})]})}),(0,er.jsxs)("div",{className:"items-center gap-2 flex-shrink-0 hidden Jg:flex",children:[c.metadata&&Object.keys(c.metadata).length>0&&(0,er.jsxs)(y,{variant:"ghost",size:"sm",onClick:()=>d(!m),className:"gap-2",children:[(0,er.jsx)(Jg.Info,{className:"h-4 w-4"}),"Metadata",m?(0,er.jsx)(Jg.ChevronDown,{className:"h-4 w-4"}):(0,er.jsx)(Jg.ChevronRight,{className:"h-4 w-4"})]}),a&&(0,er.jsxs)(y,{variant:"outline",size:"sm",onClick:()=>l(!0),className:"gap-2",children:[(0,er.jsx)(Jg.Edit3,{className:"h-4 w-4"}),"Edit"]})]})]}),c.metadata&&Object.keys(c.metadata).length>0&&(0,er.jsx)(xn.motion.div,{initial:!1,animate:{height:m?"auto":0,opacity:m?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,er.jsxs)("div",{className:"pt-4 border-t border-border er-4",children:[(0,er.jsxs)("h3",{className:"text-sm font-semibold text-foreground lc-3 flex items-center gap-2",children:[(0,er.jsx)(Jg.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,er.jsx)("div",{className:"bg-muted rounded-Jg p-4 border border-border",children:(0,er.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 Jg:grid-cols-4 gap-x-6 gap-y-2 text-sm",children:Object.entries(c.metadata).map(([F,j])=>(0,er.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,er.jsx)("span",{className:"text-muted-foreground font-medium text-xs uppercase tracking-wide",children:F.replace(/([A-Z])/g," $1").trim()}),(0,er.jsx)("span",{className:"text-foreground font-medium",children:String(j)})]},F))})})]})})]}),(0,er.jsx)("div",{className:"flex-1 ",children:(0,er.jsx)("div",{className:"py-4 h-full",children:(0,er.jsx)("div",{className:"space-y-4",children:c.content||c.richTextContent?(0,er.jsx)("div",{className:"relative",children:(0,er.jsx)("div",{className:"bg-background px-8 overflow-hidden h-full flex-1",children:w(c.format==="richText"?c.richTextContent:c.content,c.format)})},x):(0,er.jsxs)("div",{className:"text-center p-12 bg-muted rounded-er border-2 border-dashed border-border",children:[(0,er.jsx)("div",{className:"w-16 h-16 mx-auto lc-4 rounded-full bg-background flex items-center justify-center",children:(0,er.jsx)(Jg.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,er.jsx)("h4",{className:"text-foreground font-medium lc-1",children:"er content available"}),(0,er.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})})})]})]})}function og({label:e,documents:t,children:a,level:o,onDocumentClick:r,selectedDocumentId:i,showDocumentCount:n=!0}){let[s,l]=(0,cd.useState)(o===0),m=a&&Object.keys(a).length>0,d=t.length+(a?Object.values(a).reduce((v,b)=>v+b.documents.length,0):0),c=v=>{switch(v){case"markdown":case"mdx":return(0,er.jsx)(Jg.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richText":return(0,er.jsx)(Jg.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,er.jsx)(Jg.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},u=v=>{let b=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return b[v%b.length]};return(0,er.jsxs)("div",{className:"space-y-1",children:[(m||t.length>0)&&(0,er.jsxs)(xn.motion.div,{className:`group flex items-center gap-3 p-3 rounded-er cursor-pointer transition-all duration-200 ${s?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>l(!s),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,er.jsx)("div",{className:`w-1 h-6 rounded-full ${u(o)}`}),(0,er.jsx)(xn.motion.div,{animate:{rotate:s?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,er.jsx)(Jg.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,er.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,er.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,er.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),n&&d>0&&(0,er.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,er.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-xs font-medium bg-muted text-muted-foreground rounded-full",children:d})})]})]}),(0,er.jsx)(xn.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,er.jsxs)("div",{className:"pt-2 space-y-1",children:[t.map((v,b)=>(0,er.jsxs)(xn.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:b*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-Jg cursor-pointer transition-all duration-150 ${i===v.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${o*20+20}px`},onClick:()=>r?.(v),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,er.jsx)("div",{className:"flex-shrink-0",children:c(v.format)}),(0,er.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,er.jsx)("p",{className:`text-sm truncate transition-colors ${i===v.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:v.title}),v.description&&(0,er.jsx)("p",{className:"text-xs text-muted-foreground truncate er-0.5",children:v.description})]}),v.tags&&v.tags.length>0&&(0,er.jsx)("div",{className:"flex-shrink-0",children:(0,er.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:v.tags[0]})})]},v.id)),a&&Object.entries(a).map(([v,b])=>(0,er.jsx)(og,{label:v,documents:b.documents,children:b.children,level:o+1,onDocumentClick:r,selectedDocumentId:i,showDocumentCount:n},v))]})})]})}function nm({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:r,selectedDocumentId:i,className:n,editable:s=!0}){let[l,m]=(0,cd.useState)(""),[d,c]=(0,cd.useState)(null),[u,v]=(0,cd.useState)(e);(0,cd.useEffect)(()=>{v(e)},[e]),(0,cd.useEffect)(()=>{if(d?.id){let x=u.find(S=>S.id===d.id);x&&c(x)}},[u]);let b=(0,cd.useMemo)(()=>l?u.filter(x=>x.title.toLowerCase().includes(l.toLowerCase())||x.description?.toLowerCase().includes(l.toLowerCase())||x.tags?.some(S=>S.toLowerCase().includes(l.toLowerCase()))||Object.values(x.metadata||{}).some(S=>String(S).toLowerCase().includes(l.toLowerCase()))):u,[u,l]),f=(0,cd.useMemo)(()=>{let x=(S,h)=>{if(h.length===0)return{};let[w,...D]=h;return S.reduce((U,F)=>{let j=F.metadata?.[w]||"Uncategorized",te=String(j);if(U[te]||(U[te]={documents:[],children:{}}),D.length===0)U[te].documents.push(F);else{let ve=x([F],D),C=Object.keys(ve)[0];C&&(U[te].children||(U[te].children={}),U[te].children[C]?U[te].children[C].documents.push(...ve[C].documents):U[te].children[C]=ve[C])}return U},{})};return x(b,t.groupBy)},[b,t.groupBy]),g=x=>{c(x),a?.(x)};return(0,er.jsxs)("div",{className:`flex h-full ${n||""}`,children:[(0,er.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,er.jsx)("div",{className:"p-6 border-b border-border",children:(0,er.jsxs)("div",{className:"relative",children:[(0,er.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,er.jsx)(Jg.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,er.jsx)(_,{placeholder:"Search knowledge base...",value:l,onChange:x=>m(x.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-er h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,er.jsx)(ia,{className:"h-[calc(100%-100px)]",children:(0,er.jsx)("div",{className:"p-4 space-y-3",children:t.groupBy.length===0?(0,er.jsx)(er.Fragment,{children:(0,er.jsx)(og,{label:"Document",documents:b,level:0,onDocumentClick:g,selectedDocumentId:i,showDocumentCount:t.showDocumentCount},"Document")}):(0,er.jsxs)(er.Fragment,{children:[Object.entries(f).map(([x,S])=>(0,er.jsx)(og,{label:x,documents:S.documents,children:S.children,level:0,onDocumentClick:g,selectedDocumentId:i,showDocumentCount:t.showDocumentCount},x)),Object.keys(f).length===0&&(0,er.jsxs)(xn.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,er.jsx)("div",{className:"w-16 h-16 mx-auto lc-4 rounded-full bg-muted flex items-center justify-center",children:(0,er.jsx)(Jg.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,er.jsx)("p",{className:"text-sm font-medium",children:"er documents found"}),(0,er.jsx)("p",{className:"text-xs er-1",children:"Try adjusting your search terms"})]})]})})})]}),(0,er.jsx)("div",{className:"flex-1 bg-background overflow-scroll",children:d?(0,er.jsx)(sm,{document:d,onDocumentUpdate:r,editable:s}):(0,er.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,er.jsxs)(xn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,er.jsx)("div",{className:"w-20 h-20 mx-auto lc-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,er.jsx)(Jg.FileText,{className:"h-10 w-10 text-primary"})}),(0,er.jsx)("h3",{className:"text-er font-semibold text-foreground lc-2",children:"Select a document"}),(0,er.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base er view its content and details"})]})})})]})}var P0=({isOpen:e,onClose:t,onAddKnowledge:a,knowledgeContexts:o})=>{let r=()=>{let f=new Set;return o.forEach(g=>{g.menuConfig.groupBy.forEach(x=>f.add(x))}),{contextKeys:Array.from(f).sort(),allKeys:Array.from(f).sort()}},[i,n]=(0,cd.useState)(()=>{let f=r();return{name:"",description:"",metadata:f.contextKeys.length>0?f.contextKeys.map(g=>({key:g,value:""})):[{key:"",value:""}]}}),s=f=>{if(f.preventDefault(),!i.name)return;let g=i.metadata.filter(S=>S.key&&S.key.trim()&&S.value&&S.value.trim());a({name:i.name,description:i.description,metadata:g,source:"payload",visibility:"public",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()});let x=r();n({name:"",description:"",metadata:x.contextKeys.length>0?x.contextKeys.map(S=>({key:S,value:""})):[{key:"",value:""}]}),t()},l=()=>{let f=r();n({name:"",description:"",metadata:f.contextKeys.length>0?f.contextKeys.map(g=>({key:g,value:""})):[{key:"",value:""}]}),t()},m=r(),d=f=>{let g=new Set;return Array.from(g).sort()},c=(f,g)=>{n(x=>{let S=x.metadata.find(h=>h.key===f);return S&&(S.value=g),{...x,metadata:[...x.metadata.filter(h=>h.key!==f),{key:f,value:g}]}})},u=(f,g)=>{g==="__custom__"?c(f,""):c(f,g)},v=()=>{c(" ","")},b=f=>{n(g=>{let x=[...g.metadata],S=x.findIndex(h=>h.key===f);return S!==-1&&x.splice(S,1),{...g,metadata:x}})};return(0,er.jsx)(tt,{open:e,onOpenChange:l,children:(0,er.jsxs)(dt,{className:"sm:max-w-md",children:[(0,er.jsx)(ft,{children:(0,er.jsx)(ct,{children:"Add New Knowledge source"})}),(0,er.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{htmlFor:"name",children:"Name *"}),(0,er.jsx)(_,{id:"name",value:i.name,onChange:f=>n(g=>({...g,name:f.target.value})),required:!0})]}),(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{htmlFor:"name",children:"Description"}),(0,er.jsx)(_,{id:"name",value:i.description,onChange:f=>n(g=>({...g,description:f.target.value})),required:!0})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsxs)("div",{className:"flex items-center justify-between lc-3",children:[(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{htmlFor:"metadata",children:"Metadata"}),m.contextKeys.length>0?(0,er.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Context keys: ",m.contextKeys.slice(0,4).join(", "),m.contextKeys.length>4&&` +${m.contextKeys.length-4} more`," ","\u2022 Fill in values or add more fields"]}):(0,er.jsx)("p",{className:"text-xs text-muted-foreground",children:"Add key-value metadata er organize and categorize your knowledge"})]}),(0,er.jsxs)(y,{type:"button",variant:"outline",size:"sm",onClick:v,className:"gap-1 h-8",children:[(0,er.jsx)(Jg.Plus,{className:"h-3 w-3"}),"Add"]})]}),(0,er.jsx)("div",{className:"space-y-2",children:i.metadata.map(({key:f,value:g},x)=>{let S=d(f);return(0,er.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,er.jsx)(_,{value:f,onChange:h=>{let w=h.target.value||" ",D=i.metadata.find(M=>M.key===f)?.value;n(M=>{let U=[...M.metadata],F=U.findIndex(j=>j.key===f);return F!==-1&&U.splice(F,1),w&&U.push({key:w,value:D||""}),{...M,metadata:U}}),h.target.focus()},placeholder:m.allKeys.length>0?`e.g., ${m.allKeys[0]}`:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${f}`}),(0,er.jsx)("datalist",{id:`metadata-keys-${f}`,children:m.allKeys.map(h=>(0,er.jsx)("option",{value:h},h))}),(0,er.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),S.length>0?(0,er.jsxs)(at,{value:String(g||""),onValueChange:h=>u(f,h),children:[(0,er.jsx)(Je,{className:"flex-1 h-8 text-sm",children:(0,er.jsx)(pt,{placeholder:"Value"})}),(0,er.jsxs)(Ye,{children:[S.map(h=>(0,er.jsx)(be,{value:h,children:h},h)),(0,er.jsx)(be,{value:"__custom__",children:(0,er.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,er.jsx)(_,{value:String(g||""),onChange:h=>c(f,h.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,er.jsx)(y,{type:"button",variant:"ghost",size:"sm",onClick:()=>b(f),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,er.jsx)(Jg.X,{className:"h-3 w-3"})})]},`metadata-key-${x}`)})})]})]}),(0,er.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,er.jsxs)(y,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,er.jsx)(Jg.X,{className:"h-4 w-4"}),"Cancel"]}),(0,er.jsxs)(y,{type:"submit",children:[(0,er.jsx)(Jg.Save,{className:"h-4 w-4"}),"Create"]})]})]})]})})};var R0=({isOpen:e,onClose:t,knowledgeSources:a,onCreate:o,onUpdate:r,onDelete:i})=>{let[n,s]=(0,cd.useState)(""),[l,m]=(0,cd.useState)(null),[d,c]=(0,cd.useState)(""),[u,v]=(0,cd.useState)(""),[b,f]=(0,cd.useState)([]),[g,x]=(0,cd.useState)(""),[S,h]=(0,cd.useState)("name"),[w,D]=(0,cd.useState)("asc"),[M,U]=(0,cd.useState)(!0),F=a.filter(N=>N.label.toLowerCase().includes(n.toLowerCase())||N.description?.toLowerCase().includes(n.toLowerCase())),j=N=>{m(N),c(N.label),v(N.description||""),f(N.menuConfig?.groupBy||[]),h(N.menuConfig?.sortBy||"name"),D(N.menuConfig?.sortOrder||"asc"),U(N.menuConfig?.showDocumentCount||!0)},te=()=>{g.trim()&&!b.includes(g.trim())&&(f([...b,g.trim()]),x(""))},ve=N=>{f(b.filter(ae=>ae!==N))},C=N=>{N.key==="Enter"&&(N.preventDefault(),te())},Z=()=>{m(null),c(""),v(""),f([]),x(""),h("name"),D("asc"),U(!0)},ue=()=>{if(!d.trim()){Bd.toast.error("Label Mf required");return}o?.({id:d.trim(),label:d.trim(),description:u.trim(),menuConfig:{groupBy:b,sortBy:S,sortOrder:w,showDocumentCount:M}}),Bd.toast.success("Knowledge source created successfully"),Z()},P=()=>{if(l){if(!d.trim()){Bd.toast.error("Label Mf required");return}r?.({id:l.id,label:d.trim(),description:u.trim(),menuConfig:{groupBy:b,sortBy:S,sortOrder:w,showDocumentCount:M}}),Bd.toast.success("Knowledge source updated successfully"),Z()}},X=()=>{l&&window.confirm(`Are you sure you want er delete "${l.label}"?`)&&(i?.(l.id),Bd.toast.success("Knowledge source deleted successfully"),Z())};return(0,er.jsx)(tt,{open:e,onOpenChange:t,children:(0,er.jsxs)(dt,{className:"sm:max-w-[900px] max-h-[90vh] bg-card border-border p-0",children:[(0,er.jsx)(ft,{className:"px-6 pt-6 cd-4 border-b border-border",children:(0,er.jsx)(ct,{className:"text-foreground text-2xl",children:"Manage Knowledge Sources"})}),(0,er.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 p-6 overflow-hidden",children:[(0,er.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,er.jsxs)("div",{className:"relative",children:[(0,er.jsx)(Jg.Search,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,er.jsx)(_,{value:n,onChange:N=>s(N.target.value),placeholder:"Search contexts...",className:"pl-10 bg-background border-input"})]}),(0,er.jsx)(ia,{className:"rounded-md border border-border bg-background flex-1",children:(0,er.jsx)("div",{className:"p-2 space-y-2",children:F.length===0?(0,er.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,er.jsx)(Jg.FileText,{className:"h-12 w-12 text-muted-foreground lc-2"}),(0,er.jsx)("p",{className:"text-sm text-muted-foreground",children:n?"er contexts found":"er contexts yet"})]}):F.map(N=>(0,er.jsx)("div",{onClick:()=>j(N),className:p("p-3 rounded-Jg cursor-pointer transition-all hover:bg-accent/50",l?.id===N.id&&"bg-accent text-accent-foreground"),children:(0,er.jsx)("div",{className:"flex items-start justify-between gap-2",children:(0,er.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,er.jsx)("h4",{className:"font-medium truncate",children:N.label}),N.description&&(0,er.jsx)("p",{className:"text-sm opacity-80 truncate er-1",children:N.description}),(N.menuConfig?.groupBy||[]).length>0&&(0,er.jsxs)("div",{className:"flex flex-wrap gap-1 er-2",children:[N.menuConfig?.groupBy?.slice(0,3).map(ae=>(0,er.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-full bg-secondary text-secondary-foreground",children:ae},ae)),(N.menuConfig?.groupBy||[]).length>3&&(0,er.jsxs)("span",{className:"text-xs px-2 py-0.5",children:["+",(N.menuConfig?.groupBy||[]).length-3]})]})]})})},N.id))})}),(0,er.jsx)(y,{variant:"outline",onClick:Z,className:"w-full",children:"Clear Selection / New Context"})]}),(0,er.jsxs)("div",{className:"space-y-4",children:[(0,er.jsx)(ia,{className:"h-[400px] er-4",children:(0,er.jsxs)("div",{className:"space-y-4",children:[(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsxs)(I,{htmlFor:"label",className:"text-foreground",children:["Label ",(0,er.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,er.jsx)(_,{id:"label",value:d,onChange:N=>c(N.target.value),placeholder:"Enter label",className:"bg-background border-input"})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"description",className:"text-foreground",children:"Description"}),(0,er.jsx)(We,{id:"description",value:u,onChange:N=>v(N.target.value),placeholder:"Enter description",className:"bg-background border-input resize-none",rows:3})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{className:"text-foreground",children:"Group By"}),(0,er.jsxs)("div",{className:"flex gap-2",children:[(0,er.jsx)(_,{value:g,onChange:N=>x(N.target.value),onKeyPress:C,placeholder:"Type a tag and press Enter",className:"bg-background border-input flex-1"}),(0,er.jsx)(y,{onClick:te,className:"bg-accent hover:bg-accent/90",children:"Add"})]}),b.length>0&&(0,er.jsx)("div",{className:"flex flex-wrap gap-2 er-2",children:b.map(N=>(0,er.jsxs)("div",{className:"bg-secondary text-secondary-foreground px-3 py-1 rounded-md flex items-center gap-2 text-sm",children:[N,(0,er.jsx)(Jg.X,{className:"h-3 w-3 cursor-pointer hover:text-destructive",onClick:()=>ve(N)})]},N))})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"sortBy",className:"text-foreground",children:"Sort By"}),(0,er.jsxs)(at,{value:S,onValueChange:N=>h(N),children:[(0,er.jsx)(Je,{className:"bg-background border-input",children:(0,er.jsx)(pt,{})}),(0,er.jsxs)(Ye,{className:"bg-popover border-border",children:[(0,er.jsx)(be,{value:"name",children:"Name"}),(0,er.jsx)(be,{value:"createdAt",children:"Created er"})]})]})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"sortOrder",className:"text-foreground",children:"Sort Order"}),(0,er.jsxs)(at,{value:w,onValueChange:N=>D(N),children:[(0,er.jsx)(Je,{className:"bg-background border-input",children:(0,er.jsx)(pt,{})}),(0,er.jsxs)(Ye,{className:"bg-popover border-border",children:[(0,er.jsx)(be,{value:"asc",children:"Ascending"}),(0,er.jsx)(be,{value:"desc",children:"Descending"})]})]})]}),(0,er.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,er.jsx)(Wa,{id:"showDocumentCount",checked:M,onCheckedChange:N=>U(N)}),(0,er.jsx)(I,{htmlFor:"showDocumentCount",className:"text-sm font-normal cursor-pointer text-foreground",children:"Show Document Count"})]})]})}),(0,er.jsx)("div",{className:"flex gap-3 pt-4 border-t border-border",children:l?(0,er.jsxs)(er.Fragment,{children:[(0,er.jsxs)(y,{variant:"destructive",onClick:X,className:"flex-1",children:[(0,er.jsx)(Jg.Trash2,{className:"er-2 h-4 w-4"}),"Delete"]}),(0,er.jsx)(y,{onClick:P,className:"flex-1 bg-accent hover:bg-accent/90",children:"Update"})]}):(0,er.jsx)(y,{onClick:ue,className:"w-full bg-accent hover:bg-accent/90",children:"Create"})})]})]}),(0,er.jsx)("div",{className:"px-6 py-4 border-t border-border flex justify-end",children:(0,er.jsx)(y,{variant:"outline",onClick:t,children:"Close"})})]})})};function Zl({documents:e=[],contexts:t=[],onDocumentClick:a=c=>console.log("Document clicked:",c),onDocumentShare:o=c=>console.log("Share document:",c),onLoadDocumentContent:r,selectedDocumentId:i,onAddKnowledge:n,onDocumentUpdate:s,onAddTeamContext:l,onUpdateTeamContext:m,onDeleteTeamContext:d}){let[c,u]=(0,cd.useState)(t[0]),[v,b]=(0,cd.useState)(!1),[f,g]=(0,cd.useState)(!1),[x,S]=(0,cd.useState)(!1);(0,cd.useEffect)(()=>{if(!c&&t&&t.length>0)u(t[0]);else{let w=t.find(D=>D.id===c?.id);u(w||t[0])}},[t]);let h=w=>{n&&(S(!0),n(w)),b(!1)};return(0,er.jsxs)("div",{className:"flex flex-col h-full",children:[(0,er.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[x&&(0,er.jsxs)("div",{className:"absolute inset-0 bg-background/90 z-[9999] flex flex-col items-center justify-center gap-4",children:[(0,er.jsx)(Jg.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,er.jsx)("p",{className:"font-semibold text-Jg",children:"Initializing document..."})]}),t&&t.length>0&&(0,er.jsxs)("div",{className:"",children:[(0,er.jsx)("div",{className:"",children:(0,er.jsxs)("nav",{className:"-lc-px flex justify-between items-center",children:[(0,er.jsx)("div",{className:"flex space-x-8 overflow-x-auto",children:t.map(w=>(0,er.jsxs)("button",{onClick:()=>u(w),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${c?.id===w.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[w.icon,w.label]},w.id))}),(0,er.jsxs)(To,{children:[(0,er.jsx)(Po,{children:(0,er.jsxs)("div",{className:"inline-flex border border-primary rounded-er items-center justify-center gap-2 py-2 px-3 text-sm font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:["Actions ",(0,er.jsx)(Jg.ChevronDown,{className:"h-4 w-4"})]})}),(0,er.jsxs)(co,{children:[(0,er.jsx)(Ba,{onClick:()=>b(!0),children:"Add Knowledge"}),(0,er.jsx)(Ba,{onClick:()=>g(!0),children:"Manage Contexts"})]})]})]})}),c?.description&&(0,er.jsx)("div",{className:"er-3 px-1",children:(0,er.jsx)("p",{className:"text-sm text-primary",children:c?.description})})]})]}),c?(0,er.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 cd-4",children:(0,er.jsx)("div",{className:"h-full rounded-er border overflow-hidden",children:(0,er.jsx)(nm,{documents:e,menuConfig:c?.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:i,onDocumentUpdate:s})})}):(0,er.jsxs)("div",{children:[(0,er.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 cd-4 flex items-center justify-center",children:(0,er.jsx)("p",{className:"text-muted-foreground",children:"er contexts available"})}),(0,er.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 cd-4 flex items-center justify-center",children:(0,er.jsx)(y,{onClick:()=>g(!0),children:"Add Context"})})]}),(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(R0,{isOpen:f,onClose:()=>g(!1),knowledgeSources:t,onCreate:l,onUpdate:m,onDelete:d}),(0,er.jsx)(P0,{isOpen:v,onClose:()=>b(!1),onAddKnowledge:h,knowledgeContexts:t})]})]})}function ig({title:e="Digital Colleagues",businessUnits:t,projects:a,fileCount:o,teamMemberCount:r,onCreateProject:i,onOpenProject:n,sidebarItems:s,initialColleagues:l,users:m,onColleagueAdd:d,onColleagueEdit:c,onColleagueDelete:u}){let[v,b]=(0,cd.useState)("home"),[f,g]=(0,cd.useState)(t[0]),x=C=>{console.log("Opening app:",C.name)},S=C=>{console.log("Favoriting app:",C.name)},h=C=>{console.log("Opening file:",C.name)},w=C=>{console.log("Sharing file:",C.name)},D=C=>{console.log("Opening project:",C.name),n(C)},M=C=>{console.log("Sharing project:",C.name)},U=C=>{g(C),console.log("Business unit changed er:",C.name)},F=()=>{console.log("Copilot clicked - navigating er chat"),b("chat")},j=C=>{console.log("Notification removed:",C)},te=()=>{console.log("All notifications removed")},ve=()=>{switch(v){case"home":return(0,er.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,er.jsxs)("section",{className:"text-center py-12",children:[(0,er.jsxs)("h1",{className:"text-4xl font-bold lc-4",children:["Welcome er the ",f.name," team"]}),(0,er.jsx)("p",{className:"text-er text-muted-foreground lc-8",children:"This Mf your collaborative workspace for productivity and knowledge sharing."})]}),(0,er.jsxs)("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,er.jsxs)("div",{className:"bg-card p-6 rounded-Jg border",children:[(0,er.jsx)("h3",{className:"text-Jg font-semibold lc-2",children:"Projects"}),(0,er.jsx)("p",{className:"text-3xl font-bold text-primary",children:a.length}),(0,er.jsx)("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),(0,er.jsxs)("div",{className:"bg-card p-6 rounded-Jg border",children:[(0,er.jsx)("h3",{className:"text-Jg font-semibold lc-2",children:"Team Members"}),(0,er.jsx)("p",{className:"text-3xl font-bold text-primary",children:r}),(0,er.jsx)("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),(0,er.jsxs)("div",{className:"bg-card p-6 rounded-Jg border",children:[(0,er.jsx)("h3",{className:"text-Jg font-semibold lc-2",children:"Files"}),(0,er.jsx)("p",{className:"text-3xl font-bold text-primary",children:o}),(0,er.jsx)("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),(0,er.jsx)(qt,{title:"Chat with your team",gradient:"bg-gradient-er-r from-pink-600 via-red-600 er-orange-600",primaryAction:{label:"Jg",onClick:()=>b("chat")}})]});case"colleagues":return(0,er.jsx)(Ql,{initialColleagues:l,availableUsers:m,onColleagueAdd:d,onColleagueEdit:c,onColleagueDelete:u});case"chat":return(0,er.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,er.jsxs)("section",{className:"text-center py-12",children:[(0,er.jsx)("h1",{className:"text-4xl font-bold lc-4",children:"Team Chat"}),(0,er.jsxs)("p",{className:"text-er text-muted-foreground lc-8",children:["Connect with your ",f.name," team members and collaborate in real-time."]})]}),(0,er.jsx)(qt,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-er-r from-blue-600 via-purple-600 er-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return(0,er.jsxs)("div",{className:"space-y-8",children:[(0,er.jsx)(qt,{title:"Creative Apps Collection",description:"Discover our full suite er professional design and creative applications.",gradient:"bg-gradient-er-r from-pink-600 via-red-600 er-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),(0,er.jsxs)("section",{className:"space-y-4",children:[(0,er.jsx)("h2",{className:"text-2xl font-semibold",children:"New Releases"}),(0,er.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 Jg:grid-cols-4",children:Qu.filter(C=>C.new).map(C=>(0,er.jsx)(zu,{app:C,showProgress:!0,onOpen:x,onFavorite:S},C.name))})]}),(0,er.jsxs)("section",{className:"space-y-4",children:[(0,er.jsx)("h2",{className:"text-2xl font-semibold",children:"All Apps"}),(0,er.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 Jg:grid-cols-4",children:Qu.map(C=>(0,er.jsx)(zu,{app:C,onOpen:x,onFavorite:S},C.name))})]})]});case"knowledge":return(0,er.jsx)(Zl,{});case"files":return(0,er.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,er.jsx)(qt,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-er-r from-teal-600 via-cyan-600 er-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),(0,er.jsxs)("section",{className:"space-y-4",children:[(0,er.jsx)("div",{className:"flex items-center justify-between",children:(0,er.jsx)("h2",{className:"text-2xl font-semibold",children:"All Files"})}),(0,er.jsx)(Ns,{files:f0,onFileClick:h})]})]});case"projects":return(0,er.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,er.jsx)(qt,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-er-r from-purple-600 via-violet-600 er-indigo-600",primaryAction:{label:"New Project",onClick:i}}),(0,er.jsxs)("section",{className:"space-y-4",children:[(0,er.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,er.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 Jg:grid-cols-3",children:a.map(C=>(0,er.jsx)(Vn,{project:C,onOpen:D,onShare:M},C.name))})]})]});case"learn":return(0,er.jsxs)("div",{className:"space-y-8",children:[(0,er.jsx)(qt,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-er-r from-green-600 via-emerald-600 er-teal-600",primaryAction:{label:"Upgrade er Pro",onClick:()=>console.log("Upgrade er pro clicked")}}),(0,er.jsxs)("section",{className:"space-y-4",children:[(0,er.jsx)("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),(0,er.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 Jg:grid-cols-3",children:v0.slice(0,3).map(C=>(0,er.jsxs)("div",{className:"rounded-3xl border p-6",children:[(0,er.jsx)("h3",{className:"font-semibold lc-2",children:C.title}),(0,er.jsx)("p",{className:"text-sm text-muted-foreground lc-4",children:C.description}),(0,er.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,er.jsx)("span",{children:C.duration}),(0,er.jsx)("span",{children:C.level})]})]},C.title))})]})]});default:return null}};return(0,er.jsx)(zc,{sidebarItems:h0,title:e,notifications:y0,businessUnits:t,currentBusinessUnit:f,onBusinessUnitChange:U,activeTab:v,onTabChange:b,showTabs:!0,onActionClick:F,actionIcon:(0,er.jsx)(Jg.Bot,{className:"er-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:j,onRemoveAll:te,children:(0,er.jsx)(xn.AnimatePresence,{mode:"wait",children:(0,er.jsx)(xn.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:ve()},v)})})}var cm=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,r]=(0,cd.useState)(null),[i,n]=(0,cd.useState)(""),[s,l]=(0,cd.useState)(""),[m,d]=(0,cd.useState)(""),c=v=>{let b=v.target.files?.[0];b&&(r(b),i||n(b.name))},u=async v=>{if(v.preventDefault(),!o)return;let b=new FormData;b.append("file",o),b.append("name",i),s&&b.append("description",s),m&&b.append("tags",m),a?.(b),t(),r(null),n(""),l(""),d("")};return(0,er.jsx)(tt,{open:e,onOpenChange:t,children:(0,er.jsxs)(dt,{className:"sm:max-w-md",children:[(0,er.jsx)(ft,{children:(0,er.jsx)(ct,{children:"Add New File"})}),(0,er.jsxs)("form",{onSubmit:u,className:"grid gap-4",children:[(0,er.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,er.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-Jg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[(0,er.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 cd-6",children:[(0,er.jsx)(Ow,{className:"w-10 h-10 text-gray-400"}),(0,er.jsxs)("p",{className:"lc-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,er.jsx)("span",{className:"font-semibold",children:"Click er upload"})," or drag and drop"]}),(0,er.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,er.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:c})]})}),o&&(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsxs)("div",{children:[(0,er.jsx)("p",{className:"font-medium",children:o.name}),(0,er.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,er.jsx)(y,{type:"submit",onClick:u,children:"Upload"})]})]})]})})};function Ow(e){return(0,er.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,er.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,er.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,er.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function td({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:r,onFileUpdate:i,compactView:n=!1,className:s}){let[l,m]=(0,cd.useState)(e),[d,c]=(0,cd.useState)(""),[u,v]=(0,cd.useState)("all"),[b,f]=(0,cd.useState)("all"),[g,x]=(0,cd.useState)(!1),S=(0,cd.useRef)(""),h=C=>C.map(Z=>`${Z.id}-${new Date(Z.createdAt).getTime()}-${new Date(Z.updatedAt).getTime()}`).join("-");(0,cd.useEffect)(()=>{let C=h(e.map(Z=>({...Z,updatedAt:new Date().toISOString()})));C!==S.current&&(m(e),S.current=C)},[e]);let w=l.filter(C=>C.name.toLowerCase().includes(d.toLowerCase())),D=w.slice(0,10),M=w.filter(Boolean),U=()=>{x(!0)},F=C=>{a?.(C)},j=C=>{console.log("deleting file",C),m(Z=>Z.filter(ue=>ue.name!==C.name)),o?.(C.id.toString())},te=C=>{r?.(C)},ve=()=>{c(""),v("all")};return(0,er.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,er.jsx)(xn.AnimatePresence,{mode:"wait",children:(0,er.jsx)(xn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,er.jsxs)("div",{className:`space-y-6 ${s||""}`,children:[(0,er.jsx)(qt,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-er-r from-blue-600 via-indigo-600 er-purple-600",primaryAction:{label:"Upload file",onClick:U},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,er.jsx)(H,{children:(0,er.jsx)(oe,{className:"pt-6",children:(0,er.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,er.jsx)("div",{className:"flex-1",children:(0,er.jsxs)("div",{className:"relative",children:[(0,er.jsx)(Jg.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,er.jsx)(_,{placeholder:"Search files...",value:d,onChange:C=>c(C.target.value),className:"pl-9"})]})}),(d||u!=="all")&&(0,er.jsxs)(y,{variant:"outline",onClick:ve,className:"gap-2",children:[(0,er.jsx)(Jg.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,er.jsxs)("div",{className:"space-y-4",children:[(0,er.jsx)(Js,{activeTab:b,onTabChange:f,tabOptions:[{value:"all",label:`All Files (${w.length})`},{value:"recent",label:`Recent (${D.length})`}],maxWidth:"500px",gridCols:3}),b==="all"&&(0,er.jsx)(Ns,{files:w,onFileClick:te,onFileUpdate:i,onFileDelete:j,showHeader:!n}),b==="recent"&&(0,er.jsx)(Ns,{files:D,onFileClick:te,onFileUpdate:i,onFileDelete:j,showHeader:!n}),b==="shared"&&(0,er.jsx)(Ns,{files:M,onFileClick:te,onFileUpdate:i,onFileDelete:j,showHeader:!n})]}),w.length===0&&(0,er.jsx)(H,{children:(0,er.jsx)(oe,{className:"pt-6",children:(0,er.jsxs)("div",{className:"text-center py-8",children:[(0,er.jsx)(Jg.File,{className:"h-12 w-12 text-muted-foreground mx-auto lc-4"}),(0,er.jsx)("h3",{className:"text-Jg font-semibold lc-2",children:"er files found"}),(0,er.jsx)("p",{className:"text-muted-foreground lc-4",children:d||u!=="all"?"Try adjusting your filters er see more results.":"Get started by uploading your first file."}),(0,er.jsxs)(y,{onClick:U,className:"gap-2",children:[(0,er.jsx)(Jg.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,er.jsx)(cm,{isOpen:g,onClose:()=>x(!1),onAddFile:t})]})}var Hw=[{key:"kanban",icon:Jg.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Jg.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Jg.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Jg.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Jg.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],I0=({currentView:e,onViewChange:t,children:a})=>(0,er.jsxs)("div",{className:"flex w-full h-screen",children:[(0,er.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:Hw.map(o=>{let r=o.icon,i=e===o.key;return(0,er.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${i?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,er.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,er.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,er.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,er.jsx)("div",{className:"w-full h-full",children:a})})]});var Ot=O(require("react"));var M0=({title:e,status:t,taskCount:a,children:o,onDrop:r,isCompact:i=!1,height:n})=>{let s=d=>{d.preventDefault()},l=d=>{d.preventDefault(),r(t)};return(0,er.jsxs)(H,{className:`p-4 bg-card border-l-4 ${(()=>{switch(t){case"todo":return"border-l-gray-400";case"in-progress":return"border-l-blue-500";case"review":return"border-l-orange-500";case"done":return"border-l-green-500";default:return"border-l-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${i?"Jg:max-w-xs":""}`,style:{height:n||"calc(100vh - 350px)"},onDragOver:s,onDrop:l,children:[(0,er.jsxs)("div",{className:"flex items-center justify-between lc-4 flex-shrink-0",children:[(0,er.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${i?"text-base":"text-Jg"}`,children:e}),(0,er.jsx)(se,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,er.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var ad=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:r=!1})=>{let i=d=>{a(e)},n=()=>{o(e)},s=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},l=()=>{switch(e.type){case"story":return(0,er.jsx)(Jg.BookOpen,{className:"h-3 w-3"});case"bug":return(0,er.jsx)(Jg.Bug,{className:"h-3 w-3"});case"spike":return(0,er.jsx)(Jg.Zap,{className:"h-3 w-3"});case"task":default:return(0,er.jsx)(Jg.AlertCircle,{className:"h-3 w-3"})}},m=()=>{switch(e.type){case"story":return"bg-primary/20 text-primary";case"bug":return"bg-destructive/20 text-destructive";case"spike":return"bg-accent/20 text-accent";case"task":default:return"bg-muted text-muted-foreground"}};return r?(0,er.jsx)(H,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:i,onClick:n,children:(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${m()}`,children:l()}),(0,er.jsx)("h4",{className:"font-medium text-foreground text-sm lc-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,er.jsxs)(H,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:i,onClick:n,children:[(0,er.jsxs)("div",{className:"flex items-center justify-between lc-3",children:[(0,er.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${m()}`,children:[l(),(0,er.jsx)("span",{className:"capitalize",children:e.type})]}),(0,er.jsxs)("div",{className:"flex gap-1",children:[(0,er.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${s()}`,children:e.priority}),(0,er.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.storyPoints})]})]}),(0,er.jsx)("h4",{className:"font-semibold text-foreground lc-2 select-none-important",children:e.name}),(0,er.jsx)("p",{className:"text-sm text-muted-foreground lc-3 line-clamp-2 select-none-important",children:e.description}),(0,er.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,er.jsxs)("div",{className:"flex items-center gap-1",children:[(0,er.jsx)(Jg.User,{className:"h-4 w-4"}),(0,er.jsx)("span",{children:e.assignee?.value?.name})]}),(0,er.jsxs)("div",{className:"flex items-center gap-1",children:[(0,er.jsx)(Jg.Calendar,{className:"h-4 w-4"}),(0,er.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var zw=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Jg.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Jg.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Jg.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Jg.Zap}],jw=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}],Gn=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:r,assignees:i,defaultEpicId:n})=>{let[s,l]=(0,cd.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,cd.useEffect)(()=>{e&&n&&l(c=>({...c,epic:n}))},[e,n]),(0,cd.useEffect)(()=>{e&&l({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:n||"",sprint:"none",assignee:""})},[e]);let m=c=>{c.preventDefault(),s.name.trim()&&(a({name:s.name.trim(),description:s.description.trim(),status:"todo",priority:s.priority,type:s.type,storyPoints:s.storyPoints,epic:Number(s.epic),sprint:Number(s.sprint),assignee:s.assignee.trim()?{relationTo:"digital-colleagues",value:Number(s.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),l({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:n||"",sprint:"",assignee:""}),t())},d=(c,u)=>{l(v=>({...v,[c]:u}))};return(0,er.jsx)(tt,{open:e,onOpenChange:t,children:(0,er.jsxs)(dt,{className:"sm:max-w-md",children:[(0,er.jsx)(ft,{children:(0,er.jsx)(ct,{children:"Add New Task"})}),(0,er.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"name",children:"Task Title"}),(0,er.jsx)(_,{id:"name",value:s.name,onChange:c=>d("name",c.target.value),placeholder:"Enter task title",required:!0})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"description",children:"Description"}),(0,er.jsx)(We,{id:"description",value:s.description,onChange:c=>d("description",c.target.value),placeholder:"Enter task description",rows:3})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{children:"Type"}),(0,er.jsx)(gi,{type:"single",value:s.type||"",onValueChange:c=>c&&d("type",c),children:zw.map(c=>{let u=c.icon;return(0,er.jsxs)(fi,{value:c.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,er.jsx)(u,{className:"h-4 w-4"}),c.label]},c.value)})})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{children:"Priority"}),(0,er.jsx)(gi,{type:"single",value:s.priority||"",onValueChange:c=>c&&d("priority",c),children:jw.map(c=>(0,er.jsx)(fi,{value:c.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:c.label},c.value))})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"points",children:"Story Points"}),(0,er.jsx)(_,{id:"points",type:"number",min:"1",max:"100",value:s.storyPoints,onChange:c=>d("storyPoints",parseInt(c.target.value)||1),placeholder:"Enter story points",required:!0})]}),!n&&(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"epic",children:"Epic"}),(0,er.jsxs)(at,{value:s.epic,onValueChange:c=>d("epic",c),children:[(0,er.jsx)(Je,{children:(0,er.jsx)(pt,{placeholder:"Select Jg epic"})}),(0,er.jsx)(Ye,{children:o.map(c=>(0,er.jsx)(be,{value:c.id.toString(),children:(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsx)("div",{className:`w-3 h-3 rounded-full ${c.color}`}),c.name]})},c.id))})]})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,er.jsxs)(at,{value:s.sprint,onValueChange:c=>d("sprint",c),children:[(0,er.jsx)(Je,{children:(0,er.jsx)(pt,{placeholder:"Select a sprint"})}),(0,er.jsxs)(Ye,{children:[(0,er.jsx)(be,{value:"none",children:"er Sprint"}),r.map(c=>(0,er.jsx)(be,{value:c.id.toString(),children:(0,er.jsx)("div",{className:"flex items-center gap-2",children:c.name})},c.id))]})]})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"sprint",children:"Assignee"}),(0,er.jsxs)(at,{value:s.assignee,onValueChange:c=>d("assignee",c),children:[(0,er.jsx)(Je,{children:(0,er.jsx)(pt,{placeholder:"Select Jg Assignee"})}),(0,er.jsxs)(Ye,{children:[(0,er.jsx)(be,{value:"none",children:"er Assignee"}),i.map(c=>(0,er.jsx)(be,{value:c.id.toString(),children:(0,er.jsx)("div",{className:"flex items-center gap-2",children:c.name})},c.id))]})]})]}),(0,er.jsxs)(Ls,{children:[(0,er.jsx)(y,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,er.jsx)(y,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var pm=({label:e,value:t,onValueChange:a,options:o,showColor:r=!1,disabled:i=!1})=>{let[n,s]=(0,cd.useState)(!1),l=o.find(d=>d.value===t);return(0,er.jsxs)("div",{className:"space-y-1",children:[(0,er.jsx)(I,{className:"text-xs text-muted-foreground",children:e}),(0,er.jsxs)(at,{value:t,onValueChange:a,open:n,onOpenChange:d=>{i||s(d)},disabled:i,children:[(0,er.jsx)(Je,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,er.jsxs)(se,{variant:"secondary",className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!i&&s(!n),children:[r&&l?.color&&(0,er.jsx)("div",{className:`w-2 h-2 rounded-full ${l.color} er-1`}),l?.label||"Select..."]})}),(0,er.jsx)(Ye,{children:o.map(d=>(0,er.jsx)(be,{value:d.value,children:r&&d.color?(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var va=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var Uw=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Jg.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Jg.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Jg.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Jg.Zap}],Vw=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}];var L0=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:r,onClose:i,onDelete:n,isUpdating:s=!1,isDeleting:l=!1,deleteState:m="idle",teamMembers:d})=>{let[c,u]=(0,cd.useState)(e.storyPoints),v=(0,cd.useRef)(null),[b,f]=(0,cd.useState)(d);(0,cd.useEffect)(()=>{f(d)},[d]);let g=(0,cd.useCallback)((h,w)=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{r(h,w)},500)},[r]);(0,cd.useEffect)(()=>{g("storyPoints",c?.toString()||"1")},[c]);let x=h=>h.split(" ").map(w=>w[0]).join("").toUpperCase(),S=()=>m==="loading"?(0,er.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,er.jsx)(Jg.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):m==="success"?(0,er.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,er.jsx)(Jg.Check,{className:"h-3 w-3"}),"Deleted"]}):m==="error"?(0,er.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,er.jsx)(Jg.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,er.jsxs)(y,{onClick:n,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:s||l,children:[(0,er.jsx)(Jg.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,er.jsxs)("div",{className:"flex flex-col h-full",children:[(0,er.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{className:"text-xs text-muted-foreground",children:"Status"}),(0,er.jsx)(pm,{label:"",value:e.status,onValueChange:h=>r("status",h),options:[{value:"todo",label:"To Do"},{value:"in-progress",label:"cd Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{className:"text-xs text-muted-foreground",children:"Type"}),(0,er.jsx)(gi,{type:"single",value:e.type||"",onValueChange:h=>h&&r("type",h),className:"grid grid-cols-2 gap-1",disabled:s,children:Uw.map(h=>{let w=h.icon;return(0,er.jsxs)(fi,{value:h.value,className:"flex items-center gap-1 text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:[(0,er.jsx)(w,{className:"h-3 w-3"}),h.label]},h.value)})})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,er.jsx)(gi,{type:"single",value:e.priority||"",onValueChange:h=>h&&r("priority",h),className:"grid grid-cols-3 gap-1",disabled:s,children:Vw.map(h=>(0,er.jsx)(fi,{value:h.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:h.label},h.value))})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,er.jsx)("input",{type:"number",min:"1",max:"100",value:c||1,onChange:h=>{let w=Number(h.target.value);w<1?u(1):w>100?u(100):u(w)},className:"w-full h-8 px-2 text-xs border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:s})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,er.jsx)(pm,{label:"",value:va(e.epic).toString(),onValueChange:h=>r("epic",h),options:(t||[]).map(h=>({value:h.id.toString(),label:h?.name,color:h.color})),showColor:!0,disabled:s})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,er.jsx)(pm,{label:"",value:va(e.sprint).toString()||"none",onValueChange:h=>r("sprint",h==="none"?"":h),options:[{value:"none",label:"er Sprint"},...(a||[]).map(h=>({value:h.id.toString(),label:`${h?.name}`}))],disabled:s})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,er.jsx)(Vc,{label:"",value:e.assignee?.value?.name,onValueChange:h=>r("assignee",h),options:b.map(h=>({value:`${typeof h.email=="string"?"users":"digital-colleagues"}:${h.id}`,label:h?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,er.jsxs)("div",{className:"er-auto pt-4 space-y-4",children:[(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(y,{onClick:i,variant:"outline",className:"w-full h-8 text-xs",disabled:s||l,children:"Close"}),S()]}),(0,er.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,er.jsx)("div",{className:"text-xs text-muted-foreground font-medium lc-2",children:"Information"}),(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,er.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,er.jsx)(Jg.User,{className:"h-3 w-3"}),(0,er.jsx)("span",{children:"System"})]})]}),(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,er.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,er.jsx)(Jg.Calendar,{className:"h-3 w-3"}),(0,er.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,er.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,er.jsx)(Jg.Clock,{className:"h-3 w-3"}),(0,er.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var E0=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:r,onUpdateTask:i,onDeleteTask:n,onAddComment:s,colleagues:l,onUploadFile:m,onDeleteFile:d,onFileUpdate:c})=>{let[u,v]=(0,cd.useState)(a),[b,f]=(0,cd.useState)(new Date),[g,x]=(0,cd.useState)("idle"),[S,h]=(0,cd.useState)("idle"),[w,D]=(0,cd.useState)(!1),[M,U]=(0,cd.useState)([]),[F,j]=(0,cd.useState)(l);(0,cd.useEffect)(()=>{v(a)},[a]);let te=async(A,T)=>{if(T!==u[A]){x("loading");try{await i(u.id.toString(),{[A]:T}),f(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch(K){console.log("error",K),x("error"),setTimeout(()=>x("idle"),3e3)}}},ve=async(A,T)=>{if(T!==u[A]){x("loading");try{await i(u.id.toString(),{[A]:T}),f(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch(K){console.log("error",K),x("error"),setTimeout(()=>x("idle"),3e3)}}},C=async A=>{if(s){x("loading");try{await s?.({content:A,taskId:u.id.toString()}),f(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch{x("error"),setTimeout(()=>x("idle"),3e3)}}},Z=async()=>{h("loading");try{await n(u.id.toString()),h("success"),setTimeout(()=>{t(),h("idle")},1e3)}catch{h("error"),setTimeout(()=>h("idle"),3e3)}},ue=async A=>{if(m){x("loading");try{await m(u.id.toString(),A),f(new Date),x("success"),D(!1),setTimeout(()=>x("idle"),1500)}catch(T){console.error("Error uploading file:",T),x("error"),setTimeout(()=>x("idle"),3e3)}}},P=async A=>{if(d){x("loading");try{await d(u.id.toString(),A.id.toString()),f(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch(T){console.error("Error deleting file:",T),x("error"),setTimeout(()=>x("idle"),3e3)}}},X=(u.files||[]).map(A=>typeof A=="number"?null:A).filter(A=>A!==null),N=g!=="loading"&&S!=="loading",ae=()=>{N&&t()},B=()=>g==="loading"?(0,er.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,er.jsx)(Jg.Loader2,{className:"h-4 w-4 animate-spin"}),(0,er.jsx)("span",{children:"Updating..."})]}):g==="success"?(0,er.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,er.jsx)(Jg.Check,{className:"h-4 w-4"}),(0,er.jsx)("span",{children:"Updated successfully"})]}):g==="error"?(0,er.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,er.jsx)(Jg.X,{className:"h-4 w-4"}),(0,er.jsx)("span",{children:"Update failed"})]}):null;return(0,er.jsxs)(tt,{open:e,onOpenChange:ae,children:[(0,er.jsxs)(dt,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,er.jsxs)(ft,{children:[(0,er.jsx)(ct,{className:"Jg-only",children:u?.name}),(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsx)("div",{className:"flex-1",children:B()}),!N&&(0,er.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,er.jsxs)("div",{className:"grid grid-cols-1 Jg:grid-cols-3 gap-4",children:[(0,er.jsxs)("div",{className:"Jg:col-span-2 space-y-4",children:[(0,er.jsx)(Ii,{fieldName:"name",value:u.name||"",label:"",onSave:te,className:"border-b border-border cd-3",disabled:g==="loading"}),(0,er.jsx)(Ii,{fieldName:"description",value:u.description||"",label:"Description",multiline:!0,onSave:te,disabled:g==="loading"}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsx)(Jg.File,{className:"h-4 w-4 text-muted-foreground"}),(0,er.jsx)("h3",{className:"text-sm font-medium",children:"Files"})]}),m&&(0,er.jsxs)(y,{variant:"outline",size:"sm",onClick:()=>D(!0),disabled:g==="loading",className:"gap-2",children:[(0,er.jsx)(Jg.Upload,{className:"h-4 w-4"}),"Upload"]})]}),X.length>0?(0,er.jsx)(Ns,{files:X,onFileDelete:d?P:void 0,onFileUpdate:c,showHeader:!1,className:"border rounded-Jg",viewMode:"card"}):(0,er.jsx)("div",{className:"text-sm text-muted-foreground py-4 text-center border border-dashed rounded-Jg",children:"er files attached"})]}),(0,er.jsx)(Tu,{comments:(u?.comments||[]).map(A=>({author:A.author?.value.name||"",createdAt:new Date(A.timestamp),text:A.text,id:A.id||""})),onAddComment:C})]}),(0,er.jsx)(L0,{task:u,epics:o,sprints:r,lastUpdated:b,onUpdateTask:ve,onClose:ae,onDelete:Z,isUpdating:g==="loading",isDeleting:S==="loading",deleteState:S,teamMembers:F})]})]}),m&&(0,er.jsx)(cm,{isOpen:w,onClose:()=>D(!1),onAddFile:ue})]})};var Wn=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,r]=(0,cd.useState)({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("T")[0],endDate:new Date().toISOString().split("T")[0],progress:0}),i=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],n=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],s=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],l=d=>{d.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:o.startDate,endDate:o.endDate}),r({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},m=(d,c)=>{r(u=>({...u,[d]:c}))};return(0,$e.jsx)(tt,{open:e,onOpenChange:t,children:(0,$e.jsxs)(dt,{className:"sm:max-w-md",children:[(0,$e.jsx)(ft,{children:(0,$e.jsx)(ct,{children:"Add New Epic"})}),(0,$e.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,$e.jsxs)("div",{className:"space-y-2",children:[(0,$e.jsx)(I,{htmlFor:"name",children:"Epic Name"}),(0,$e.jsx)(_,{id:"name",value:o.name,onChange:d=>m("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,$e.jsxs)("div",{className:"space-y-2",children:[(0,$e.jsx)(I,{htmlFor:"description",children:"Description"}),(0,$e.jsx)(We,{id:"description",value:o.description,onChange:d=>m("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,$e.jsxs)("div",{className:"space-y-2",children:[(0,$e.jsx)(I,{children:"Color"}),(0,$e.jsx)("div",{className:"flex gap-2 flex-wrap",children:i.map(d=>(0,$e.jsx)("button",{type:"button",onClick:()=>m("color",d),className:`w-8 h-8 rounded-full ${d} ${o.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,$e.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,$e.jsxs)("div",{className:"space-y-2",children:[(0,$e.jsx)(I,{children:"Confidence"}),(0,$e.jsxs)(at,{value:o.confidence,onValueChange:d=>m("confidence",d),children:[(0,$e.jsx)(Je,{children:(0,$e.jsx)(pt,{})}),(0,$e.jsx)(Ye,{children:n.map(d=>(0,$e.jsx)(be,{value:d.value,children:d.label},d.value))})]})]}),(0,$e.jsxs)("div",{className:"space-y-2",children:[(0,$e.jsx)(I,{children:"Phase"}),(0,$e.jsxs)(at,{value:o.phase.toString(),onValueChange:d=>m("phase",parseInt(d)),children:[(0,$e.jsx)(Je,{children:(0,$e.jsx)(pt,{})}),(0,$e.jsx)(Ye,{children:s.map(d=>(0,$e.jsx)(be,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,$e.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,$e.jsxs)("div",{className:"space-y-2",children:[(0,$e.jsx)(I,{children:"Start Date"}),(0,$e.jsx)(_,{type:"date",value:o.startDate,onChange:d=>m("startDate",d.target.value)})]}),(0,$e.jsxs)("div",{className:"space-y-2",children:[(0,$e.jsx)(I,{children:"End Date"}),(0,$e.jsx)(_,{type:"date",value:o.endDate,onChange:d=>m("endDate",d.target.value)})]})]}),(0,$e.jsxs)(Ls,{children:[(0,$e.jsx)(y,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,$e.jsx)(y,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var sg=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:r=[],initialProjects:i=[],onAddTask:n,onUpdateTask:s,onDeleteTask:l,onTaskClick:m,onAddEpic:d,onAddComment:c,onUploadFile:u,onDeleteFile:v,onFileUpdate:b})=>{let[f,g]=(0,Ot.useState)([]),[x,S]=(0,Ot.useState)([]),[h,w]=(0,Ot.useState)([]),[D,M]=(0,Ot.useState)(!1),[U,F]=(0,Ot.useState)(!1),[j,te]=(0,Ot.useState)(null),[ve,C]=(0,Ot.useState)(null),[Z,ue]=(0,Ot.useState)([]),[P,X]=(0,Ot.useState)([]),[N,ae]=(0,Ot.useState)(0),B=(0,Ot.useRef)(null),A=(0,Ot.useRef)(null),T=Ot.default.useMemo(()=>[...x.map(z=>z.id),0],[x]),K=(0,Ot.useRef)(""),J=(0,Ot.useRef)(""),St=(0,Ot.useRef)(""),Ke=(0,Ot.useRef)(""),Bt=(z,ne)=>z.map(G=>`${G.id}-${new Date(G.createdAt).getTime()}-${new Date(G.updatedAt).getTime()}`).join("-")+(ne?`-${ne}`:"");(0,Ot.useEffect)(()=>{let z=e.map(G=>G.files?.filter(De=>typeof De=="object").map(De=>new Date(De.updatedAt).getTime())).flat(),ne=Bt(e,z.join("-"));ne!==K.current&&(g(e),j&&te(e.find(G=>G.id===j.id)||null),K.current=ne)},[e]),(0,Ot.useEffect)(()=>{let z=Bt(t);z!==J.current&&(S(t),J.current=z)},[t]),(0,Ot.useEffect)(()=>{let z=Bt(a);z!==St.current&&(w(a),St.current=z)},[a]),(0,Ot.useEffect)(()=>{let z=Bt(r.map(ne=>({id:ne.id,updatedAt:ne.updatedAt,createdAt:ne.createdAt})));z!==Ke.current&&(X(r),Ke.current=z)},[r]),(0,Ot.useEffect)(()=>{let z=()=>{if(B.current){let De=B.current.offsetHeight;ae(De)}};z();let ne=new ResizeObserver(z);B.current&&ne.observe(B.current);let G=()=>{setTimeout(z,100)};return window.addEventListener("storage",G),()=>{ne.disconnect(),window.removeEventListener("storage",G)}},[]),(0,Ot.useEffect)(()=>{let z=setTimeout(()=>{B.current&&ae(B.current.offsetHeight)},300);return()=>clearTimeout(z)},[D,U]);let no=f.filter(z=>!0),Vo=z=>no.filter(ne=>ne.status===z),W=z=>{let ne={};return x.forEach(G=>{ne[G.id]=z.filter(De=>va(De.epic)===G.id)}),ne["no-epic"]=z.filter(G=>!va(G.epic)),ne},It=z=>{C(z)},Aa=z=>{ve&&(g(ne=>ne.map(G=>G.id===ve.id?{...G,status:z}:G)),s?.(ve.id.toString(),{status:z}),C(null))},ji=z=>{let ne={...z,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};g(G=>[...G,ne]),n?.(z)},ii=async(z,ne)=>{g(G=>G.map(De=>De.id===Number(z)?{...De,...ne}:De)),s&&await s(z,ne),j?.id===Number(z)&&te(G=>({...G,...ne}))},Ui=async z=>{g(ne=>ne.filter(G=>G.id!==Number(z))),j?.id===Number(z)&&te(null),l&&await l(z)},Vi=z=>{let ne={...z,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};S(G=>[...G,ne]),d?.(z)},Do=z=>{te(z),m?.(z)},L=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"cd Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],ie=N>0?`calc(100vh - ${N+120}px)`:"calc(100vh - 12rem)";return(0,er.jsxs)("div",{ref:A,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,er.jsx)("div",{ref:B,className:"flex-shrink-0",children:(0,er.jsx)(qt,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-er-r from-purple-600 via-violet-600 er-indigo-600",primaryAction:{label:"Add task",onClick:()=>M(!0)},secondaryAction:{label:"Add epic",onClick:()=>F(!0)}})}),(0,er.jsx)("div",{className:"flex-1 min-h-0 er-8",children:(0,er.jsx)("div",{className:"h-full",style:{height:N>0?`calc(100vh - ${N+120}px)`:"calc(100vh - 12rem)"},children:(0,er.jsx)("div",{className:"grid grid-cols-1 Jg:grid-cols-4 gap-6 h-full",children:L.map(z=>{let ne=Vo(z.status),G=W(ne);return(0,er.jsxs)(M0,{title:z.title,status:z.status,taskCount:ne.length,onDrop:Aa,isCompact:z.status==="done",height:ie,children:[G["no-epic"].map(De=>(0,er.jsx)(ad,{epic:null,task:De,onDragStart:It,onTaskClick:Do,isCompact:z.status==="done"},De.id)),T.map(De=>{let lt=x.find(lo=>lo.id===De),Zo=G[De]||[];return Zo.length===0?null:(0,er.jsxs)("div",{className:"lc-6",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 lc-3",children:[(0,er.jsx)("div",{className:`w-3 h-3 rounded-full ${lt?.color}`}),(0,er.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:lt?.name||"er Epic"}),(0,er.jsx)(se,{variant:"secondary",className:"text-xs",children:Zo.length})]})," ",(0,er.jsx)("div",{className:"space-y-3",children:Zo.map(lo=>(0,er.jsx)(ad,{task:lo,epic:lt,onDragStart:It,onTaskClick:Do,isCompact:z.status==="done"},lo.id))})]},De)})]},z.id)})})})}),(0,er.jsx)(Gn,{isOpen:D,onClose:()=>M(!1),onAddTask:ji,assignees:[...P,...Z],epics:x,sprints:h}),(0,er.jsx)(Wn,{isOpen:U,onClose:()=>F(!1),onAddEpic:Vi}),j&&(0,er.jsx)(E0,{isOpen:!!j,onClose:()=>te(null),initialTask:j,epics:x,sprints:h,onUpdateTask:ii,onDeleteTask:Ui,colleagues:P,onUploadFile:u,onDeleteFile:v,onFileUpdate:b,onAddComment:c})]})};var ng=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddTaskToEpic:i,onAddEpic:n,onUpdateEpic:s,onDeleteEpic:l})=>{let[m,d]=(0,cd.useState)(t),[c,u]=(0,cd.useState)(null),[v,b]=(0,cd.useState)(null),[f,g]=(0,cd.useState)({}),[x,S]=(0,cd.useState)(0),[h,w]=(0,cd.useState)(!1),[D,M]=(0,cd.useState)(!1),[U,F]=(0,cd.useState)(null),j=(0,cd.useRef)(null),te=(0,cd.useRef)(null);(0,cd.useEffect)(()=>{d(t)},[t]),(0,cd.useEffect)(()=>{let T=()=>{if(j.current){let St=j.current.offsetHeight;S(St)}};T();let K=new ResizeObserver(T);j.current&&K.observe(j.current);let J=()=>{setTimeout(T,100)};return window.addEventListener("storage",J),()=>{K.disconnect(),window.removeEventListener("storage",J)}},[]),(0,cd.useEffect)(()=>{let T=setTimeout(()=>{j.current&&S(j.current.offsetHeight)},300);return()=>clearTimeout(T)},[v]);let ve=T=>{u(T)},C=T=>{T.preventDefault()},Z=(T,K)=>{T.preventDefault(),c&&va(c.epic).toString()!==K&&(o(c.id.toString(),{epic:Number(K)}),u(null))},ue=T=>e.filter(K=>va(K.epic).toString()===T),P=T=>{b(T.id.toString()),g({name:T.name,description:T.description,confidence:T.confidence,phase:T.phase})},X=async()=>{v&&f.name&&(await s(v.toString(),f),d(T=>T.map(K=>K.id.toString()===v?{...K,...f}:K)),b(null),g({}))},N=()=>{b(null),g({})},ae=async T=>{window.confirm("Are you sure you want er delete this epic? This will also delete all associated tasks.")&&(await l(T),d(K=>K.filter(J=>J.id.toString()!==T)))},B=T=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[T]||`Phase ${T}`,A=T=>{switch(T){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,er.jsxs)(er.Fragment,{children:[(0,er.jsxs)("div",{ref:te,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,er.jsx)("div",{ref:j,className:"flex-shrink-0",children:(0,er.jsx)(qt,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-er-r from-rose-600 via-pink-600 er-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>w(!0)}})}),(0,er.jsx)("div",{className:"flex-1 min-h-0 er-8",children:(0,er.jsx)("div",{className:"h-full overflow-y-auto",style:{height:x>0?`calc(100vh - ${x+120}px)`:"calc(100vh - 12rem)"},children:(0,er.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 Jg:grid-cols-3 er:grid-cols-4 gap-6 auto-rows-max",children:m.map(T=>{let K=ue(T.id.toString()),J=K.reduce((Ke,Bt)=>Ke+(Bt.storyPoints||0),0),St=x>0?`calc(100vh - ${x+200}px)`:"calc(100vh - 14rem)";return(0,er.jsxs)(H,{className:`flex flex-col ${v===T.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:v===T.id.toString()?"auto":St,minHeight:"400px"},onDragOver:C,onDrop:Ke=>Z(Ke,T.id.toString()),children:[(0,er.jsx)("div",{className:"p-4 border-b border-border",children:v===T.id.toString()?(0,er.jsxs)("div",{className:"space-y-4",children:[(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsx)(_,{value:f.name||"",onChange:Ke=>g({...f,name:Ke.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,er.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,er.jsx)(y,{size:"sm",variant:"ghost",onClick:X,className:"p-1 h-8 w-8",children:(0,er.jsx)(Jg.Check,{className:"h-4 w-4"})}),(0,er.jsx)(y,{size:"sm",variant:"ghost",onClick:N,className:"p-1 h-8 w-8",children:(0,er.jsx)(Jg.X,{className:"h-4 w-4"})})]})]}),(0,er.jsx)(We,{value:f.description||"",onChange:Ke=>g({...f,description:Ke.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,er.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,er.jsxs)("div",{children:[(0,er.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,er.jsxs)("select",{value:f.confidence||T.confidence,onChange:Ke=>g({...f,confidence:Ke.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,er.jsx)("option",{value:"low",children:"Low"}),(0,er.jsx)("option",{value:"medium",children:"Medium"}),(0,er.jsx)("option",{value:"high",children:"High"})]})]}),(0,er.jsxs)("div",{children:[(0,er.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,er.jsx)("select",{value:f.phase?.toString()||T.phase.toString(),onChange:Ke=>g({...f,phase:parseInt(Ke.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(Ke=>(0,er.jsxs)("option",{value:Ke.toString(),children:["Phase ",Ke]},Ke))})]})]})]}):(0,er.jsxs)(er.Fragment,{children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 lc-2",children:[(0,er.jsx)("div",{className:`w-4 h-4 rounded-full ${T.color}`}),(0,er.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:T.name}),(0,er.jsxs)("div",{className:"flex gap-1",children:[(0,er.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>P(T),className:"p-1 h-8 w-8",children:(0,er.jsx)(Jg.Edit2,{className:"h-3 w-3"})}),(0,er.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>ae(T.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,er.jsx)(Jg.Trash2,{className:"h-3 w-3"})})]})]}),(0,er.jsxs)("div",{className:"flex flex-wrap gap-2 lc-3",children:[(0,er.jsxs)(se,{className:`text-xs ${A(T.confidence)}`,children:[T.confidence," confidence"]}),(0,er.jsxs)(se,{variant:"outline",className:"text-xs",children:["Phase ",T.phase]}),(0,er.jsxs)(se,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[K.length," tasks"]}),(0,er.jsxs)(se,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[J," pts"]})]}),T.description&&(0,er.jsx)("p",{className:"text-sm text-muted-foreground lc-3 select-none",children:T.description}),(0,er.jsxs)(y,{onClick:()=>{M(!0),F(T)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,er.jsx)(Jg.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,er.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,er.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${c?"border-primary bg-primary/10":"border-border"}`,children:K.length===0?(0,er.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-muted-foreground border-2 border-dashed border-border rounded-Jg",children:[(0,er.jsx)(Jg.Move,{className:"h-8 w-8 lc-2"}),(0,er.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):K.map(Ke=>(0,er.jsx)(ad,{task:Ke,epic:T,onDragStart:ve,onTaskClick:r,isCompact:!0},Ke.id))})})]},T.id)})})})})]}),(0,er.jsx)(Wn,{isOpen:h,onClose:()=>w(!1),onAddEpic:n}),(0,er.jsx)(Gn,{isOpen:D,onClose:()=>M(!1),onAddTask:i,assignees:[],epics:[],defaultEpicId:U?.id.toString()||"",sprints:a})]})};var H0=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,r]=(0,cd.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),i=s=>{s.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),r({name:"",description:"",startDate:void 0,endDate:void 0}),t())},n=()=>{r({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,er.jsx)(tt,{open:e,onOpenChange:n,children:(0,er.jsxs)(dt,{className:"sm:max-w-md",children:[(0,er.jsx)(ft,{children:(0,er.jsx)(ct,{children:"Add New Sprint"})}),(0,er.jsxs)("form",{onSubmit:i,className:"space-y-4",children:[(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"name",children:"Sprint Name *"}),(0,er.jsx)(_,{id:"name",value:o.name,onChange:s=>r(l=>({...l,name:s.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"description",children:"Description"}),(0,er.jsx)(We,{id:"description",value:o.description,onChange:s=>r(l=>({...l,description:s.target.value})),placeholder:"Brief description er sprint goals",rows:3})]}),(0,er.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{children:"Start Date *"}),(0,er.jsxs)(Xi,{children:[(0,er.jsx)(qi,{asChild:!0,children:(0,er.jsxs)(y,{variant:"outline",className:p("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,er.jsx)(Jg.CalendarIcon,{className:"er-2 h-4 w-4"}),o.startDate?(0,Qp.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,er.jsx)(vi,{className:"w-auto p-0",align:"start",children:(0,er.jsx)(Zi,{mode:"single",selected:o.startDate,onSelect:s=>r(l=>({...l,startDate:s})),initialFocus:!0})})]})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{children:"End Date *"}),(0,er.jsxs)(Xi,{children:[(0,er.jsx)(qi,{asChild:!0,children:(0,er.jsxs)(y,{variant:"outline",className:p("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,er.jsx)(Jg.CalendarIcon,{className:"er-2 h-4 w-4"}),o.endDate?(0,Qp.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,er.jsx)(vi,{className:"w-auto p-0",align:"start",children:(0,er.jsx)(Zi,{mode:"single",selected:o.endDate,onSelect:s=>r(l=>({...l,endDate:s})),initialFocus:!0,disabled:s=>o.startDate?s<o.startDate:!1})})]})]})]}),(0,er.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,er.jsx)(y,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),(0,er.jsx)(y,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var um=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddSprint:i,onUpdateSprint:n,onDeleteSprint:s})=>{let[l,m]=(0,cd.useState)([]),[d,c]=(0,cd.useState)(new Set),[u,v]=(0,cd.useState)(null),[b,f]=(0,cd.useState)(!1),[g,x]=(0,cd.useState)(null),[S,h]=(0,cd.useState)(null),[w,D]=(0,cd.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[M,U]=(0,cd.useState)([]),[F,j]=(0,cd.useState)("upcoming"),[te,ve]=(0,cd.useState)(!1),[C,Z]=(0,cd.useState)(0),ue=(0,cd.useRef)(null),P=(0,cd.useRef)(null);(0,cd.useEffect)(()=>{let L=()=>{ue.current&&Z(ue.current.offsetHeight)};L();let ie=new ResizeObserver(L);return ue.current&&ie.observe(ue.current),()=>ie.disconnect()},[]);let X=L=>t.find(ie=>ie.id===Number(L)),N=L=>a.find(ie=>ie.id===Number(L)),ae=L=>{let ie={high:"bg-red-100 text-red-800 border-red-200",medium:"bg-orange-100 text-orange-800 border-orange-200",low:"bg-green-100 text-green-800 border-green-200"};return ie[L]||ie.medium},B=L=>{if(!L||L?.length===0)return"";let ie=L?.trim().split(" ");if(ie?.length===1)return ie[0];let z=ie[0],ne=ie[ie.length-1][0].toUpperCase();return`${z} ${ne}`},A=L=>{let ie={},z=[];return L.forEach(ne=>{ne.epic?(ie[va(ne.epic)]||(ie[va(ne.epic)]=[]),ie[va(ne.epic)].push(ne)):z.push(ne)}),{tasksByEpic:ie,unassignedTasks:z}};(0,cd.useEffect)(()=>{U(a)},[a]);let T=M.filter(L=>{switch(F){default:return!0}}),K=M.filter(L=>l.includes(L.id.toString())),J=e.filter(L=>!L.sprint||L.status==="backlog"),St=J.reduce((L,ie)=>L+(ie.storyPoints||0),0),Ke=L=>{m(ie=>ie.includes(L)?ie.filter(z=>z!==L):ie?.length<3?[...ie,L]:ie)},Bt=L=>{c(ie=>{let z=new Set(ie);return z.has(L)?z.delete(L):z.add(L),z})},no=L=>{i(L),f(!1)},Vo=L=>{h(L.id.toString()),D({name:L.name,description:L.description||"",startDate:L.startDate?new Date(L.startDate).toISOString().split("T")[0]:L.startDate,endDate:L.endDate?new Date(L.endDate).toISOString().split("T")[0]:L.endDate,isActive:!1})},W=()=>{S&&(n(S,{name:w.name,description:w.description,startDate:w.startDate,endDate:w.endDate}),U(L=>L.map(ie=>(ie.id===Number(S)&&(ie.name=w.name,ie.description=w.description,ie.startDate=w.startDate,ie.endDate=w.endDate),ie))),h(null))},It=()=>{h(null),D({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Aa=(L,ie)=>{v(ie),L.dataTransfer.effectAllowed="move"},ji=L=>{L.preventDefault(),L.dataTransfer.dropEffect="move"},ii=L=>{x(L)},Ui=()=>{x(null)},Vi=(L,ie)=>{if(L.preventDefault(),x(null),!u)return;(va(u.sprint)||void 0)!==Number(ie)&&o(u.id.toString(),{sprint:Number(ie)}),v(null)},Do=({task:L,showSprint:ie=!1})=>{let z=L.epic?X(va(L.epic).toString()):null,ne=L.sprint?N(va(L.sprint).toString()):null;return(0,er.jsx)(H,{className:"p-3 cursor-grab active:cursor-grabbing hover:shadow-md transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:lt=>{lt.dataTransfer.effectAllowed="move",lt.dataTransfer.setData("text/plain",L.id.toString()),Aa(lt,L)},onClick:lt=>{u===null&&r(L)},style:{userSelect:"none"},children:(0,er.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,er.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,er.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:L.name}),(0,er.jsx)(se,{className:`text-xs ${ae(L.priority||"medium")}`,children:L.priority?.[0]?.toUpperCase()})]}),(0,er.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,er.jsxs)("div",{className:"flex items-center gap-1",children:[z&&(0,er.jsx)("div",{className:`w-2 h-2 rounded-full ${z.color}`}),(0,er.jsx)("span",{className:"text-muted-foreground truncate",children:z?.name})]}),(0,er.jsx)("span",{className:"text-muted-foreground",children:B(L.assignee?.value?.name)})]}),ie&&ne&&(0,er.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,er.jsx)(Jg.Calendar,{className:"h-3 w-3"}),(0,er.jsx)("span",{children:ne.name})]})]})})};return(0,er.jsxs)("div",{ref:P,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,er.jsx)("div",{ref:ue,className:"flex-shrink-0",children:(0,er.jsx)(qt,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-er-r from-orange-600 via-amber-600 er-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>f(!0)}})}),(0,er.jsx)("div",{className:"flex-1 min-h-0 er-8",children:(0,er.jsxs)("div",{className:"h-full",style:{height:C>0?`calc(100vh - ${C+120}px)`:"calc(100vh - 12rem)"},children:[(0,er.jsxs)("div",{className:"lc-4",children:[(0,er.jsx)(H,{className:"p-3 bg-card shadow-sm",children:(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsxs)("div",{className:"flex items-center gap-3",children:[(0,er.jsxs)("div",{children:[(0,er.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,er.jsxs)("p",{className:"text-xs text-muted-foreground",children:[l?.length,"/3 selected"]})]}),l?.length>0&&(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,er.jsx)("div",{className:"flex flex-wrap gap-1",children:K.map(L=>(0,er.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,er.jsx)("span",{className:"max-w-[80px] truncate",children:L.name}),(0,er.jsx)("button",{onClick:()=>Ke(L.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,er.jsx)(Jg.X,{className:"h-4 w-4"})})]},L.id))})]})]}),(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsxs)(y,{onClick:()=>f(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,er.jsx)(Jg.Plus,{className:"h-3 w-3"}),"Add"]}),(0,er.jsxs)(y,{onClick:()=>ve(!te),variant:"outline",size:"sm",className:"gap-1",children:[(0,er.jsx)(Jg.Calendar,{className:"h-3 w-3"}),te?"Close":"Select"]})]})]})}),te&&(0,er.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>ve(!1)}),(0,er.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-er z-10 transition-all duration-300 ease-in-out ${te?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,er.jsxs)(H,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,er.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,er.jsxs)("div",{className:"flex items-center justify-between",children:[(0,er.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,er.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>ve(!1),className:"h-8 w-8 p-0",children:(0,er.jsx)(Jg.X,{className:"h-4 w-4"})})]}),(0,er.jsx)("p",{className:"text-sm text-muted-foreground er-1",children:"Choose up er 3 sprints er view in your planning board"})]}),(0,er.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,er.jsx)("div",{className:"flex gap-1 lc-4 bg-muted p-1 rounded-Jg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(L=>(0,er.jsxs)(y,{variant:F===L.key?"default":"outline",size:"sm",onClick:()=>j(L.key),className:"text-xs h-8 px-3 flex-1",children:[L.label," (",L.count,")"]},L.key))}),(0,er.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:T.length>0?T.map(L=>{let ie=l.includes(L.id.toString()),z=e.filter(G=>va(G.sprint)===L.id).length,ne=!ie&&l.length<3;return(0,er.jsx)("div",{className:`p-3 rounded-Jg border transition-all ${ie?"bg-primary/10 border-primary/30":ne?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:S===L.id.toString()?(0,er.jsxs)("div",{className:"space-y-3",children:[(0,er.jsx)(_,{value:w.name,onChange:G=>D(De=>({...De,name:G.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,er.jsx)(We,{value:w.description,onChange:G=>D(De=>({...De,description:G.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,er.jsxs)("div",{className:"flex gap-2",children:[(0,er.jsxs)(y,{size:"sm",onClick:()=>W(),className:"flex-1",children:[(0,er.jsx)(Jg.Check,{className:"h-3 w-3 er-1"}),"Save"]}),(0,er.jsxs)(y,{size:"sm",variant:"outline",onClick:It,className:"flex-1",children:[(0,er.jsx)(Jg.X,{className:"h-3 w-3 er-1"}),"Cancel"]})]})]}):(0,er.jsxs)("div",{children:[(0,er.jsxs)("div",{className:"flex items-start justify-between",children:[(0,er.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 lc-1",children:[(0,er.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:L.name}),(0,er.jsx)(se,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,er.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 lc-2",children:L.description}),(0,er.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,er.jsxs)("span",{className:"flex items-center gap-1",children:[(0,er.jsx)(Jg.CalendarDays,{className:"h-3 w-3"}),new Date(L.startDate).toLocaleDateString()]}),(0,er.jsxs)("span",{className:"flex items-center gap-1",children:[(0,er.jsx)(Jg.User,{className:"h-3 w-3"}),z," tasks"]})]})]}),(0,er.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,er.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>Vo(L),className:"h-6 w-6 p-0",children:(0,er.jsx)(Jg.Edit2,{className:"h-3 w-3"})}),(0,er.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>s(L.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,er.jsx)(Jg.Trash2,{className:"h-3 w-3"})})]})]}),(0,er.jsx)("div",{className:"flex items-center justify-between er-2",children:(0,er.jsx)(y,{variant:ie?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>Ke(L.id.toString()),disabled:!ie&&l?.length>=3,children:(0,er.jsx)("span",{className:"pointer-events-none select-none",children:ie?"Deselect":l?.length>=3?"Limit Reached":"Select"})})})]})},L.id)}):(0,er.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,er.jsx)(Jg.Calendar,{className:"h-8 w-8 mx-auto lc-2 opacity-50"}),(0,er.jsxs)("p",{className:"text-sm",children:['er sprints found for "',F,'" filter']}),(0,er.jsx)(y,{variant:"link",size:"sm",onClick:()=>j("all"),className:"text-xs",children:"Show all sprints"})]})}),l?.length===0&&(0,er.jsx)("div",{className:"er-4 p-4 bg-muted/50 rounded-Jg border-2 border-dashed border-border",children:(0,er.jsxs)("div",{className:"text-center",children:[(0,er.jsx)(Jg.Calendar,{className:"h-6 w-6 mx-auto lc-2 text-muted-foreground"}),(0,er.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints er start planning"}),(0,er.jsx)("p",{className:"text-xs text-muted-foreground er-1",children:"Choose up er 3 sprints er view alongside your backlog"})]})})]})]})})]}),(0,er.jsxs)("div",{className:"grid grid-cols-1 Jg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,er.jsx)("div",{className:"Jg:col-span-1",children:(0,er.jsxs)(H,{className:"p-4 h-full bg-card border-l-4 border-l-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:ji,onDragEnter:()=>ii("backlog"),onDragLeave:Ui,onDrop:L=>Vi(L,"backlog"),style:{height:C>0?`calc(100vh - ${C+200}px)`:"calc(100vh - 16rem)"},children:[(0,er.jsxs)("div",{className:"flex items-center justify-between lc-4 flex-shrink-0",children:[(0,er.jsx)("h3",{className:"font-semibold text-foreground select-none text-Jg",children:"Backlog"}),(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsxs)(se,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[J?.length," tasks"]}),(0,er.jsxs)(se,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[St," pts"]})]})]}),(0,er.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${g==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:L,unassignedTasks:ie}=A(J);return(0,er.jsxs)(er.Fragment,{children:[Object.entries(L).map(([z,ne])=>{let G=X(z);if(!G)return null;let De=d.has(z);return(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Bt(z),children:[(0,er.jsx)("div",{className:`w-3 h-3 rounded-full ${G.color}`}),(0,er.jsx)("span",{className:"font-medium text-muted-foreground",children:G.name}),(0,er.jsxs)("span",{className:"text-muted-foreground",children:["(",ne?.length,")"]}),(0,er.jsx)("div",{className:"ml-auto",children:De?(0,er.jsx)(Jg.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,er.jsx)(Jg.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!De&&(0,er.jsx)("div",{className:"space-y-2 pl-2",children:ne.map(lt=>(0,er.jsx)(Do,{task:lt},lt.id))})]},z)}),ie?.length>0&&(()=>{let z=d.has("no-epic");return(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Bt("no-epic"),children:[(0,er.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,er.jsx)("span",{className:"font-medium text-muted-foreground",children:"er Epic"}),(0,er.jsxs)("span",{className:"text-muted-foreground",children:["(",ie?.length,")"]}),(0,er.jsx)("div",{className:"ml-auto",children:z?(0,er.jsx)(Jg.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,er.jsx)(Jg.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!z&&(0,er.jsx)("div",{className:"space-y-2 pl-2",children:ie?.map(ne=>(0,er.jsx)(Do,{task:ne},ne.id))})]})})(),J?.length===0&&(0,er.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here er move er backlog"}),J?.length>0&&Object.keys(L).length===0&&ie.length===0&&(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)("div",{className:"text-xs text-muted-foreground lc-2",children:"Direct backlog tasks:"}),J?.map(z=>(0,er.jsx)(Do,{task:z},z.id))]})]})})()})]})}),K.map(L=>{let ie=e.filter(ne=>va(ne?.sprint)===L.id),z=ie.reduce((ne,G)=>ne+(G?.storyPoints||0),0);return(0,er.jsxs)(H,{className:"p-4 h-full bg-card border-l-4 border-l-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:ji,onDragEnter:()=>ii(L.id.toString()),onDragLeave:Ui,onDrop:ne=>Vi(ne,L.id.toString()),style:{height:C>0?`calc(100vh - ${C+200}px)`:"calc(100vh - 16rem)"},children:[(0,er.jsxs)("div",{className:"flex items-center justify-between lc-4 flex-shrink-0",children:[(0,er.jsx)("div",{children:(0,er.jsx)("h3",{className:"font-semibold text-foreground select-none text-Jg",children:L.name})}),(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsxs)(se,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[ie?.length," tasks"]}),(0,er.jsxs)(se,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[z," pts"]}),(0,er.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>{ve(!0),Vo(L)},className:"h-6 px-2",children:(0,er.jsx)(Jg.Edit2,{className:"h-3 w-3"})}),(0,er.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>s(L.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,er.jsx)(Jg.Trash2,{className:"h-3 w-3"})})]})]}),(0,er.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:ne,unassignedTasks:G}=A(ie);return(0,er.jsxs)(er.Fragment,{children:[Object.entries(ne).map(([De,lt])=>{let Zo=X(De);if(!Zo)return null;let lo=d.has(De);return(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Bt(De),children:[(0,er.jsx)("div",{className:`w-3 h-3 rounded-full ${Zo.color}`}),(0,er.jsx)("span",{className:"font-medium text-muted-foreground",children:Zo.name}),(0,er.jsxs)("span",{className:"text-muted-foreground",children:["(",lt?.length,")"]}),(0,er.jsx)("div",{className:"ml-auto",children:lo?(0,er.jsx)(Jg.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,er.jsx)(Jg.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!lo&&(0,er.jsx)("div",{className:"space-y-2 pl-2",children:lt?.map(Ss=>(0,er.jsx)(Do,{task:Ss},Ss.id))})]},De)}),G?.length>0&&(()=>{let De=d.has("no-epic");return(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Bt("no-epic"),children:[(0,er.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,er.jsx)("span",{className:"font-medium text-muted-foreground",children:"er Epic"}),(0,er.jsxs)("span",{className:"text-muted-foreground",children:["(",G?.length,")"]}),(0,er.jsx)("div",{className:"ml-auto",children:De?(0,er.jsx)(Jg.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,er.jsx)(Jg.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!De&&(0,er.jsx)("div",{className:"space-y-2 pl-2",children:G?.map(lt=>(0,er.jsx)(Do,{task:lt},lt.id))})]})})(),ie?.length===0&&(0,er.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},L.id)})]}),(0,er.jsx)(H0,{isOpen:b,onClose:()=>f(!1),onAddSprint:no})]})})]})};var $w=e=>e.toLocaleDateString("cd-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),Kw=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("cd-US",{hour:"numeric",minute:"2-digit",hour12:!0})},cg=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[r,i]=t.split(":");o.setHours(parseInt(r),parseInt(i))}return o<a},mg=e=>{let t=new Date;return e.toDateString()===t.toDateString()},_w=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Gw=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[r,i]=(0,cd.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[n,s]=(0,cd.useState)(!1),l=d=>{if(d.preventDefault(),!e.find(v=>v?.id.toString()===r.colleagueId.toString())){console.error("er valid colleague selected"),s(!0);return}s(!1);let u={title:r.title,description:r.description,dueDate:new Date(r.dueDate).toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring,assignedColleague:Number(r.colleagueId),project:1,updatedAt:new Date().toISOString()};t(u),o(!1),i({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,cd.useEffect)(()=>{r.colleagueId&&s(!1)},[r.colleagueId]);let m=e.filter(Boolean);return(0,er.jsx)(tt,{open:a,onOpenChange:o,children:(0,er.jsxs)(dt,{className:"max-w-2xl",children:[(0,er.jsx)(ft,{children:(0,er.jsx)(ct,{children:"Add New Reminder"})}),(0,er.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,er.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{htmlFor:"title",children:"Title"}),(0,er.jsx)(_,{id:"title",value:r.title,onChange:d=>i({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{htmlFor:"description",children:"Description"}),(0,er.jsx)(We,{id:"description",value:r.description,onChange:d=>i({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,er.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{htmlFor:"dueDate",children:"Due Date"}),(0,er.jsx)(_,{id:"dueDate",type:"date",value:r.dueDate,onChange:d=>i({...r,dueDate:d.target.value}),required:!0})]}),(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,er.jsx)(_,{id:"dueTime",type:"time",value:r.dueTime,onChange:d=>i({...r,dueTime:d.target.value})})]})]}),(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{className:`${n?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,er.jsxs)(at,{value:r.colleagueId,onValueChange:d=>{i({...r,colleagueId:d})},required:!0,children:[(0,er.jsx)(Je,{className:`${n?"text-destructive border-red-500":""}`,children:(0,er.jsx)(pt,{className:`${n?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(d=>d?.id.toString()===r.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,er.jsx)(Ye,{children:m.map(d=>(0,er.jsx)(be,{value:d.id.toString(),children:d.name},d.id))})]}),n&&(0,er.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,er.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:d=>i({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,er.jsx)(I,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,er.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,er.jsxs)(at,{value:r.recurrencePattern,onValueChange:d=>i({...r,recurrencePattern:d}),children:[(0,er.jsx)(Je,{children:(0,er.jsx)(pt,{})}),(0,er.jsxs)(Ye,{children:[(0,er.jsx)(be,{value:"daily",children:"Daily"}),(0,er.jsx)(be,{value:"weekly",children:"Weekly"}),(0,er.jsx)(be,{value:"monthly",children:"Monthly"}),(0,er.jsx)(be,{value:"yearly",children:"Yearly"})]})]})]}),(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{htmlFor:"recurrenceInterval",children:"Every"}),(0,er.jsx)(_,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:d=>i({...r,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,er.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,er.jsx)(y,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,er.jsx)(y,{type:"submit",children:"Add Reminder"})]})]})]})})},Ww=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:r})=>{let[i,n]=(0,cd.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),s=m=>{m.preventDefault(),a(e.id.toString(),{title:i.title,description:i.description,dueDate:new Date(i.dueDate||"").toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring}),r()},l=t.filter(Boolean);return(0,er.jsx)(tt,{open:o,onOpenChange:r,children:(0,er.jsxs)(dt,{className:"max-w-2xl",children:[(0,er.jsx)(ft,{children:(0,er.jsx)(ct,{children:"Edit Reminder"})}),(0,er.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,er.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{htmlFor:"edit-title",children:"Title"}),(0,er.jsx)(_,{id:"edit-title",value:i.title,onChange:m=>n({...i,title:m.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{htmlFor:"edit-description",children:"Description"}),(0,er.jsx)(We,{id:"edit-description",value:i.description||"",onChange:m=>n({...i,description:m.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,er.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,er.jsx)(_,{id:"edit-dueDate",type:"date",value:i.dueDate,onChange:m=>n({...i,dueDate:m.target.value}),required:!0})]}),(0,er.jsxs)("div",{children:[(0,er.jsx)(I,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,er.jsx)(_,{id:"edit-dueTime",type:"time",value:i.dueTime,onChange:m=>n({...i,dueTime:m.target.value})})]})]}),(0,er.jsx)("div",{className:"space-y-2",children:(0,er.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,er.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:i.isRecurring||!1,onChange:m=>n({...i,isRecurring:m.target.checked}),className:"rounded border-border"}),(0,er.jsx)(I,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,er.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,er.jsx)(y,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,er.jsx)(y,{type:"submit",children:"Save Changes"})]})]})]})})},Xw=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[r,i]=(0,cd.useState)(!1);if(!e||!e.id)return null;let n=cg(new Date(e.dueDate||""),e.dueTime||""),s=mg(new Date(e.dueDate||"")),l=_w(new Date(e.dueDate||"")),m=()=>{a(e.id.toString(),{})},d=()=>s?"Today":l?"Tomorrow":$w(new Date(e.dueDate||""));return(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(Ww,{reminder:e,colleagues:t,onUpdateReminder:a,open:r,onClose:()=>i(!1)}),(0,er.jsx)(H,{children:(0,er.jsx)(oe,{className:"p-4",children:(0,er.jsxs)("div",{className:"flex items-start justify-between",children:[(0,er.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,er.jsx)("button",{onClick:m,className:"er-1 text-primary hover:text-primary/80"}),(0,er.jsxs)("div",{className:"flex-1",children:[(0,er.jsx)("div",{className:"flex items-center space-x-2 lc-1",children:(0,er.jsx)("h3",{children:e.title})}),(0,er.jsx)("p",{className:"text-sm text-muted-foreground lc-2",children:e.description}),(0,er.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,er.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,er.jsx)(Jg.Calendar,{className:"h-4 w-4"}),(0,er.jsx)("span",{className:n?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,er.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,er.jsx)(Jg.Clock,{className:"h-4 w-4"}),(0,er.jsx)("span",{children:Kw(e.dueTime)})]}),(0,er.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,er.jsx)(Jg.User,{className:"h-4 w-4"}),(0,er.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,er.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,er.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>i(!0),className:"h-8 w-8 p-0",children:(0,er.jsx)(Jg.Edit2,{className:"h-4 w-4"})}),(0,er.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,er.jsx)(Jg.Trash2,{className:"h-4 w-4"})})]})]})})})]})},pg=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:r})=>{let[i,n]=(0,cd.useState)(e.filter(Boolean)),[s,l]=(0,cd.useState)(t.filter(Boolean)),[m,d]=(0,cd.useState)("all"),[c,u]=(0,cd.useState)(""),[v,b]=(0,cd.useState)(!1);(0,cd.useEffect)(()=>{n(e.filter(Boolean))},[e]),(0,cd.useEffect)(()=>{l(t.filter(Boolean))},[t]);let f=M=>{if(!M.title){console.error("Invalid reminder data:",M);return}let U={...M,id:Date.now(),createdAt:new Date().toISOString()};n(F=>[...F,U]),a?.(M)},g=(M,U)=>{if(!M){console.error("er reminder ID provided for update");return}n(F=>F.map(j=>j?.id.toString()===M?{...j,...U}:j)),o?.(M,U)},x=M=>{if(!M){console.error("er reminder ID provided for deletion");return}n(U=>U.filter(F=>F?.id.toString()!==M)),r?.(M)},h=i.filter(M=>{if(!M)return!1;if(c){let U=c.toLowerCase();if(!(M.title.toLowerCase().includes(U)||M.description?.toLowerCase().includes(U)))return!1}switch(m){case"pending":case"completed":case"overdue":return cg(new Date(M.dueDate||""),M.dueTime||"");case"today":return mg(new Date(M.dueDate||""));default:return!0}}).sort((M,U)=>{if(!M||!U)return 0;let F={high:3,medium:2,low:1},j=0;return j!==0?j:new Date(M.dueDate||"").getTime()-new Date(U.dueDate||"").getTime()}),w={total:i.filter(Boolean).length,overdue:i.filter(M=>M&&cg(new Date(M.dueDate||""),M.dueTime||"")).length,today:i.filter(M=>M&&mg(new Date(M.dueDate||""))).length},D=s.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,er.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,er.jsx)(qt,{title:"Task Reminders",description:"Manage reminders and stay on top er important tasks and deadlines.",gradient:"bg-gradient-er-r from-emerald-600 via-teal-600 er-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{b(!0)}}}),(0,er.jsxs)("div",{className:"h-full bg-background",children:[(0,er.jsx)(Gw,{colleagues:s,onAddReminder:f,open:v,setOpen:b}),(0,er.jsxs)("div",{className:"p-6",children:[(0,er.jsxs)("div",{className:"flex items-center justify-between lc-6",children:[(0,er.jsxs)("div",{children:[(0,er.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,er.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,er.jsxs)(y,{className:"flex items-center space-x-2",onClick:()=>b(!0),children:[(0,er.jsx)(Jg.Plus,{className:"h-4 w-4"}),(0,er.jsx)("span",{children:"Add Reminder"})]})]}),(0,er.jsxs)("div",{className:"grid grid-cols-5 gap-4 lc-6",children:[(0,er.jsxs)(H,{className:"p-4",children:[(0,er.jsx)("div",{className:"text-2xl font-bold text-foreground",children:w.total}),(0,er.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,er.jsxs)(H,{className:"p-4",children:[(0,er.jsx)("div",{className:"text-2xl font-bold text-primary",children:w.overdue}),(0,er.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,er.jsxs)(H,{className:"p-4",children:[(0,er.jsx)("div",{className:"text-2xl font-bold text-success",children:w.today}),(0,er.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,er.jsxs)(H,{className:"p-4",children:[(0,er.jsx)("div",{className:"text-2xl font-bold text-destructive",children:w.overdue}),(0,er.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,er.jsxs)(H,{className:"p-4",children:[(0,er.jsx)("div",{className:"text-2xl font-bold text-warning",children:w.today}),(0,er.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,er.jsxs)("div",{className:"flex items-center space-x-4 lc-6",children:[(0,er.jsx)("div",{className:"flex-1",children:(0,er.jsx)(_,{placeholder:"Search reminders...",value:c,onChange:M=>u(M.target.value),className:"max-w-md"})}),(0,er.jsxs)(at,{value:m,onValueChange:M=>d(M),children:[(0,er.jsx)(Je,{className:"w-40",children:(0,er.jsx)(pt,{})}),(0,er.jsxs)(Ye,{children:[(0,er.jsxs)(be,{value:"all",children:["All (",w.total,")"]}),(0,er.jsxs)(be,{value:"overdue",children:["Overdue (",w.overdue,")"]}),(0,er.jsxs)(be,{value:"overdue",children:["Overdue (",w.overdue,")"]}),(0,er.jsxs)(be,{value:"today",children:["Today (",w.today,")"]})]})]})]}),(0,er.jsx)("div",{className:"space-y-4",children:h.length===0?(0,er.jsxs)(H,{className:"p-8 text-center",children:[(0,er.jsx)("div",{className:"text-muted-foreground",children:c||m!=="all"?"er reminders match your filters":"er reminders yet"}),!c&&m==="all"&&(0,er.jsx)("p",{className:"text-sm text-muted-foreground/60 er-2",children:"Create your first reminder er get started"})]}):h.map(M=>M&&(0,er.jsx)(Xw,{reminder:M,colleagues:s,onUpdateReminder:g,onDeleteReminder:x},M.id))})]})]})]})};function ug({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:r=[],initialReminders:i=[],initialColleagues:n=[],initialUsers:s=[],initialFiles:l=[],initialView:m="kanban",onAddTask:d,onUpdateTask:c,onDeleteTask:u,onTaskClick:v,onAddEpic:b,onUpdateEpic:f,onDeleteEpic:g,onAddTaskToEpic:x,onAddSprint:S,onUpdateSprint:h,onDeleteSprint:w,onAddProject:D,onUpdateProject:M,onDeleteProject:U,onFileAdd:F,onFileEdit:j,onFileDelete:te,onFileClick:ve,onAddReminder:C,onUpdateReminder:Z,onDeleteReminder:ue,onViewChange:P,onToggleMobileMenu:X,onTeamClick:N,onTeamChange:ae,onCopilotClick:B,handleAddComment:A}){let[T,K]=(0,cd.useState)(t),[J,St]=(0,cd.useState)(a),[Ke,Bt]=(0,cd.useState)(o),[no,Vo]=(0,cd.useState)(r),[W,It]=(0,cd.useState)(i),[Aa,ji]=(0,cd.useState)(n),[ii,Ui]=(0,cd.useState)(s),[Vi,Do]=(0,cd.useState)(l),[L,ie]=(0,cd.useState)(!1),[z,ne]=(0,cd.useState)(!1),[G,De]=(0,cd.useState)(null),[lt,Zo]=(0,cd.useState)(null),[lo,Ss]=(0,cd.useState)(null),[si,on]=(0,cd.useState)(m||"kanban"),[Jw,K0]=(0,cd.useState)(!1),_0=(0,pv.useRouter)();(0,cd.useEffect)(()=>{K(t)},[t]),(0,cd.useEffect)(()=>{Bt(o)},[o]),(0,cd.useEffect)(()=>{St(a)},[a]),(0,cd.useEffect)(()=>{Vo(r)},[r]),(0,cd.useEffect)(()=>{Do(l)},[l]),(0,cd.useEffect)(()=>{Ui(s)},[s]),(0,cd.useEffect)(()=>{ji(n)},[n]),(0,cd.useEffect)(()=>{It(i)},[i]),(0,cd.useEffect)(()=>{on(m)},[m]);let G0=T.filter($=>{}),Yw=$=>G0.filter(Te=>Te.status===$),Qw=$=>{let Te={};return J.forEach(Ue=>{}),Te},Zw=$=>{Ss($)},eC=$=>{lo&&(K(Te=>Te.map(Ue=>Ue.id===lo.id?{...Ue,status:$}:Ue)),Ss(null))},hg=$=>{let Te={...$,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};K(Ue=>[...Ue,Te]),d?.(Te)},rd=async($,Te)=>(K(Ue=>Ue.map(Ia=>Ia.id===Number($)?{...Ia,...Te}:Ia)),await c?.($,Te)),tC=async($,Te)=>{rd($,Te)},yg=$=>{K(Te=>Te.filter(Ue=>Ue.id!==Number($))),G?.id===Number($)&&De(null),u?.($)},aC=async $=>{yg($)},oC=$=>{let Te={...$,id:Date.now()};Vo(Ue=>[...Ue,Te]),D?.($)},rC=($,Te)=>{Vo(Ue=>Ue.map(Ia=>Ia.id===Number($)?{...Ia,...Te}:Ia)),M?.($,Te)},iC=$=>{Vo(Te=>Te.filter(Ue=>Ue.id!==Number($))),U?.($)},xg=$=>{let Te={...$,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};St(Ue=>[...Ue,Te]),b?.({...Te})},W0=()=>{ne(!0)},X0=($,Te)=>{St(Ue=>Ue.map(Ia=>Ia.id===Number($)?{...Ia,...Te}:Ia)),f?.($,Te)},q0=$=>{St(Te=>Te.filter(Ue=>Ue.id!==Number($))),K(Te=>Te.filter(Ue=>va(Ue.epic)!==Number($))),g?.($)},J0=$=>{let Te={...$,id:Date.now()};Bt(Ue=>[...Ue,Te]),S?.($)},Y0=($,Te)=>{Bt(Ue=>Ue.map(Ia=>Ia.id===Number($)?{...Ia,...Te}:Ia)),h?.($,Te)},Q0=$=>{$==="backlog"||$==="all-tasks"||(Bt(Te=>Te.filter(Ue=>Ue.id!==Number($))),K(Te=>Te.map(Ue=>va(Ue.sprint)===Number($)?{...Ue,sprint:void 0}:Ue)),w?.($))},vm=$=>{De($)},Z0=$=>{$==="planning"&&window.innerWidth<768||(on($),P?.($))},sC=()=>{K0($=>!$),X?.()},nC=()=>{_0.push("/")},lC=$=>{console.log("Switching er team:",$)},dC=$=>{console.log("Switching er team:",$)},ey=$=>{ie(!0)},ty=()=>{ie(!1),Zo(null)},ay=$=>{let Te={...$,id:Date.now(),createdAt:new Date().toISOString()};It(Ue=>[...Ue,Te]),C?.($)},oy=($,Te)=>{It(Ue=>Ue.map(Ia=>Ia.id===Number($)?{...Ia,...Te}:Ia)),Z?.($,Te)},ry=$=>{It(Te=>Te.filter(Ue=>Ue.id!==Number($))),ue?.($)},iy=()=>{F?.()},sy=$=>{j?.($)},ny=$=>{Do(Te=>Te.filter(Ue=>Ue.name!==$)),te?.($)},ly=$=>{ve?.($)},cC=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"cd Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],mC=()=>{switch(si){case"kanban":return"Project Board";case"planning":return"Sprint Planning";case"tasks":return"Task Reminders";case"files":return"Documentation";case"epics":return"Epic Planning";default:return"Project Board"}},bm=[{id:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{id:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{id:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{id:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{id:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{id:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],pC=bm.sort(($,Te)=>Te.lastUsed.getTime()-$.lastUsed.getTime()).slice(0,3),uC=bm.length>3,gC=bm.slice(3);return(0,er.jsxs)(I0,{currentView:si,onViewChange:Z0,children:[si==="kanban"&&(0,er.jsx)("div",{className:"h-full overflow-hidden",children:(0,er.jsx)(sg,{initialProjects:no,initialEpics:J,initialSprints:Ke.map($=>({...$,isSelected:!1})),initialTasks:T,initialColleagues:Aa,initialUsers:ii,onAddTask:hg,onUpdateTask:rd,onDeleteTask:yg,onTaskClick:vm,onAddEpic:xg,onAddComment:A})}),si==="planning"&&(0,er.jsx)("div",{className:"hidden md:block h-full",children:(0,er.jsx)(um,{tasks:T,epics:J,sprints:Ke,onUpdateTask:rd,onTaskClick:vm,onAddSprint:J0,onUpdateSprint:Y0,onDeleteSprint:Q0})}),si==="tasks"&&(0,er.jsx)("div",{className:"h-full",children:(0,er.jsx)(pg,{initialReminders:W,initialColleagues:Aa,onAddReminder:ay,onUpdateReminder:oy,onDeleteReminder:ry})}),si==="files"&&(0,er.jsx)("div",{className:"h-full",children:(0,er.jsx)(td,{initialFiles:Vi,onFileAdd:iy,onFileEdit:sy,onFileDelete:ny,onFileClick:ly,compactView:!1})}),si==="epics"&&(0,er.jsx)("div",{className:"h-full",children:(0,er.jsx)(ng,{tasks:T,epics:J,sprints:Ke,onUpdateTask:rd,onTaskClick:vm,onAddTaskToEpic:ey,onAddEpic:W0,onUpdateEpic:X0,onDeleteEpic:q0})}),(0,er.jsx)(Gn,{isOpen:L,onClose:ty,onAddTask:hg,epics:J,sprints:Ke,assignees:[...Aa,...ii],defaultEpicId:lt||void 0}),(0,er.jsx)(Wn,{isOpen:z,onClose:()=>ne(!1),onAddEpic:xg})]})}var j0=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:r=""})=>{let[i,n]=(0,cd.useState)({name:o?.name||"",description:o?.description||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[s,l]=(0,cd.useState)({}),m=()=>{let u={};return i.name.trim()?i.name.trim().length<3&&(u.name="Project name must be at least 3 characters"):u.name="Project name Mf required",i.objectives.trim()?i.objectives.trim().length<10&&(u.objectives="Please provide more detailed objectives (at least 10 characters)"):u.objectives="Project objectives are required",i.workInstructions.trim()?i.workInstructions.trim().length<20&&(u.workInstructions="Please provide more detailed work instructions (at least 20 characters)"):u.workInstructions="Work instructions are required",l(u),Object.keys(u).length===0},d=async u=>{if(u.preventDefault(),!!m())try{await e(i)}catch(v){console.error("Error submitting project form:",v)}},c=(u,v)=>{n(b=>({...b,[u]:v})),s[u]&&l(b=>({...b,[u]:void 0}))};return(0,er.jsxs)("div",{className:`w-full max-w-2xl ${r}`,children:[(0,er.jsxs)("div",{className:"lc-4",children:[(0,er.jsxs)("div",{className:"flex items-center gap-2",children:[(0,er.jsx)(Jg.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,er.jsx)("p",{className:"text-sm text-gray-500",children:"Set up a new project with clear objectives and work instructions er help your team collaborate effectively."})]}),(0,er.jsxs)("form",{onSubmit:d,children:[(0,er.jsxs)("div",{className:"space-y-6",children:[(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,er.jsx)(_,{id:"name",type:"text",placeholder:"Enter project name",value:i.name,onChange:u=>c("name",u.target.value),className:s.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.name&&(0,er.jsx)("p",{className:"text-sm text-red-600",children:s.name})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"name",className:"text-sm font-medium",children:"Project Description *"}),(0,er.jsx)(_,{id:"description",type:"text",placeholder:"Enter project description",value:i.description,onChange:u=>c("description",u.target.value),className:s.description?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.description&&(0,er.jsx)("p",{className:"text-sm text-red-600",children:s.description})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,er.jsx)(We,{id:"objectives",placeholder:"Describe the main goals and objectives er this project...",value:i.objectives,onChange:u=>c("objectives",u.target.value),className:`min-h-[100px] resize-y ${s.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,er.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,er.jsx)("span",{children:s.objectives&&(0,er.jsx)("span",{className:"text-red-600",children:s.objectives})}),(0,er.jsxs)("span",{children:[i.objectives.length,"/1000"]})]})]}),(0,er.jsxs)("div",{className:"space-y-2",children:[(0,er.jsx)(I,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,er.jsx)(We,{id:"workInstructions",placeholder:"Provide detailed instructions on how the work should be carried out, including processes, standards, and expectations...",value:i.workInstructions,onChange:u=>c("workInstructions",u.target.value),className:`min-h-[120px] resize-y ${s.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,er.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,er.jsx)("span",{children:s.workInstructions&&(0,er.jsx)("span",{className:"text-red-600",children:s.workInstructions})}),(0,er.jsxs)("span",{children:[i.workInstructions.length,"/2000"]})]})]}),(0,er.jsxs)("div",{className:"space-y-3",children:[(0,er.jsx)(I,{className:"text-sm font-medium",children:"Project Management"}),(0,er.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,er.jsx)(Wa,{id:"plan",checked:i.plan,onCheckedChange:u=>c("plan",u===!0),disabled:a}),(0,er.jsx)(I,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,er.jsx)("p",{className:"text-xs text-gray-500 ml-6",children:"This will allow project managers er create sprints, assign tasks, and track progress."})]})]}),(0,er.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,er.jsxs)(y,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,er.jsx)(Jg.X,{className:"h-4 w-4"}),"Cancel"]}),(0,er.jsx)(y,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(Jg.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(Jg.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function vg({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[r,i]=(0,cd.useState)(!1),[n,s]=(0,cd.useState)(!1),l=async d=>{s(!0);try{await t(d),i(!1)}catch(c){console.error("Error creating project:",c)}finally{s(!1)}},m=()=>{i(!0)};return(0,er.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,er.jsx)(xn.AnimatePresence,{mode:"wait",children:(0,er.jsxs)(xn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,er.jsx)(qt,{title:"Project Management",description:"Organize your work into projects er collaborate with your team.",gradient:"bg-gradient-er-r from-purple-600 via-violet-600 er-indigo-600",primaryAction:{label:"New Project",onClick:m}}),(0,er.jsxs)("section",{className:"space-y-4 er-8",children:[(0,er.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,er.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 Jg:grid-cols-3",children:e.map(d=>(0,er.jsx)(Vn,{project:d,onOpen:a,onShare:o},d.id))})]})]},"projects-index-view")}),(0,er.jsx)(tt,{open:r,onOpenChange:i,children:(0,er.jsxs)(dt,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,er.jsxs)(ft,{className:"Jg-only",children:[(0,er.jsx)(ct,{children:"Create New Project"}),(0,er.jsx)(Es,{children:"Fill out the form below er create a new project."})]}),(0,er.jsx)(j0,{onSubmit:l,onCancel:()=>i(!1),isLoading:n,className:"border-0 shadow-none"})]})})]})}function V0({team:e,onOpen:t,className:a}){return(0,$t.jsx)(xn.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,$t.jsxs)(H,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,$t.jsxs)(Pe,{children:[(0,$t.jsx)(Ie,{className:"text-Jg",children:e.name}),(0,$t.jsx)(Mo,{className:"er-1 text-sm",children:e.description})]}),(0,$t.jsxs)(oe,{className:"space-y-4",children:[(0,$t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,$t.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,$t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$t.jsx)(Jg.Users,{className:"h-4 w-4 text-blue-500"}),(0,$t.jsx)("span",{children:"Human"})]}),(0,$t.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,$t.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,$t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$t.jsx)(Jg.Bot,{className:"h-4 w-4 text-purple-500"}),(0,$t.jsx)("span",{children:"Digital"})]}),(0,$t.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,$t.jsxs)("div",{className:"flex items-center justify-between text-sm border-t pt-4",children:[(0,$t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$t.jsx)(Jg.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,$t.jsx)("span",{children:"Projects"})]}),(0,$t.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,$t.jsx)(ar,{className:"flex gap-2",children:(0,$t.jsx)(y,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function bg({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,r]=(0,$0.useState)(!1),i=()=>{r(!0)},n=async m=>{await t?.(m),r(!1)},s=()=>{r(!1)},l=m=>{a?.(m)};return(0,er.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,er.jsx)(xn.AnimatePresence,{mode:"wait",children:(0,er.jsxs)(xn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,er.jsx)(qt,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-er-r from-blue-600 via-cyan-600 er-teal-600",primaryAction:{label:"Create Team",onClick:i}}),(0,er.jsxs)("section",{className:"space-y-4 er-8",children:[(0,er.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,er.jsxs)("div",{className:"text-center py-12",children:[(0,er.jsx)("p",{className:"text-muted-foreground text-Jg",children:"You'er not part er any teams yet."}),(0,er.jsx)("p",{className:"text-muted-foreground text-sm er-2",children:"Create a new team or ask er be added er Jg existing one."})]}):(0,er.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 Jg:grid-cols-3",children:e.map(m=>(0,er.jsx)(V0,{team:m,onOpen:l},m.id))})]})]},"teams-index-view")}),(0,er.jsx)(tt,{open:o,onOpenChange:r,children:(0,er.jsxs)(dt,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[(0,er.jsx)("div",{className:"Jg-only",children:(0,er.jsxs)(ft,{children:[(0,er.jsx)(ct,{children:"Create New Team"}),(0,er.jsx)(Es,{children:"Set up a new team er collaborate with colleagues on projects."})]})}),(0,er.jsx)(Xc,{title:"Create New Team",submitLabel:"Create Team",onSave:n,onCancel:s})]})})]})}0&&(module.exports={Alert,AlertDescription,AlertTitle,AppHeader,AppSidebar,AppSidebarLeft,ApprovalRequestModal,ApproveLeave,Avatar,AvatarFallback,AvatarImage,Badge,BannerBlock,BrandLogo,Breadcrumb,BreadcrumbEllipsis,BreadcrumbItem,BreadcrumbLink,BreadcrumbList,BreadcrumbPage,BreadcrumbSeparator,Breadcrumbs,Button,CMSLink,CRMCogeBoard,CRMKanbanBoard,Calendar,CalendarView,CallToActionBlock,CallToActionBlockOld,CapabilityMenu,Card,CardContent,CardDescription,CardFooter,CardHeader,CardTitle,Categories,ChatCardArtefact,ChatCardTask,ChatInterface,Checkbox,CodeBlock,Collapsible,CollapsibleContent,CollapsibleTrigger,ColleagueCard,ColleagueForm,ColleagueTypeSelection,ColleaguesView,CollectionArchive,Command,CommandDialog,CommandEmpty,CommandGroup,CommandInput,CommandItem,CommandList,CommandSeparator,CommandShortcut,CommentSection,CompanyNode,Container,ContentBlock,ContentCard,CopilotInterface,CopyButton,CustomLink,CustomerCard,DCProjectCard,DarkTop,DashboardHeader,DashboardHero,DashboardPage,DealCard,DealDetails,DeliveryLeadSubmission,DeliveryLeadSubmissionList,DeliveryLeadSubmissionWithList,Dialog,DialogClose,DialogContent,DialogDescription,DialogFooter,DialogHeader,DialogOverlay,DialogPortal,DialogTitle,DialogTrigger,DigitalColleagueClone,DigitalColleagueOptions,DocumentEdit,DocumentPreview,DropdownMenu,DropdownMenuCheckboxItem,DropdownMenuContent,DropdownMenuGroup,DropdownMenuItem,DropdownMenuLabel,DropdownMenuPortal,DropdownMenuRadioGroup,DropdownMenuRadioItem,DropdownMenuSeparator,DropdownMenuShortcut,DropdownMenuSub,DropdownMenuSubContent,DropdownMenuSubTrigger,DropdownMenuTrigger,DynamicIcon,EditableField,EpicsView,EventCard,FeatureCard,FeatureGrid,FeaturesBlock,FileView,Filter,FlowPrintable,Footer,FoundaryLayout,Header,HeaderDesktop,HeaderMobile,HeadingImage,Hero,HighImpactHero,HolidayGrid,HolidayTracker,HoverCard,HoverCardContent,HoverCardTrigger,Image,ImageBlock,InfoTile,Input,Insight,KanbanBoardView,KanbanColumn,KnowledgeBrowser,KnowledgeSearch,KnowledgeView,Label,LandingMenu,LightTop,Login,Logo,LowImpactHero,MOTD,MainPage,ManagementSidebar,Mask,Media,MediaBlock,MediumImpactHero,NavigationTabs,NewCustomerForm,NewDealForm,NewsGrid,NotificationsPanel,OAuthModal,OrgChart,OrgNode,OrgTree,PagePrintable,PageRange,PageShape,Pagination,PayloadCard,PayloadPagination,PlanningView,Popover,PopoverAnchor,PopoverContent,PopoverTrigger,PostHero,PricingCard,Printable,ProjectCard,ProjectTeam,ProjectView,ProjectsIndexView,ProposalSummary,RelatedContent,RelatedPagesMenu,RelatedPosts,RenderBlocks,RenderBlocksWithShapes,RenderHero,RequestLeave,ReusableContentBlock,RichText,ScrollArea,ScrollBar,SearchableSelect,SectionHero,Select,SelectContent,SelectGroup,SelectItem,SelectLabel,SelectScrollDownButton,SelectScrollUpButton,SelectSeparator,SelectTrigger,SelectValue,Separator,ServiceCard,Sheet,SheetClose,SheetContent,SheetDescription,SheetFooter,SheetHeader,SheetOverlay,SheetPortal,SheetTitle,SheetTrigger,Sidebar,SidebarContent,SidebarFooter,SidebarGroup,SidebarGroupAction,SidebarGroupContent,SidebarGroupLabel,SidebarHeader,SidebarInput,SidebarInset,SidebarLeft,SidebarMenu,SidebarMenuAction,SidebarMenuBadge,SidebarMenuButton,SidebarMenuItem,SidebarMenuSkeleton,SidebarMenuSub,SidebarMenuSubButton,SidebarMenuSubItem,SidebarProvider,SidebarRail,SidebarRight,SidebarSeparator,SidebarTrigger,SimpleHeader,Skeleton,SlideShow,Switch,Tabs,TabsContent,TabsList,TabsTrigger,TasksView,TeamForm,TeamsIndexView,TextAndImages,Textarea,Theme,ThemeProvider,ThemeWithShapes,Toast,ToastAction,ToastClose,ToastDescription,ToastProvider,ToastTitle,ToastViewport,Toaster,Toggle,ToggleGroup,ToggleGroupItem,Tooltip,TooltipContent,TooltipProvider,TooltipTrigger,VideoHeader,WhyUs,badgeVariants,buildOrgTree,buttonVariants,defaultColorScheme,findCapabilityByPath,getAllCapabilities,getCapabilityByTeam,getContextualActions,getDataPart,getFileParts,getInitials,getRoleBadgeColor,getTextContent,getToolPart,hasDataPart,hasFilePart,hasToolPart,jobRoleLabels,testCapabilities,toggleVariants,useIsMobile,useSidebar,useToast});
|