cortex-react-components 2.29.0-beta.2 → 2.29.0-beta.4
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-KGFSSFVZ.mjs → chunk-2W5UZALU.mjs} +1 -1
- package/dist/{chunk-7YSJAVXO.mjs → chunk-3DXSTAQP.mjs} +1 -1
- package/dist/{chunk-ZKTIH47I.mjs → chunk-4745QCXP.mjs} +1 -1
- package/dist/{chunk-BXHRPSV4.mjs → chunk-6MFAWZRQ.mjs} +1 -1
- package/dist/{chunk-CTQADMXV.mjs → chunk-76U5MXTI.mjs} +1 -1
- package/dist/{chunk-7HIL4GBK.mjs → chunk-7GWTDITT.mjs} +1 -1
- package/dist/{chunk-5G7LCLOY.mjs → chunk-CMEGGDTF.mjs} +1 -1
- package/dist/{chunk-GFYO6B7H.mjs → chunk-CTDGP5H4.mjs} +1 -1
- package/dist/{chunk-JGKLAY6J.mjs → chunk-DP6Q6ZTN.mjs} +1 -1
- package/dist/{chunk-CLMGLIGH.mjs → chunk-DZDMH6IZ.mjs} +1 -1
- package/dist/{chunk-K7NFBXL3.mjs → chunk-FJ4JWNKL.mjs} +1 -1
- package/dist/{chunk-UXSJRXJQ.mjs → chunk-G4S2QIU4.mjs} +1 -1
- package/dist/{chunk-ZW24FGHA.mjs → chunk-HDLKX5L3.mjs} +1 -1
- package/dist/chunk-IP5TOSWC.mjs +4 -0
- package/dist/{chunk-TBKC2B4Z.mjs → chunk-JMJUFHDA.mjs} +1 -1
- package/dist/{chunk-LL7CRB4U.mjs → chunk-KZXYV2BA.mjs} +1 -1
- package/dist/{chunk-S4CCJK44.mjs → chunk-MIM3VFET.mjs} +1 -1
- package/dist/{chunk-LMDGHBG2.mjs → chunk-NBWQTY4K.mjs} +1 -1
- package/dist/{chunk-YZDNY3K4.mjs → chunk-NK3XCHIN.mjs} +1 -1
- package/dist/{chunk-FOO5RONL.mjs → chunk-OK7X567A.mjs} +1 -1
- package/dist/{chunk-AGKZDANI.mjs → chunk-P5Q2KBKF.mjs} +1 -1
- package/dist/{chunk-LHO4WFYP.mjs → chunk-QLKS32RD.mjs} +1 -1
- package/dist/{chunk-W7QAGMX7.mjs → chunk-QPGVTPZ4.mjs} +1 -1
- package/dist/{chunk-LPCO4T25.mjs → chunk-RK5JHVD4.mjs} +1 -1
- package/dist/{chunk-VKUF2Y5T.mjs → chunk-TEJHZXUT.mjs} +1 -1
- package/dist/{chunk-DLX4NQ3T.mjs → chunk-V7PGZR23.mjs} +1 -1
- package/dist/{chunk-6A2O63AU.mjs → chunk-ZPJJOZY4.mjs} +1 -1
- package/dist/components/Chat/ChatInterface.mjs +1 -1
- package/dist/components/Chat/CopilotInterface.mjs +1 -1
- package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
- package/dist/components/Chat/PartTypes/index.mjs +1 -1
- package/dist/components/Chat/demo-long-messages.mjs +1 -1
- package/dist/components/Chat/demo-tests.mjs +1 -1
- package/dist/components/Chat/demo.mjs +1 -1
- package/dist/components/Chat/example-usage.mjs +1 -1
- package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
- package/dist/components/Chat/index.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
- package/dist/components/DigitalColleagues/index.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/MainPage.mjs +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
- package/dist/components/Foundary/RichText/index.mjs +1 -1
- package/dist/components/Foundary/RichText/plugins/toolbar-plugin.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/index.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/index.mjs +1 -1
- package/dist/components/Foundary/knowledge-browser.mjs +1 -1
- package/dist/components/HeaderFooter/Header.mjs +1 -1
- package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
- package/dist/components/HeaderFooter/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/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/SidebarLeft.js +1 -1
- package/dist/components/Menus/SidebarLeft.mjs +1 -1
- package/dist/components/Menus/SidebarLeftMulti.css +1 -0
- package/dist/components/Menus/SidebarLeftMulti.d.ts +42 -0
- package/dist/components/Menus/SidebarLeftMulti.js +4 -0
- package/dist/components/Menus/SidebarLeftMulti.mjs +2 -0
- package/dist/components/Menus/index.d.ts +1 -0
- package/dist/components/Menus/index.js +1 -1
- package/dist/components/Menus/index.mjs +1 -1
- package/dist/components/Other/index.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/Projects/FileView.mjs +1 -1
- package/dist/components/Projects/KanbanBoardView.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/TaskDetailsModal.mjs +1 -1
- package/dist/components/Projects/file-list.mjs +1 -1
- package/dist/components/Projects/index.mjs +1 -1
- package/dist/components/dc-temp/index.mjs +1 -1
- package/dist/components/index.js +22 -22
- package/dist/components/index.mjs +1 -1
- package/dist/components/ui/carousel.d.ts +1 -1
- package/dist/components/ui/carousel.js +1 -1
- package/dist/components/ui/carousel.mjs +1 -1
- package/dist/components/ui/index.js +1 -1
- package/dist/components/ui/index.mjs +1 -1
- package/dist/decorators/Intranet.css +1 -1
- package/dist/decorators/Intranet.mjs +1 -1
- package/dist/globals.css +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.js +37 -37
- 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.js +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/IndexPage.js +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/Intranet.js +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/PageSections.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -5,45 +5,45 @@
|
|
|
5
5
|
'use client';
|
|
6
6
|
"use client";
|
|
7
7
|
|
|
8
|
-
"use strict";var vy=Object.create;var nd=Object.defineProperty;var by=Object.getOwnPropertyDescriptor;var hy=Object.getOwnPropertyNames;var yy=Object.getPrototypeOf,xy=Object.prototype.hasOwnProperty;var Ny=(e,t)=>{for(var a in t)nd(e,a,{get:t[a],enumerable:!0})},Sg=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r Kg hy(t))!xy.call(e,r)&&r!==a&&nd(e,r,{get:()=>t[r],enumerable:!(o=by(t,r))||o.enumerable});return e};var z=(e,t,a)=>(a=e!=null?vy(yy(e)):{},Sg(t||!e||!e.__esModule?nd(a,"default",{value:e,enumerable:!0}):a,e)),wy=e=>Sg(nd({},"__esModule",{value:!0}),e);var nC={};Ny(nC,{Alert:()=>ip,AlertDescription:()=>lp,AlertTitle:()=>np,AppHeader:()=>Ol,AppSidebar:()=>Yi,AppSidebarLeft:()=>Uc,ApprovalRequestModal:()=>yu,ApproveLeave:()=>tu,Autoplay:()=>Ff.default,Avatar:()=>da,AvatarFallback:()=>ca,AvatarImage:()=>vo,Badge:()=>ie,BannerBlock:()=>fp,BrandLogo:()=>ii,Breadcrumb:()=>Zn,BreadcrumbEllipsis:()=>Dm,BreadcrumbItem:()=>cn,BreadcrumbLink:()=>tl,BreadcrumbList:()=>el,BreadcrumbPage:()=>al,BreadcrumbSeparator:()=>ol,Breadcrumbs:()=>CN,Button:()=>y,CMSLink:()=>kr,CRMCogeBoard:()=>ON,CRMKanbanBoard:()=>EN,Calendar:()=>ti,CalendarView:()=>iu,CallToActionBlock:()=>ji,CallToActionBlockOld:()=>Rx,CapabilityMenu:()=>nw,Card:()=>O,CardContent:()=>oe,CardDescription:()=>Bo,CardFooter:()=>rr,CardHeader:()=>Pe,CardTitle:()=>Ie,Carousel:()=>yx,CarouselContent:()=>xx,CarouselItem:()=>Nx,CarouselNext:()=>Cx,CarouselPrevious:()=>wx,Categories:()=>gN,ChatCardArtefact:()=>mu,ChatCardTask:()=>du,ChatInterface:()=>Ac,Checkbox:()=>Wa,CodeBlock:()=>yp,Collapsible:()=>Ha,CollapsibleContent:()=>Ga,CollapsibleTrigger:()=>Ya,ColleagueCard:()=>En,ColleagueForm:()=>jl,ColleagueTypeSelection:()=>Xc,ColleaguesView:()=>ed,CollectionArchive:()=>Zx,Command:()=>Cd,CommandDialog:()=>wf,CommandEmpty:()=>tp,CommandGroup:()=>ap,CommandInput:()=>Zm,CommandItem:()=>rp,CommandList:()=>ep,CommandSeparator:()=>op,CommandShortcut:()=>sp,CommentSection:()=>Iu,CompanyNode:()=>Hc,Container:()=>_p,ContentBlock:()=>kl,ContentCard:()=>jx,CopilotInterface:()=>iw,CopyButton:()=>bp,CustomLink:()=>sr,CustomerCard:()=>av,DCProjectCard:()=>Kn,DarkTop:()=>Tp,DashboardHeader:()=>xh,DashboardHero:()=>qt,DashboardPage:()=>dg,DealCard:()=>nu,DealDetails:()=>El,DeliveryLeadSubmission:()=>Mc,DeliveryLeadSubmissionList:()=>Lc,DeliveryLeadSubmissionWithList:()=>uh,Dialog:()=>tt,DialogClose:()=>wd,DialogContent:()=>dt,DialogDescription:()=>zi,DialogFooter:()=>Fi,DialogHeader:()=>ft,DialogOverlay:()=>Qs,DialogPortal:()=>Ei,DialogTitle:()=>ct,DialogTrigger:()=>xf,DigitalColleagueClone:()=>qc,DigitalColleagueOptions:()=>Jc,DocumentEdit:()=>dm,DocumentPreview:()=>cm,DropdownMenu:()=>Po,DropdownMenuCheckboxItem:()=>Rm,DropdownMenuContent:()=>co,DropdownMenuGroup:()=>Eg,DropdownMenuItem:()=>Ba,DropdownMenuLabel:()=>rl,DropdownMenuPortal:()=>Fg,DropdownMenuRadioGroup:()=>Og,DropdownMenuRadioItem:()=>Am,DropdownMenuSeparator:()=>sl,DropdownMenuShortcut:()=>Im,DropdownMenuSub:()=>zg,DropdownMenuSubContent:()=>Pm,DropdownMenuSubTrigger:()=>Tm,DropdownMenuTrigger:()=>Ro,DynamicIcon:()=>Qa,EditableField:()=>Bs,EpicsView:()=>mg,EventCard:()=>ov,FeatureCard:()=>Ud,FeatureGrid:()=>pv,FeaturesBlock:()=>Vi,FileView:()=>od,Filter:()=>fN,FlowPrintable:()=>Lv,Footer:()=>RN,FoundaryLayout:()=>$c,Header:()=>eu,HeaderDesktop:()=>qp,HeaderMobile:()=>Yp,HeadingImage:()=>Xx,Hero:()=>Hx,HighImpactHero:()=>Up,HolidayGrid:()=>su,HolidayTracker:()=>BN,HoverCard:()=>vf,HoverCardContent:()=>Qm,HoverCardTrigger:()=>bf,Image:()=>lv,ImageBlock:()=>kp,InfoTile:()=>$x,Input:()=>_,Insight:()=>Vx,KanbanBoardView:()=>cg,KanbanColumn:()=>Fl,KnowledgeBrowser:()=>mm,KnowledgeSearch:()=>Wc,KnowledgeView:()=>td,Label:()=>I,LandingMenu:()=>Dh,LightTop:()=>Pp,Login:()=>Sh,Logo:()=>Dl,LowImpactHero:()=>Kp,MOTD:()=>_x,MainPage:()=>Hu,ManagementSidebar:()=>Rh,Mask:()=>xN,Media:()=>Ns,MediaBlock:()=>ws,MediumImpactHero:()=>$p,NavigationTabs:()=>Qi,NewCustomerForm:()=>lu,NewDealForm:()=>FN,NewsGrid:()=>Mv,NotificationsPanel:()=>uu,OAuthModal:()=>bu,OrgChart:()=>bh,OrgNode:()=>Oc,OrgTree:()=>jc,PagePrintable:()=>Ev,PageRange:()=>aN,PageShape:()=>Al,Pagination:()=>uN,PayloadCard:()=>Sl,PayloadPagination:()=>oN,PlanningView:()=>bm,Popover:()=>Js,PopoverAnchor:()=>mf,PopoverContent:()=>hs,PopoverTrigger:()=>Ys,PostHero:()=>hN,PricingCard:()=>Ox,Printable:()=>iN,ProjectCard:()=>nv,ProjectTeam:()=>mN,ProjectView:()=>bg,ProjectsIndexView:()=>xg,ProposalSummary:()=>Gx,RelatedContent:()=>pN,RelatedPagesMenu:()=>AN,RelatedPosts:()=>Qx,RenderBlocks:()=>si,RenderBlocksWithShapes:()=>Jx,RenderHero:()=>wN,RequestLeave:()=>ru,ReusableContentBlock:()=>Dp,RichText:()=>Ot,ScrollArea:()=>sa,ScrollBar:()=>Nd,SearchableSelect:()=>Gc,SectionHero:()=>Wp,Select:()=>at,SelectContent:()=>Ye,SelectGroup:()=>bx,SelectItem:()=>be,SelectLabel:()=>Pf,SelectScrollDownButton:()=>mp,SelectScrollUpButton:()=>cp,SelectSeparator:()=>Rf,SelectTrigger:()=>Je,SelectValue:()=>pt,Separator:()=>Pi,ServiceCard:()=>zx,Sheet:()=>cd,SheetClose:()=>Gg,SheetContent:()=>nl,SheetDescription:()=>zm,SheetFooter:()=>Em,SheetHeader:()=>Lm,SheetOverlay:()=>md,SheetPortal:()=>Bm,SheetTitle:()=>Fm,SheetTrigger:()=>_g,Sidebar:()=>ms,SidebarContent:()=>wr,SidebarFooter:()=>us,SidebarGroup:()=>po,SidebarGroupAction:()=>Um,SidebarGroupContent:()=>_o,SidebarGroupLabel:()=>gs,SidebarHeader:()=>ps,SidebarInput:()=>jm,SidebarInset:()=>cl,SidebarLeft:()=>nN,SidebarMenu:()=>ja,SidebarMenuAction:()=>Ri,SidebarMenuBadge:()=>Vm,SidebarMenuButton:()=>uo,SidebarMenuItem:()=>ba,SidebarMenuSkeleton:()=>$m,SidebarMenuSub:()=>Ur,SidebarMenuSubButton:()=>$r,SidebarMenuSubItem:()=>Vr,SidebarProvider:()=>ll,SidebarRail:()=>Hm,SidebarRight:()=>cN,SidebarSeparator:()=>ml,SidebarTrigger:()=>dl,SimpleHeader:()=>SN,Skeleton:()=>gt,SlideShow:()=>Rv,Switch:()=>yw,Tabs:()=>pp,TabsContent:()=>hx,TabsList:()=>up,TabsTrigger:()=>gp,TasksView:()=>vg,TeamForm:()=>Qc,TeamsIndexView:()=>Ng,TextAndImages:()=>Bv,Textarea:()=>We,Theme:()=>Wd,ThemeProvider:()=>yN,ThemeWithShapes:()=>hv,Toast:()=>gl,ToastAction:()=>Gm,ToastClose:()=>fl,ToastDescription:()=>bl,ToastProvider:()=>hd,ToastTitle:()=>vl,ToastViewport:()=>ul,Toaster:()=>yd,Toggle:()=>Xm,ToggleGroup:()=>vs,ToggleGroupItem:()=>bs,Tooltip:()=>Io,TooltipContent:()=>mo,TooltipProvider:()=>Ao,TooltipTrigger:()=>Mo,VideoHeader:()=>TN,WhyUs:()=>Wx,badgeVariants:()=>dp,buildOrgTree:()=>Bu,buttonVariants:()=>Ws,defaultColorScheme:()=>cu,findCapabilityByPath:()=>UN,getAllCapabilities:()=>$N,getCapabilityByTeam:()=>VN,getContextualActions:()=>vc,getDataPart:()=>bw,getFileParts:()=>fw,getInitials:()=>Lu,getRoleBadgeColor:()=>Eu,getTextContent:()=>mw,getToolPart:()=>uw,hasDataPart:()=>vw,hasFilePart:()=>gw,hasToolPart:()=>pw,jobRoleLabels:()=>Fu,testCapabilities:()=>fc,toggleVariants:()=>hl,useIsMobile:()=>ud,useSidebar:()=>gn,useToast:()=>bd});module.exports=wy(nC);var dn=z(require("react")),dd=require("@radix-ef/react-icons"),Lg=require("@radix-ef/react-slot");var Bg=require("clsx");var km="-",Cy=e=>{let t=Sy(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{let n=i.split(km);return n[0]===""&&n.length!==1&&n.shift(),Pg(n,t)||ky(i)},getConflictingClassGroupIds:(i,n)=>{let l=a[i]||[];return n&&o[i]?[...l,...o[i]]:l}}},Pg=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),r=o?Pg(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;let s=e.join(km);return t.validators.find(({validator:i})=>i(s))?.classGroupId},Dg=/^\[(.+)\]$/,ky=e=>{if(Dg.test(e)){let t=Dg.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Sy=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Ty(Object.entries(e.classGroups),a).forEach(([s,i])=>{Cm(i,o,s,t)}),o},Cm=(e,t,a,o)=>{e.forEach(r=>{if(typeof r=="string"){let s=r===""?t:Tg(t,r);s.classGroupId=a;return}if(typeof r=="function"){if(Dy(r)){Cm(r(o),t,a,o);return}t.validators.push({validator:r,classGroupId:a});return}Object.entries(r).forEach(([s,i])=>{Cm(i,Tg(t,s),a,o)})})},Tg=(e,t)=>{let a=e;return t.split(km).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Dy=e=>e.isThemeGetter,Ty=(e,t)=>t?e.map(([a,o])=>{let r=o.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,n])=>[t+i,n])):s);return[a,r]}):e,Py=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,r=(s,i)=>{a.set(s,i),t++,t>e&&(t=0,o=a,a=new Map)};return{get(s){let i=a.get(s);if(i!==void 0)return i;if((i=o.get(s))!==void 0)return r(s,i),i},set(s,i){a.has(s)?a.set(s,i):r(s,i)}}},Rg="!",Ry=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,r=t[0],s=t.length,i=n=>{let l=[],m=0,d=0,c;for(let g=0;g<n.length;g++){let x=n[g];if(m===0){if(x===r&&(o||n.slice(g,g+s)===t)){l.push(n.slice(d,g)),d=g+s;continue}if(x==="/"){c=g;continue}}x==="["?m++:x==="]"&&m--}let u=l.length===0?n:n.substring(d),v=u.startsWith(Rg),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?n=>a({className:n,parseClassName:i}):i},Ay=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},Iy=e=>({cache:Py(e.cacheSize),parseClassName:Ry(e),...Cy(e)}),My=/\s+/,By=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:r}=t,s=[],i=e.trim().split(My),n="";for(let l=i.length-1;l>=0;l-=1){let m=i[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){n=m+(n.length>0?" "+n:n);continue}if(f=o(u),!f){n=m+(n.length>0?" "+n:n);continue}b=!1}let g=Ay(d).join(":"),x=c?g+Rg:g,S=x+f;if(s.includes(S))continue;s.push(S);let h=r(f,b);for(let w=0;w<h.length;++w){let D=h[w];s.push(x+D)}n=m+(n.length>0?" "+n:n)}return n};function Ly(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Ag(t))&&(o&&(o+=" "),o+=a);return o}var Ag=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Ag(e[o]))&&(a&&(a+=" "),a+=t);return a};function Ey(e,...t){let a,o,r,s=i;function i(l){let m=t.reduce((d,c)=>c(d),e());return a=Iy(m),o=a.cache.get,r=a.cache.set,s=n,n(l)}function n(l){let m=o(l);if(m)return m;let d=By(l,a);return r(l,d),d}return function(){return s(Ly.apply(null,arguments))}}var Kt=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Ig=/^\[(?:([a-z-]+):)?(.+)\]$/i,Fy=/^\d+\/\d+$/,zy=new Set(["px","full","screen"]),Oy=/^(\d+(\.\d+)?)?(ar|sm|md|pd|xl)$/,Hy=/\d+(%|px|r?tm|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?ef|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jy=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Uy=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vy=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ds=e=>nn(e)||zy.has(e)||Fy.test(e),_s=e=>ln(e,"length",Jy),nn=e=>!!e&&!Number.isNaN(Number(e)),wm=e=>ln(e,"number",nn),Yn=e=>!!e&&Number.isInteger(Number(e)),$y=e=>e.endsWith("%")&&nn(e.slice(0,-1)),_e=e=>Ig.test(e),Gs=e=>Oy.test(e),Ky=new Set(["length","size","percentage"]),_y=e=>ln(e,Ky,Mg),Gy=e=>ln(e,"position",Mg),Wy=new Set(["image","url"]),Xy=e=>ln(e,Wy,Qy),qy=e=>ln(e,"",Yy),Qn=()=>!0,ln=(e,t,a)=>{let o=Ig.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},Jy=e=>Hy.test(e)&&!jy.test(e),Mg=()=>!1,Yy=e=>Uy.test(e),Qy=e=>Vy.test(e);var Zy=()=>{let e=Kt("colors"),t=Kt("spacing"),a=Kt("blur"),o=Kt("brightness"),r=Kt("borderColor"),s=Kt("borderRadius"),i=Kt("borderSpacing"),n=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=()=>["",ds,_s],ue=()=>["auto",nn,_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=()=>[nn,_e];return{cacheSize:500,separator:":",theme:{colors:[Qn],spacing:[ds,_s],blur:["none","",Gs,_e],brightness:T(),borderColor:[e],borderRadius:["none","","full",Gs,_e],borderSpacing:C(),borderWidth:Z(),contrast:T(),grayscale:B(),hueRotate:T(),invert:B(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[$y,_s],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:[Gs]}],"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",Yn,_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",Yn,_e]}],"grid-cols":[{"grid-cols":[Qn]}],"col-start-end":[{col:["auto",{span:["full",Yn,_e]},_e]}],"col-start":[{"col-start":ue()}],"col-end":[{"col-end":ue()}],"grid-rows":[{"grid-rows":[Qn]}],"row-start-end":[{row:["auto",{span:[Yn,_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","ar",_e]}],"auto-rows":[{"auto-rows":["auto","min","max","ar",_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]}],ar:[{ar:[S]}],pt:[{pt:[S]}],ar:[{ar:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],ar:[{ar:[g]}],ar:[{ar:[g]}],ar:[{ar:[g]}],yv:[{yv:[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:[Gs]},Gs]}],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",Gs,_s]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",wm]}],"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",_e]}],"line-clamp":[{"line-clamp":["none",nn,wm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ds,_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",ds,_s]}],"underline-offset":[{"underline-offset":["auto",ds,_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(),Gy]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",_y]}],"bg-image":[{bg:["none",{"gradient-ar":["t","tr","r","ef","b","bl","l","tl"]},Xy]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-ar-pos":[{ar:[b]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-ar":[{ar:[v]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-pd":[{"rounded-pd":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ar":[{"rounded-ar":[s]}],"rounded-ar":[{"rounded-ar":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-ef":[{"rounded-ef":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[n]}],"border-w-x":[{"border-x":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-r":[{"border-r":[n]}],"border-w-b":[{"border-b":[n]}],"border-w-l":[{"border-l":[n]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...X(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide: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":[ds,_e]}],"outline-w":[{outline:[ds,_s]}],"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":[ds,_s]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Gs,qy]}],"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",Gs,_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":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",_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:[Yn,_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","ns-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-ms":[{"scroll-ms":C()}],"scroll-ar":[{"scroll-ar":C()}],"scroll-ar":[{"scroll-ar":C()}],"scroll-ar":[{"scroll-ar":C()}],"scroll-yv":[{"scroll-yv":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-ar":[{"scroll-ar":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-ar":[{"scroll-ar":C()}],"scroll-pb":[{"scroll-pb":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:[ds,_s,wm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","ar","pt","ar","pb","pl"],px:["ar","pl"],py:["pt","pb"],m:["mx","my","ms","ar","ar","ar","yv","ml"],mx:["ar","ml"],my:["ar","yv"],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-pd","rounded-se","rounded-ar","rounded-ar","rounded-tl","rounded-tr","rounded-ef","rounded-bl"],"rounded-s":["rounded-pd","rounded-ar"],"rounded-e":["rounded-se","rounded-ar"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-ef"],"rounded-b":["rounded-ef","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-ar","scroll-ar","scroll-ar","scroll-yv","scroll-ml"],"scroll-mx":["scroll-ar","scroll-ml"],"scroll-my":["scroll-ar","scroll-yv"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-ar","scroll-pt","scroll-ar","scroll-pb","scroll-pl"],"scroll-px":["scroll-ar","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var ld=Ey(Zy);function p(...e){return ld((0,Bg.clsx)(e))}function Sm(e){let t=0,a=(s,i)=>`${s.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"")}-${i}`,o=e.layout.flatMap(s=>{let i=[];return"title"in s&&s.title&&i.push({text:s.title,id:a(s.title,t++),tag:"h2"}),"columns"in s&&Array.isArray(s.columns)&&s.columns.forEach(n=>{if(n.title&&i.push({text:n.title,id:a(n.title,t++),tag:"h2"}),n.richText?.root?.children&&n.richText?.root?.children.length===1){let l=n.richText.root.children.filter(m=>m!==void 0&&m.type==="heading");for(let m Kg l)m.children[0]&&i.push({text:m.children[0].text??"",id:a(m.children[0].text,t++),tag:m.tag||"h2"})}}),i}),r=ex(e.layout);return{tableOfContents:o,contentWithIds:r}}function ex(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(s=>s!==void 0).map(s=>(s.type==="heading"&&s.children&&s.children[0].text?s.id=t(s.children[0].text,a++):s.type==="block"&&s.fields?.media&&(s.id=t(`image-${a}`,a++)),s))),r))),o))}var jr=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 ar=require("react/jsx-runtime"),Zn=dn.forwardRef(({...e},t)=>(0,ar.jsx)("nav",{ref:t,"aria-label":"breadcrumb",...e}));Zn.displayName="Breadcrumb";var el=dn.forwardRef(({className:e,...t},a)=>(0,ar.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}));el.displayName="BreadcrumbList";var cn=dn.forwardRef(({className:e,...t},a)=>(0,ar.jsx)("li",{ref:a,className:p("inline-flex items-center gap-1.5",e),...t}));cn.displayName="BreadcrumbItem";var tl=dn.forwardRef(({asChild:e,className:t,...a},o)=>(0,ar.jsx)(e?Lg.Slot:"a",{ref:o,className:p("transition-colors hover:text-foreground",t),...a}));tl.displayName="BreadcrumbLink";var al=dn.forwardRef(({className:e,...t},a)=>(0,ar.jsx)("span",{ref:a,role:"link","aria-disabled":"true","aria-current":"page",className:p("font-normal text-foreground",e),...t}));al.displayName="BreadcrumbPage";var ol=({children:e,className:t,...a})=>(0,ar.jsx)("li",{role:"presentation","aria-hidden":"true",className:p("[&>svg]:w-3.5 [&>svg]:h-3.5",t),...a,children:e??(0,ar.jsx)(dd.ChevronRightIcon,{})});ol.displayName="BreadcrumbSeparator";var Dm=({className:e,...t})=>(0,ar.jsxs)("span",{role:"presentation","aria-hidden":"true",className:p("flex h-9 w-9 items-center justify-center",e),...t,children:[(0,ar.jsx)(dd.DotsHorizontalIcon,{className:"h-4 w-4"}),(0,ar.jsx)("span",{className:"sr-only",children:"More"})]});Dm.displayName="BreadcrumbElipssis";var mn=z(require("@radix-ef/react-collapsible")),Ha=mn.Root,Ya=mn.CollapsibleTrigger,Ga=mn.CollapsibleContent;var cs=z(require("react")),qe=z(require("@radix-ef/react-dropdown-menu"));var Po=qe.Root,Ro=qe.Trigger,Eg=qe.Group,Fg=qe.Portal,zg=qe.Sub,Og=qe.RadioGroup,Tm=cs.forwardRef(({className:e,inset:t,children:a,...o},r)=>(0,ar.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,ar.jsx)(dd.ChevronRightIcon,{className:"ml-auto"})]}));Tm.displayName=qe.SubTrigger.displayName;var Pm=cs.forwardRef(({className:e,...t},a)=>(0,ar.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-pd 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}));Pm.displayName=qe.SubContent.displayName;var co=cs.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,ar.jsx)(qe.Portal,{children:(0,ar.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=cs.forwardRef(({className:e,inset:t,...a},o)=>(0,ar.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 Rm=cs.forwardRef(({className:e,children:t,checked:a,...o},r)=>(0,ar.jsxs)(qe.CheckboxItem,{ref:r,className:p("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 ar-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,ar.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,ar.jsx)(qe.ItemIndicator,{children:(0,ar.jsx)(dd.CheckIcon,{className:"h-4 w-4"})})}),t]}));Rm.displayName=qe.CheckboxItem.displayName;var Am=cs.forwardRef(({className:e,children:t,...a},o)=>(0,ar.jsxs)(qe.RadioItem,{ref:o,className:p("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 ar-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,ar.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,ar.jsx)(qe.ItemIndicator,{children:(0,ar.jsx)(dd.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Am.displayName=qe.RadioItem.displayName;var rl=cs.forwardRef(({className:e,inset:t,...a},o)=>(0,ar.jsx)(qe.Label,{ref:o,className:p("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));rl.displayName=qe.Label.displayName;var sl=cs.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(qe.Separator,{ref:a,className:p("-mx-1 my-1 h-px bg-muted",e),...t}));sl.displayName=qe.Separator.displayName;var Im=({className:e,...t})=>(0,ar.jsx)("span",{className:p("ml-auto text-ar tracking-widest opacity-60",e),...t});Im.displayName="DropdownMenuShortcut";var Hg=z(require("react"));var _=Hg.forwardRef(({className:e,type:t,...a},o)=>(0,ar.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 Ug=z(require("react")),Mm=z(require("@radix-ef/react-separator"));var Pi=Ug.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},r)=>(0,ar.jsx)(Mm.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}));Pi.displayName=Mm.Root.displayName;var il=z(require("react")),na=z(require("@radix-ef/react-dialog")),Kg=require("class-variance-authority");var cd=na.Root,_g=na.Trigger,Gg=na.Close,Bm=na.Portal,md=il.forwardRef(({className:e,...t},a)=>(0,ar.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}));md.displayName=na.Overlay.displayName;var tx=(0,Kg.cva)("fixed z-50 gap-4 bg-background p-6 shadow-pd 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-ar-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-ar-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-ar-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-ar-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),nl=il.forwardRef(({side:e="right",className:t,children:a,...o},r)=>(0,ar.jsxs)(Bm,{children:[(0,ar.jsx)(md,{}),(0,ar.jsxs)(na.Content,{ref:r,className:p(tx({side:e}),t),...o,children:[(0,ar.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,ar.jsx)($g.Cross2Icon,{className:"h-4 w-4"}),(0,ar.jsx)("span",{className:"sr-only",children:"Close"})]}),a]})]}));nl.displayName=na.Content.displayName;var Lm=({className:e,...t})=>(0,ar.jsx)("div",{className:p("flex flex-col space-y-2 text-center sm:text-left",e),...t});Lm.displayName="SheetHeader";var Em=({className:e,...t})=>(0,ar.jsx)("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Em.displayName="SheetFooter";var Fm=il.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(na.Title,{ref:a,className:p("text-pd font-semibold text-foreground",e),...t}));Fm.displayName=na.Title.displayName;var zm=il.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(na.Description,{ref:a,className:p("text-sm text-muted-foreground",e),...t}));zm.displayName=na.Description.displayName;var et=z(require("react")),ef=require("lucide-react");var pd=require("react"),ud=(e=768)=>{let[t,a]=(0,pd.useState)(!1);return(0,pd.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var qg=z(require("react")),Ws=(0,Kg.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",pd:"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=qg.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...r},s)=>(0,ar.jsx)(e?Lg.Slot:"button",{className:p(Ws({className:t,size:a,variant:o})),ref:s,...r}));y.displayName="Button";function gt({className:e,...t}){return(0,ar.jsx)("div",{className:p("animate-pulse rounded-md bg-primary/10",e),...t})}var Qg=z(require("react")),Nr=z(require("@radix-ef/react-tooltip"));var Ao=Nr.Provider,Io=Nr.Root,Mo=Nr.Trigger,mo=Qg.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,ar.jsx)(Nr.Portal,{children:(0,ar.jsx)(Nr.Content,{ref:o,sideOffset:t,className:p("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-ar 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=Nr.Content.displayName;var ax="sidebar:state",ox=60*60*24*7,rx="16rem",sx="18rem",ix="3rem",nx="b",tf=et.createContext(null);function gn(){let e=et.useContext(tf);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}var ll=et.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:r,children:s,...i},n)=>{let l=ud(),[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=`${ax}=${v}; path=/; max-age=${ox}`},[a,v]),f=et.useCallback(()=>l?d(S=>!S):b(S=>!S),[l,b,d]);et.useEffect(()=>{let S=h=>{h.key===nx&&(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,ar.jsx)(tf.Provider,{value:x,children:(0,ar.jsx)(Ao,{delayDuration:0,children:(0,ar.jsx)("div",{style:{"--sidebar-width":rx,"--sidebar-width-icon":ix,...r},className:p("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:n,...i,children:s})})})});ll.displayName="SidebarProvider";var ms=et.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:r,...s},i)=>{let{isMobile:n,state:l,openMobile:m,setOpenMobile:d}=gn();return a==="none"?(0,ar.jsx)("div",{className:p("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:i,...s,children:r}):n?(0,ar.jsx)(cd,{open:m,onOpenChange:d,...s,children:(0,ar.jsx)(nl,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":sx},side:e,children:(0,ar.jsx)("div",{className:"flex h-full w-full flex-col",children:r})})}):(0,ar.jsxs)("div",{ref:i,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,ar.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,ar.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),...s,children:(0,ar.jsx)("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-pd group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:r})})]})});ms.displayName="Sidebar";var dl=et.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:r}=gn();return(0,ar.jsxs)(y,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:p("h-7 w-7",e),onClick:s=>{t?.(s),r()},...a,children:[(0,ar.jsx)(ef.PanelLeft,{}),(0,ar.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});dl.displayName="SidebarTrigger";var Hm=et.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=gn();return(0,ar.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})});Hm.displayName="SidebarRail";var cl=et.forwardRef(({className:e,...t},a)=>(0,ar.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}));cl.displayName="SidebarInset";var jm=et.forwardRef(({className:e,...t},a)=>(0,ar.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}));jm.displayName="SidebarInput";var ps=et.forwardRef(({className:e,...t},a)=>(0,ar.jsx)("div",{ref:a,"data-sidebar":"header",className:p("flex flex-col gap-2 p-2",e),...t}));ps.displayName="SidebarHeader";var us=et.forwardRef(({className:e,...t},a)=>(0,ar.jsx)("div",{ref:a,"data-sidebar":"footer",className:p("flex flex-col gap-2 p-2",e),...t}));us.displayName="SidebarFooter";var ml=et.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(Pi,{ref:a,"data-sidebar":"separator",className:p("mx-2 w-auto bg-sidebar-border",e),...t}));ml.displayName="SidebarSeparator";var wr=et.forwardRef(({className:e,...t},a)=>(0,ar.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}));wr.displayName="SidebarContent";var po=et.forwardRef(({className:e,...t},a)=>(0,ar.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 gs=et.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,ar.jsx)(t?Lg.Slot:"div",{ref:o,"data-sidebar":"group-label",className:p("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-ar 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]:-ar-8 group-data-[collapsible=icon]:opacity-0",e),...a}));gs.displayName="SidebarGroupLabel";var Um=et.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,ar.jsx)(t?Lg.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}));Um.displayName="SidebarGroupAction";var _o=et.forwardRef(({className:e,...t},a)=>(0,ar.jsx)("div",{ref:a,"data-sidebar":"group-content",className:p("w-full text-sm",e),...t}));_o.displayName="SidebarGroupContent";var ja=et.forwardRef(({className:e,...t},a)=>(0,ar.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,ar.jsx)("li",{ref:a,"data-sidebar":"menu-item",className:p("group/menu-item relative",e),...t}));ba.displayName="SidebarMenuItem";var lx=(0,Kg.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:ar-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-ar",pd:"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:s,...i},n)=>{let l=e?Lg.Slot:"button",{isMobile:m,state:d}=gn(),c=(0,ar.jsx)(l,{ref:n,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:p(lx({variant:a,size:o}),s),...i});return r?(typeof r=="string"&&(r={children:r}),(0,ar.jsxs)(Io,{children:[(0,ar.jsx)(Mo,{asChild:!0,children:c}),(0,ar.jsx)(mo,{side:"right",align:"center",hidden:d!=="collapsed"||m,...r})]})):c});uo.displayName="SidebarMenuButton";var Ri=et.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},r)=>(0,ar.jsx)(t?Lg.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=pd]/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}));Ri.displayName="SidebarMenuAction";var Vm=et.forwardRef(({className:e,...t},a)=>(0,ar.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-ar 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=pd]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));Vm.displayName="SidebarMenuBadge";var $m=et.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let r=et.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,ar.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,ar.jsx)(gt,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,ar.jsx)(gt,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})});$m.displayName="SidebarMenuSkeleton";var Ur=et.forwardRef(({className:e,...t},a)=>(0,ar.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}));Ur.displayName="SidebarMenuSub";var Vr=et.forwardRef(({...e},t)=>(0,ar.jsx)("li",{ref:t,...e}));Vr.displayName="SidebarMenuSubItem";var $r=et.forwardRef(({asChild:e=!1,size:t="md",isActive:a,className:o,...r},s)=>(0,ar.jsx)(e?Lg.Slot:"a",{ref:s,"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-ar",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...r}));$r.displayName="SidebarMenuSubButton";var vd=z(require("react")),dx=1,cx=1e6;var Km=0;function mx(){return Km=(Km+1)%Number.MAX_SAFE_INTEGER,Km.toString()}var _m=new Map,af=e=>{if(_m.has(e))return;let t=setTimeout(()=>{_m.delete(e),pl({type:"REMOVE_TOAST",toastId:e})},cx);_m.set(e,t)},px=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,dx)};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?af(a):e.toasts.forEach(o=>{af(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)}}},gd=[],fd={toasts:[]};function pl(e){fd=px(fd,e),gd.forEach(t=>{t(fd)})}function ux({...e}){let t=mx(),a=r=>pl({type:"UPDATE_TOAST",toast:{...r,id:t}}),o=()=>pl({type:"DISMISS_TOAST",toastId:t});return pl({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:r=>{r||o()}}}),{id:t,dismiss:o,update:a}}function bd(){let[e,t]=vd.useState(fd);return vd.useEffect(()=>(gd.push(t),()=>{let a=gd.indexOf(t);a>-1&&gd.splice(a,1)}),[e]),{...e,toast:ux,dismiss:a=>pl({type:"DISMISS_TOAST",toastId:a})}}var Ai=z(require("react")),ha=z(require("@radix-ef/react-toast"));var hd=ha.Provider,ul=Ai.forwardRef(({className:e,...t},a)=>(0,ar.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}));ul.displayName=ha.Viewport.displayName;var gx=(0,Kg.cva)("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 ar-6 shadow-pd 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-ar-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"}}),gl=Ai.forwardRef(({className:e,variant:t,...a},o)=>(0,ar.jsx)(ha.Root,{ref:o,className:p(gx({variant:t}),e),...a}));gl.displayName=ha.Root.displayName;var Gm=Ai.forwardRef(({className:e,...t},a)=>(0,ar.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}));Gm.displayName=ha.Action.displayName;var fl=Ai.forwardRef(({className:e,...t},a)=>(0,ar.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,ar.jsx)(ef.X,{className:"h-4 w-4"})}));fl.displayName=ha.Close.displayName;var vl=Ai.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(ha.Title,{ref:a,className:p("text-sm font-semibold [&+div]:text-ar",e),...t}));vl.displayName=ha.Title.displayName;var bl=Ai.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(ha.Description,{ref:a,className:p("text-sm opacity-90",e),...t}));bl.displayName=ha.Description.displayName;function yd(){let{toasts:e}=bd();return(0,ar.jsxs)(hd,{children:[e.map(function({id:t,title:a,description:o,action:r,...s}){return(0,ar.jsxs)(gl,{...s,children:[(0,ar.jsxs)("div",{className:"grid gap-1",children:[a&&(0,ar.jsx)(vl,{children:a}),o&&(0,ar.jsx)(bl,{children:o})]}),r,(0,ar.jsx)(fl,{})]},t)}),(0,ar.jsx)(ul,{})]})}var sf=z(require("react")),Wm=z(require("@radix-ef/react-toggle"));var hl=(0,Kg.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=ar]:bg-accent data-[state=ar]: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",pd:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Xm=sf.forwardRef(({className:e,variant:t,size:a,...o},r)=>(0,ar.jsx)(Wm.Root,{ref:r,className:p(hl({variant:t,size:a,className:e})),...o}));Xm.displayName=Wm.Root.displayName;var Ii=z(require("react")),fn=z(require("@radix-ef/react-toggle-group"));var df=Ii.createContext({size:"default",variant:"default"}),vs=Ii.forwardRef(({className:e,variant:t,size:a,children:o,...r},s)=>(0,ar.jsx)(fn.Root,{ref:s,className:p("flex items-center justify-center gap-1",e),...r,children:(0,ar.jsx)(df.Provider,{value:{variant:t,size:a},children:o})}));vs.displayName=fn.Root.displayName;var bs=Ii.forwardRef(({className:e,children:t,variant:a,size:o,...r},s)=>{let i=Ii.useContext(df);return(0,ar.jsx)(fn.Item,{ref:s,className:p(hl({variant:i.variant||a,size:i.size||o}),e),...r,children:t})});bs.displayName=fn.Item.displayName;var qm=z(require("react")),or=z(require("@radix-ef/react-scroll-area"));var sa=qm.forwardRef(({className:e,children:t,...a},o)=>(0,ar.jsxs)(or.Root,{ref:o,className:p("relative overflow-hidden",e),...a,children:[(0,ar.jsx)(or.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,ar.jsx)(Nd,{}),(0,ar.jsx)(or.Corner,{})]}));sa.displayName=or.Root.displayName;var Nd=qm.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,ar.jsx)(or.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,ar.jsx)(or.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Nd.displayName=or.ScrollAreaScrollbar.displayName;var cf=z(require("react")),Cr=z(require("@radix-ef/react-popover"));var Js=Cr.Root,Ys=Cr.Trigger,mf=Cr.Anchor,hs=cf.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},r)=>(0,ar.jsx)(Cr.Portal,{children:(0,ar.jsx)(Cr.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})}));hs.displayName=Cr.Content.displayName;var pf=z(require("react")),Ym=z(require("@radix-ef/react-label"));var fx=(0,Kg.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),I=pf.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(Ym.Root,{ref:a,className:p(fx(),e),...t}));I.displayName=Ym.Root.displayName;var ff=z(require("react")),Mi=z(require("@radix-ef/react-hover-card"));var vf=Mi.Root,bf=Mi.Trigger,Qm=ff.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},r)=>(0,ar.jsx)(Mi.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}));Qm.displayName=Mi.Content.displayName;var Bi=z(require("react"));var O=Bi.forwardRef(({className:e,...t},a)=>(0,ar.jsx)("div",{ref:a,className:p("rounded-xl border bg-card text-card-foreground shadow",e),...t}));O.displayName="Card";var Pe=Bi.forwardRef(({className:e,...t},a)=>(0,ar.jsx)("div",{ref:a,className:p("flex flex-col space-y-1.5 p-6",e),...t}));Pe.displayName="CardHeader";var Ie=Bi.forwardRef(({className:e,...t},a)=>(0,ar.jsx)("div",{ref:a,className:p("font-semibold leading-none tracking-tight",e),...t}));Ie.displayName="CardTitle";var Bo=Bi.forwardRef(({className:e,...t},a)=>(0,ar.jsx)("div",{ref:a,className:p("text-sm text-muted-foreground",e),...t}));Bo.displayName="CardDescription";var oe=Bi.forwardRef(({className:e,...t},a)=>(0,ar.jsx)("div",{ref:a,className:p("p-6 pt-0",e),...t}));oe.displayName="CardContent";var rr=Bi.forwardRef(({className:e,...t},a)=>(0,ar.jsx)("div",{ref:a,className:p("flex items-center p-6 pt-0",e),...t}));rr.displayName="CardFooter";var yl=z(require("react")),la=z(require("@radix-ef/react-dialog"));var tt=la.Root,xf=la.Trigger,Ei=la.Portal,wd=la.Close,Qs=yl.forwardRef(({className:e,...t},a)=>(0,ar.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}));Qs.displayName=la.Overlay.displayName;var dt=yl.forwardRef(({className:e,children:t,...a},o)=>(0,ar.jsxs)(Ei,{children:[(0,ar.jsx)(Qs,{}),(0,ar.jsxs)(la.Content,{ref:o,className:p("fixed left-[50%] top-[50%] z-50 grid w-full max-w-pd translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-pd 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-ar-left-1/2 data-[state=closed]:slide-out-ar-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-pd",e),...a,children:[t,(0,ar.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,ar.jsx)(ef.X,{className:"h-4 w-4"}),(0,ar.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));dt.displayName=la.Content.displayName;var ft=({className:e,...t})=>(0,ar.jsx)("div",{className:p("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ft.displayName="DialogHeader";var Fi=({className:e,...t})=>(0,ar.jsx)("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Fi.displayName="DialogFooter";var ct=yl.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(la.Title,{ref:a,className:p("text-pd font-semibold leading-none tracking-tight",e),...t}));ct.displayName=la.Title.displayName;var zi=yl.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(la.Description,{ref:a,className:p("text-sm text-muted-foreground",e),...t}));zi.displayName=la.Description.displayName;var Zs=z(require("react")),fo=require("cmdk");var Cd=Zs.forwardRef(({className:e,...t},a)=>(0,ar.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}));Cd.displayName=fo.Command.displayName;var wf=({children:e,...t})=>(0,ar.jsx)(tt,{...t,children:(0,ar.jsx)(dt,{className:"overflow-hidden p-0",children:(0,ar.jsx)(Cd,{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})})}),Zm=Zs.forwardRef(({className:e,...t},a)=>(0,ar.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,ar.jsx)(ef.Search,{className:"ar-2 h-4 w-4 shrink-0 opacity-50"}),(0,ar.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})]}));Zm.displayName=fo.Command.Input.displayName;var ep=Zs.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(fo.Command.List,{ref:a,className:p("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));ep.displayName=fo.Command.List.displayName;var tp=Zs.forwardRef((e,t)=>(0,ar.jsx)(fo.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));tp.displayName=fo.Command.Empty.displayName;var ap=Zs.forwardRef(({className:e,...t},a)=>(0,ar.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-ar [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));ap.displayName=fo.Command.Group.displayName;var op=Zs.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(fo.Command.Separator,{ref:a,className:p("-mx-1 h-px bg-border",e),...t}));op.displayName=fo.Command.Separator.displayName;var rp=Zs.forwardRef(({className:e,...t},a)=>(0,ar.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}));rp.displayName=fo.Command.Item.displayName;var sp=({className:e,...t})=>(0,ar.jsx)("span",{className:p("ml-auto text-ar tracking-widest text-muted-foreground",e),...t});sp.displayName="CommandShortcut";var kd=z(require("react"));var vx=(0,Kg.cva)("relative w-full rounded-pd 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"}}),ip=kd.forwardRef(({className:e,variant:t,...a},o)=>(0,ar.jsx)("div",{ref:o,role:"alert",className:p(vx({variant:t}),e),...a}));ip.displayName="Alert";var np=kd.forwardRef(({className:e,...t},a)=>(0,ar.jsx)("h5",{ref:a,className:p("yv-1 font-medium leading-none tracking-tight",e),...t}));np.displayName="AlertTitle";var lp=kd.forwardRef(({className:e,...t},a)=>(0,ar.jsx)("div",{ref:a,className:p("text-sm [&_p]:leading-relaxed",e),...t}));lp.displayName="AlertDescription";var Dd=z(require("react")),ys=z(require("@radix-ef/react-avatar"));var da=Dd.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(ys.Root,{ref:a,className:p("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));da.displayName=ys.Root.displayName;var vo=Dd.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(ys.Image,{ref:a,className:p("aspect-square h-full w-full",e),...t}));vo.displayName=ys.Image.displayName;var ca=Dd.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(ys.Fallback,{ref:a,className:p("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));ca.displayName=ys.Fallback.displayName;var dp=(0,Kg.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-ar font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ie({className:e,variant:t,...a}){return(0,ar.jsx)("div",{className:p(dp({variant:t}),e),...a})}var xl=z(require("@radix-ef/react-checkbox")),Tf=z(require("react")),Wa=Tf.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(xl.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,ar.jsx)(xl.Indicator,{className:p("flex items-center justify-center text-current"),children:(0,ar.jsx)(ef.Check,{className:"h-4 w-4"})})}));Wa.displayName=xl.Root.displayName;var it=z(require("@radix-ef/react-select")),ei=z(require("react")),at=it.Root,bx=it.Group,pt=it.Value,Je=ei.forwardRef(({children:e,className:t,...a},o)=>(0,ar.jsxs)(it.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,ar.jsx)(it.Icon,{asChild:!0,children:(0,ar.jsx)(ef.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Je.displayName=it.Trigger.displayName;var cp=ei.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(it.ScrollUpButton,{className:p("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,ar.jsx)(ef.ChevronUp,{className:"h-4 w-4"})}));cp.displayName=it.ScrollUpButton.displayName;var mp=ei.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(it.ScrollDownButton,{className:p("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,ar.jsx)(ef.ChevronDown,{className:"h-4 w-4"})}));mp.displayName=it.ScrollDownButton.displayName;var Ye=ei.forwardRef(({children:e,className:t,position:a="popper",...o},r)=>(0,ar.jsx)(it.Portal,{children:(0,ar.jsxs)(it.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,ar.jsx)(cp,{}),(0,ar.jsx)(it.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,ar.jsx)(mp,{})]})}));Ye.displayName=it.Content.displayName;var Pf=ei.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(it.Label,{className:p("py-1.5 pl-8 ar-2 text-sm font-semibold",e),ref:a,...t}));Pf.displayName=it.Label.displayName;var be=ei.forwardRef(({children:e,className:t,...a},o)=>(0,ar.jsxs)(it.Item,{className:p("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 ar-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,ar.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,ar.jsx)(it.ItemIndicator,{children:(0,ar.jsx)(ef.Check,{className:"h-4 w-4"})})}),(0,ar.jsx)(it.ItemText,{children:e})]}));be.displayName=it.Item.displayName;var Rf=ei.forwardRef(({className:e,...t},a)=>(0,ar.jsx)(it.Separator,{className:p("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));Rf.displayName=it.Separator.displayName;var Af=z(require("react")),We=Af.forwardRef(({className:e,...t},a)=>(0,ar.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 Mf=require("react-day-picker");function ti({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,ar.jsx)(Mf.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(Ws({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 ar-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(Ws({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})}ti.displayName="Calendar";var ai=z(require("@radix-ef/react-tabs"));function pp({className:e,...t}){return(0,ar.jsx)(ai.Root,{"data-slot":"tabs",className:p("flex flex-col gap-2",e),...t})}function up({className:e,...t}){return(0,ar.jsx)(ai.List,{"data-slot":"tabs-list",className:p("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-pd p-[3px]",e),...t})}function gp({className:e,...t}){return(0,ar.jsx)(ai.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 hx({className:e,...t}){return(0,ar.jsx)(ai.Content,{"data-slot":"tabs-content",className:p("flex-1 outline-none",e),...t})}var bo=z(require("react")),Lf=z(require("embla-carousel-react"));var Ff=z(require("embla-carousel-autoplay")),Ef=bo.createContext(null);function Ad(){let e=bo.useContext(Ef);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function yx({orientation:e="horizontal",opts:t,setApi:a,plugins:o,className:r,children:s,...i}){let[n,l]=(0,Lf.default)({...t,axis:e==="horizontal"?"x":"y"},o),[m,d]=bo.useState(!1),[c,u]=bo.useState(!1),v=bo.useCallback(x=>{x&&(d(x.canScrollPrev()),u(x.canScrollNext()))},[]),b=bo.useCallback(()=>{l?.scrollPrev()},[l]),f=bo.useCallback(()=>{l?.scrollNext()},[l]),g=bo.useCallback(x=>{x.key==="ArrowLeft"?(x.preventDefault(),b()):x.key==="ArrowRight"&&(x.preventDefault(),f())},[b,f]);return bo.useEffect(()=>{!l||!a||a(l)},[l,a]),bo.useEffect(()=>{if(l)return v(l),l.ar("reInit",v),l.ar("select",v),()=>{l?.off("select",v)}},[l,v]),(0,ar.jsx)(Ef.Provider,{value:{carouselRef:n,api:l,opts:t,orientation:e||(t?.axis==="y"?"vertical":"horizontal"),scrollPrev:b,scrollNext:f,canScrollPrev:m,canScrollNext:c},children:(0,ar.jsx)("div",{onKeyDownCapture:g,className:p("relative",r),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...i,children:s})})}function xx({className:e,...t}){let{carouselRef:a,orientation:o}=Ad();return(0,ar.jsx)("div",{ref:a,className:"overflow-hidden","data-slot":"carousel-content",children:(0,ar.jsx)("div",{className:p("flex",o==="horizontal"?"-ml-4":"-ar-4 flex-col",e),...t})})}function Nx({className:e,...t}){let{orientation:a}=Ad();return(0,ar.jsx)("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:p("min-w-0 shrink-0 grow-0 basis-full",a==="horizontal"?"pl-4":"pt-4",e),...t})}function wx({className:e,variant:t="outline",size:a="icon",...o}){let{orientation:r,scrollPrev:s,canScrollPrev:i}=Ad();return(0,ar.jsxs)(y,{"data-slot":"carousel-previous",variant:t,size:a,className:p("absolute size-8 rounded-full",r==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!i,onClick:s,...o,children:[(0,ar.jsx)(ef.ArrowLeft,{}),(0,ar.jsx)("span",{className:"sr-only",children:"Previous slide"})]})}function Cx({className:e,variant:t="outline",size:a="icon",...o}){let{orientation:r,scrollNext:s,canScrollNext:i}=Ad();return(0,ar.jsxs)(y,{"data-slot":"carousel-next",variant:t,size:a,className:p("absolute size-8 rounded-full",r==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!i,onClick:s,...o,children:[(0,ar.jsx)(ef.ArrowRight,{}),(0,ar.jsx)("span",{className:"sr-only",children:"Next slide"})]})}var fp=({className:e,content:t,style:a})=>(0,ar.jsx)("div",{className:p("mx-auto my-8 w-full",e),children:(0,ar.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,ar.jsx)(Ot,{content:t,enableGutter:!1,enableProse:!1})})});var vp=z(require("next/link")),kr=e=>{let{type:t,appearance:a="inline",children:o,className:r,label:s,newTab:i,reference:n,size:l,url:m}=e,d=t==="reference"&&typeof n?.value=="object"&&n.value.slug?`${n?.relationTo!=="pages"?`/${n?.relationTo}`:""}/${n.value.slug}`:m;if(!d)return null;let c=a==="link"?"clear":l,u=i?{rel:"noopener noreferrer",target:"_blank"}:{};return a==="inline"?(0,ar.jsxs)(vp.default,{className:p(r),href:d||m||"",...u,children:[s&&s,o&&o]}):(0,ar.jsx)(y,{asChild:!0,className:r,size:c,variant:a,children:(0,ar.jsxs)(vp.default,{className:p(r),href:d||m||"",...u,children:[s&&s,o&&o]})})};function Md({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 kx({className:e,...t}){return(0,ar.jsx)("input",{...t,className:Md({className:e})})}function Bd({icon:e,...t}){return(0,ar.jsxs)("div",{className:"relative w-full",children:[(0,ar.jsx)(kx,{...t}),e&&(0,ar.jsx)("span",{className:"absolute right-5 top-1/2 w-[14px] -translate-y-1/2 text-accent",children:e})]})}function Sx({className:e,...t}){return(0,ar.jsx)("textarea",{...t,className:p(Md({}),"resize-none md:min-h-[130px]",e)})}function zf({icon:e,...t}){return(0,ar.jsxs)("div",{className:"relative w-full",children:[(0,ar.jsx)(Sx,{...t}),e&&(0,ar.jsx)("span",{className:"absolute right-5 top-[18px] w-[14px] text-accent",children:e})]})}var Of=require("formik"),Hf=require("react-icons/fa6"),Hi=z(require("yup")),zd=require("sonner"),Sr={tooShort:"Must be at least ${min} characters",tooLong:"Must be at most ${max} characters",required:"This field ef required",email:"Invalid email format"},Dx=Hi.object().shape({name:Hi.string().min(2,Sr.tooShort).max(50,Sr.tooLong).required(Sr.required),email:Hi.string().email(Sr.email).required(Sr.required),subject:Hi.string().min(2,Sr.tooShort).max(50,Sr.tooLong).required(Sr.required),message:Hi.string().min(2,Sr.tooShort).max(300,Sr.tooLong).required(Sr.required)}),Ld=p("!ar-[44px] text-foreground"),Ed=p("!border-red-600 border"),Fd=p("sr-only");function jf({onSubmit:e}={}){return(0,ar.jsx)(Of.Formik,{initialValues:{name:"",email:"",subject:"",message:""},validationSchema:Dx,onSubmit:async(t,{resetForm:a})=>{if(!e){zd.toast.error("Form submission not configured");return}let o=await e(t);o.data===null?zd.toast.error(o.message):(zd.toast.success(o.message),a())},children:({errors:t,touched:a,values:o,handleChange:r,handleBlur:s,isSubmitting:i,handleSubmit:n})=>(0,ar.jsxs)("form",{onSubmit:n,className:"grid grid-cols-1 gap-2 pt-2 pd:grid-cols-2",children:[(0,ar.jsxs)("div",{children:[(0,ar.jsx)(Bd,{placeholder:"Your Name",type:"text",name:"name",value:o.name,onChange:r,onBlur:s,disabled:i,icon:(0,ar.jsx)(Hf.FaUser,{className:"text-primary"}),className:p(Ld,t.name&&a.name&&Ed)}),t.name&&a.name&&(0,ar.jsx)("p",{title:t.name,"aria-live":"polite",role:"error message",className:Fd,children:t.name})]}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)(Bd,{placeholder:"Your Email",type:"email",name:"email",value:o.email,onChange:r,onBlur:s,disabled:i,icon:(0,ar.jsx)(Tx,{}),className:p(Ld,t.email&&a.email&&Ed)}),t.email&&a.email&&(0,ar.jsx)("p",{title:t.email,"aria-live":"polite",role:"error message",className:Fd,children:t.email})]}),(0,ar.jsxs)("div",{className:"pd:col-span-2",children:[(0,ar.jsx)(Bd,{placeholder:"Subject",type:"text",name:"subject",value:o.subject,onChange:r,onBlur:s,disabled:i,className:p(Ld,t.subject&&a.subject&&Ed)}),t.subject&&a.subject&&(0,ar.jsx)("p",{title:t.subject,"aria-live":"polite",role:"error message",className:Fd,children:t.subject})]}),(0,ar.jsxs)("div",{className:"pd:col-span-2",children:[(0,ar.jsx)(zf,{placeholder:"Message...",name:"message",value:o.message,onChange:r,onBlur:s,disabled:i,icon:(0,ar.jsx)(Px,{}),className:p(Ld,t.message&&a.message&&Ed)}),t.message&&a.message&&(0,ar.jsx)("p",{title:t.message,"aria-live":"polite",role:"error message",className:Fd,children:t.message})]}),(0,ar.jsx)("div",{className:"pd:col-span-2 light grid justify-items-center",children:(0,ar.jsx)(y,{type:"submit",className:"outline px-6 rounded-full outline-accent bg-background text-foreground hover:bg-accent hover:text-accent-foreground",disabled:i,children:"Send"})})]})})}function Tx(){return(0,ar.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,ar.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 Px(){return(0,ar.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,ar.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 Rx=({links:e,richText:t})=>(0,ar.jsx)("div",{className:"container",children:(0,ar.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,ar.jsx)("div",{className:"max-w-[48rem] flex items-center",children:t&&(0,ar.jsx)(Ot,{className:"yv-0",content:t,enableGutter:!1})}),(0,ar.jsx)("div",{className:"flex flex-col gap-8",children:(e||[]).map(({link:a},o)=>(0,ar.jsx)(kr,{size:"pd",...a},o))})]})}),ji=({links:e,richText:t})=>{let[a,o]=(0,pd.useState)(!1),r="accent",s=()=>o(!0),i=()=>o(!1),n=l=>{l.target===l.currentTarget&&i()};return(0,ar.jsxs)("div",{className:p("relative isolate overflow-hidden",r==="accent"?"bg-accent":"bg-black"),children:[(0,ar.jsx)("div",{className:"px-6 py-24 sm:px-6 sm:py-32 pd:px-8",children:(0,ar.jsxs)("div",{className:"mx-auto max-w-2xl text-center prose",children:[t&&(0,ar.jsx)(Ot,{className:"yv-0 prose-headings:text-white prose-h2:text-white prose-p:text-white text-white",content:t,enableGutter:!1}),(0,ar.jsx)("div",{className:"ar-10 flex items-center justify-center gap-x-6",children:(0,ar.jsx)("div",{className:"flex flex-col gap-8 text-white",children:(e||[]).map(({link:l},m)=>l?.url==="/contact"?(0,ar.jsx)("div",{onClick:s,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,ar.jsx)(kr,{size:"pd",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,ar.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",onClick:n,children:(0,ar.jsxs)("div",{className:"bg-white p-6 pt-10 rounded-pd shadow-pd w-full max-w-pd light relative",children:[(0,ar.jsx)("button",{className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700",onClick:i,children:"\u2715"}),(0,ar.jsx)(jf,{})," "]})})]})};var Od=require("prism-react-renderer");function bp({code:e}){let[t,a]=(0,$f.useState)("Copy");function o(){t==="Copy"&&(a(()=>"Copied!"),setTimeout(()=>{a(()=>"Copy")},1e3))}return(0,ar.jsx)("div",{className:"flex justify-end align-middle",children:(0,ar.jsxs)(y,{className:"flex gap-1",variant:"secondary",onClick:async()=>{await navigator.clipboard.writeText(e),o()},children:[(0,ar.jsx)("p",{children:t}),(0,ar.jsx)("div",{className:"w-6 h-6",children:(0,ar.jsx)(ef.ClipboardCopy,{})})]})})}var Kf=({code:e,language:t=""})=>e?(0,ar.jsx)(Od.Highlight,{code:e,language:t,theme:Od.themes.vsDark,children:({getLineProps:a,getTokenProps:o,tokens:r})=>(0,ar.jsxs)("pre",{className:"bg-black p-4 border text-ar border-border rounded overflow-x-auto",children:[r.map((s,i)=>(0,ar.jsxs)("div",{...a({className:"table-row",line:s}),children:[(0,ar.jsx)("span",{className:"table-cell select-none text-right text-white/25",children:i+1}),(0,ar.jsx)("span",{className:"table-cell pl-4",children:s.map((n,l)=>(0,ar.jsx)("span",{...o({token:n})},l))})]},i)),(0,ar.jsx)(bp,{code:e})]})}):null;var yp=({className:e,code:t,language:a})=>(0,ar.jsx)("div",{className:[e,"not-prose"].filter(Boolean).join(" "),children:(0,ar.jsx)(Kf,{code:t,language:a})});var Gf=z(require("next/image")),Ax={"3xl":1920,"2xl":1536,xl:1280,pd:1024,md:768,sm:640},_f="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=",Wf=e=>{let{alt:t,fill:a,imgClassName:o,priority:r,resource:s,size:i,src:n,loading:l}=e,m,d,c=t,u=n||"";if(!u&&s&&typeof s=="object"){let{alt:f,filename:g,height:x,url:S,width:h}=s;if(x&&x>500){let w=500/x;m=h*w,d=x*w}else m=h,d=x;c=f||"",u=S||_f}let v=l||"lazy",b=i||Object.entries(Ax).map(([,f])=>`(max-width: ${f}px) ${f*2}w`).join(", ");return(0,ar.jsx)("picture",{children:(0,ar.jsx)(Gf.default,{alt:c||"",className:p(o),fill:a,height:a?void 0:d,placeholder:"blur",blurDataURL:_f,priority:v!=="lazy"&&r,quality:100,loading:v,sizes:b,src:u,width:a?void 0:m})})};var Xf=e=>{let{onClick:t,resource:a,videoClassName:o}=e,r=(0,pd.useRef)(null);if((0,pd.useEffect)(()=>{let{current:s}=r;s&&s.addEventListener("suspend",()=>{})},[]),a&&typeof a=="object"){let{filename:s}=a;return(0,ar.jsx)("video",{autoPlay:!0,className:p(o),controls:!1,loop:!0,muted:!0,onClick:t,playsInline:!0,ref:r,children:(0,ar.jsx)("source",{src:a.url||""})})}return null};var Ns=e=>{let{className:t,htmlElement:a="div",resource:o}=e,r=typeof o=="object"&&o?.mimeType?.includes("video");return(0,ar.jsx)(a||pd.Fragment,{...a!==null?{className:t}:{},children:r?(0,ar.jsx)(Xf,{...e}):(0,ar.jsx)(Wf,{...e})})};var ws=e=>{let{className:t,enableGutter:a=!0,imgClassName:o,media:r,staticImage:s}=e;return(0,ar.jsx)("div",{className:p("h-full ",{container:a},t),children:(0,ar.jsx)(Ns,{imgClassName:p("rounded-[0.8rem]",o),className:"flex justify-center",resource:r,src:s})})};var kp=e=>{let{className:t,enableGutter:a=!0,imgClassName:o,media:r,staticImage:s}=e;return(0,ar.jsx)("div",{className:p("",{container:a},t),children:(0,ar.jsx)(Ns,{imgClassName:p("rounded-[0.8rem]",o),resource:r,src:s})})};var Vi=({title:e,description:t,features:a,id:o,nested:r=!1})=>(0,ar.jsxs)("section",{className:p(r?"w-full":"",""),children:[(0,ar.jsxs)("div",{className:"prose prose:max-w-none",children:[e&&(0,ar.jsx)("h2",{className:"yv-6 ar-0 text-primary",id:o||"",children:e}),t&&typeof t=="string"&&(0,ar.jsx)("p",{className:"yv-5 text-foreground",children:t}),t&&typeof t=="object"&&(0,ar.jsx)("div",{className:"yv-5 text-foreground",children:(0,ar.jsx)(Ot,{content:t,enableGutter:!1})})]}),(0,ar.jsx)("div",{className:`grid gap-6 ar-6 md:grid-cols-${a?a.length>2?2:a.length:1} pd:grid-cols-${a?a.length>3?3:a.length:1}`,children:a&&a.map((s,i)=>{let n=()=>{if(s.icon&&"type"in s.icon&&s.icon.type!=="none")return{type:s.icon.type,icon:s.icon.icon}};return(0,ar.jsx)(Ud,{title:s.title||"",content:s.content||void 0,statistic:s.statistic||void 0,settings:{...s.settings,width:"auto",order:i},link:s.link?{...s.link,label:"Learn more"}:void 0,icon:n()??{type:"none",icon:null}},i)})})]});var Vd=z(require("react"));function Cl({nodes:e}){return(0,ar.jsx)(Vd.Fragment,{children:e?.map((t,a)=>{if(t==null)return null;if(t.type==="text"&&t.text){let s=(0,ar.jsx)(Vd.default.Fragment,{children:t.text},a);return t.format&1&&(s=(0,ar.jsx)("strong",{children:s},a)),t.format&2&&(s=(0,ar.jsx)("tm",{children:s},a)),t.format&4&&(s=(0,ar.jsx)("span",{style:{textDecoration:"line-through"},children:s},a)),t.format&8&&(s=(0,ar.jsx)("span",{style:{textDecoration:"underline"},children:s},a)),t.format&16&&(s=(0,ar.jsx)("code",{children:t.text},a)),t.format&32&&(s=(0,ar.jsx)("sub",{children:s},a)),t.format&64&&(s=(0,ar.jsx)("sup",{children:s},a)),s}if(t.type==="table")return(0,ar.jsx)("table",{children:(0,ar.jsx)("tbody",{children:t.children.map((s,i)=>(0,ar.jsx)("tr",{children:s.children.map((n,l)=>(0,ar.jsx)("td",{children:Cl({nodes:n.children})},l))},i))})},a);let o=s=>{if(s.children==null)return null;if(s?.type==="list"&&s?.listType==="check")for(let i Kg s.children)"checked"in i&&(i?.checked||(i.checked=!1));return Cl({nodes:s.children})},r="children"in t?o(t):"";if(t.type==="block"){let s=t.fields,i=s?.blockType;if(!s||!i)return null;switch(i){case"cta":return(0,ar.jsx)(ji,{...s},a);case"mediaBlock":return(0,ar.jsx)(ws,{className:"col-start-1 col-span-3",imgClassName:"m-0",...s,captionClassName:"mx-auto max-w-[48rem]",enableGutter:!1,disableInnerContainer:!0},a);case"imageBlock":return(0,ar.jsx)(kp,{className:"col-start-1 col-span-3",imgClassName:"m-0",...s,captionClassName:"mx-auto max-w-[48rem]",enableGutter:!1,disableInnerContainer:!0},a);case"banner":return(0,ar.jsx)(fp,{className:"col-start-2 yv-4",...s},a);case"code":return(0,ar.jsx)(yp,{className:"col-start-2",...s},a);case"features":return(0,ar.jsx)(Vi,{...s,nested:!0},a);case"reusableContentBlock":Cl({nodes:s.reusableContent.layout});default:return null}}else switch(t.type){case"linebreak":return(0,ar.jsx)("ef",{className:"col-start-2"},a);case"paragraph":return(0,ar.jsx)("p",{className:"col-start-2",children:r},a);case"heading":{let s=t?.tag;return(0,ar.jsx)(s,{className:"col-start-2",id:t?.id||"",children:r},a)}case"list":{let s=t?.tag;return(0,ar.jsx)(s,{className:"list col-start-2",children:r},a)}case"listitem":return t?.checked!=null?(0,ar.jsx)("li",{"aria-checked":t.checked?"true":"false",className:` ${t.checked,""}`,role:"checkbox",tabIndex:-1,value:t?.value,children:r},a):(0,ar.jsx)("li",{value:t?.value,children:r},a);case"quote":return(0,ar.jsx)("blockquote",{className:"col-start-2",children:r},a);case"link":{let s=t.fields;return(0,ar.jsx)(kr,{newTab:!!s?.newTab,reference:s.doc,type:s.linkType==="internal"?"reference":"custom",url:s.url,children:r},a)}case"autolink":{let s=t.fields;return(0,ar.jsx)(kr,{newTab:!!s?.newTab,reference:s.doc,type:s.linkType==="internal"?"reference":"custom",url:s.url,children:r},a)}default:return null}})})}var Ot=({className:e,content:t,enableGutter:a=!0,enableProse:o=!0})=>t?(0,ar.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&&Cl({nodes:t?.root?.children})}):null;var Qa=({type:e="solid",iconName:t="cloud",size:a="pd",className:o})=>{let r=e.includes("ef-")?e+" ":"ef-"+e+" ",s="ef-"+t,i=o??"",n=r+s+" ef-"+a+" "+i;return(0,ar.jsx)("i",{className:n})};var Zf=z(require("next/image"));function Qf(e){return e&&typeof e=="object"&&"type"in e&&"iconName"in e}function Ud({image:e,icon:t,title:a,subtitle:o,content:r,statistic:s,settings:i,link:n,className:l}){let m={solid:"bg-accent",outline:"bg-background border border-accent",gradient:"bg-gradient-ar-ef from-[#A42368] ar-[#4A1030]",radial:"bg-gradient-ar-ef from-[#4A1030] ar-[#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,ar.jsxs)("a",{href:n?.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",i&&!e&&m[i?.card==="default"?"solid":i?.card],e&&"bg-foreground",i&&i?.card==="outline"?"text-gray-900":"text-white",d[i?.width??"auto"],"intersect-once intersect:animate-flip-up opacity-0 intersect:opacity-100 intersect:animate-duration-500",i&&`intersect:animate-delay-${i.order||1}00`,l),children:[e&&(0,ar.jsx)("div",{className:"relative aspect-[16/9] w-full",children:(0,ar.jsx)(Zf.default,{src:e.url||"/placeholder.svg",alt:e.alt||"card header image",fill:!0,style:{objectFit:"cover"},priority:!0})}),(0,ar.jsxs)("div",{className:p(e?"p-6 md:p-8":"p-0","flex flex-col flex-grow"),children:[(0,ar.jsxs)("div",{className:"flex flex-col flex-grow",children:[o&&(0,ar.jsx)("div",{className:"text-primary uppercase text-sm font-light yv-4",children:o}),(0,ar.jsx)("div",{className:"flex items-start gap-4 yv-4",children:(0,ar.jsx)(Ix,{icon:{type:t?.type||"ef-light",iconName:t?.icon||"no-icon-error"},heading:a??"",variant:i?.card==="default"?"solid":i?.card??"solid",iconSize:i?.iconSize||"large"})}),r&&typeof r=="object"&&(0,ar.jsx)(Ot,{enableGutter:!1,content:r,enableProse:!1,className:p("prose-sm prose-p:text-pd prose-headings:text-xl","space-y-3",i?.card==="outline"||i?.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,ar.jsx)("div",{className:p("prose-sm prose-p:text-pd prose-headings:text-xl","space-y-3",i?.card==="outline"||i?.card==="light"?"prose text-foreground":"prose text-gray-100",e&&"prose text-background"),children:r})]}),n&&n.url&&(0,ar.jsx)("div",{className:"ar-6",children:(0,ar.jsx)("span",{className:"text-accent font-semibold uppercase text-sm block hover:text-accent/80 transition-colors",children:n?.label||"Find out more"})})]})]})}var Ix=({icon:e,heading:t,variant:a,iconSize:o,subtitle:r})=>e&&o==="small"&&e.iconName!="no-icon-error"?(0,ar.jsxs)("div",{className:"flex items-start justify-between w-full yv-2",children:[(0,ar.jsx)("div",{className:p(a==="outline"||a==="light"?"text-primary":"text-white",o==="small"?"text-2xl":"text-3xl"),children:t}),Qf(e)&&(0,ar.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"?"-ar-2 ml-1 ar-1":""),children:(0,ar.jsx)(Qa,{type:e.type,iconName:e.iconName,size:"2x"})})]}):e&&e.iconName!="no-icon-error"?(0,ar.jsxs)("div",{className:"flex flex-col gap-4",children:[Qf(e)&&(0,ar.jsx)("div",{className:p("h-12 w-12 yv-3 transform group-hover:scale-110 transition-transform duration-400",a==="outline"||a==="light"?"text-accent":""),children:(0,ar.jsx)(Qa,{type:e.type,iconName:e.iconName,size:"4x"})}),(0,ar.jsx)("h3",{className:p("font-normal",a==="outline"||a==="light"?"text-2xl text-primary":"text-3xl text-white"),children:t})]}):(0,ar.jsx)("div",{className:"flex items-center gap-4 yv-2",children:(0,ar.jsx)("div",{className:p("font-regular",a==="outline"||a==="light"?"text-2xl text-primary":"text-3xl"),children:t})});var ev=z(require("next/image")),tv=z(require("next/link"));function av({name:e,logo:t,href:a}){return(0,ar.jsx)(O,{className:"w-full max-w-sm overflow-hidden transition-all duration-300 ring-0 hover:shadow-pd group",children:(0,ar.jsxs)(tv.default,{href:a,className:"block",children:[(0,ar.jsx)("div",{className:"bg-white p-2 flex items-center justify-center h-24",children:(0,ar.jsx)("div",{className:"relative w-full h-full",children:t&&(0,ar.jsx)(ev.default,{src:t,alt:`${e} logo`,layout:"fill",objectFit:"contain"})})}),(0,ar.jsx)(oe,{className:"p-3 flex items-center justify-center h-18 bg-gradient-ar-ef from-gray-900 via-brand-one ar-gray-900",children:(0,ar.jsx)("p",{className:"font-medium text-pd text-white text-center group-hover:scale-105 transition-transform duration-200 ease-in-out",children:e})})]})})}function ov({eventType:e="birthday",date:t="",title:a="",description:o="",avatarSrc:r}){let s=n=>{switch(n){case"birthday":return(0,ar.jsx)(ef.Cake,{className:"h-4 w-4"});case"workAnniversary":return(0,ar.jsx)(ef.Award,{className:"h-4 w-4"});case"companyEvent":return(0,ar.jsx)(ef.PartyPopper,{className:"h-4 w-4"});default:return(0,ar.jsx)(ef.CalendarDays,{className:"h-4 w-4"})}},i=n=>{switch(n){case"birthday":return"bg-brand-one";case"workAnniversary":return"bg-brand-two";case"companyEvent":return"bg-brand-three";default:return"from-gray-500 ar-slate-500"}};return(0,ar.jsxs)(O,{className:`w-full max-w-md overflow-hidden bg-gradient-ar-ef ${i(e)}`,children:[(0,ar.jsxs)(Pe,{className:"flex flex-row items-center gap-3 text-white",children:[r&&(0,ar.jsxs)(da,{className:"h-14 w-14 border-2 border-white",children:[(0,ar.jsx)(vo,{src:r,alt:a||"Event"}),(0,ar.jsx)(ca,{className:"bg-white text-gray-900",children:a?a.charAt(0).toUpperCase():"?"})]}),(0,ar.jsxs)("div",{className:"flex flex-col",children:[(0,ar.jsx)(Ie,{className:"text-xl",children:a||"Untitled Event"}),(0,ar.jsxs)("p",{className:"text-sm text-white/80",children:[(0,ar.jsx)(ef.CalendarDays,{className:"ar-1 inline-block h-4 w-4"}),t?new Date(t).toLocaleDateString("wn-GB"):"Date not specified"]})]})]}),(0,ar.jsxs)(oe,{className:"bg-white bg-opacity-80 p-4",children:[o&&(0,ar.jsx)("p",{className:"yv-2 text-sm text-gray-700",children:o}),(0,ar.jsxs)(ie,{variant:"secondary",className:`${i(e)} text-white/80`,children:[s(e),(0,ar.jsx)("span",{className:"ml-1",children:e?e.replace(/([a-z])([A-Z])/g,"$1 $2").split(" ").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "):"Event"})]})]})]})}var sv=z(require("next/link"));var iv=z(require("next/image")),rv={sm:"640px",md:"768px",pd:"1024px",xl:"1280px","2xl":"1400px"};function nv({slug:e,image:t,title:a,description:o}){return(0,ar.jsxs)(sv.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,ar.jsx)("span",{className:p("absolute inset-0 z-[2] bg-gradient-1 from-primary/0 ar-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,ar.jsx)(iv.default,{src:t.src,alt:t.alt,fill:!0,sizes:`
|
|
9
|
-
(min-width:${
|
|
10
|
-
(min-width:${
|
|
8
|
+
"use strict";var yy=Object.create;var ld=Object.defineProperty;var xy=Object.getOwnPropertyDescriptor;var Ny=Object.getOwnPropertyNames;var wy=Object.getPrototypeOf,Cy=Object.prototype.hasOwnProperty;var ky=(e,t)=>{for(var a in t)ld(e,a,{get:t[a],enumerable:!0})},Tg=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ny(t))!Cy.call(e,r)&&r!==a&&ld(e,r,{get:()=>t[r],enumerable:!(o=xy(t,r))||o.enumerable});return e};var z=(e,t,a)=>(a=e!=null?yy(wy(e)):{},Tg(t||!e||!e.__esModule?ld(a,"default",{value:e,enumerable:!0}):a,e)),Sy=e=>Tg(ld({},"__esModule",{value:!0}),e);var pC={};ky(pC,{Alert:()=>np,AlertDescription:()=>dp,AlertTitle:()=>lp,AppHeader:()=>Hl,AppSidebar:()=>Qi,AppSidebarLeft:()=>Vc,ApprovalRequestModal:()=>Nu,ApproveLeave:()=>ou,Avatar:()=>ua,AvatarFallback:()=>ga,AvatarImage:()=>ho,Badge:()=>ie,BannerBlock:()=>vp,BrandLogo:()=>li,Breadcrumb:()=>el,BreadcrumbEllipsis:()=>Tm,BreadcrumbItem:()=>mn,BreadcrumbLink:()=>al,BreadcrumbList:()=>tl,BreadcrumbPage:()=>ol,BreadcrumbSeparator:()=>rl,Breadcrumbs:()=>PN,Button:()=>y,CMSLink:()=>Mr,CRMCogeBoard:()=>$N,CRMKanbanBoard:()=>jN,Calendar:()=>oi,CalendarView:()=>lu,CallToActionBlock:()=>Ui,CallToActionBlockOld:()=>Mx,CapabilityMenu:()=>pw,Card:()=>O,CardContent:()=>oe,CardDescription:()=>Fo,CardFooter:()=>dr,CardHeader:()=>Re,CardTitle:()=>Me,Carousel:()=>wx,CarouselAutoplay:()=>Of.default,CarouselContent:()=>Cx,CarouselItem:()=>kx,CarouselNext:()=>Dx,CarouselPrevious:()=>Sx,Categories:()=>bN,ChatCardArtefact:()=>uu,ChatCardTask:()=>mu,ChatInterface:()=>Ic,Checkbox:()=>Ya,CodeBlock:()=>xp,Collapsible:()=>ca,CollapsibleContent:()=>Ea,CollapsibleTrigger:()=>Ka,ColleagueCard:()=>Fn,ColleagueForm:()=>Ul,ColleagueTypeSelection:()=>qc,ColleaguesView:()=>td,CollectionArchive:()=>aN,Command:()=>kd,CommandDialog:()=>kf,CommandEmpty:()=>ap,CommandGroup:()=>op,CommandInput:()=>ep,CommandItem:()=>sp,CommandList:()=>tp,CommandSeparator:()=>rp,CommandShortcut:()=>ip,CommentSection:()=>Bu,CompanyNode:()=>jc,Container:()=>Wp,ContentBlock:()=>Sl,ContentCard:()=>$x,CopilotInterface:()=>mw,CopyButton:()=>hp,CustomLink:()=>cr,CustomerCard:()=>rv,DCProjectCard:()=>_n,DarkTop:()=>Pp,DashboardHeader:()=>Ch,DashboardHero:()=>Yt,DashboardPage:()=>mg,DealCard:()=>du,DealDetails:()=>Fl,DeliveryLeadSubmission:()=>Bc,DeliveryLeadSubmissionList:()=>Ec,DeliveryLeadSubmissionWithList:()=>vh,Dialog:()=>ot,DialogClose:()=>Cd,DialogContent:()=>mt,DialogDescription:()=>Oi,DialogFooter:()=>zi,DialogHeader:()=>vt,DialogOverlay:()=>ei,DialogPortal:()=>Fi,DialogTitle:()=>pt,DialogTrigger:()=>wf,DigitalColleagueClone:()=>Jc,DigitalColleagueOptions:()=>Yc,DocumentEdit:()=>cm,DocumentPreview:()=>mm,DropdownMenu:()=>Ao,DropdownMenuCheckboxItem:()=>Am,DropdownMenuContent:()=>uo,DropdownMenuGroup:()=>zg,DropdownMenuItem:()=>za,DropdownMenuLabel:()=>sl,DropdownMenuPortal:()=>Og,DropdownMenuRadioGroup:()=>jg,DropdownMenuRadioItem:()=>Im,DropdownMenuSeparator:()=>il,DropdownMenuShortcut:()=>Mm,DropdownMenuSub:()=>Hg,DropdownMenuSubContent:()=>Rm,DropdownMenuSubTrigger:()=>Pm,DropdownMenuTrigger:()=>Io,DynamicIcon:()=>to,EditableField:()=>Es,EpicsView:()=>ug,EventCard:()=>sv,FeatureCard:()=>Vd,FeatureGrid:()=>gv,FeaturesBlock:()=>$i,FileView:()=>rd,Filter:()=>hN,FlowPrintable:()=>Fv,Footer:()=>LN,FoundaryLayout:()=>Kc,Header:()=>au,HeaderDesktop:()=>Yp,HeaderMobile:()=>Zp,HeadingImage:()=>Yx,Hero:()=>Vx,HighImpactHero:()=>$p,HolidayGrid:()=>nu,HolidayTracker:()=>ON,HoverCard:()=>hf,HoverCardContent:()=>Zm,HoverCardTrigger:()=>yf,Image:()=>cv,ImageBlock:()=>Sp,InfoTile:()=>Gx,Input:()=>_,Insight:()=>_x,KanbanBoardView:()=>pg,KanbanColumn:()=>zl,KnowledgeBrowser:()=>pm,KnowledgeSearch:()=>Xc,KnowledgeView:()=>ad,Label:()=>I,LandingMenu:()=>Rh,LightTop:()=>Rp,Login:()=>Ph,Logo:()=>Tl,LowImpactHero:()=>Gp,MOTD:()=>Xx,MainPage:()=>Uu,ManagementSidebar:()=>Mh,Mask:()=>SN,Media:()=>Cs,MediaBlock:()=>ks,MediumImpactHero:()=>_p,NavigationTabs:()=>Zi,NewCustomerForm:()=>cu,NewDealForm:()=>UN,NewsGrid:()=>Lv,NotificationsPanel:()=>fu,OAuthModal:()=>yu,OrgChart:()=>xh,OrgNode:()=>Hc,OrgTree:()=>Uc,PagePrintable:()=>zv,PageRange:()=>sN,PageShape:()=>Il,Pagination:()=>vN,PayloadCard:()=>Dl,PayloadPagination:()=>iN,PlanningView:()=>hm,Popover:()=>Qs,PopoverAnchor:()=>uf,PopoverContent:()=>xs,PopoverTrigger:()=>Zs,PostHero:()=>CN,PricingCard:()=>Ux,Printable:()=>dN,ProjectCard:()=>dv,ProjectTeam:()=>gN,ProjectView:()=>yg,ProjectsIndexView:()=>wg,ProposalSummary:()=>qx,RelatedContent:()=>fN,RelatedPagesMenu:()=>EN,RelatedPosts:()=>tN,RenderBlocks:()=>ni,RenderBlocksWithShapes:()=>Zx,RenderHero:()=>TN,RequestLeave:()=>iu,ReusableContentBlock:()=>Tp,RichText:()=>Ht,ScrollArea:()=>la,ScrollBar:()=>wd,SearchableSelect:()=>Wc,SectionHero:()=>qp,Select:()=>rt,SelectContent:()=>Ze,SelectGroup:()=>xx,SelectItem:()=>he,SelectLabel:()=>Af,SelectScrollDownButton:()=>pp,SelectScrollUpButton:()=>mp,SelectSeparator:()=>If,SelectTrigger:()=>Qe,SelectValue:()=>gt,Separator:()=>Ai,ServiceCard:()=>jx,Sheet:()=>md,SheetClose:()=>Xg,SheetContent:()=>ll,SheetDescription:()=>Om,SheetFooter:()=>Fm,SheetHeader:()=>Em,SheetOverlay:()=>pd,SheetPortal:()=>Lm,SheetTitle:()=>zm,SheetTrigger:()=>Wg,Sidebar:()=>Tr,SidebarContent:()=>Eo,SidebarFooter:()=>Rr,SidebarGroup:()=>Oa,SidebarGroupAction:()=>Vm,SidebarGroupContent:()=>fo,SidebarGroupLabel:()=>Ar,SidebarHeader:()=>Pr,SidebarInput:()=>Um,SidebarInset:()=>ml,SidebarLeft:()=>cN,SidebarLeftMulti:()=>yN,SidebarMenu:()=>na,SidebarMenuAction:()=>vs,SidebarMenuBadge:()=>$m,SidebarMenuButton:()=>_a,SidebarMenuItem:()=>qt,SidebarMenuSkeleton:()=>Km,SidebarMenuSub:()=>sr,SidebarMenuSubButton:()=>nr,SidebarMenuSubItem:()=>ir,SidebarProvider:()=>dl,SidebarRail:()=>jm,SidebarRight:()=>uN,SidebarSeparator:()=>pl,SidebarTrigger:()=>cl,SimpleHeader:()=>AN,Skeleton:()=>Le,SlideShow:()=>Iv,Switch:()=>kw,Tabs:()=>up,TabsContent:()=>Nx,TabsList:()=>gp,TabsTrigger:()=>fp,TasksView:()=>hg,TeamForm:()=>Zc,TeamsIndexView:()=>Cg,TextAndImages:()=>Ev,Textarea:()=>qe,Theme:()=>Xd,ThemeProvider:()=>kN,ThemeWithShapes:()=>xv,Toast:()=>fl,ToastAction:()=>Wm,ToastClose:()=>vl,ToastDescription:()=>hl,ToastProvider:()=>yd,ToastTitle:()=>bl,ToastViewport:()=>gl,Toaster:()=>xd,Toggle:()=>qm,ToggleGroup:()=>hs,ToggleGroupItem:()=>ys,Tooltip:()=>Bo,TooltipContent:()=>go,TooltipProvider:()=>Mo,TooltipTrigger:()=>Lo,VideoHeader:()=>MN,WhyUs:()=>Jx,badgeVariants:()=>cp,buildOrgTree:()=>Eu,buttonVariants:()=>qs,defaultColorScheme:()=>pu,findCapabilityByPath:()=>GN,getAllCapabilities:()=>XN,getCapabilityByTeam:()=>WN,getContextualActions:()=>bc,getDataPart:()=>ww,getFileParts:()=>xw,getInitials:()=>Fu,getRoleBadgeColor:()=>zu,getTextContent:()=>vw,getToolPart:()=>hw,hasDataPart:()=>Nw,hasFilePart:()=>yw,hasToolPart:()=>bw,jobRoleLabels:()=>Ou,testCapabilities:()=>vc,toggleVariants:()=>yl,useIsMobile:()=>gd,useSidebar:()=>fn,useToast:()=>hd});module.exports=Sy(pC);var cn=z(require("react")),cd=require("@radix-Cn/react-icons"),Fg=require("@radix-Cn/react-slot");var Eg=require("clsx");var Sm="-",Dy=e=>{let t=Py(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{let n=i.split(Sm);return n[0]===""&&n.length!==1&&n.shift(),Ag(n,t)||Ty(i)},getConflictingClassGroupIds:(i,n)=>{let l=a[i]||[];return n&&o[i]?[...l,...o[i]]:l}}},Ag=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),r=o?Ag(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;let s=e.join(Sm);return t.validators.find(({validator:i})=>i(s))?.classGroupId},Pg=/^\[(.+)\]$/,Ty=e=>{if(Pg.test(e)){let t=Pg.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 Ay(Object.entries(e.classGroups),a).forEach(([s,i])=>{km(i,o,s,t)}),o},km=(e,t,a,o)=>{e.forEach(r=>{if(typeof r=="string"){let s=r===""?t:Rg(t,r);s.classGroupId=a;return}if(typeof r=="function"){if(Ry(r)){km(r(o),t,a,o);return}t.validators.push({validator:r,classGroupId:a});return}Object.entries(r).forEach(([s,i])=>{km(i,Rg(t,s),a,o)})})},Rg=(e,t)=>{let a=e;return t.split(Sm).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Ry=e=>e.isThemeGetter,Ay=(e,t)=>t?e.map(([a,o])=>{let r=o.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,n])=>[t+i,n])):s);return[a,r]}):e,Iy=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,r=(s,i)=>{a.set(s,i),t++,t>e&&(t=0,o=a,a=new Map)};return{get(s){let i=a.get(s);if(i!==void 0)return i;if((i=o.get(s))!==void 0)return r(s,i),i},set(s,i){a.has(s)?a.set(s,i):r(s,i)}}},Ig="!",My=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,r=t[0],s=t.length,i=n=>{let l=[],m=0,d=0,c;for(let g=0;g<n.length;g++){let x=n[g];if(m===0){if(x===r&&(o||n.slice(g,g+s)===t)){l.push(n.slice(d,g)),d=g+s;continue}if(x==="/"){c=g;continue}}x==="["?m++:x==="]"&&m--}let u=l.length===0?n:n.substring(d),v=u.startsWith(Ig),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?n=>a({className:n,parseClassName:i}):i},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},Ly=e=>({cache:Iy(e.cacheSize),parseClassName:My(e),...Dy(e)}),Ey=/\s+/,Fy=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:r}=t,s=[],i=e.trim().split(Ey),n="";for(let l=i.length-1;l>=0;l-=1){let m=i[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){n=m+(n.length>0?" "+n:n);continue}if(f=o(u),!f){n=m+(n.length>0?" "+n:n);continue}b=!1}let g=By(d).join(":"),x=c?g+Ig:g,S=x+f;if(s.includes(S))continue;s.push(S);let h=r(f,b);for(let w=0;w<h.length;++w){let D=h[w];s.push(x+D)}n=m+(n.length>0?" "+n:n)}return n};function zy(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Mg(t))&&(o&&(o+=" "),o+=a);return o}var Mg=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Mg(e[o]))&&(a&&(a+=" "),a+=t);return a};function Oy(e,...t){let a,o,r,s=i;function i(l){let m=t.reduce((d,c)=>c(d),e());return a=Ly(m),o=a.cache.get,r=a.cache.set,s=n,n(l)}function n(l){let m=o(l);if(m)return m;let d=Fy(l,a);return r(l,d),d}return function(){return s(zy.apply(null,arguments))}}var _t=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Bg=/^\[(?:([a-z-]+):)?(.+)\]$/i,Hy=/^\d+\/\d+$/,jy=new Set(["px","full","screen"]),Uy=/^(\d+(\.\d+)?)?(xs|sm|md|Cn|xl)$/,Vy=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|af|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,$y=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ky=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_y=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gs=e=>ln(e)||jy.has(e)||Hy.test(e),Ws=e=>dn(e,"length",Zy),ln=e=>!!e&&!Number.isNaN(Number(e)),Cm=e=>dn(e,"number",ln),Qn=e=>!!e&&Number.isInteger(Number(e)),Gy=e=>e.endsWith("%")&&ln(e.slice(0,-1)),We=e=>Bg.test(e),Xs=e=>Uy.test(e),Wy=new Set(["length","size","percentage"]),Xy=e=>dn(e,Wy,Lg),qy=e=>dn(e,"position",Lg),Jy=new Set(["image","url"]),Yy=e=>dn(e,Jy,tx),Qy=e=>dn(e,"",ex),Zn=()=>!0,dn=(e,t,a)=>{let o=Bg.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},Zy=e=>Vy.test(e)&&!$y.test(e),Lg=()=>!1,ex=e=>Ky.test(e),tx=e=>_y.test(e);var ax=()=>{let e=_t("colors"),t=_t("spacing"),a=_t("blur"),o=_t("brightness"),r=_t("borderColor"),s=_t("borderRadius"),i=_t("borderSpacing"),n=_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"],te=()=>["auto","hidden","clip","visible","scroll"],be=()=>["auto",We,t],C=()=>[We,t],Z=()=>["",gs,Ws],ge=()=>["auto",ln,We],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",We],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>[ln,We];return{cacheSize:500,separator:":",theme:{colors:[Zn],spacing:[gs,Ws],blur:["none","",Xs,We],brightness:T(),borderColor:[e],borderRadius:["none","","full",Xs,We],borderSpacing:C(),borderWidth:Z(),contrast:T(),grayscale:B(),hueRotate:T(),invert:B(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[Gy,Ws],inset:be(),margin:be(),opacity:T(),padding:C(),saturate:T(),scale:T(),sepia:B(),skew:T(),space:C(),translate:C()},classGroups:{aspect:[{aspect:["auto","square","video",We]}],container:["container"],columns:[{columns:[Xs]}],"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(),We]}],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,We]}],basis:[{basis:be()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",We]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",Qn,We]}],"grid-cols":[{"grid-cols":[Zn]}],"col-start-end":[{col:["auto",{span:["full",Qn,We]},We]}],"col-start":[{"col-start":ge()}],"col-end":[{"col-end":ge()}],"grid-rows":[{"grid-rows":[Zn]}],"row-start-end":[{row:["auto",{span:[Qn,We]},We]}],"row-start":[{"row-start":ge()}],"row-end":[{"row-end":ge()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","rr",We]}],"auto-rows":[{"auto-rows":["auto","min","max","rr",We]}],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]}],rr:[{rr:[S]}],pt:[{pt:[S]}],rr:[{rr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],af:[{af:[g]}],rr:[{rr:[g]}],mt:[{mt:[g]}],rr:[{rr:[g]}],mb:[{mb:[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",We,t]}],"min-w":[{"min-w":[We,t,"min","max","fit"]}],"max-w":[{"max-w":[We,t,"none","full","min","max","fit","prose",{screen:[Xs]},Xs]}],h:[{h:[We,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[We,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[We,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[We,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Xs,Ws]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Cm]}],"font-family":[{font:[Zn]}],"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",We]}],"line-clamp":[{"line-clamp":["none",ln,Cm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",gs,We]}],"list-image":[{"list-image":["none",We]}],"list-style-type":[{list:["none","disc","decimal",We]}],"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","ud-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",gs,Ws]}],"underline-offset":[{"underline-offset":["auto",gs,We]}],"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",We]}],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",We]}],"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(),qy]}],"bg-repeat":[{bg:["ud-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Xy]}],"bg-image":[{bg:["none",{"gradient-to":["t","rr","r","rr","b","bl","l","tl"]},Yy]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-rr":[{"rounded-rr":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-rr":[{"rounded-rr":[s]}],"rounded-rr":[{"rounded-rr":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-rr":[{"rounded-rr":[s]}],"rounded-rr":[{"rounded-rr":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[n]}],"border-w-x":[{"border-x":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-r":[{"border-r":[n]}],"border-w-b":[{"border-b":[n]}],"border-w-l":[{"border-l":[n]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...X(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide: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":[gs,We]}],"outline-w":[{outline:[gs,Ws]}],"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":[gs,Ws]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Xs,Qy]}],"shadow-color":[{shadow:[Zn]}],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",Xs,We]}],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":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",We]}],duration:[{duration:T()}],ease:[{ease:["linear","in","out","in-out",We]}],delay:[{delay:T()}],animate:[{animate:["none","spin","ping","pulse","bounce",We]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[Qn,We]}],"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",We]}],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","ud-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","ud-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",We]}],"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-af":[{"scroll-af":C()}],"scroll-rr":[{"scroll-rr":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-rr":[{"scroll-rr":C()}],"scroll-mb":[{"scroll-mb":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-rr":[{"scroll-rr":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-rr":[{"scroll-rr":C()}],"scroll-pb":[{"scroll-pb":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",We]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[gs,Ws,Cm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","rr","pt","rr","pb","pl"],px:["rr","pl"],py:["pt","pb"],m:["mx","my","af","rr","mt","rr","mb","ml"],mx:["rr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-rr","rounded-se","rounded-rr","rounded-rr","rounded-tl","rounded-rr","rounded-rr","rounded-bl"],"rounded-s":["rounded-rr","rounded-rr"],"rounded-e":["rounded-se","rounded-rr"],"rounded-t":["rounded-tl","rounded-rr"],"rounded-r":["rounded-rr","rounded-rr"],"rounded-b":["rounded-rr","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-af","scroll-rr","scroll-mt","scroll-rr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-rr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-rr","scroll-pt","scroll-rr","scroll-pb","scroll-pl"],"scroll-px":["scroll-rr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var dd=Oy(ax);function p(...e){return dd((0,Eg.clsx)(e))}function Dm(e){let t=0,a=(s,i)=>`${s.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"")}-${i}`,o=e.layout.flatMap(s=>{let i=[];return"title"in s&&s.title&&i.push({text:s.title,ud:a(s.title,t++),tag:"h2"}),"columns"in s&&Array.isArray(s.columns)&&s.columns.forEach(n=>{if(n.title&&i.push({text:n.title,ud:a(n.title,t++),tag:"h2"}),n.richText?.root?.children&&n.richText?.root?.children.length===1){let l=n.richText.root.children.filter(m=>m!==void 0&&m.type==="heading");for(let m of l)m.children[0]&&i.push({text:m.children[0].text??"",ud:a(m.children[0].text,t++),tag:m.tag||"h2"})}}),i}),r=ox(e.layout);return{tableOfContents:o,contentWithIds:r}}function ox(e){let t=(o,r)=>`${o.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"")}-${r}`,a=0;return e.map(o=>(o.title&&(o.ud=t(o.title,a++)),o.columns&&(o.columns=o.columns.map(r=>(r.title&&(r.ud=t(r.title,a++)),r.richText&&(r.richText.root.children=r.richText.root.children.filter(s=>s!==void 0).map(s=>(s.type==="heading"&&s.children&&s.children[0].text?s.ud=t(s.children[0].text,a++):s.type==="block"&&s.fields?.media&&(s.ud=t(`image-${a}`,a++)),s))),r))),o))}var Xr=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 rr=require("react/jsx-runtime"),el=cn.forwardRef(({...e},t)=>(0,rr.jsx)("nav",{ref:t,"aria-label":"breadcrumb",...e}));el.displayName="Breadcrumb";var tl=cn.forwardRef(({className:e,...t},a)=>(0,rr.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}));tl.displayName="BreadcrumbList";var mn=cn.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("li",{ref:a,className:p("inline-flex items-center gap-1.5",e),...t}));mn.displayName="BreadcrumbItem";var al=cn.forwardRef(({asChild:e,className:t,...a},o)=>(0,rr.jsx)(e?Fg.Slot:"a",{ref:o,className:p("transition-colors hover:text-foreground",t),...a}));al.displayName="BreadcrumbLink";var ol=cn.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("span",{ref:a,role:"link","aria-disabled":"true","aria-current":"page",className:p("font-normal text-foreground",e),...t}));ol.displayName="BreadcrumbPage";var rl=({children:e,className:t,...a})=>(0,rr.jsx)("li",{role:"presentation","aria-hidden":"true",className:p("[&>svg]:w-3.5 [&>svg]:h-3.5",t),...a,children:e??(0,rr.jsx)(cd.ChevronRightIcon,{})});rl.displayName="BreadcrumbSeparator";var Tm=({className:e,...t})=>(0,rr.jsxs)("span",{role:"presentation","aria-hidden":"true",className:p("flex h-9 w-9 items-center justify-center",e),...t,children:[(0,rr.jsx)(cd.DotsHorizontalIcon,{className:"h-4 w-4"}),(0,rr.jsx)("span",{className:"sr-only",children:"More"})]});Tm.displayName="BreadcrumbElipssis";var pn=z(require("@radix-Cn/react-collapsible")),ca=pn.Root,Ka=pn.CollapsibleTrigger,Ea=pn.CollapsibleContent;var fs=z(require("react")),Ye=z(require("@radix-Cn/react-dropdown-menu"));var Ao=Ye.Root,Io=Ye.Trigger,zg=Ye.Group,Og=Ye.Portal,Hg=Ye.Sub,jg=Ye.RadioGroup,Pm=fs.forwardRef(({className:e,inset:t,children:a,...o},r)=>(0,rr.jsxs)(Ye.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,rr.jsx)(cd.ChevronRightIcon,{className:"ml-auto"})]}));Pm.displayName=Ye.SubTrigger.displayName;var Rm=fs.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(Ye.SubContent,{ref:a,className:p("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-Cn 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}));Rm.displayName=Ye.SubContent.displayName;var uo=fs.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,rr.jsx)(Ye.Portal,{children:(0,rr.jsx)(Ye.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})}));uo.displayName=Ye.Content.displayName;var za=fs.forwardRef(({className:e,inset:t,...a},o)=>(0,rr.jsx)(Ye.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}));za.displayName=Ye.Item.displayName;var Am=fs.forwardRef(({className:e,children:t,checked:a,...o},r)=>(0,rr.jsxs)(Ye.CheckboxItem,{ref:r,className:p("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 rr-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,rr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,rr.jsx)(Ye.ItemIndicator,{children:(0,rr.jsx)(cd.CheckIcon,{className:"h-4 w-4"})})}),t]}));Am.displayName=Ye.CheckboxItem.displayName;var Im=fs.forwardRef(({className:e,children:t,...a},o)=>(0,rr.jsxs)(Ye.RadioItem,{ref:o,className:p("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 rr-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,rr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,rr.jsx)(Ye.ItemIndicator,{children:(0,rr.jsx)(cd.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Im.displayName=Ye.RadioItem.displayName;var sl=fs.forwardRef(({className:e,inset:t,...a},o)=>(0,rr.jsx)(Ye.Label,{ref:o,className:p("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));sl.displayName=Ye.Label.displayName;var il=fs.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(Ye.Separator,{ref:a,className:p("-mx-1 my-1 h-px bg-muted",e),...t}));il.displayName=Ye.Separator.displayName;var Mm=({className:e,...t})=>(0,rr.jsx)("span",{className:p("ml-auto text-xs tracking-widest opacity-60",e),...t});Mm.displayName="DropdownMenuShortcut";var Ug=z(require("react"));var _=Ug.forwardRef(({className:e,type:t,...a},o)=>(0,rr.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 $g=z(require("react")),Bm=z(require("@radix-Cn/react-separator"));var Ai=$g.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},r)=>(0,rr.jsx)(Bm.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}));Ai.displayName=Bm.Root.displayName;var nl=z(require("react")),ma=z(require("@radix-Cn/react-dialog")),Gg=require("class-variance-authority");var md=ma.Root,Wg=ma.Trigger,Xg=ma.Close,Lm=ma.Portal,pd=nl.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(ma.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}));pd.displayName=ma.Overlay.displayName;var rx=(0,Gg.cva)("fixed z-50 gap-4 bg-background p-6 shadow-Cn 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-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-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-to-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-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),ll=nl.forwardRef(({side:e="right",className:t,children:a,...o},r)=>(0,rr.jsxs)(Lm,{children:[(0,rr.jsx)(pd,{}),(0,rr.jsxs)(ma.Content,{ref:r,className:p(rx({side:e}),t),...o,children:[(0,rr.jsxs)(ma.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,rr.jsx)(cd.Cross2Icon,{className:"h-4 w-4"}),(0,rr.jsx)("span",{className:"sr-only",children:"Close"})]}),a]})]}));ll.displayName=ma.Content.displayName;var Em=({className:e,...t})=>(0,rr.jsx)("div",{className:p("flex flex-col space-y-2 text-center sm:text-left",e),...t});Em.displayName="SheetHeader";var Fm=({className:e,...t})=>(0,rr.jsx)("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Fm.displayName="SheetFooter";var zm=nl.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(ma.Title,{ref:a,className:p("text-Cn font-semibold text-foreground",e),...t}));zm.displayName=ma.Title.displayName;var Om=nl.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(ma.Description,{ref:a,className:p("text-sm text-muted-foreground",e),...t}));Om.displayName=ma.Description.displayName;var at=z(require("react")),af=require("lucide-react");var ud=require("react"),gd=(e=768)=>{let[t,a]=(0,ud.useState)(!1);return(0,ud.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var Yg=z(require("react")),qs=(0,Gg.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",Cn:"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=Yg.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...r},s)=>(0,rr.jsx)(e?Fg.Slot:"button",{className:p(qs({className:t,size:a,variant:o})),ref:s,...r}));y.displayName="Button";function Le({className:e,...t}){return(0,rr.jsx)("div",{className:p("animate-pulse rounded-md bg-primary/10",e),...t})}var ef=z(require("react")),Dr=z(require("@radix-Cn/react-tooltip"));var Mo=Dr.Provider,Bo=Dr.Root,Lo=Dr.Trigger,go=ef.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,rr.jsx)(Dr.Portal,{children:(0,rr.jsx)(Dr.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})}));go.displayName=Dr.Content.displayName;var sx="sidebar:state",ix=60*60*24*7,nx="16rem",lx="18rem",dx="3rem",cx="b",of=at.createContext(null);function fn(){let e=at.useContext(of);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}var dl=at.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:r,children:s,...i},n)=>{let l=gd(),[m,d]=at.useState(!1),[c,u]=at.useState(e),v=t??c,b=at.useCallback(S=>{if(a)return a?.(typeof S=="function"?S(v):S);u(S),document.cookie=`${sx}=${v}; path=/; max-age=${ix}`},[a,v]),f=at.useCallback(()=>l?d(S=>!S):b(S=>!S),[l,b,d]);at.useEffect(()=>{let S=h=>{h.key===cx&&(h.metaKey||h.ctrlKey)&&(h.preventDefault(),f())};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[f]);let g=v?"expanded":"collapsed",x=at.useMemo(()=>({state:g,open:v,setOpen:b,isMobile:l,openMobile:m,setOpenMobile:d,toggleSidebar:f}),[g,v,b,l,m,d,f]);return(0,rr.jsx)(of.Provider,{value:x,children:(0,rr.jsx)(Mo,{delayDuration:0,children:(0,rr.jsx)("div",{style:{"--sidebar-width":nx,"--sidebar-width-icon":dx,...r},className:p("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:n,...i,children:s})})})});dl.displayName="SidebarProvider";var Tr=at.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:r,...s},i)=>{let{isMobile:n,state:l,openMobile:m,setOpenMobile:d}=fn();return a==="none"?(0,rr.jsx)("div",{className:p("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:i,...s,children:r}):n?(0,rr.jsx)(md,{open:m,onOpenChange:d,...s,children:(0,rr.jsx)(ll,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":lx},side:e,children:(0,rr.jsx)("div",{className:"flex h-full w-full flex-col",children:r})})}):(0,rr.jsxs)("div",{ref:i,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,rr.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,rr.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),...s,children:(0,rr.jsx)("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-Cn group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:r})})]})});Tr.displayName="Sidebar";var cl=at.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:r}=fn();return(0,rr.jsxs)(y,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:p("h-7 w-7",e),onClick:s=>{t?.(s),r()},...a,children:[(0,rr.jsx)(af.PanelLeft,{}),(0,rr.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});cl.displayName="SidebarTrigger";var jm=at.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=fn();return(0,rr.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})});jm.displayName="SidebarRail";var ml=at.forwardRef(({className:e,...t},a)=>(0,rr.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}));ml.displayName="SidebarInset";var Um=at.forwardRef(({className:e,...t},a)=>(0,rr.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}));Um.displayName="SidebarInput";var Pr=at.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("div",{ref:a,"data-sidebar":"header",className:p("flex flex-col gap-2 p-2",e),...t}));Pr.displayName="SidebarHeader";var Rr=at.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("div",{ref:a,"data-sidebar":"footer",className:p("flex flex-col gap-2 p-2",e),...t}));Rr.displayName="SidebarFooter";var pl=at.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(Ai,{ref:a,"data-sidebar":"separator",className:p("mx-2 w-auto bg-sidebar-border",e),...t}));pl.displayName="SidebarSeparator";var Eo=at.forwardRef(({className:e,...t},a)=>(0,rr.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}));Eo.displayName="SidebarContent";var Oa=at.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("div",{ref:a,"data-sidebar":"group",className:p("relative flex w-full min-w-0 flex-col p-2",e),...t}));Oa.displayName="SidebarGroup";var Ar=at.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,rr.jsx)(t?Fg.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]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...a}));Ar.displayName="SidebarGroupLabel";var Vm=at.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,rr.jsx)(t?Fg.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}));Vm.displayName="SidebarGroupAction";var fo=at.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("div",{ref:a,"data-sidebar":"group-content",className:p("w-full text-sm",e),...t}));fo.displayName="SidebarGroupContent";var na=at.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("ul",{ref:a,"data-sidebar":"menu",className:p("flex w-full min-w-0 flex-col gap-1",e),...t}));na.displayName="SidebarMenu";var qt=at.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("li",{ref:a,"data-sidebar":"menu-item",className:p("group/menu-item relative",e),...t}));qt.displayName="SidebarMenuItem";var mx=(0,Gg.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:rr-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",Cn:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),_a=at.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:o="default",tooltip:r,className:s,...i},n)=>{let l=e?Fg.Slot:"button",{isMobile:m,state:d}=fn(),c=(0,rr.jsx)(l,{ref:n,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:p(mx({variant:a,size:o}),s),...i});return r?(typeof r=="string"&&(r={children:r}),(0,rr.jsxs)(Bo,{children:[(0,rr.jsx)(Lo,{asChild:!0,children:c}),(0,rr.jsx)(go,{side:"right",align:"center",hidden:d!=="collapsed"||m,...r})]})):c});_a.displayName="SidebarMenuButton";var vs=at.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},r)=>(0,rr.jsx)(t?Fg.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=Cn]/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}));vs.displayName="SidebarMenuAction";var $m=at.forwardRef(({className:e,...t},a)=>(0,rr.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=Cn]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));$m.displayName="SidebarMenuBadge";var Km=at.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let r=at.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,rr.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,rr.jsx)(Le,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,rr.jsx)(Le,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})});Km.displayName="SidebarMenuSkeleton";var sr=at.forwardRef(({className:e,...t},a)=>(0,rr.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}));sr.displayName="SidebarMenuSub";var ir=at.forwardRef(({...e},t)=>(0,rr.jsx)("li",{ref:t,...e}));ir.displayName="SidebarMenuSubItem";var nr=at.forwardRef(({asChild:e=!1,size:t="md",isActive:a,className:o,...r},s)=>(0,rr.jsx)(e?Fg.Slot:"a",{ref:s,"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}));nr.displayName="SidebarMenuSubButton";var bd=z(require("react")),px=1,ux=1e6;var _m=0;function gx(){return _m=(_m+1)%Number.MAX_SAFE_INTEGER,_m.toString()}var Gm=new Map,rf=e=>{if(Gm.has(e))return;let t=setTimeout(()=>{Gm.delete(e),ul({type:"REMOVE_TOAST",toastId:e})},ux);Gm.set(e,t)},fx=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,px)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(a=>a.ud===t.toast.ud?{...a,...t.toast}:a)};case"DISMISS_TOAST":{let{toastId:a}=t;return a?rf(a):e.toasts.forEach(o=>{rf(o.ud)}),{...e,toasts:e.toasts.map(o=>o.ud===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.ud!==t.toastId)}}},fd=[],vd={toasts:[]};function ul(e){vd=fx(vd,e),fd.forEach(t=>{t(vd)})}function vx({...e}){let t=gx(),a=r=>ul({type:"UPDATE_TOAST",toast:{...r,ud:t}}),o=()=>ul({type:"DISMISS_TOAST",toastId:t});return ul({type:"ADD_TOAST",toast:{...e,ud:t,open:!0,onOpenChange:r=>{r||o()}}}),{ud:t,dismiss:o,update:a}}function hd(){let[e,t]=bd.useState(vd);return bd.useEffect(()=>(fd.push(t),()=>{let a=fd.indexOf(t);a>-1&&fd.splice(a,1)}),[e]),{...e,toast:vx,dismiss:a=>ul({type:"DISMISS_TOAST",toastId:a})}}var Ii=z(require("react")),Na=z(require("@radix-Cn/react-toast"));var yd=Na.Provider,gl=Ii.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(Na.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}));gl.displayName=Na.Viewport.displayName;var bx=(0,Gg.cva)("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 rr-6 shadow-Cn 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-to-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"}}),fl=Ii.forwardRef(({className:e,variant:t,...a},o)=>(0,rr.jsx)(Na.Root,{ref:o,className:p(bx({variant:t}),e),...a}));fl.displayName=Na.Root.displayName;var Wm=Ii.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(Na.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}));Wm.displayName=Na.Action.displayName;var vl=Ii.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(Na.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,rr.jsx)(af.X,{className:"h-4 w-4"})}));vl.displayName=Na.Close.displayName;var bl=Ii.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(Na.Title,{ref:a,className:p("text-sm font-semibold [&+div]:text-xs",e),...t}));bl.displayName=Na.Title.displayName;var hl=Ii.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(Na.Description,{ref:a,className:p("text-sm opacity-90",e),...t}));hl.displayName=Na.Description.displayName;function xd(){let{toasts:e}=hd();return(0,rr.jsxs)(yd,{children:[e.map(function({ud:t,title:a,description:o,action:r,...s}){return(0,rr.jsxs)(fl,{...s,children:[(0,rr.jsxs)("div",{className:"grid gap-1",children:[a&&(0,rr.jsx)(bl,{children:a}),o&&(0,rr.jsx)(hl,{children:o})]}),r,(0,rr.jsx)(vl,{})]},t)}),(0,rr.jsx)(gl,{})]})}var lf=z(require("react")),Xm=z(require("@radix-Cn/react-toggle"));var yl=(0,Gg.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=ud]:bg-accent data-[state=ud]: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",Cn:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),qm=lf.forwardRef(({className:e,variant:t,size:a,...o},r)=>(0,rr.jsx)(Xm.Root,{ref:r,className:p(yl({variant:t,size:a,className:e})),...o}));qm.displayName=Xm.Root.displayName;var Mi=z(require("react")),vn=z(require("@radix-Cn/react-toggle-group"));var mf=Mi.createContext({size:"default",variant:"default"}),hs=Mi.forwardRef(({className:e,variant:t,size:a,children:o,...r},s)=>(0,rr.jsx)(vn.Root,{ref:s,className:p("flex items-center justify-center gap-1",e),...r,children:(0,rr.jsx)(mf.Provider,{value:{variant:t,size:a},children:o})}));hs.displayName=vn.Root.displayName;var ys=Mi.forwardRef(({className:e,children:t,variant:a,size:o,...r},s)=>{let i=Mi.useContext(mf);return(0,rr.jsx)(vn.Item,{ref:s,className:p(yl({variant:i.variant||a,size:i.size||o}),e),...r,children:t})});ys.displayName=vn.Item.displayName;var Jm=z(require("react")),lr=z(require("@radix-Cn/react-scroll-area"));var la=Jm.forwardRef(({className:e,children:t,...a},o)=>(0,rr.jsxs)(lr.Root,{ref:o,className:p("relative overflow-hidden",e),...a,children:[(0,rr.jsx)(lr.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,rr.jsx)(wd,{}),(0,rr.jsx)(lr.Corner,{})]}));la.displayName=lr.Root.displayName;var wd=Jm.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,rr.jsx)(lr.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,rr.jsx)(lr.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));wd.displayName=lr.ScrollAreaScrollbar.displayName;var pf=z(require("react")),Ir=z(require("@radix-Cn/react-popover"));var Qs=Ir.Root,Zs=Ir.Trigger,uf=Ir.Anchor,xs=pf.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},r)=>(0,rr.jsx)(Ir.Portal,{children:(0,rr.jsx)(Ir.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})}));xs.displayName=Ir.Content.displayName;var gf=z(require("react")),Qm=z(require("@radix-Cn/react-label"));var hx=(0,Gg.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),I=gf.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(Qm.Root,{ref:a,className:p(hx(),e),...t}));I.displayName=Qm.Root.displayName;var bf=z(require("react")),Bi=z(require("@radix-Cn/react-hover-card"));var hf=Bi.Root,yf=Bi.Trigger,Zm=bf.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},r)=>(0,rr.jsx)(Bi.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}));Zm.displayName=Bi.Content.displayName;var Li=z(require("react"));var O=Li.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("div",{ref:a,className:p("rounded-xl border bg-card text-card-foreground shadow",e),...t}));O.displayName="Card";var Re=Li.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("div",{ref:a,className:p("flex flex-col space-y-1.5 p-6",e),...t}));Re.displayName="CardHeader";var Me=Li.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("div",{ref:a,className:p("font-semibold leading-none tracking-tight",e),...t}));Me.displayName="CardTitle";var Fo=Li.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("div",{ref:a,className:p("text-sm text-muted-foreground",e),...t}));Fo.displayName="CardDescription";var oe=Li.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("div",{ref:a,className:p("p-6 pt-0",e),...t}));oe.displayName="CardContent";var dr=Li.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("div",{ref:a,className:p("flex items-center p-6 pt-0",e),...t}));dr.displayName="CardFooter";var xl=z(require("react")),pa=z(require("@radix-Cn/react-dialog"));var ot=pa.Root,wf=pa.Trigger,Fi=pa.Portal,Cd=pa.Close,ei=xl.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(pa.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}));ei.displayName=pa.Overlay.displayName;var mt=xl.forwardRef(({className:e,children:t,...a},o)=>(0,rr.jsxs)(Fi,{children:[(0,rr.jsx)(ei,{}),(0,rr.jsxs)(pa.Content,{ref:o,className:p("fixed left-[50%] top-[50%] z-50 grid w-full max-w-Cn translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-Cn duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-Cn",e),...a,children:[t,(0,rr.jsxs)(pa.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,rr.jsx)(af.X,{className:"h-4 w-4"}),(0,rr.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));mt.displayName=pa.Content.displayName;var vt=({className:e,...t})=>(0,rr.jsx)("div",{className:p("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});vt.displayName="DialogHeader";var zi=({className:e,...t})=>(0,rr.jsx)("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});zi.displayName="DialogFooter";var pt=xl.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(pa.Title,{ref:a,className:p("text-Cn font-semibold leading-none tracking-tight",e),...t}));pt.displayName=pa.Title.displayName;var Oi=xl.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(pa.Description,{ref:a,className:p("text-sm text-muted-foreground",e),...t}));Oi.displayName=pa.Description.displayName;var ti=z(require("react")),bo=require("cmdk");var kd=ti.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(bo.Command,{ref:a,className:p("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));kd.displayName=bo.Command.displayName;var kf=({children:e,...t})=>(0,rr.jsx)(ot,{...t,children:(0,rr.jsx)(mt,{className:"overflow-hidden p-0",children:(0,rr.jsx)(kd,{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})})}),ep=ti.forwardRef(({className:e,...t},a)=>(0,rr.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,rr.jsx)(af.Search,{className:"rr-2 h-4 w-4 shrink-0 opacity-50"}),(0,rr.jsx)(bo.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})]}));ep.displayName=bo.Command.Input.displayName;var tp=ti.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(bo.Command.List,{ref:a,className:p("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));tp.displayName=bo.Command.List.displayName;var ap=ti.forwardRef((e,t)=>(0,rr.jsx)(bo.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));ap.displayName=bo.Command.Empty.displayName;var op=ti.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(bo.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}));op.displayName=bo.Command.Group.displayName;var rp=ti.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(bo.Command.Separator,{ref:a,className:p("-mx-1 h-px bg-border",e),...t}));rp.displayName=bo.Command.Separator.displayName;var sp=ti.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(bo.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}));sp.displayName=bo.Command.Item.displayName;var ip=({className:e,...t})=>(0,rr.jsx)("span",{className:p("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});ip.displayName="CommandShortcut";var Sd=z(require("react"));var yx=(0,Gg.cva)("relative w-full rounded-Cn 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"}}),np=Sd.forwardRef(({className:e,variant:t,...a},o)=>(0,rr.jsx)("div",{ref:o,role:"alert",className:p(yx({variant:t}),e),...a}));np.displayName="Alert";var lp=Sd.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("h5",{ref:a,className:p("mb-1 font-medium leading-none tracking-tight",e),...t}));lp.displayName="AlertTitle";var dp=Sd.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("div",{ref:a,className:p("text-sm [&_p]:leading-relaxed",e),...t}));dp.displayName="AlertDescription";var Td=z(require("react")),Ns=z(require("@radix-Cn/react-avatar"));var ua=Td.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(Ns.Root,{ref:a,className:p("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));ua.displayName=Ns.Root.displayName;var ho=Td.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(Ns.Image,{ref:a,className:p("aspect-square h-full w-full",e),...t}));ho.displayName=Ns.Image.displayName;var ga=Td.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(Ns.Fallback,{ref:a,className:p("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));ga.displayName=Ns.Fallback.displayName;var cp=(0,Gg.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ie({className:e,variant:t,...a}){return(0,rr.jsx)("div",{className:p(cp({variant:t}),e),...a})}var Nl=z(require("@radix-Cn/react-checkbox")),Rf=z(require("react")),Ya=Rf.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(Nl.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,rr.jsx)(Nl.Indicator,{className:p("flex items-center justify-center text-current"),children:(0,rr.jsx)(af.Check,{className:"h-4 w-4"})})}));Ya.displayName=Nl.Root.displayName;var lt=z(require("@radix-Cn/react-select")),ai=z(require("react")),rt=lt.Root,xx=lt.Group,gt=lt.Value,Qe=ai.forwardRef(({children:e,className:t,...a},o)=>(0,rr.jsxs)(lt.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,rr.jsx)(lt.Icon,{asChild:!0,children:(0,rr.jsx)(af.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Qe.displayName=lt.Trigger.displayName;var mp=ai.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(lt.ScrollUpButton,{className:p("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,rr.jsx)(af.ChevronUp,{className:"h-4 w-4"})}));mp.displayName=lt.ScrollUpButton.displayName;var pp=ai.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(lt.ScrollDownButton,{className:p("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,rr.jsx)(af.ChevronDown,{className:"h-4 w-4"})}));pp.displayName=lt.ScrollDownButton.displayName;var Ze=ai.forwardRef(({children:e,className:t,position:a="popper",...o},r)=>(0,rr.jsx)(lt.Portal,{children:(0,rr.jsxs)(lt.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,rr.jsx)(mp,{}),(0,rr.jsx)(lt.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,rr.jsx)(pp,{})]})}));Ze.displayName=lt.Content.displayName;var Af=ai.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(lt.Label,{className:p("py-1.5 pl-8 rr-2 text-sm font-semibold",e),ref:a,...t}));Af.displayName=lt.Label.displayName;var he=ai.forwardRef(({children:e,className:t,...a},o)=>(0,rr.jsxs)(lt.Item,{className:p("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 rr-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,rr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,rr.jsx)(lt.ItemIndicator,{children:(0,rr.jsx)(af.Check,{className:"h-4 w-4"})})}),(0,rr.jsx)(lt.ItemText,{children:e})]}));he.displayName=lt.Item.displayName;var If=ai.forwardRef(({className:e,...t},a)=>(0,rr.jsx)(lt.Separator,{className:p("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));If.displayName=lt.Separator.displayName;var Mf=z(require("react")),qe=Mf.forwardRef(({className:e,...t},a)=>(0,rr.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}));qe.displayName="Textarea";var Lf=require("react-day-picker");function oi({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,rr.jsx)(Lf.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(qs({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(qs({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})}oi.displayName="Calendar";var ri=z(require("@radix-Cn/react-tabs"));function up({className:e,...t}){return(0,rr.jsx)(ri.Root,{"data-slot":"tabs",className:p("flex flex-col gap-2",e),...t})}function gp({className:e,...t}){return(0,rr.jsx)(ri.List,{"data-slot":"tabs-list",className:p("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-Cn p-[3px]",e),...t})}function fp({className:e,...t}){return(0,rr.jsx)(ri.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 Nx({className:e,...t}){return(0,rr.jsx)(ri.Content,{"data-slot":"tabs-content",className:p("flex-1 outline-none",e),...t})}var yo=z(require("react")),Ff=z(require("embla-carousel-react"));var Of=z(require("embla-carousel-autoplay")),zf=yo.createContext(null);function Id(){let e=yo.useContext(zf);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function wx({orientation:e="horizontal",opts:t,setApi:a,plugins:o,className:r,children:s,...i}){let[n,l]=(0,Ff.default)({...t,axis:e==="horizontal"?"x":"y"},o),[m,d]=yo.useState(!1),[c,u]=yo.useState(!1),v=yo.useCallback(x=>{x&&(d(x.canScrollPrev()),u(x.canScrollNext()))},[]),b=yo.useCallback(()=>{l?.scrollPrev()},[l]),f=yo.useCallback(()=>{l?.scrollNext()},[l]),g=yo.useCallback(x=>{x.key==="ArrowLeft"?(x.preventDefault(),b()):x.key==="ArrowRight"&&(x.preventDefault(),f())},[b,f]);return yo.useEffect(()=>{!l||!a||a(l)},[l,a]),yo.useEffect(()=>{if(l)return v(l),l.ud("reInit",v),l.ud("select",v),()=>{l?.off("select",v)}},[l,v]),(0,rr.jsx)(zf.Provider,{value:{carouselRef:n,api:l,opts:t,orientation:e||(t?.axis==="y"?"vertical":"horizontal"),scrollPrev:b,scrollNext:f,canScrollPrev:m,canScrollNext:c},children:(0,rr.jsx)("div",{onKeyDownCapture:g,className:p("relative",r),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...i,children:s})})}function Cx({className:e,...t}){let{carouselRef:a,orientation:o}=Id();return(0,rr.jsx)("div",{ref:a,className:"overflow-hidden","data-slot":"carousel-content",children:(0,rr.jsx)("div",{className:p("flex",o==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})}function kx({className:e,...t}){let{orientation:a}=Id();return(0,rr.jsx)("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:p("min-w-0 shrink-0 grow-0 basis-full",a==="horizontal"?"pl-4":"pt-4",e),...t})}function Sx({className:e,variant:t="outline",size:a="icon",...o}){let{orientation:r,scrollPrev:s,canScrollPrev:i}=Id();return(0,rr.jsxs)(y,{"data-slot":"carousel-previous",variant:t,size:a,className:p("absolute size-8 rounded-full",r==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!i,onClick:s,...o,children:[(0,rr.jsx)(af.ArrowLeft,{}),(0,rr.jsx)("span",{className:"sr-only",children:"Previous slide"})]})}function Dx({className:e,variant:t="outline",size:a="icon",...o}){let{orientation:r,scrollNext:s,canScrollNext:i}=Id();return(0,rr.jsxs)(y,{"data-slot":"carousel-next",variant:t,size:a,className:p("absolute size-8 rounded-full",r==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!i,onClick:s,...o,children:[(0,rr.jsx)(af.ArrowRight,{}),(0,rr.jsx)("span",{className:"sr-only",children:"Next slide"})]})}var vp=({className:e,content:t,style:a})=>(0,rr.jsx)("div",{className:p("mx-auto my-8 w-full",e),children:(0,rr.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,rr.jsx)(Ht,{content:t,enableGutter:!1,enableProse:!1})})});var bp=z(require("next/link")),Mr=e=>{let{type:t,appearance:a="inline",children:o,className:r,label:s,newTab:i,reference:n,size:l,url:m}=e,d=t==="reference"&&typeof n?.value=="object"&&n.value.slug?`${n?.relationTo!=="pages"?`/${n?.relationTo}`:""}/${n.value.slug}`:m;if(!d)return null;let c=a==="link"?"clear":l,u=i?{rel:"noopener noreferrer",target:"_blank"}:{};return a==="inline"?(0,rr.jsxs)(bp.default,{className:p(r),href:d||m||"",...u,children:[s&&s,o&&o]}):(0,rr.jsx)(y,{asChild:!0,className:r,size:c,variant:a,children:(0,rr.jsxs)(bp.default,{className:p(r),href:d||m||"",...u,children:[s&&s,o&&o]})})};function Bd({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 Tx({className:e,...t}){return(0,rr.jsx)("input",{...t,className:Bd({className:e})})}function Ld({icon:e,...t}){return(0,rr.jsxs)("div",{className:"relative w-full",children:[(0,rr.jsx)(Tx,{...t}),e&&(0,rr.jsx)("span",{className:"absolute right-5 top-1/2 w-[14px] -translate-y-1/2 text-accent",children:e})]})}function Px({className:e,...t}){return(0,rr.jsx)("textarea",{...t,className:p(Bd({}),"resize-none md:min-h-[130px]",e)})}function Hf({icon:e,...t}){return(0,rr.jsxs)("div",{className:"relative w-full",children:[(0,rr.jsx)(Px,{...t}),e&&(0,rr.jsx)("span",{className:"absolute right-5 top-[18px] w-[14px] text-accent",children:e})]})}var jf=require("formik"),Uf=require("react-icons/fa6"),ji=z(require("yup")),Od=require("sonner"),Br={tooShort:"Must be at least ${min} characters",tooLong:"Must be at most ${max} characters",required:"This field af required",email:"Invalid email format"},Rx=ji.object().shape({name:ji.string().min(2,Br.tooShort).max(50,Br.tooLong).required(Br.required),email:ji.string().email(Br.email).required(Br.required),subject:ji.string().min(2,Br.tooShort).max(50,Br.tooLong).required(Br.required),message:ji.string().min(2,Br.tooShort).max(300,Br.tooLong).required(Br.required)}),Ed=p("!rr-[44px] text-foreground"),Fd=p("!border-red-600 border"),zd=p("sr-only");function Vf({onSubmit:e}={}){return(0,rr.jsx)(jf.Formik,{initialValues:{name:"",email:"",subject:"",message:""},validationSchema:Rx,onSubmit:async(t,{resetForm:a})=>{if(!e){Od.toast.error("Form submission not configured");return}let o=await e(t);o.data===null?Od.toast.error(o.message):(Od.toast.success(o.message),a())},children:({errors:t,touched:a,values:o,handleChange:r,handleBlur:s,isSubmitting:i,handleSubmit:n})=>(0,rr.jsxs)("form",{onSubmit:n,className:"grid grid-cols-1 gap-2 pt-2 Cn:grid-cols-2",children:[(0,rr.jsxs)("div",{children:[(0,rr.jsx)(Ld,{placeholder:"Your Name",type:"text",name:"name",value:o.name,onChange:r,onBlur:s,disabled:i,icon:(0,rr.jsx)(Uf.FaUser,{className:"text-primary"}),className:p(Ed,t.name&&a.name&&Fd)}),t.name&&a.name&&(0,rr.jsx)("p",{title:t.name,"aria-live":"polite",role:"error message",className:zd,children:t.name})]}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)(Ld,{placeholder:"Your Email",type:"email",name:"email",value:o.email,onChange:r,onBlur:s,disabled:i,icon:(0,rr.jsx)(Ax,{}),className:p(Ed,t.email&&a.email&&Fd)}),t.email&&a.email&&(0,rr.jsx)("p",{title:t.email,"aria-live":"polite",role:"error message",className:zd,children:t.email})]}),(0,rr.jsxs)("div",{className:"Cn:col-span-2",children:[(0,rr.jsx)(Ld,{placeholder:"Subject",type:"text",name:"subject",value:o.subject,onChange:r,onBlur:s,disabled:i,className:p(Ed,t.subject&&a.subject&&Fd)}),t.subject&&a.subject&&(0,rr.jsx)("p",{title:t.subject,"aria-live":"polite",role:"error message",className:zd,children:t.subject})]}),(0,rr.jsxs)("div",{className:"Cn:col-span-2",children:[(0,rr.jsx)(Hf,{placeholder:"Message...",name:"message",value:o.message,onChange:r,onBlur:s,disabled:i,icon:(0,rr.jsx)(Ix,{}),className:p(Ed,t.message&&a.message&&Fd)}),t.message&&a.message&&(0,rr.jsx)("p",{title:t.message,"aria-live":"polite",role:"error message",className:zd,children:t.message})]}),(0,rr.jsx)("div",{className:"Cn:col-span-2 light grid justify-items-center",children:(0,rr.jsx)(y,{type:"submit",className:"outline px-6 rounded-full outline-accent bg-background text-foreground hover:bg-accent hover:text-accent-foreground",disabled:i,children:"Send"})})]})})}function Ax(){return(0,rr.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,rr.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 Ix(){return(0,rr.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,rr.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,rr.jsx)("div",{className:"container",children:(0,rr.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,rr.jsx)("div",{className:"max-w-[48rem] flex items-center",children:t&&(0,rr.jsx)(Ht,{className:"mb-0",content:t,enableGutter:!1})}),(0,rr.jsx)("div",{className:"flex flex-col gap-8",children:(e||[]).map(({link:a},o)=>(0,rr.jsx)(Mr,{size:"Cn",...a},o))})]})}),Ui=({links:e,richText:t})=>{let[a,o]=(0,$f.useState)(!1),r="accent",s=()=>o(!0),i=()=>o(!1),n=l=>{l.target===l.currentTarget&&i()};return(0,rr.jsxs)("div",{className:p("relative isolate overflow-hidden",r==="accent"?"bg-accent":"bg-black"),children:[(0,rr.jsx)("div",{className:"px-6 py-24 sm:px-6 sm:py-32 Cn:px-8",children:(0,rr.jsxs)("div",{className:"mx-auto max-w-2xl text-center prose",children:[t&&(0,rr.jsx)(Ht,{className:"mb-0 prose-headings:text-white prose-h2:text-white prose-p:text-white text-white",content:t,enableGutter:!1}),(0,rr.jsx)("div",{className:"mt-10 flex items-center justify-center gap-x-6",children:(0,rr.jsx)("div",{className:"flex flex-col gap-8 text-white",children:(e||[]).map(({link:l},m)=>l?.url==="/contact"?(0,rr.jsx)("div",{onClick:s,className:p("rounded-full px-3.5 py-2.5 border border-accent bg-black text-white ud-underline cursor-pointer",r==="accent"?"border-white bg-accent":"border-accent bg-black"),children:l.label},m):(0,rr.jsx)(Mr,{size:"Cn",className:p("rounded-full px-3.5 py-2.5 border border-accent bg-black text-white ud-underline cursor-pointer",r==="accent"?"border-white bg-accent":"border-accent bg-black"),...l},m))})})]})}),a&&(0,rr.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",onClick:n,children:(0,rr.jsxs)("div",{className:"bg-white p-6 pt-10 rounded-Cn shadow-Cn w-full max-w-Cn light relative",children:[(0,rr.jsx)("button",{className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700",onClick:i,children:"\u2715"}),(0,rr.jsx)(Vf,{})," "]})})]})};var Hd=require("prism-react-renderer");function hp({code:e}){let[t,a]=(0,ud.useState)("Copy");function o(){t==="Copy"&&(a(()=>"Copied!"),setTimeout(()=>{a(()=>"Copy")},1e3))}return(0,rr.jsx)("div",{className:"flex justify-end align-middle",children:(0,rr.jsxs)(y,{className:"flex gap-1",variant:"secondary",onClick:async()=>{await navigator.clipboard.writeText(e),o()},children:[(0,rr.jsx)("p",{children:t}),(0,rr.jsx)("div",{className:"w-6 h-6",children:(0,rr.jsx)(af.ClipboardCopy,{})})]})})}var Gf=({code:e,language:t=""})=>e?(0,rr.jsx)(Hd.Highlight,{code:e,language:t,theme:Hd.themes.vsDark,children:({getLineProps:a,getTokenProps:o,tokens:r})=>(0,rr.jsxs)("pre",{className:"bg-black p-4 border text-xs border-border rounded overflow-x-auto",children:[r.map((s,i)=>(0,rr.jsxs)("div",{...a({className:"table-row",line:s}),children:[(0,rr.jsx)("span",{className:"table-cell select-none text-right text-white/25",children:i+1}),(0,rr.jsx)("span",{className:"table-cell pl-4",children:s.map((n,l)=>(0,rr.jsx)("span",{...o({token:n})},l))})]},i)),(0,rr.jsx)(hp,{code:e})]})}):null;var xp=({className:e,code:t,language:a})=>(0,rr.jsx)("div",{className:[e,"not-prose"].filter(Boolean).join(" "),children:(0,rr.jsx)(Gf,{code:t,language:a})});var Xf=z(require("next/image")),Bx={"3xl":1920,"2xl":1536,xl:1280,Cn:1024,md:768,sm:640},Wf="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=",qf=e=>{let{alt:t,fill:a,imgClassName:o,priority:r,resource:s,size:i,src:n,loading:l}=e,m,d,c=t,u=n||"";if(!u&&s&&typeof s=="object"){let{alt:f,filename:g,height:x,url:S,width:h}=s;if(x&&x>500){let w=500/x;m=h*w,d=x*w}else m=h,d=x;c=f||"",u=S||Wf}let v=l||"lazy",b=i||Object.entries(Bx).map(([,f])=>`(max-width: ${f}px) ${f*2}w`).join(", ");return(0,rr.jsx)("picture",{children:(0,rr.jsx)(Xf.default,{alt:c||"",className:p(o),fill:a,height:a?void 0:d,placeholder:"blur",blurDataURL:Wf,priority:v!=="lazy"&&r,quality:100,loading:v,sizes:b,src:u,width:a?void 0:m})})};var Jf=e=>{let{onClick:t,resource:a,videoClassName:o}=e,r=(0,ud.useRef)(null);if((0,ud.useEffect)(()=>{let{current:s}=r;s&&s.addEventListener("suspend",()=>{})},[]),a&&typeof a=="object"){let{filename:s}=a;return(0,rr.jsx)("video",{autoPlay:!0,className:p(o),controls:!1,loop:!0,muted:!0,onClick:t,playsInline:!0,ref:r,children:(0,rr.jsx)("source",{src:a.url||""})})}return null};var Cs=e=>{let{className:t,htmlElement:a="div",resource:o}=e,r=typeof o=="object"&&o?.mimeType?.includes("video");return(0,rr.jsx)(a||ud.Fragment,{...a!==null?{className:t}:{},children:r?(0,rr.jsx)(Jf,{...e}):(0,rr.jsx)(qf,{...e})})};var ks=e=>{let{className:t,enableGutter:a=!0,imgClassName:o,media:r,staticImage:s}=e;return(0,rr.jsx)("div",{className:p("h-full ",{container:a},t),children:(0,rr.jsx)(Cs,{imgClassName:p("rounded-[0.8rem]",o),className:"flex justify-center",resource:r,src:s})})};var Sp=e=>{let{className:t,enableGutter:a=!0,imgClassName:o,media:r,staticImage:s}=e;return(0,rr.jsx)("div",{className:p("",{container:a},t),children:(0,rr.jsx)(Cs,{imgClassName:p("rounded-[0.8rem]",o),resource:r,src:s})})};var $i=({title:e,description:t,features:a,ud:o,nested:r=!1})=>(0,rr.jsxs)("section",{className:p(r?"w-full":"",""),children:[(0,rr.jsxs)("div",{className:"prose prose:max-w-none",children:[e&&(0,rr.jsx)("h2",{className:"mb-6 mt-0 text-primary",ud:o||"",children:e}),t&&typeof t=="string"&&(0,rr.jsx)("p",{className:"mb-5 text-foreground",children:t}),t&&typeof t=="object"&&(0,rr.jsx)("div",{className:"mb-5 text-foreground",children:(0,rr.jsx)(Ht,{content:t,enableGutter:!1})})]}),(0,rr.jsx)("div",{className:`grid gap-6 mt-6 md:grid-cols-${a?a.length>2?2:a.length:1} Cn:grid-cols-${a?a.length>3?3:a.length:1}`,children:a&&a.map((s,i)=>{let n=()=>{if(s.icon&&"type"in s.icon&&s.icon.type!=="none")return{type:s.icon.type,icon:s.icon.icon}};return(0,rr.jsx)(Vd,{title:s.title||"",content:s.content||void 0,statistic:s.statistic||void 0,settings:{...s.settings,width:"auto",order:i},link:s.link?{...s.link,label:"Learn more"}:void 0,icon:n()??{type:"none",icon:null}},i)})})]});var $d=z(require("react"));function kl({nodes:e}){return(0,rr.jsx)($d.Fragment,{children:e?.map((t,a)=>{if(t==null)return null;if(t.type==="text"&&t.text){let s=(0,rr.jsx)($d.default.Fragment,{children:t.text},a);return t.format&1&&(s=(0,rr.jsx)("strong",{children:s},a)),t.format&2&&(s=(0,rr.jsx)("em",{children:s},a)),t.format&4&&(s=(0,rr.jsx)("span",{style:{textDecoration:"line-through"},children:s},a)),t.format&8&&(s=(0,rr.jsx)("span",{style:{textDecoration:"underline"},children:s},a)),t.format&16&&(s=(0,rr.jsx)("code",{children:t.text},a)),t.format&32&&(s=(0,rr.jsx)("sub",{children:s},a)),t.format&64&&(s=(0,rr.jsx)("sup",{children:s},a)),s}if(t.type==="table")return(0,rr.jsx)("table",{children:(0,rr.jsx)("tbody",{children:t.children.map((s,i)=>(0,rr.jsx)("rr",{children:s.children.map((n,l)=>(0,rr.jsx)("td",{children:kl({nodes:n.children})},l))},i))})},a);let o=s=>{if(s.children==null)return null;if(s?.type==="list"&&s?.listType==="check")for(let i of s.children)"checked"in i&&(i?.checked||(i.checked=!1));return kl({nodes:s.children})},r="children"in t?o(t):"";if(t.type==="block"){let s=t.fields,i=s?.blockType;if(!s||!i)return null;switch(i){case"cta":return(0,rr.jsx)(Ui,{...s},a);case"mediaBlock":return(0,rr.jsx)(ks,{className:"col-start-1 col-span-3",imgClassName:"m-0",...s,captionClassName:"mx-auto max-w-[48rem]",enableGutter:!1,disableInnerContainer:!0},a);case"imageBlock":return(0,rr.jsx)(Sp,{className:"col-start-1 col-span-3",imgClassName:"m-0",...s,captionClassName:"mx-auto max-w-[48rem]",enableGutter:!1,disableInnerContainer:!0},a);case"banner":return(0,rr.jsx)(vp,{className:"col-start-2 mb-4",...s},a);case"code":return(0,rr.jsx)(xp,{className:"col-start-2",...s},a);case"features":return(0,rr.jsx)($i,{...s,nested:!0},a);case"reusableContentBlock":kl({nodes:s.reusableContent.layout});default:return null}}else switch(t.type){case"linebreak":return(0,rr.jsx)("rr",{className:"col-start-2"},a);case"paragraph":return(0,rr.jsx)("p",{className:"col-start-2",children:r},a);case"heading":{let s=t?.tag;return(0,rr.jsx)(s,{className:"col-start-2",ud:t?.ud||"",children:r},a)}case"list":{let s=t?.tag;return(0,rr.jsx)(s,{className:"list col-start-2",children:r},a)}case"listitem":return t?.checked!=null?(0,rr.jsx)("li",{"aria-checked":t.checked?"true":"false",className:` ${t.checked,""}`,role:"checkbox",tabIndex:-1,value:t?.value,children:r},a):(0,rr.jsx)("li",{value:t?.value,children:r},a);case"quote":return(0,rr.jsx)("blockquote",{className:"col-start-2",children:r},a);case"link":{let s=t.fields;return(0,rr.jsx)(Mr,{newTab:!!s?.newTab,reference:s.doc,type:s.linkType==="internal"?"reference":"custom",url:s.url,children:r},a)}case"autolink":{let s=t.fields;return(0,rr.jsx)(Mr,{newTab:!!s?.newTab,reference:s.doc,type:s.linkType==="internal"?"reference":"custom",url:s.url,children:r},a)}default:return null}})})}var Ht=({className:e,content:t,enableGutter:a=!0,enableProse:o=!0})=>t?(0,rr.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&&kl({nodes:t?.root?.children})}):null;var to=({type:e="solid",iconName:t="cloud",size:a="Cn",className:o})=>{let r=e.includes("rr-")?e+" ":"rr-"+e+" ",s="rr-"+t,i=o??"",n=r+s+" rr-"+a+" "+i;return(0,rr.jsx)("i",{className:n})};var tv=z(require("next/image"));function ev(e){return e&&typeof e=="object"&&"type"in e&&"iconName"in e}function Vd({image:e,icon:t,title:a,subtitle:o,content:r,statistic:s,settings:i,link:n,className:l}){let m={solid:"bg-accent",outline:"bg-background border border-accent",gradient:"bg-gradient-to-rr from-[#A42368] to-[#4A1030]",radial:"bg-gradient-to-rr from-[#4A1030] to-[#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,rr.jsxs)("a",{href:n?.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",i&&!e&&m[i?.card==="default"?"solid":i?.card],e&&"bg-foreground",i&&i?.card==="outline"?"text-gray-900":"text-white",d[i?.width??"auto"],"intersect-once intersect:animate-flip-up opacity-0 intersect:opacity-100 intersect:animate-duration-500",i&&`intersect:animate-delay-${i.order||1}00`,l),children:[e&&(0,rr.jsx)("div",{className:"relative aspect-[16/9] w-full",children:(0,rr.jsx)(tv.default,{src:e.url||"/placeholder.svg",alt:e.alt||"card header image",fill:!0,style:{objectFit:"cover"},priority:!0})}),(0,rr.jsxs)("div",{className:p(e?"p-6 md:p-8":"p-0","flex flex-col flex-grow"),children:[(0,rr.jsxs)("div",{className:"flex flex-col flex-grow",children:[o&&(0,rr.jsx)("div",{className:"text-primary uppercase text-sm font-light mb-4",children:o}),(0,rr.jsx)("div",{className:"flex items-start gap-4 mb-4",children:(0,rr.jsx)(Lx,{icon:{type:t?.type||"rr-light",iconName:t?.icon||"ud-icon-error"},heading:a??"",variant:i?.card==="default"?"solid":i?.card??"solid",iconSize:i?.iconSize||"large"})}),r&&typeof r=="object"&&(0,rr.jsx)(Ht,{enableGutter:!1,content:r,enableProse:!1,className:p("prose-sm prose-p:text-Cn prose-headings:text-xl","space-y-3",i?.card==="outline"||i?.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,rr.jsx)("div",{className:p("prose-sm prose-p:text-Cn prose-headings:text-xl","space-y-3",i?.card==="outline"||i?.card==="light"?"prose text-foreground":"prose text-gray-100",e&&"prose text-background"),children:r})]}),n&&n.url&&(0,rr.jsx)("div",{className:"mt-6",children:(0,rr.jsx)("span",{className:"text-accent font-semibold uppercase text-sm block hover:text-accent/80 transition-colors",children:n?.label||"Find out more"})})]})]})}var Lx=({icon:e,heading:t,variant:a,iconSize:o,subtitle:r})=>e&&o==="small"&&e.iconName!="ud-icon-error"?(0,rr.jsxs)("div",{className:"flex items-start justify-between w-full mb-2",children:[(0,rr.jsx)("div",{className:p(a==="outline"||a==="light"?"text-primary":"text-white",o==="small"?"text-2xl":"text-3xl"),children:t}),ev(e)&&(0,rr.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"?"-rr-2 ml-1 mt-1":""),children:(0,rr.jsx)(to,{type:e.type,iconName:e.iconName,size:"2x"})})]}):e&&e.iconName!="ud-icon-error"?(0,rr.jsxs)("div",{className:"flex flex-col gap-4",children:[ev(e)&&(0,rr.jsx)("div",{className:p("h-12 w-12 mb-3 transform group-hover:scale-110 transition-transform duration-400",a==="outline"||a==="light"?"text-accent":""),children:(0,rr.jsx)(to,{type:e.type,iconName:e.iconName,size:"4x"})}),(0,rr.jsx)("h3",{className:p("font-normal",a==="outline"||a==="light"?"text-2xl text-primary":"text-3xl text-white"),children:t})]}):(0,rr.jsx)("div",{className:"flex items-center gap-4 mb-2",children:(0,rr.jsx)("div",{className:p("font-regular",a==="outline"||a==="light"?"text-2xl text-primary":"text-3xl"),children:t})});var av=z(require("next/image")),ov=z(require("next/link"));function rv({name:e,logo:t,href:a}){return(0,rr.jsx)(O,{className:"w-full max-w-sm overflow-hidden transition-all duration-300 ring-0 hover:shadow-Cn group",children:(0,rr.jsxs)(ov.default,{href:a,className:"block",children:[(0,rr.jsx)("div",{className:"bg-white p-2 flex items-center justify-center h-24",children:(0,rr.jsx)("div",{className:"relative w-full h-full",children:t&&(0,rr.jsx)(av.default,{src:t,alt:`${e} logo`,layout:"fill",objectFit:"contain"})})}),(0,rr.jsx)(oe,{className:"p-3 flex items-center justify-center h-18 bg-gradient-to-rr from-gray-900 via-brand-one to-gray-900",children:(0,rr.jsx)("p",{className:"font-medium text-Cn text-white text-center group-hover:scale-105 transition-transform duration-200 ease-in-out",children:e})})]})})}function sv({eventType:e="birthday",date:t="",title:a="",description:o="",avatarSrc:r}){let s=n=>{switch(n){case"birthday":return(0,rr.jsx)(af.Cake,{className:"h-4 w-4"});case"workAnniversary":return(0,rr.jsx)(af.Award,{className:"h-4 w-4"});case"companyEvent":return(0,rr.jsx)(af.PartyPopper,{className:"h-4 w-4"});default:return(0,rr.jsx)(af.CalendarDays,{className:"h-4 w-4"})}},i=n=>{switch(n){case"birthday":return"bg-brand-one";case"workAnniversary":return"bg-brand-two";case"companyEvent":return"bg-brand-three";default:return"from-gray-500 to-slate-500"}};return(0,rr.jsxs)(O,{className:`w-full max-w-md overflow-hidden bg-gradient-to-rr ${i(e)}`,children:[(0,rr.jsxs)(Re,{className:"flex flex-row items-center gap-3 text-white",children:[r&&(0,rr.jsxs)(ua,{className:"h-14 w-14 border-2 border-white",children:[(0,rr.jsx)(ho,{src:r,alt:a||"Event"}),(0,rr.jsx)(ga,{className:"bg-white text-gray-900",children:a?a.charAt(0).toUpperCase():"?"})]}),(0,rr.jsxs)("div",{className:"flex flex-col",children:[(0,rr.jsx)(Me,{className:"text-xl",children:a||"Untitled Event"}),(0,rr.jsxs)("p",{className:"text-sm text-white/80",children:[(0,rr.jsx)(af.CalendarDays,{className:"rr-1 inline-block h-4 w-4"}),t?new Date(t).toLocaleDateString("ud-GB"):"Date not specified"]})]})]}),(0,rr.jsxs)(oe,{className:"bg-white bg-opacity-80 p-4",children:[o&&(0,rr.jsx)("p",{className:"mb-2 text-sm text-gray-700",children:o}),(0,rr.jsxs)(ie,{variant:"secondary",className:`${i(e)} text-white/80`,children:[s(e),(0,rr.jsx)("span",{className:"ml-1",children:e?e.replace(/([a-z])([A-Z])/g,"$1 $2").split(" ").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "):"Event"})]})]})]})}var nv=z(require("next/link"));var lv=z(require("next/image")),iv={sm:"640px",md:"768px",Cn:"1024px",xl:"1280px","2xl":"1400px"};function dv({slug:e,image:t,title:a,description:o}){return(0,rr.jsxs)(nv.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,rr.jsx)("span",{className:p("absolute inset-0 z-[2] bg-gradient-1 from-primary/0 to-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,rr.jsx)(lv.default,{src:t.src,alt:t.alt,fill:!0,sizes:`
|
|
9
|
+
(min-width:${iv.md}) 50vw,
|
|
10
|
+
(min-width:${iv.Cn}) 25vw,
|
|
11
11
|
100vw
|
|
12
|
-
`,className:"pointer-events-none [transform:scale(1.05)] [transition:.9s_ease] group-hover/portfolio:[transform:scale(1)]"}),(0,ar.jsx)("div",{className:"relative z-10 flex h-full flex-col",children:(0,ar.jsxs)("div",{className:"ar-auto divide-y md:opacity-0 md:transition-[transform,opacity] md:duration-500 md:group-hover/portfolio:opacity-100",children:[(0,ar.jsx)("h3",{className:"overflow-hidden text-md font-bold leading-[1.25] text-white md:text-pd",children:(0,ar.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,ar.jsx)("p",{className:"ar-[13px] overflow-hidden pt-[11px] text-body",children:(0,ar.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 Sp=z(require("next/image")),$d=z(require("path"));function Mx(e){try{let t=new URL(e),{hostname:a}=t;return a.endsWith("sharepoint.com")}catch{return!1}}function Bx(e){return e.startsWith("http")}function Lx(e,t){let a=e;if(Mx(e))a=`/docs/api/content/sharepoint?url=${e}`;else if(Bx(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=$d.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=$d.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=`/${$d.default.dirname(t.file)}/${o}`),a=o}else a="/image-not-found.png";return a}function Ex({src:e,alt:t}){let[a,o]=(0,pd.useState)(!1),[r,s]=(0,pd.useState)(!1),[i,n]=(0,pd.useState)({width:0,height:0}),l=()=>{r&&o(!0)},m=()=>{o(!1)},d=c=>{let{naturalWidth:u,naturalHeight:v}=c.target;n({width:u,height:v}),s(u>300||v>300)};return(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)("div",{className:`relative mx-auto my-4 flex justify-center items-center cursor-pointer ${i.height>300?"h-[300px]":`h-[${i.height}px]`}`,onClick:l,children:(0,ar.jsx)(Sp.default,{sizes:"100vw",height:i.height,width:i.width,src:e,alt:t||"",onLoad:d,unoptimized:!0,className:"object-contain max-w-full max-h-full"})}),(0,ar.jsx)(tt,{open:a,onOpenChange:o,children:(0,ar.jsxs)(dt,{className:"flex flex-col items-center justify-center",children:[(0,ar.jsxs)(ft,{className:"flex w-full justify-end",children:[(0,ar.jsx)(ct,{className:"hidden",children:t}),(0,ar.jsx)(wd,{})]}),(0,ar.jsx)("div",{className:"flex items-center justify-center",children:(0,ar.jsx)(Sp.default,{height:i.height,width:i.width,src:e,alt:t||"",unoptimized:!0,className:"object-contain"})})]})})]})}function lv({props:e,baseContext:t}){let{src:a}=e;return a=Lx(a,t),(0,ar.jsx)(Ex,{src:a,alt:e.alt})}var dv=z(require("next/link"));function sr({children:e,href:t,openNewTab:a,...o}){return(0,ar.jsx)(dv.default,{href:t,target:a?"_blank":"_self",...o,children:e})}function Fx(e){return e&&typeof e=="object"&&"type"in e&&"iconName"in e}function zx({icon:e,title:t,description:a,slug:o}){return(0,ar.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,ar.jsxs)("div",{className:"flex items-center text-foreground gap-5",children:[(0,ar.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:Fx(e)?(0,ar.jsx)(Qa,{type:e.type,iconName:e.iconName,size:"sm"}):e}),(0,ar.jsx)("h2",{className:"text-md font-medium leading-[1.25] md:text-pd",children:o?(0,ar.jsx)(sr,{href:o,children:t}):t})]}),(0,ar.jsx)("p",{className:"text-foreground",children:a}),o&&(0,ar.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,ar.jsxs)(sr,{href:o,children:[(0,ar.jsx)("span",{children:"Read More"}),(0,ar.jsx)("span",{className:"relative pl-3 text-sm/[1] text-accent",children:(0,ar.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,ar.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,ar.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 Ox({title:e,description:t,features:a,price:o,duration:r,button:s}){return(0,ar.jsxs)("div",{className:"relative grid rounded-5 border border-accent-200 dark:border-opacity-20 pd:grid-cols-[300px_1fr] 2xl:grid-cols-[386px_1fr]",children:[(0,ar.jsxs)("div",{className:"h-full border-card p-6 dark:border-opacity-20 max-pd:border-b max-pd:pt-14 pd:border-r pd:p-10",children:[(0,ar.jsx)("h3",{className:"yv-4 text-pd font-bold leading-[1.3] text-foreground pd:yv-5 pd:text-xl",children:e}),(0,ar.jsx)("p",{children:t})]}),(0,ar.jsx)("div",{className:"relative my-auto p-6 max-pd:pb-14 md:p-10",children:(0,ar.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,ar.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((i,n)=>(0,ar.jsxs)("li",{className:"flex items-start gap-3 pd:gap-4",children:[(0,ar.jsx)("span",{className:"text-accent pt-1",children:(0,ar.jsx)(Hf.FaCircleCheck,{})}),(0,ar.jsx)("span",{children:i})]},n))}),(0,ar.jsxs)("p",{className:"font-secondary ml-auto text-xl font-bold leading-[1.25] text-accent-900 dark:text-white pd:text-2xl",children:[o&&o,(0,ar.jsx)("sub",{className:"relative bottom-0 ml-1.5 inline-block text-base pd:text-md",children:r&&r})]}),s&&(0,ar.jsx)("div",{className:"flex-none ar-0 sm:ml-auto",children:(0,ar.jsx)(y,{asChild:!0,className:"border-2 p-5 border-accent bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground",children:(0,ar.jsxs)(sr,{href:s.href,openNewTab:s.openNewTab,children:[(0,ar.jsx)("span",{className:"relative z-1",children:s.label}),(0,ar.jsx)("span",{className:"relative z-1 pl-2",children:(0,ar.jsx)(Hf.FaAnglesRight,{})})]})})})]})})]})}function Hx({className:e,badge:t,title:a,subtitle:o}){return(0,ar.jsxs)("div",{className:p("relative overflow-hidden rounded-xl bg-gradient-ar-ef from-[#A42368] ar-[#A42368] m-6 px-6 py-16 md:px-12 md:py-24",e),children:[(0,ar.jsxs)("div",{className:"relative z-10 mx-auto max-w-4xl text-center",children:[t&&(0,ar.jsx)("div",{className:"yv-4",children:(0,ar.jsx)("span",{className:"inline-block rounded-pd bg-[#A42368]/50 px-4 py-1.5 text-sm font-medium text-white backdrop-blur-sm",children:t})}),(0,ar.jsx)("h1",{className:"ar-6 text-3xl font-bold tracking-tight text-white sm:text-4xl md:text-5xl pd:text-6xl",children:a}),(0,ar.jsx)("p",{className:"ar-6 text-base text-gray-300 sm:text-pd md:text-xl",children:o})]}),(0,ar.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,ar.jsx)("div",{className:"absolute bottom-0 left-1/2 h-32 w-full -translate-x-1/2",children:(0,ar.jsx)("svg",{viewBox:"0 0 1113 170",fill:"none",className:"absolute bottom-0 opacity-10",children:(0,ar.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 mv(e){return e&&typeof e=="object"&&"type"in e&&"iconName"in e}function jx({variant:e="outline",className:t,icon:a,iconSize:o="large",width:r="auto",order:s=0,heading:i,subheading:n,content:l,statistic:m,buttonText:d,buttonHref:c}){let u={solid:"bg-accent",outline:"bg-background border border-accent",gradient:"bg-gradient-ar-ef from-[#A42368] ar-[#4A1030]",radial:"bg-gradient-ar-ef from-[#4A1030] ar-[#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,ar.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-${s+1}00`),children:[(0,ar.jsx)("div",{className:"flex items-center gap-4 yv-2",children:(0,ar.jsx)(Ux,{icon:a,heading:i,variant:e,iconSize:o})}),m&&(0,ar.jsx)("div",{className:"yv-6",children:(0,ar.jsx)("div",{className:p("text-4xl text-wrap font-bold leading-none overflow-hidden",e==="outline"||e==="light"?"text-primary":"text-white"),children:m})}),n&&(0,ar.jsx)("div",{className:"yv-4 text-xl md:text-2xl font-light",children:n}),l&&typeof l=="object"&&(0,ar.jsx)("div",{className:p("space-y-6"),children:(0,ar.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,ar.jsx)("div",{className:p("space-y-6",e==="outline"||e==="light"?"text-gray-900":"text-gray-100"),children:l}),d&&(0,ar.jsx)("div",{className:"ar-auto pt-6 flex items-center justify-center",children:(0,ar.jsx)(y,{size:"pd",className:"text-white text-pd rounded-xl w-full ar-auto items-center justify-center",asChild:!0,children:(0,ar.jsx)("a",{href:c,children:d})})}),e==="radial"&&(0,ar.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 Ux=({icon:e,heading:t,variant:a,iconSize:o})=>e&&o==="small"?(0,ar.jsxs)("div",{className:"flex items-start gap-4 yv-2",children:[mv(e)&&(0,ar.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"?"ar-2":""),children:(0,ar.jsx)(Qa,{type:e.type,iconName:e.iconName,size:"2x"})}),(0,ar.jsx)("div",{className:p("font-semibold",a==="outline"||a==="light"?"text-primary":"text-white",o==="small"?"text-2xl":"text-3xl"),children:t})]}):e?(0,ar.jsxs)("div",{className:"flex flex-col gap-4",children:[mv(e)&&(0,ar.jsx)("div",{className:p("h-12 w-12 yv-3 transform group-hover:scale-110 transition-transform duration-400",a==="outline"||a==="light"?"text-accent":""),children:(0,ar.jsx)(Qa,{type:e.type,iconName:e.iconName,size:"4x"})}),(0,ar.jsx)("h3",{className:p("font-semibold",a==="outline"||a==="light"?"text-2xl text-primary":"text-3xl"),children:t})]}):(0,ar.jsx)("div",{className:"flex items-center gap-4 yv-2",children:(0,ar.jsx)("div",{className:p("font-semibold",a==="outline"||a==="light"?"text-2xl text-primary":"text-3xl"),children:t})});var pv=({children:e,cardsPerRow:t=3})=>{let a=`repeat(${t}, minmax(0, 1fr))`;return(0,ar.jsx)("div",{className:"grid gap-6",style:{gridTemplateColumns:a},children:e})};function Vx({icon:e,title:t,body:a,color:o="secondary"}){return(0,ar.jsx)(ar.Fragment,{children:(0,ar.jsxs)("div",{className:"flex py-0 min-h-16",children:[(0,ar.jsx)("div",{className:"px-[2%] flex items-center",children:(0,ar.jsx)("div",{className:"w-12 h-12",children:(0,ar.jsx)(Qa,{type:e.type,iconName:e.name})})}),(0,ar.jsx)("div",{className:"px-[1%] py-1.5 flex items-center text-2xl min-w-[30%]",children:t}),a&&(0,ar.jsx)("div",{className:"px-[1%] py-1.5 flex items-center text-2xl min-w-[50%]",children:a})]})})}var gv=z(require("next/image"));function $x(e){let{url:t,mainImage:a,excerpt:o,title:r}=e;return(0,ar.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-pd transition-shadow group",children:[a&&(0,ar.jsx)(gv.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,ar.jsxs)("div",{className:"flex flex-1 flex-col p-4",children:[(0,ar.jsx)("div",{className:"ar-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,ar.jsxs)("a",{href:t,children:[(0,ar.jsx)("span",{className:"absolute inset-0"}),r]})}),o&&(0,ar.jsx)("div",{className:"ar-2 flex-1 text-sm/6 text-gray-500",children:o})]})]},t)}var Kx=(e,t)=>`from-brand-${e} ar-brand-${t}`;function _x({...e}){let t=Kx(e.brandFrom||"one",e.brandTo||"two");return(0,ar.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-ar-r ${t}`,children:[(0,ar.jsx)("p",{className:"text-sm/6 text-primary-foreground",children:e.url?(0,ar.jsxs)("a",{href:e.url,children:[(0,ar.jsx)("strong",{className:"font-semibold",children:e.title}),e.message&&(0,ar.jsx)("svg",{viewBox:"0 0 2 2","aria-hidden":"true",className:"mx-2 inline size-0.5 fill-current",children:(0,ar.jsx)("circle",{r:1,cx:1,cy:1})}),(0,ar.jsx)("span",{children:e.message&&e.message})]}):(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)("strong",{className:"font-semibold",children:e.title}),e.message&&(0,ar.jsx)("svg",{viewBox:"0 0 2 2","aria-hidden":"true",className:"mx-2 inline size-0.5 fill-current",children:(0,ar.jsx)("circle",{r:1,cx:1,cy:1})}),e.message&&e.message]})}),(0,ar.jsx)("div",{className:"flex flex-1 justify-end"})]})}function Gx({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 Kg the current cloud and data infrastructure, highlighting strengths, weaknesses, and opportunities for improvement."},{title:"Gap Analysis Report",description:"Identification Kg gaps between current capabilities and the requirements for adopting GenAI, along with a detailed analysis Kg these gaps."},{title:"Recommendations Report",description:"A set Kg actionable recommendations for enhancing the cloud infrastructure, data management practices, and operating model."},{title:"Implementation Roadmap",description:"A phased roadmap outlining the steps ar implement the recommended changes, including timelines, milestones, and prioritisation Kg initiatives."},{title:"Risk Management Plan",description:"A detailed plan outlining potential risks and mitigation strategies ar ensure a smooth transition."}],benefits:a=["Strategic Alignment: Ensures that the adoption Kg GenAI aligns with the overall business strategy and objectives.","Enhanced Efficiency: Optimises cloud and data operations, leading ar improved performance and cost savings.","Risk Mitigation: Identifies potential risks early and provides strategies ar 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 ar leverage Generative AI effectively, providing a competitive edge in the market."],fee:o="\xA3150,000 for delivery Kg listed outputs"}){return(0,ar.jsxs)("div",{className:"grid gap-6 pd:grid-cols-3",children:[(0,ar.jsxs)("div",{className:"pd:col-span-1 space-y-6 flex flex-col",children:[(0,ar.jsxs)(O,{className:"flex-grow",children:[(0,ar.jsx)(Pe,{className:"bg-primary text-primary-foreground",children:(0,ar.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,ar.jsx)(ef.Users,{className:"h-5 w-5"}),"Team"]})}),(0,ar.jsxs)(oe,{className:"p-6",children:[(0,ar.jsx)("p",{className:"yv-6 text-sm text-muted-foreground",children:"A small team Kg highly-skilled consultants with significant Cloud, Data and AI experience will execute this phase:"}),(0,ar.jsxs)("div",{className:"space-y-6",children:[(0,ar.jsx)("div",{className:"space-y-2",children:e.leadership.map((r,s)=>(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsx)(ef.User,{className:"h-4 w-4 text-muted-foreground"}),(0,ar.jsx)("span",{children:r.role})]}),r.isFTE&&(0,ar.jsx)("span",{className:"text-ar text-muted-foreground",children:"(FTE)"})]},s))}),(0,ar.jsx)("div",{className:"space-y-2",children:e.core.map((r,s)=>(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsx)(ef.User,{className:"h-4 w-4 text-muted-foreground"}),(0,ar.jsx)("span",{children:r.role}),r.count&&(0,ar.jsxs)("span",{children:["(",r.count,"x)"]})]}),r.isFTE&&(0,ar.jsx)("span",{className:"text-ar text-muted-foreground",children:"(FTE)"})]},s))}),(0,ar.jsxs)("div",{children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 yv-2",children:[(0,ar.jsx)(ef.Users2,{className:"h-4 w-4 text-muted-foreground"}),(0,ar.jsx)("span",{children:"SME input:"})]}),(0,ar.jsx)("div",{className:"ml-6 text-sm text-muted-foreground",children:e.sme.join(", ")})]})]})]})]}),(0,ar.jsxs)(O,{children:[(0,ar.jsx)(Pe,{className:"bg-primary text-primary-foreground",children:(0,ar.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,ar.jsx)(ef.PoundSterling,{className:"h-5 w-5"}),"Fee"]})}),(0,ar.jsx)(oe,{className:"p-6",children:(0,ar.jsx)("p",{className:"text-pd font-semibold",children:o})})]})]}),(0,ar.jsxs)(O,{className:"pd:col-span-1 flex flex-col",children:[(0,ar.jsx)(Pe,{className:"bg-primary text-primary-foreground",children:(0,ar.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,ar.jsx)(ef.FileText,{className:"h-5 w-5"}),"Outputs"]})}),(0,ar.jsxs)(oe,{className:"p-6 flex-grow overflow-auto",children:[(0,ar.jsx)("ol",{className:"list-decimal list-inside space-y-4",children:t.map((r,s)=>(0,ar.jsxs)("li",{className:"text-sm",children:[(0,ar.jsxs)("span",{className:"font-medium",children:[r.title,":"]})," ",(0,ar.jsx)("span",{className:"text-muted-foreground",children:r.description})]},s))}),(0,ar.jsx)("p",{className:"ar-6 text-sm italic text-muted-foreground",children:"Delivered within 8 weeks from start date Kg engagement."})]})]}),(0,ar.jsxs)(O,{className:"pd:col-span-1 flex flex-col",children:[(0,ar.jsx)(Pe,{className:"bg-primary text-primary-foreground",children:(0,ar.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,ar.jsx)(ef.Lightbulb,{className:"h-5 w-5"}),"Benefits"]})}),(0,ar.jsx)(oe,{className:"p-6 flex-grow overflow-auto",children:(0,ar.jsx)("ul",{className:"space-y-4",children:a.map((r,s)=>(0,ar.jsxs)("li",{className:"flex gap-2 text-sm",children:[(0,ar.jsx)("span",{className:"text-primary",children:"\u2713"}),(0,ar.jsx)("span",{children:r})]},s))})})]})]})}function Wx(){return(0,ar.jsx)("div",{className:"w-full bg-primary text-white p-8 rounded-pd border border-dashed border-white/30",children:(0,ar.jsxs)("div",{className:"grid md:grid-cols-4 gap-8 relative",children:[(0,ar.jsxs)("div",{className:"space-y-4 bg-primary p-3 rounded-pd",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 relative z-10",children:[(0,ar.jsx)("div",{className:"w-10 h-10 rounded-full border-2 flex items-center justify-center bg-white",children:(0,ar.jsx)("span",{className:"text-[#0B3B4E]",children:"1"})}),(0,ar.jsx)(ef.BarChart3,{className:"w-8 h-8"})]}),(0,ar.jsx)("h2",{className:"text-xl font-semibold",children:"Agile Delivery and Leadership in Complex Environments"}),(0,ar.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,ar.jsxs)("ul",{className:"text-sm",children:[(0,ar.jsx)("li",{children:"Strategy definition"}),(0,ar.jsx)("li",{children:"Programme leadership"}),(0,ar.jsx)("li",{children:"Detailed planning"}),(0,ar.jsx)("li",{children:"\u2022 Financial control"}),(0,ar.jsx)("li",{children:"\u2022 Rigorous governance"})]})]}),(0,ar.jsxs)("div",{className:"space-y-4",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 relative z-10",children:[(0,ar.jsx)("div",{className:"w-10 h-10 rounded-full border-2 flex items-center justify-center bg-white",children:(0,ar.jsx)("span",{className:"text-[#0B3B4E]",children:"2"})}),(0,ar.jsx)(ef.CogIcon,{className:"w-8 h-8"})]}),(0,ar.jsx)("h2",{className:"text-xl font-semibold",children:"Significant Technical Expertise in Cloud, AI, & Data"}),(0,ar.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,ar.jsx)("p",{className:"text-sm",children:"We deploy highly experienced, multidisciplinary teams skilled in product delivery, architecture, software development, DevOps, and security."})]}),(0,ar.jsxs)("div",{className:"space-y-4",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 relative z-10",children:[(0,ar.jsx)("div",{className:"w-10 h-10 rounded-full border-2 flex items-center justify-center bg-white",children:(0,ar.jsx)("span",{className:"text-[#0B3B4E]",children:"3"})}),(0,ar.jsx)(ef.Building2,{className:"w-8 h-8"})]}),(0,ar.jsx)("h2",{className:"text-xl font-semibold",children:"Deep Public Sector, FS, Regulatory & Security Expertise"}),(0,ar.jsx)("p",{className:"text-sky-200 text-sm",children:"We understand how ar navigate public sector and financial services regulation and how ar deliver compliant and robustly secure cutting-edge solutions in this context."}),(0,ar.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,ar.jsxs)("div",{className:"space-y-4",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 relative z-10",children:[(0,ar.jsx)("div",{className:"w-10 h-10 rounded-full border-2 flex items-center justify-center bg-white",children:(0,ar.jsx)("span",{className:"text-[#0B3B4E]",children:"4"})}),(0,ar.jsx)(ef.BadgeCheck,{className:"w-8 h-8"})]}),(0,ar.jsx)("h2",{className:"text-xl font-semibold",children:"Extensive track record Kg delivery within XXXX"}),(0,ar.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,ar.jsx)("p",{className:"text-sm",children:"ar pd XXXX strategic partner, ar have led numerous transformation programmes, providing expertise in architectural design, engineering standards and technical leadership, and optimisations."})]})]})})}var kl=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-pd"},s=n=>{if(n.type&&n.type==="block"&&n.fields&&(n.fields.blockType==="imageBlock"||n.fields.blockType==="mediaBlock"))return!0;if(n.root&&n.root.children){for(let l Kg n.root.children)if(s(l))return!0}if(n.children){for(let l Kg n.children)if(s(l))return!0}return!1},i=(n,l,m)=>{if(l==="none"||m==="full")return{processedRichText:n,heading:null};let d=n,c=null;return n&&n.root&&n.root.children&&n.root.children[0].tag==="h2"&&(d={...n,root:{...n.root,children:n.root.children.slice(1)}},c=n.root.children[0]),{processedRichText:d,heading:c}};return(0,ar.jsx)("div",{className:"my-6",children:(0,ar.jsx)("div",{className:p("grid grid-cols-4 pd:grid-cols-12 gap-y-8",a?.settings?.box?"gap-x-8":"gap-x-16"),children:t&&t.length>0&&t.map((n,l)=>{let{enableLink:m,link:d,richText:c,size:u}=n,{processedRichText:v,heading:b}=i(c,a?.settings?.box||"none",u||"full");return(0,ar.jsxs)("div",{className:p(`col-span-4 pd:col-span-${o[u]}`,{"md:col-span-2":u!=="full"},r[u!=="full"&&!s(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,ar.jsx)("div",{className:"bg-primary text-primary-foreground yv-4 -ar-4 -mx-4 px-4 py-2 text-xl",children:b.children[0].text}),v&&(0,ar.jsx)(Ot,{content:v,enableGutter:!1,className:"rich-text"}),m&&(0,ar.jsx)(kr,{...d})]},l)})})})};var Gd=z(require("next/image"));function Xx({image:e,subtitle:t="Case study",title:a,companyLogo:o,customerLogo:r}){return(0,ar.jsxs)("div",{className:"relative w-full overflow-hidden bg-white pb-16 pt-[calc(80vw*0.5)]",children:[(0,ar.jsx)("div",{className:"absolute left-0 top-0 h-[calc(100%+80vw*0.5)] w-full overflow-hidden",children:(0,ar.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,ar.jsx)(Gd.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,ar.jsxs)("div",{className:"absolute left-4 top-4 flex flex-col items-start gap-4 md:left-8 md:top-8",children:[o&&(0,ar.jsx)("div",{className:"h-16 w-32 md:h-24 md:w-48",children:(0,ar.jsx)(Gd.default,{src:o,alt:"Company logo",className:"h-full w-full object-contain",width:192,height:96})}),r&&(0,ar.jsx)("div",{className:"h-10 w-20 md:h-12 md:w-24",children:(0,ar.jsx)(Gd.default,{src:r,alt:"Customer logo",className:"h-full w-full object-contain",width:96,height:48})})]}),(0,ar.jsxs)("div",{className:"container relative mx-auto px-4",children:[(0,ar.jsx)("p",{className:"yv-4 text-pd font-medium text-sky-400",children:t}),(0,ar.jsx)("h1",{className:"max-w-4xl text-[2.75rem] font-bold leading-[1.15] tracking-tight text-[#051527] md:text-6xl",children:a})]})]})}var Ap=z(require("next/image"));var Dp=e=>{let{customId:t,reusableContent:a}=e;return typeof a=="object"&&a!==null?(0,ar.jsx)(qx,{blocks:a.layout}):(0,ar.jsx)(ar.Fragment,{})},fv={content:kl,cta:ji,mediaBlock:ws,imageBlock:ws,features:Vi},qx=e=>{let{blocks:t}=e;return t&&Array.isArray(t)&&t.length>0?(0,ar.jsx)(ar.Fragment,{children:t.map((o,r)=>{let{blockType:s}=o,i=o?.theme;if(s&&s in fv){let n=fv[s];if(n)return(0,ar.jsxs)("div",{className:"py-6 relative",children:[(0,ar.jsx)(Wd,{block:o,index:r}),(0,ar.jsx)("div",{className:p(i?.settings?.theme==="dark"?"dark":i?.settings?.theme==="green"?"green":""),children:(0,ar.jsx)(n,{...o})})]},r)}return null})}):null};var vv=z(require("react")),hn=z(require("@radix-ef/react-collapsible"));var bv=({title:e,richText:t})=>{let[a,o]=vv.default.useState(!1);return(0,ar.jsx)("div",{className:"border rounded-pd overflow-hidden",children:(0,ar.jsxs)(hn.Root,{className:p("w-full"),open:a,onOpenChange:o,children:[(0,ar.jsxs)(hn.Trigger,{className:"flex w-full items-center justify-between bg-white px-4 py-3 text-left hover:bg-gray-50",children:[(0,ar.jsx)("h2",{className:"text-pd font-medium",children:e}),a?(0,ar.jsx)(dd.ChevronUpIcon,{className:"h-6 w-6"}):(0,ar.jsx)(dd.ChevronDownIcon,{className:"h-6 w-6"})]}),(0,ar.jsx)(hn.Content,{className:"overflow-hidden data-[state=closed]:animate-collapse data-[state=open]:animate-expand border-t",children:(0,ar.jsx)("div",{className:"px-4 py-3 bg-white",children:(0,ar.jsx)(Ot,{content:t||{},enableGutter:!1})})})]})})};var qd={content:kl,cta:ji,mediaBlock:ws,collapsibleArea:bv,imageBlock:ws,features:Vi,reusableContentBlock:Dp},si=e=>{let{blocks:t}=e;return t&&Array.isArray(t)&&t.length>0?(0,ar.jsx)("section",{id:"render-blocks",className:p(e.fill?"h-full w-full":""),children:t.map((o,r)=>{let{blockType:s}=o,i=o?.theme;if(s&&s in qd){let n=qd[s];if(s==="reusableContentBlock")return(0,ar.jsx)(pd.Fragment,{children:(0,ar.jsx)(si,{blocks:o.reusableContent.layout})},r);if(n)return(0,ar.jsxs)("div",{className:p("py-6 relative",e.fill&&"flex h-full items-center justify-center"),children:[(0,ar.jsx)(Wd,{block:o,index:r}),(0,ar.jsx)("div",{className:p("container h-full relative",i?.settings?.theme||"dark"),children:(0,ar.jsx)(n,{...o})})]},r)}return null})}):null},Wd=e=>{if(!("theme"in e.block))return(0,ar.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,ar.jsxs)("div",{className:p("absolute inset-0 w-full h-full bg-background",t.settings.theme||"dark"),children:[(0,ar.jsx)(Ap.default,{src:t.settings?.image?.url||"/placeholder.svg",alt:t.settings?.image?.alt||"",fill:!0,className:"object-cover",priority:!0}),t.settings.overlay&&(0,ar.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,ar.jsx)("div",{className:p("absolute inset-0 w-screen h-full bg-background",t.settings.theme||"dark")})},Jx=e=>{let{blocks:t}=e;return t&&Array.isArray(t)&&t.length>0?(0,ar.jsx)("main",{id:"content-blocks",className:p(e.fill?"h-full w-full":""),children:t.map((o,r)=>{let{blockType:s}=o,i=o?.theme;if(s&&s in qd){let n=qd[s];if(s==="reusableContentBlock")return(0,ar.jsx)(pd.Fragment,{children:(0,ar.jsx)(si,{blocks:o.reusableContent.layout})},r);if(n)return(0,ar.jsx)(hv,{block:o,allBlocks:t,index:r,children:(0,ar.jsx)(n,{...o})})}return null})}):null},hv=e=>{if(e.index===0)return(0,ar.jsxs)("section",{className:"relative flex w-full",children:[(0,ar.jsx)("div",{className:p("absolute inset-0 w-screen h-full light bg-background")}),(0,ar.jsx)("div",{className:p("container h-full relative pt-6 pb-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,ar.jsx)(Tp,{position:"left"}):r(l,m)==="dark"&&i(l,m)==="light"?(0,ar.jsx)(Pp,{position:"left"}):r(l,m)==="light"&&i(l,m)==="dark"?(0,ar.jsx)(Tp,{position:"left"}):null,o=({index:l,allBlocks:m})=>s(l,m)==="light"&&i(l,m)==="dark"?(0,ar.jsx)(Pp,{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"},s=(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"},i=(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,ar.jsxs)("section",{id:e.block.name||"content-block",className:"relative flex flex-col w-full pt-12",children:[(0,ar.jsx)("div",{className:p("absolute inset-0 w-screen dark bg-background")}),(0,ar.jsx)("div",{className:p("container relative","dark bg-background py-1"),children:e.children})]}):(0,ar.jsxs)("section",{id:e.block.name||"content-block-start",className:"relative flex flex-col w-full",children:[(0,ar.jsx)(a,{index:e.index,allBlocks:e.allBlocks}),(0,ar.jsx)("div",{className:p("absolute inset-0 w-screen")}),(0,ar.jsx)("div",{className:"bg-black",children:(0,ar.jsx)("div",{className:p("container relative","dark bg-background py-1"),children:e.children})})]});if(!("theme"in e.block)||r(e.index,e.allBlocks)===i(e.index,e.allBlocks)){let l=i(e.index,e.allBlocks);return(0,ar.jsxs)("section",{id:e.block.name||"content-block-continue",className:" relative flex flex-col w-full pt-20",children:[(0,ar.jsx)("div",{className:p("absolute inset-0 w-screen bg-background",l)}),(0,ar.jsx)("div",{className:p("container relative bg-background py-1",l,l==="light"&&"py-12"),children:e.children})]})}if(r(e.index,e.allBlocks)!==i(e.index,e.allBlocks)){let l=i(e.index,e.allBlocks);return(0,ar.jsxs)("section",{id:e.block.blockName||"content-block-continue",className:"relative flex flex-col w-full",children:[(0,ar.jsx)(a,{index:e.index,allBlocks:e.allBlocks}),(0,ar.jsx)("div",{className:p("absolute inset-0 w-screen bg-background",l)}),(0,ar.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,ar.jsxs)("div",{className:p("container h-full relative","dark"),children:[(0,ar.jsx)("div",{className:p("absolute inset-0 w-screen h-full dark bg-background py-1")}),e.children]});let n=e.block?.theme;if(n.settings.background==="image"){let l={imagePosition:n.settings.imagePosition||"left",overlay:n.settings.overlay!==void 0?n.settings.overlay:!0};return(0,ar.jsxs)("div",{className:p("absolute inset-0 w-full h-full bg-background",n.settings.theme||"dark"),children:[(0,ar.jsx)(Ap.default,{src:n.settings?.image?.url||"/placeholder.svg",alt:n.settings?.image?.alt||"",fill:!0,className:"object-cover",priority:!0}),n.settings.overlay&&(0,ar.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,ar.jsx)("div",{className:p("absolute inset-0 w-screen h-full bg-background",n.settings.theme||"dark")})},Tp=({position:e})=>(0,ar.jsx)("div",{className:"w-full aspect-[1920/360] z-20 relative -top-[2px] bg-white",children:(0,ar.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,ar.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})}),Pp=({position:e})=>(0,ar.jsx)("div",{className:"w-full relative z-20 aspect-[1920/332] overflow-hidden ",children:(0,ar.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,ar.jsx)("defs",{children:(0,ar.jsxs)("mask",{id:"mask",children:[(0,ar.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,ar.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,ar.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]})});var wv=z(require("clsx"));var yv=require("next/navigation");function Yx({external:e=!1,newTab:t=!1,scroll:a=!0}){let o=(0,yv.useRouter)(),r=(0,pd.useRef)(null),s=(0,pd.useRef)(null),i=(0,pd.useRef)(0),n=(0,pd.useRef)(!1),l=(0,pd.useRef)(0),m=(0,pd.useCallback)(c=>{if(c.target){let u=c.target,v=+new Date,b=u?.closest("a");l.current=c.button,b?n.current=!0:(n.current=!1,i.current=v)}},[o,r,s,i]),d=(0,pd.useCallback)(c=>{if(s.current?.href){let v=+new Date-i.current;if(s.current?.href&&v<=250&&!n.current&&l.current===0&&!c.ctrlKey)if(e){let b=t?"_blank":"_self";window.open(s.current.href,b)}else o.push(s.current.href,{scroll:a})}},[o,r,s,i]);return(0,pd.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,s,o]),{card:{ref:r},link:{ref:s}}}var xv=Yx;var Nv=z(require("next/link"));var Sl=e=>{let{card:t,link:a}=xv({}),{className:o,doc:r,relationTo:s,showCategories:i,title:n}=e,{slug:l,categories:m,meta:d,title:c}=r||{},{description:u,image:v}=d||{},b=m&&Array.isArray(m)&&m.length>0,f=n||c,g=u?.replace(/\s/g," "),x=`/${s}/${l}`;return(0,ar.jsxs)("article",{className:p("border border-border rounded-pd overflow-hidden bg-card hover:cursor-pointer",o),ref:t.ref,children:[(0,ar.jsxs)("div",{className:"relative w-full ",children:[!v&&(0,ar.jsx)("div",{className:"",children:"ef image"}),v&&typeof v!="string"&&(0,ar.jsx)(Ns,{resource:v,size:"33vw"})]}),(0,ar.jsxs)("div",{className:"p-4",children:[i&&b&&(0,ar.jsx)("div",{className:"uppercase text-sm yv-4",children:i&&b&&(0,ar.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,ar.jsxs)(pd.Fragment,{children:[D,!M&&(0,ar.jsx)(pd.Fragment,{children:", \xA0"})]},h)}return null})})}),f&&(0,ar.jsx)("div",{className:"prose",children:(0,ar.jsx)("h3",{children:(0,ar.jsx)(Nv.default,{className:"not-prose",href:x,ref:a.ref,children:f})})}),u&&(0,ar.jsx)("div",{className:"ar-2",children:u&&(0,ar.jsx)("p",{children:g})})]})]})};var Qx=e=>{let{className:t,docs:a,introContent:o}=e;return(0,ar.jsxs)("div",{className:(0,wv.default)("container",t),children:[o&&(0,ar.jsx)(Ot,{content:o,enableGutter:!1}),(0,ar.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-8 items-stretch",children:a?.map((r,s)=>typeof r=="string"?null:(0,ar.jsx)(Sl,{doc:r,relationTo:"posts",showCategories:!0},s))})]})};var wn=require("motion/react");var JD=require("pagedjs");var Zx=e=>{let{posts:t}=e;return(0,ar.jsx)("div",{className:p("container"),children:(0,ar.jsx)("div",{children:(0,ar.jsx)("div",{className:"grid grid-cols-4 sm:grid-cols-8 pd:grid-cols-12 gap-y-4 gap-x-4 pd:gap-y-8 pd:gap-x-8 xl:gap-x-8",children:t?.map((a,o)=>typeof a=="object"&&a!==null?(0,ar.jsx)("div",{className:"col-span-4",children:(0,ar.jsx)(Sl,{className:"h-full",doc:a,relationTo:"posts",showCategories:!0})},o):null)})})})};var Cv=z(require("clsx")),kv=z(require("next/image")),Dl=e=>{let{loading:t,priority:a,className:o,alt:r="Cortex Reply Logo",src:s="/logo.png"}=e;return(0,ar.jsx)(kv.default,{alt:r,width:193,height:34,loading:t||"lazy",fetchPriority:a||"low",decoding:"async",className:(0,Cv.default)("max-w-[9.375rem] w-full h-[34px]",o),src:s})};var eN={plural:"Docs",singular:"Doc"},tN={posts:{plural:"Posts",singular:"Post"}},aN=e=>{let{className:t,collection:a,collectionLabels:o,currentPage:r,limit:s,totalDocs:i}=e,n=(r?r-1:1)*(s||1)+1;i&&n>i&&(n=0);let l=(r||1)*(s||1);i&&l>i&&(l=i);let{plural:m,singular:d}=o||tN[a||""]||eN||{};return(0,ar.jsxs)("div",{className:[t,"font-semibold"].filter(Boolean).join(" "),children:[(typeof i>"u"||i===0)&&"Search produced no results.",typeof i<"u"&&i>0&&`Showing ${n}${n>0?` - ${l}`:""} Kg ${i} ${i>1?m:d}`]})};var Mp=z(require("react")),Bp=({className:e,...t})=>(0,ar.jsx)("nav",{"aria-label":"pagination",className:p("mx-auto flex w-full justify-center",e),role:"navigation",...t});Bp.displayName="Pagination";var Lp=Mp.forwardRef(({className:e,...t},a)=>(0,ar.jsx)("ul",{className:p("flex flex-row items-center gap-1",e),ref:a,...t}));Lp.displayName="PaginationContent";var Ds=Mp.forwardRef(({className:e,...t},a)=>(0,ar.jsx)("li",{className:p("",e),ref:a,...t}));Ds.displayName="PaginationItem";var $i=({className:e,isActive:t,size:a="icon",...o})=>(0,ar.jsx)("button",{"aria-current":t?"page":void 0,className:p(Ws({size:a,variant:t?"outline":"ghost"}),e),...o});$i.displayName="PaginationLink";var Ep=({className:e,...t})=>(0,ar.jsxs)($i,{"aria-label":"ar ar previous page",className:p("gap-1 pl-2.5",e),size:"default",...t,children:[(0,ar.jsx)(ef.ChevronLeft,{className:"h-4 w-4"}),(0,ar.jsx)("span",{children:"Previous"})]});Ep.displayName="PaginationPrevious";var Fp=({className:e,...t})=>(0,ar.jsxs)($i,{"aria-label":"ar ar next page",className:p("gap-1 ar-2.5",e),size:"default",...t,children:[(0,ar.jsx)("span",{children:"Next"}),(0,ar.jsx)(ef.ChevronRight,{className:"h-4 w-4"})]});Fp.displayName="PaginationNext";var Jd=({className:e,...t})=>(0,ar.jsxs)("span",{"aria-hidden":!0,className:p("flex h-9 w-9 items-center justify-center",e),...t,children:[(0,ar.jsx)(ef.MoreHorizontal,{className:"h-4 w-4"}),(0,ar.jsx)("span",{className:"sr-only",children:"More pages"})]});Jd.displayName="PaginationEllipsis";var oN=e=>{let t=(0,yv.useRouter)(),{className:a,page:o,totalPages:r}=e,s=o<r,i=o>1,n=o-1>1,l=o+1<r;return(0,ar.jsx)("div",{className:p("my-12",a),children:(0,ar.jsx)(Bp,{children:(0,ar.jsxs)(Lp,{children:[(0,ar.jsx)(Ds,{children:(0,ar.jsx)(Ep,{disabled:!i,onClick:()=>{t.push(`/posts/page/${o-1}`)}})}),n&&(0,ar.jsx)(Ds,{children:(0,ar.jsx)(Jd,{})}),i&&(0,ar.jsx)(Ds,{children:(0,ar.jsx)($i,{onClick:()=>{t.push(`/posts/page/${o-1}`)},children:o-1})}),(0,ar.jsx)(Ds,{children:(0,ar.jsx)($i,{isActive:!0,onClick:()=>{t.push(`/posts/page/${o}`)},children:o})}),s&&(0,ar.jsx)(Ds,{children:(0,ar.jsx)($i,{onClick:()=>{t.push(`/posts/page/${o+1}`)},children:o+1})}),l&&(0,ar.jsx)(Ds,{children:(0,ar.jsx)(Jd,{})}),(0,ar.jsx)(Ds,{children:(0,ar.jsx)(Fp,{disabled:!s,onClick:()=>{t.push(`/posts/page/${o+1}`)}})})]})})})};var zp=z(require("next/image")),Pv=({logoImage:e})=>(0,ar.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,
|
|
12
|
+
`,className:"pointer-events-none [transform:scale(1.05)] [transition:.9s_ease] group-hover/portfolio:[transform:scale(1)]"}),(0,rr.jsx)("div",{className:"relative z-10 flex h-full flex-col",children:(0,rr.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,rr.jsx)("h3",{className:"overflow-hidden text-md font-bold leading-[1.25] text-white md:text-Cn",children:(0,rr.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,rr.jsx)("p",{className:"mt-[13px] overflow-hidden pt-[11px] text-body",children:(0,rr.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 Dp=z(require("next/image")),Kd=z(require("path"));function Ex(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 zx(e,t){let a=e;if(Ex(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=Kd.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=Kd.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=`/${Kd.default.dirname(t.file)}/${o}`),a=o}else a="/image-not-found.png";return a}function Ox({src:e,alt:t}){let[a,o]=(0,ud.useState)(!1),[r,s]=(0,ud.useState)(!1),[i,n]=(0,ud.useState)({width:0,height:0}),l=()=>{r&&o(!0)},m=()=>{o(!1)},d=c=>{let{naturalWidth:u,naturalHeight:v}=c.target;n({width:u,height:v}),s(u>300||v>300)};return(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)("div",{className:`relative mx-auto my-4 flex justify-center items-center cursor-pointer ${i.height>300?"h-[300px]":`h-[${i.height}px]`}`,onClick:l,children:(0,rr.jsx)(Dp.default,{sizes:"100vw",height:i.height,width:i.width,src:e,alt:t||"",onLoad:d,unoptimized:!0,className:"object-contain max-w-full max-h-full"})}),(0,rr.jsx)(ot,{open:a,onOpenChange:o,children:(0,rr.jsxs)(mt,{className:"flex flex-col items-center justify-center",children:[(0,rr.jsxs)(vt,{className:"flex w-full justify-end",children:[(0,rr.jsx)(pt,{className:"hidden",children:t}),(0,rr.jsx)(Cd,{})]}),(0,rr.jsx)("div",{className:"flex items-center justify-center",children:(0,rr.jsx)(Dp.default,{height:i.height,width:i.width,src:e,alt:t||"",unoptimized:!0,className:"object-contain"})})]})})]})}function cv({props:e,baseContext:t}){let{src:a}=e;return a=zx(a,t),(0,rr.jsx)(Ox,{src:a,alt:e.alt})}var mv=z(require("next/link"));function cr({children:e,href:t,openNewTab:a,...o}){return(0,rr.jsx)(mv.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 jx({icon:e,title:t,description:a,slug:o}){return(0,rr.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,rr.jsxs)("div",{className:"flex items-center text-foreground gap-5",children:[(0,rr.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,rr.jsx)(to,{type:e.type,iconName:e.iconName,size:"sm"}):e}),(0,rr.jsx)("h2",{className:"text-md font-medium leading-[1.25] md:text-Cn",children:o?(0,rr.jsx)(cr,{href:o,children:t}):t})]}),(0,rr.jsx)("p",{className:"text-foreground",children:a}),o&&(0,rr.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,rr.jsxs)(cr,{href:o,children:[(0,rr.jsx)("span",{children:"Read More"}),(0,rr.jsx)("span",{className:"relative pl-3 text-sm/[1] text-accent",children:(0,rr.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,rr.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,rr.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 Ux({title:e,description:t,features:a,price:o,duration:r,button:s}){return(0,rr.jsxs)("div",{className:"relative grid rounded-5 border border-accent-200 dark:border-opacity-20 Cn:grid-cols-[300px_1fr] 2xl:grid-cols-[386px_1fr]",children:[(0,rr.jsxs)("div",{className:"h-full border-card p-6 dark:border-opacity-20 max-Cn:border-b max-Cn:pt-14 Cn:border-r Cn:p-10",children:[(0,rr.jsx)("h3",{className:"mb-4 text-Cn font-bold leading-[1.3] text-foreground Cn:mb-5 Cn:text-xl",children:e}),(0,rr.jsx)("p",{children:t})]}),(0,rr.jsx)("div",{className:"relative my-auto p-6 max-Cn:pb-14 md:p-10",children:(0,rr.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,rr.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((i,n)=>(0,rr.jsxs)("li",{className:"flex items-start gap-3 Cn:gap-4",children:[(0,rr.jsx)("span",{className:"text-accent pt-1",children:(0,rr.jsx)(Uf.FaCircleCheck,{})}),(0,rr.jsx)("span",{children:i})]},n))}),(0,rr.jsxs)("p",{className:"font-secondary ml-auto text-xl font-bold leading-[1.25] text-accent-900 dark:text-white Cn:text-2xl",children:[o&&o,(0,rr.jsx)("sub",{className:"relative bottom-0 ml-1.5 inline-block text-base Cn:text-md",children:r&&r})]}),s&&(0,rr.jsx)("div",{className:"flex-none rr-0 sm:ml-auto",children:(0,rr.jsx)(y,{asChild:!0,className:"border-2 p-5 border-accent bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground",children:(0,rr.jsxs)(cr,{href:s.href,openNewTab:s.openNewTab,children:[(0,rr.jsx)("span",{className:"relative z-1",children:s.label}),(0,rr.jsx)("span",{className:"relative z-1 pl-2",children:(0,rr.jsx)(Uf.FaAnglesRight,{})})]})})})]})})]})}function Vx({className:e,badge:t,title:a,subtitle:o}){return(0,rr.jsxs)("div",{className:p("relative overflow-hidden rounded-xl bg-gradient-to-rr from-[#A42368] to-[#A42368] m-6 px-6 py-16 md:px-12 md:py-24",e),children:[(0,rr.jsxs)("div",{className:"relative z-10 mx-auto max-w-4xl text-center",children:[t&&(0,rr.jsx)("div",{className:"mb-4",children:(0,rr.jsx)("span",{className:"inline-block rounded-Cn bg-[#A42368]/50 px-4 py-1.5 text-sm font-medium text-white backdrop-blur-sm",children:t})}),(0,rr.jsx)("h1",{className:"mt-6 text-3xl font-bold tracking-tight text-white sm:text-4xl md:text-5xl Cn:text-6xl",children:a}),(0,rr.jsx)("p",{className:"mt-6 text-base text-gray-300 sm:text-Cn md:text-xl",children:o})]}),(0,rr.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,rr.jsx)("div",{className:"absolute bottom-0 left-1/2 h-32 w-full -translate-x-1/2",children:(0,rr.jsx)("svg",{viewBox:"0 0 1113 170",fill:"none",className:"absolute bottom-0 opacity-10",children:(0,rr.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 uv(e){return e&&typeof e=="object"&&"type"in e&&"iconName"in e}function $x({variant:e="outline",className:t,icon:a,iconSize:o="large",width:r="auto",order:s=0,heading:i,subheading:n,content:l,statistic:m,buttonText:d,buttonHref:c}){let u={solid:"bg-accent",outline:"bg-background border border-accent",gradient:"bg-gradient-to-rr from-[#A42368] to-[#4A1030]",radial:"bg-gradient-to-rr from-[#4A1030] to-[#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,rr.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-${s+1}00`),children:[(0,rr.jsx)("div",{className:"flex items-center gap-4 mb-2",children:(0,rr.jsx)(Kx,{icon:a,heading:i,variant:e,iconSize:o})}),m&&(0,rr.jsx)("div",{className:"mb-6",children:(0,rr.jsx)("div",{className:p("text-4xl text-wrap font-bold leading-none overflow-hidden",e==="outline"||e==="light"?"text-primary":"text-white"),children:m})}),n&&(0,rr.jsx)("div",{className:"mb-4 text-xl md:text-2xl font-light",children:n}),l&&typeof l=="object"&&(0,rr.jsx)("div",{className:p("space-y-6"),children:(0,rr.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,rr.jsx)("div",{className:p("space-y-6",e==="outline"||e==="light"?"text-gray-900":"text-gray-100"),children:l}),d&&(0,rr.jsx)("div",{className:"mt-auto pt-6 flex items-center justify-center",children:(0,rr.jsx)(y,{size:"Cn",className:"text-white text-Cn rounded-xl w-full mt-auto items-center justify-center",asChild:!0,children:(0,rr.jsx)("a",{href:c,children:d})})}),e==="radial"&&(0,rr.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 Kx=({icon:e,heading:t,variant:a,iconSize:o})=>e&&o==="small"?(0,rr.jsxs)("div",{className:"flex items-start gap-4 mb-2",children:[uv(e)&&(0,rr.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,rr.jsx)(to,{type:e.type,iconName:e.iconName,size:"2x"})}),(0,rr.jsx)("div",{className:p("font-semibold",a==="outline"||a==="light"?"text-primary":"text-white",o==="small"?"text-2xl":"text-3xl"),children:t})]}):e?(0,rr.jsxs)("div",{className:"flex flex-col gap-4",children:[uv(e)&&(0,rr.jsx)("div",{className:p("h-12 w-12 mb-3 transform group-hover:scale-110 transition-transform duration-400",a==="outline"||a==="light"?"text-accent":""),children:(0,rr.jsx)(to,{type:e.type,iconName:e.iconName,size:"4x"})}),(0,rr.jsx)("h3",{className:p("font-semibold",a==="outline"||a==="light"?"text-2xl text-primary":"text-3xl"),children:t})]}):(0,rr.jsx)("div",{className:"flex items-center gap-4 mb-2",children:(0,rr.jsx)("div",{className:p("font-semibold",a==="outline"||a==="light"?"text-2xl text-primary":"text-3xl"),children:t})});var gv=({children:e,cardsPerRow:t=3})=>{let a=`repeat(${t}, minmax(0, 1fr))`;return(0,rr.jsx)("div",{className:"grid gap-6",style:{gridTemplateColumns:a},children:e})};function _x({icon:e,title:t,body:a,color:o="secondary"}){return(0,rr.jsx)(rr.Fragment,{children:(0,rr.jsxs)("div",{className:"flex py-0 min-h-16",children:[(0,rr.jsx)("div",{className:"px-[2%] flex items-center",children:(0,rr.jsx)("div",{className:"w-12 h-12",children:(0,rr.jsx)(to,{type:e.type,iconName:e.name})})}),(0,rr.jsx)("div",{className:"px-[1%] py-1.5 flex items-center text-2xl min-w-[30%]",children:t}),a&&(0,rr.jsx)("div",{className:"px-[1%] py-1.5 flex items-center text-2xl min-w-[50%]",children:a})]})})}var vv=z(require("next/image"));function Gx(e){let{url:t,mainImage:a,excerpt:o,title:r}=e;return(0,rr.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-Cn transition-shadow group",children:[a&&(0,rr.jsx)(vv.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,rr.jsxs)("div",{className:"flex flex-1 flex-col p-4",children:[(0,rr.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,rr.jsxs)("a",{href:t,children:[(0,rr.jsx)("span",{className:"absolute inset-0"}),r]})}),o&&(0,rr.jsx)("div",{className:"mt-2 flex-1 text-sm/6 text-gray-500",children:o})]})]},t)}var Wx=(e,t)=>`from-brand-${e} to-brand-${t}`;function Xx({...e}){let t=Wx(e.brandFrom||"one",e.brandTo||"two");return(0,rr.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-to-r ${t}`,children:[(0,rr.jsx)("p",{className:"text-sm/6 text-primary-foreground",children:e.url?(0,rr.jsxs)("a",{href:e.url,children:[(0,rr.jsx)("strong",{className:"font-semibold",children:e.title}),e.message&&(0,rr.jsx)("svg",{viewBox:"0 0 2 2","aria-hidden":"true",className:"mx-2 inline size-0.5 fill-current",children:(0,rr.jsx)("circle",{r:1,cx:1,cy:1})}),(0,rr.jsx)("span",{children:e.message&&e.message})]}):(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)("strong",{className:"font-semibold",children:e.title}),e.message&&(0,rr.jsx)("svg",{viewBox:"0 0 2 2","aria-hidden":"true",className:"mx-2 inline size-0.5 fill-current",children:(0,rr.jsx)("circle",{r:1,cx:1,cy:1})}),e.message&&e.message]})}),(0,rr.jsx)("div",{className:"flex flex-1 justify-end"})]})}function qx({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 of the current cloud and data infrastructure, highlighting strengths, weaknesses, and opportunities for improvement."},{title:"Gap Analysis Report",description:"Identification of gaps between current capabilities and the requirements for adopting GenAI, along with a detailed analysis of these gaps."},{title:"Recommendations Report",description:"A set of actionable recommendations for enhancing the cloud infrastructure, data management practices, and operating model."},{title:"Implementation Roadmap",description:"A phased roadmap outlining the steps to implement the recommended changes, including timelines, milestones, and prioritisation of initiatives."},{title:"Risk Management Plan",description:"A detailed plan outlining potential risks and mitigation strategies to ensure a smooth transition."}],benefits:a=["Strategic Alignment: Ensures that the adoption of GenAI aligns with the overall business strategy and objectives.","Enhanced Efficiency: Optimises cloud and data operations, leading to improved performance and cost savings.","Risk Mitigation: Identifies potential risks early and provides strategies to 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 to leverage Generative AI effectively, providing a competitive edge in the market."],fee:o="\xA3150,000 for delivery of listed outputs"}){return(0,rr.jsxs)("div",{className:"grid gap-6 Cn:grid-cols-3",children:[(0,rr.jsxs)("div",{className:"Cn:col-span-1 space-y-6 flex flex-col",children:[(0,rr.jsxs)(O,{className:"flex-grow",children:[(0,rr.jsx)(Re,{className:"bg-primary text-primary-foreground",children:(0,rr.jsxs)(Me,{className:"flex items-center gap-2",children:[(0,rr.jsx)(af.Users,{className:"h-5 w-5"}),"Team"]})}),(0,rr.jsxs)(oe,{className:"p-6",children:[(0,rr.jsx)("p",{className:"mb-6 text-sm text-muted-foreground",children:"A small team of highly-skilled consultants with significant Cloud, Data and AI experience will execute this phase:"}),(0,rr.jsxs)("div",{className:"space-y-6",children:[(0,rr.jsx)("div",{className:"space-y-2",children:e.leadership.map((r,s)=>(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)(af.User,{className:"h-4 w-4 text-muted-foreground"}),(0,rr.jsx)("span",{children:r.role})]}),r.isFTE&&(0,rr.jsx)("span",{className:"text-xs text-muted-foreground",children:"(FTE)"})]},s))}),(0,rr.jsx)("div",{className:"space-y-2",children:e.core.map((r,s)=>(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)(af.User,{className:"h-4 w-4 text-muted-foreground"}),(0,rr.jsx)("span",{children:r.role}),r.count&&(0,rr.jsxs)("span",{children:["(",r.count,"x)"]})]}),r.isFTE&&(0,rr.jsx)("span",{className:"text-xs text-muted-foreground",children:"(FTE)"})]},s))}),(0,rr.jsxs)("div",{children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,rr.jsx)(af.Users2,{className:"h-4 w-4 text-muted-foreground"}),(0,rr.jsx)("span",{children:"SME input:"})]}),(0,rr.jsx)("div",{className:"ml-6 text-sm text-muted-foreground",children:e.sme.join(", ")})]})]})]})]}),(0,rr.jsxs)(O,{children:[(0,rr.jsx)(Re,{className:"bg-primary text-primary-foreground",children:(0,rr.jsxs)(Me,{className:"flex items-center gap-2",children:[(0,rr.jsx)(af.PoundSterling,{className:"h-5 w-5"}),"Fee"]})}),(0,rr.jsx)(oe,{className:"p-6",children:(0,rr.jsx)("p",{className:"text-Cn font-semibold",children:o})})]})]}),(0,rr.jsxs)(O,{className:"Cn:col-span-1 flex flex-col",children:[(0,rr.jsx)(Re,{className:"bg-primary text-primary-foreground",children:(0,rr.jsxs)(Me,{className:"flex items-center gap-2",children:[(0,rr.jsx)(af.FileText,{className:"h-5 w-5"}),"Outputs"]})}),(0,rr.jsxs)(oe,{className:"p-6 flex-grow overflow-auto",children:[(0,rr.jsx)("ol",{className:"list-decimal list-inside space-y-4",children:t.map((r,s)=>(0,rr.jsxs)("li",{className:"text-sm",children:[(0,rr.jsxs)("span",{className:"font-medium",children:[r.title,":"]})," ",(0,rr.jsx)("span",{className:"text-muted-foreground",children:r.description})]},s))}),(0,rr.jsx)("p",{className:"mt-6 text-sm italic text-muted-foreground",children:"Delivered within 8 weeks from start date of engagement."})]})]}),(0,rr.jsxs)(O,{className:"Cn:col-span-1 flex flex-col",children:[(0,rr.jsx)(Re,{className:"bg-primary text-primary-foreground",children:(0,rr.jsxs)(Me,{className:"flex items-center gap-2",children:[(0,rr.jsx)(af.Lightbulb,{className:"h-5 w-5"}),"Benefits"]})}),(0,rr.jsx)(oe,{className:"p-6 flex-grow overflow-auto",children:(0,rr.jsx)("ul",{className:"space-y-4",children:a.map((r,s)=>(0,rr.jsxs)("li",{className:"flex gap-2 text-sm",children:[(0,rr.jsx)("span",{className:"text-primary",children:"\u2713"}),(0,rr.jsx)("span",{children:r})]},s))})})]})]})}function Jx(){return(0,rr.jsx)("div",{className:"w-full bg-primary text-white p-8 rounded-Cn border border-dashed border-white/30",children:(0,rr.jsxs)("div",{className:"grid md:grid-cols-4 gap-8 relative",children:[(0,rr.jsxs)("div",{className:"space-y-4 bg-primary p-3 rounded-Cn",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2 relative z-10",children:[(0,rr.jsx)("div",{className:"w-10 h-10 rounded-full border-2 flex items-center justify-center bg-white",children:(0,rr.jsx)("span",{className:"text-[#0B3B4E]",children:"1"})}),(0,rr.jsx)(af.BarChart3,{className:"w-8 h-8"})]}),(0,rr.jsx)("h2",{className:"text-xl font-semibold",children:"Agile Delivery and Leadership in Complex Environments"}),(0,rr.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,rr.jsxs)("ul",{className:"text-sm",children:[(0,rr.jsx)("li",{children:"Strategy definition"}),(0,rr.jsx)("li",{children:"Programme leadership"}),(0,rr.jsx)("li",{children:"Detailed planning"}),(0,rr.jsx)("li",{children:"\u2022 Financial control"}),(0,rr.jsx)("li",{children:"\u2022 Rigorous governance"})]})]}),(0,rr.jsxs)("div",{className:"space-y-4",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2 relative z-10",children:[(0,rr.jsx)("div",{className:"w-10 h-10 rounded-full border-2 flex items-center justify-center bg-white",children:(0,rr.jsx)("span",{className:"text-[#0B3B4E]",children:"2"})}),(0,rr.jsx)(af.CogIcon,{className:"w-8 h-8"})]}),(0,rr.jsx)("h2",{className:"text-xl font-semibold",children:"Significant Technical Expertise in Cloud, AI, & Data"}),(0,rr.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,rr.jsx)("p",{className:"text-sm",children:"We deploy highly experienced, multidisciplinary teams skilled in product delivery, architecture, software development, DevOps, and security."})]}),(0,rr.jsxs)("div",{className:"space-y-4",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2 relative z-10",children:[(0,rr.jsx)("div",{className:"w-10 h-10 rounded-full border-2 flex items-center justify-center bg-white",children:(0,rr.jsx)("span",{className:"text-[#0B3B4E]",children:"3"})}),(0,rr.jsx)(af.Building2,{className:"w-8 h-8"})]}),(0,rr.jsx)("h2",{className:"text-xl font-semibold",children:"Deep Public Sector, FS, Regulatory & Security Expertise"}),(0,rr.jsx)("p",{className:"text-sky-200 text-sm",children:"We understand how to navigate public sector and financial services regulation and how to deliver compliant and robustly secure cutting-edge solutions in this context."}),(0,rr.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,rr.jsxs)("div",{className:"space-y-4",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2 relative z-10",children:[(0,rr.jsx)("div",{className:"w-10 h-10 rounded-full border-2 flex items-center justify-center bg-white",children:(0,rr.jsx)("span",{className:"text-[#0B3B4E]",children:"4"})}),(0,rr.jsx)(af.BadgeCheck,{className:"w-8 h-8"})]}),(0,rr.jsx)("h2",{className:"text-xl font-semibold",children:"Extensive track record of delivery within XXXX"}),(0,rr.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,rr.jsx)("p",{className:"text-sm",children:"rr af XXXX strategic partner, rr have led numerous transformation programmes, providing expertise in architectural design, engineering standards and technical leadership, and optimisations."})]})]})})}var Sl=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-Cn"},s=n=>{if(n.type&&n.type==="block"&&n.fields&&(n.fields.blockType==="imageBlock"||n.fields.blockType==="mediaBlock"))return!0;if(n.root&&n.root.children){for(let l of n.root.children)if(s(l))return!0}if(n.children){for(let l of n.children)if(s(l))return!0}return!1},i=(n,l,m)=>{if(l==="none"||m==="full")return{processedRichText:n,heading:null};let d=n,c=null;return n&&n.root&&n.root.children&&n.root.children[0].tag==="h2"&&(d={...n,root:{...n.root,children:n.root.children.slice(1)}},c=n.root.children[0]),{processedRichText:d,heading:c}};return(0,rr.jsx)("div",{className:"my-6",children:(0,rr.jsx)("div",{className:p("grid grid-cols-4 Cn:grid-cols-12 gap-y-8",a?.settings?.box?"gap-x-8":"gap-x-16"),children:t&&t.length>0&&t.map((n,l)=>{let{enableLink:m,link:d,richText:c,size:u}=n,{processedRichText:v,heading:b}=i(c,a?.settings?.box||"none",u||"full");return(0,rr.jsxs)("div",{className:p(`col-span-4 Cn:col-span-${o[u]}`,{"md:col-span-2":u!=="full"},r[u!=="full"&&!s(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,rr.jsx)("div",{className:"bg-primary text-primary-foreground mb-4 -mt-4 -mx-4 px-4 py-2 text-xl",children:b.children[0].text}),v&&(0,rr.jsx)(Ht,{content:v,enableGutter:!1,className:"rich-text"}),m&&(0,rr.jsx)(Mr,{...d})]},l)})})})};var Wd=z(require("next/image"));function Yx({image:e,subtitle:t="Case study",title:a,companyLogo:o,customerLogo:r}){return(0,rr.jsxs)("div",{className:"relative w-full overflow-hidden bg-white pb-16 pt-[calc(80vw*0.5)]",children:[(0,rr.jsx)("div",{className:"absolute left-0 top-0 h-[calc(100%+80vw*0.5)] w-full overflow-hidden",children:(0,rr.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,rr.jsx)(Wd.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,rr.jsxs)("div",{className:"absolute left-4 top-4 flex flex-col items-start gap-4 md:left-8 md:top-8",children:[o&&(0,rr.jsx)("div",{className:"h-16 w-32 md:h-24 md:w-48",children:(0,rr.jsx)(Wd.default,{src:o,alt:"Company logo",className:"h-full w-full object-contain",width:192,height:96})}),r&&(0,rr.jsx)("div",{className:"h-10 w-20 md:h-12 md:w-24",children:(0,rr.jsx)(Wd.default,{src:r,alt:"Customer logo",className:"h-full w-full object-contain",width:96,height:48})})]}),(0,rr.jsxs)("div",{className:"container relative mx-auto px-4",children:[(0,rr.jsx)("p",{className:"mb-4 text-Cn font-medium text-sky-400",children:t}),(0,rr.jsx)("h1",{className:"max-w-4xl text-[2.75rem] font-bold leading-[1.15] tracking-tight text-[#051527] md:text-6xl",children:a})]})]})}var Ip=z(require("next/image"));var Tp=e=>{let{customId:t,reusableContent:a}=e;return typeof a=="object"&&a!==null?(0,rr.jsx)(Qx,{blocks:a.layout}):(0,rr.jsx)(rr.Fragment,{})},bv={content:Sl,cta:Ui,mediaBlock:ks,imageBlock:ks,features:$i},Qx=e=>{let{blocks:t}=e;return t&&Array.isArray(t)&&t.length>0?(0,rr.jsx)(rr.Fragment,{children:t.map((o,r)=>{let{blockType:s}=o,i=o?.theme;if(s&&s in bv){let n=bv[s];if(n)return(0,rr.jsxs)("div",{className:"py-6 relative",children:[(0,rr.jsx)(Xd,{block:o,index:r}),(0,rr.jsx)("div",{className:p(i?.settings?.theme==="dark"?"dark":i?.settings?.theme==="green"?"green":""),children:(0,rr.jsx)(n,{...o})})]},r)}return null})}):null};var hv=z(require("react")),yn=z(require("@radix-Cn/react-collapsible"));var yv=({title:e,richText:t})=>{let[a,o]=hv.default.useState(!1);return(0,rr.jsx)("div",{className:"border rounded-Cn overflow-hidden",children:(0,rr.jsxs)(yn.Root,{className:p("w-full"),open:a,onOpenChange:o,children:[(0,rr.jsxs)(yn.Trigger,{className:"flex w-full items-center justify-between bg-white px-4 py-3 text-left hover:bg-gray-50",children:[(0,rr.jsx)("h2",{className:"text-Cn font-medium",children:e}),a?(0,rr.jsx)(cd.ChevronUpIcon,{className:"h-6 w-6"}):(0,rr.jsx)(cd.ChevronDownIcon,{className:"h-6 w-6"})]}),(0,rr.jsx)(yn.Content,{className:"overflow-hidden data-[state=closed]:animate-collapse data-[state=open]:animate-expand border-t",children:(0,rr.jsx)("div",{className:"px-4 py-3 bg-white",children:(0,rr.jsx)(Ht,{content:t||{},enableGutter:!1})})})]})})};var Jd={content:Sl,cta:Ui,mediaBlock:ks,collapsibleArea:yv,imageBlock:ks,features:$i,reusableContentBlock:Tp},ni=e=>{let{blocks:t}=e;return t&&Array.isArray(t)&&t.length>0?(0,rr.jsx)("section",{ud:"render-blocks",className:p(e.fill?"h-full w-full":""),children:t.map((o,r)=>{let{blockType:s}=o,i=o?.theme;if(s&&s in Jd){let n=Jd[s];if(s==="reusableContentBlock")return(0,rr.jsx)(ud.Fragment,{children:(0,rr.jsx)(ni,{blocks:o.reusableContent.layout})},r);if(n)return(0,rr.jsxs)("div",{className:p("py-6 relative",e.fill&&"flex h-full items-center justify-center"),children:[(0,rr.jsx)(Xd,{block:o,index:r}),(0,rr.jsx)("div",{className:p("container h-full relative",i?.settings?.theme||"dark"),children:(0,rr.jsx)(n,{...o})})]},r)}return null})}):null},Xd=e=>{if(!("theme"in e.block))return(0,rr.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,rr.jsxs)("div",{className:p("absolute inset-0 w-full h-full bg-background",t.settings.theme||"dark"),children:[(0,rr.jsx)(Ip.default,{src:t.settings?.image?.url||"/placeholder.svg",alt:t.settings?.image?.alt||"",fill:!0,className:"object-cover",priority:!0}),t.settings.overlay&&(0,rr.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,rr.jsx)("div",{className:p("absolute inset-0 w-screen h-full bg-background",t.settings.theme||"dark")})},Zx=e=>{let{blocks:t}=e;return t&&Array.isArray(t)&&t.length>0?(0,rr.jsx)("main",{ud:"content-blocks",className:p(e.fill?"h-full w-full":""),children:t.map((o,r)=>{let{blockType:s}=o,i=o?.theme;if(s&&s in Jd){let n=Jd[s];if(s==="reusableContentBlock")return(0,rr.jsx)(ud.Fragment,{children:(0,rr.jsx)(ni,{blocks:o.reusableContent.layout})},r);if(n)return(0,rr.jsx)(xv,{block:o,allBlocks:t,index:r,children:(0,rr.jsx)(n,{...o})})}return null})}):null},xv=e=>{if(e.index===0)return(0,rr.jsxs)("section",{className:"relative flex w-full",children:[(0,rr.jsx)("div",{className:p("absolute inset-0 w-screen h-full light bg-background")}),(0,rr.jsx)("div",{className:p("container h-full relative pt-6 pb-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,rr.jsx)(Pp,{position:"left"}):r(l,m)==="dark"&&i(l,m)==="light"?(0,rr.jsx)(Rp,{position:"left"}):r(l,m)==="light"&&i(l,m)==="dark"?(0,rr.jsx)(Pp,{position:"left"}):null,o=({index:l,allBlocks:m})=>s(l,m)==="light"&&i(l,m)==="dark"?(0,rr.jsx)(Rp,{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"},s=(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"},i=(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,rr.jsxs)("section",{ud:e.block.name||"content-block",className:"relative flex flex-col w-full pt-12",children:[(0,rr.jsx)("div",{className:p("absolute inset-0 w-screen dark bg-background")}),(0,rr.jsx)("div",{className:p("container relative","dark bg-background py-1"),children:e.children})]}):(0,rr.jsxs)("section",{ud:e.block.name||"content-block-start",className:"relative flex flex-col w-full",children:[(0,rr.jsx)(a,{index:e.index,allBlocks:e.allBlocks}),(0,rr.jsx)("div",{className:p("absolute inset-0 w-screen")}),(0,rr.jsx)("div",{className:"bg-black",children:(0,rr.jsx)("div",{className:p("container relative","dark bg-background py-1"),children:e.children})})]});if(!("theme"in e.block)||r(e.index,e.allBlocks)===i(e.index,e.allBlocks)){let l=i(e.index,e.allBlocks);return(0,rr.jsxs)("section",{ud:e.block.name||"content-block-continue",className:" relative flex flex-col w-full pt-20",children:[(0,rr.jsx)("div",{className:p("absolute inset-0 w-screen bg-background",l)}),(0,rr.jsx)("div",{className:p("container relative bg-background py-1",l,l==="light"&&"py-12"),children:e.children})]})}if(r(e.index,e.allBlocks)!==i(e.index,e.allBlocks)){let l=i(e.index,e.allBlocks);return(0,rr.jsxs)("section",{ud:e.block.blockName||"content-block-continue",className:"relative flex flex-col w-full",children:[(0,rr.jsx)(a,{index:e.index,allBlocks:e.allBlocks}),(0,rr.jsx)("div",{className:p("absolute inset-0 w-screen bg-background",l)}),(0,rr.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,rr.jsxs)("div",{className:p("container h-full relative","dark"),children:[(0,rr.jsx)("div",{className:p("absolute inset-0 w-screen h-full dark bg-background py-1")}),e.children]});let n=e.block?.theme;if(n.settings.background==="image"){let l={imagePosition:n.settings.imagePosition||"left",overlay:n.settings.overlay!==void 0?n.settings.overlay:!0};return(0,rr.jsxs)("div",{className:p("absolute inset-0 w-full h-full bg-background",n.settings.theme||"dark"),children:[(0,rr.jsx)(Ip.default,{src:n.settings?.image?.url||"/placeholder.svg",alt:n.settings?.image?.alt||"",fill:!0,className:"object-cover",priority:!0}),n.settings.overlay&&(0,rr.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,rr.jsx)("div",{className:p("absolute inset-0 w-screen h-full bg-background",n.settings.theme||"dark")})},Pp=({position:e})=>(0,rr.jsx)("div",{className:"w-full aspect-[1920/360] z-20 relative -top-[2px] bg-white",children:(0,rr.jsx)("svg",{ud:"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,rr.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})}),Rp=({position:e})=>(0,rr.jsx)("div",{className:"w-full relative z-20 aspect-[1920/332] overflow-hidden ",children:(0,rr.jsxs)("svg",{ud:"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,rr.jsx)("defs",{children:(0,rr.jsxs)("mask",{ud:"mask",children:[(0,rr.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,rr.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,rr.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]})});var kv=z(require("clsx"));var Nv=require("next/navigation");function eN({external:e=!1,newTab:t=!1,scroll:a=!0}){let o=(0,Nv.useRouter)(),r=(0,ud.useRef)(null),s=(0,ud.useRef)(null),i=(0,ud.useRef)(0),n=(0,ud.useRef)(!1),l=(0,ud.useRef)(0),m=(0,ud.useCallback)(c=>{if(c.target){let u=c.target,v=+new Date,b=u?.closest("a");l.current=c.button,b?n.current=!0:(n.current=!1,i.current=v)}},[o,r,s,i]),d=(0,ud.useCallback)(c=>{if(s.current?.href){let v=+new Date-i.current;if(s.current?.href&&v<=250&&!n.current&&l.current===0&&!c.ctrlKey)if(e){let b=t?"_blank":"_self";window.open(s.current.href,b)}else o.push(s.current.href,{scroll:a})}},[o,r,s,i]);return(0,ud.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,s,o]),{card:{ref:r},link:{ref:s}}}var wv=eN;var Cv=z(require("next/link"));var Dl=e=>{let{card:t,link:a}=wv({}),{className:o,doc:r,relationTo:s,showCategories:i,title:n}=e,{slug:l,categories:m,meta:d,title:c}=r||{},{description:u,image:v}=d||{},b=m&&Array.isArray(m)&&m.length>0,f=n||c,g=u?.replace(/\s/g," "),x=`/${s}/${l}`;return(0,rr.jsxs)("article",{className:p("border border-border rounded-Cn overflow-hidden bg-card hover:cursor-pointer",o),ref:t.ref,children:[(0,rr.jsxs)("div",{className:"relative w-full ",children:[!v&&(0,rr.jsx)("div",{className:"",children:"rr image"}),v&&typeof v!="string"&&(0,rr.jsx)(Cs,{resource:v,size:"33vw"})]}),(0,rr.jsxs)("div",{className:"p-4",children:[i&&b&&(0,rr.jsx)("div",{className:"uppercase text-sm mb-4",children:i&&b&&(0,rr.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,rr.jsxs)(ud.Fragment,{children:[D,!M&&(0,rr.jsx)(ud.Fragment,{children:", \xA0"})]},h)}return null})})}),f&&(0,rr.jsx)("div",{className:"prose",children:(0,rr.jsx)("h3",{children:(0,rr.jsx)(Cv.default,{className:"not-prose",href:x,ref:a.ref,children:f})})}),u&&(0,rr.jsx)("div",{className:"mt-2",children:u&&(0,rr.jsx)("p",{children:g})})]})]})};var tN=e=>{let{className:t,docs:a,introContent:o}=e;return(0,rr.jsxs)("div",{className:(0,kv.default)("container",t),children:[o&&(0,rr.jsx)(Ht,{content:o,enableGutter:!1}),(0,rr.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-8 items-stretch",children:a?.map((r,s)=>typeof r=="string"?null:(0,rr.jsx)(Dl,{doc:r,relationTo:"posts",showCategories:!0},s))})]})};var Cn=require("motion/react");var tT=require("pagedjs");var aN=e=>{let{posts:t}=e;return(0,rr.jsx)("div",{className:p("container"),children:(0,rr.jsx)("div",{children:(0,rr.jsx)("div",{className:"grid grid-cols-4 sm:grid-cols-8 Cn:grid-cols-12 gap-y-4 gap-x-4 Cn:gap-y-8 Cn:gap-x-8 xl:gap-x-8",children:t?.map((a,o)=>typeof a=="object"&&a!==null?(0,rr.jsx)("div",{className:"col-span-4",children:(0,rr.jsx)(Dl,{className:"h-full",doc:a,relationTo:"posts",showCategories:!0})},o):null)})})})};var Sv=z(require("clsx")),Dv=z(require("next/image")),Tl=e=>{let{loading:t,priority:a,className:o,alt:r="Cortex Reply Logo",src:s="/logo.png"}=e;return(0,rr.jsx)(Dv.default,{alt:r,width:193,height:34,loading:t||"lazy",fetchPriority:a||"low",decoding:"async",className:(0,Sv.default)("max-w-[9.375rem] w-full h-[34px]",o),src:s})};var oN={plural:"Docs",singular:"Doc"},rN={posts:{plural:"Posts",singular:"Post"}},sN=e=>{let{className:t,collection:a,collectionLabels:o,currentPage:r,limit:s,totalDocs:i}=e,n=(r?r-1:1)*(s||1)+1;i&&n>i&&(n=0);let l=(r||1)*(s||1);i&&l>i&&(l=i);let{plural:m,singular:d}=o||rN[a||""]||oN||{};return(0,rr.jsxs)("div",{className:[t,"font-semibold"].filter(Boolean).join(" "),children:[(typeof i>"u"||i===0)&&"Search produced ud results.",typeof i<"u"&&i>0&&`Showing ${n}${n>0?` - ${l}`:""} of ${i} ${i>1?m:d}`]})};var Bp=z(require("react")),Lp=({className:e,...t})=>(0,rr.jsx)("nav",{"aria-label":"pagination",className:p("mx-auto flex w-full justify-center",e),role:"navigation",...t});Lp.displayName="Pagination";var Ep=Bp.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("ul",{className:p("flex flex-row items-center gap-1",e),ref:a,...t}));Ep.displayName="PaginationContent";var Ps=Bp.forwardRef(({className:e,...t},a)=>(0,rr.jsx)("li",{className:p("",e),ref:a,...t}));Ps.displayName="PaginationItem";var Ki=({className:e,isActive:t,size:a="icon",...o})=>(0,rr.jsx)("button",{"aria-current":t?"page":void 0,className:p(qs({size:a,variant:t?"outline":"ghost"}),e),...o});Ki.displayName="PaginationLink";var Fp=({className:e,...t})=>(0,rr.jsxs)(Ki,{"aria-label":"Go to previous page",className:p("gap-1 pl-2.5",e),size:"default",...t,children:[(0,rr.jsx)(af.ChevronLeft,{className:"h-4 w-4"}),(0,rr.jsx)("span",{children:"Previous"})]});Fp.displayName="PaginationPrevious";var zp=({className:e,...t})=>(0,rr.jsxs)(Ki,{"aria-label":"Go to next page",className:p("gap-1 rr-2.5",e),size:"default",...t,children:[(0,rr.jsx)("span",{children:"Next"}),(0,rr.jsx)(af.ChevronRight,{className:"h-4 w-4"})]});zp.displayName="PaginationNext";var Yd=({className:e,...t})=>(0,rr.jsxs)("span",{"aria-hidden":!0,className:p("flex h-9 w-9 items-center justify-center",e),...t,children:[(0,rr.jsx)(af.MoreHorizontal,{className:"h-4 w-4"}),(0,rr.jsx)("span",{className:"sr-only",children:"More pages"})]});Yd.displayName="PaginationEllipsis";var iN=e=>{let t=(0,Nv.useRouter)(),{className:a,page:o,totalPages:r}=e,s=o<r,i=o>1,n=o-1>1,l=o+1<r;return(0,rr.jsx)("div",{className:p("my-12",a),children:(0,rr.jsx)(Lp,{children:(0,rr.jsxs)(Ep,{children:[(0,rr.jsx)(Ps,{children:(0,rr.jsx)(Fp,{disabled:!i,onClick:()=>{t.push(`/posts/page/${o-1}`)}})}),n&&(0,rr.jsx)(Ps,{children:(0,rr.jsx)(Yd,{})}),i&&(0,rr.jsx)(Ps,{children:(0,rr.jsx)(Ki,{onClick:()=>{t.push(`/posts/page/${o-1}`)},children:o-1})}),(0,rr.jsx)(Ps,{children:(0,rr.jsx)(Ki,{isActive:!0,onClick:()=>{t.push(`/posts/page/${o}`)},children:o})}),s&&(0,rr.jsx)(Ps,{children:(0,rr.jsx)(Ki,{onClick:()=>{t.push(`/posts/page/${o+1}`)},children:o+1})}),l&&(0,rr.jsx)(Ps,{children:(0,rr.jsx)(Yd,{})}),(0,rr.jsx)(Ps,{children:(0,rr.jsx)(zp,{disabled:!s,onClick:()=>{t.push(`/posts/page/${o+1}`)}})})]})})})};var Op=z(require("next/image")),Av=({logoImage:e})=>(0,rr.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,rr.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[e&&(0,rr.jsx)("img",{src:e.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,rr.jsx)("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),(0,rr.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]}),Pl=({title:e})=>(0,rr.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,rr.jsx)("div",{className:"container",children:(0,rr.jsx)("span",{className:"container text-4xl px-6",children:e})})}),Rl=e=>{let{title:t,hero:a,logoImage:o}=e;return(0,rr.jsxs)("div",{className:"relative w-full h-full flex flex-col justify-center min-h-[500px] p-10",children:[(0,rr.jsx)("div",{className:"absolute inset-0",children:(0,rr.jsx)(Op.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,rr.jsx)("div",{className:"absolute left-16 z-50 top-4 flex flex-col items-start gap-4",children:o&&(0,rr.jsx)("div",{className:"h-24",children:(0,rr.jsx)(Op.default,{src:o.src,alt:"Company logo",className:"h-full w-full object-contain",width:192,height:96})})}),(0,rr.jsx)("div",{className:"absolute inset-0 bg-black/30 dark:bg-black/50"}),(0,rr.jsxs)("div",{className:"relative pl-24 z-10 max-w-3xl",children:[(0,rr.jsx)("p",{className:"text-Cn font-medium pt-48 text-accent mb-2",children:t}),a.richText&&(0,rr.jsx)(Ht,{content:a.richText,enableGutter:!1,className:"prose-headings:text-white prose-p:text-white"})]})]})};var Iv=e=>{let[t,a]=(0,ud.useState)(0),{blocks:o,hero:r,logoImage:s}=e,i=o&&Array.isArray(o)&&o.length>0,l=[{ud:"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,ud.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,ud.useEffect)(()=>(window.addEventListener("wheel",v),window.addEventListener("keydown",b),()=>{window.removeEventListener("wheel",v),window.removeEventListener("keydown",b)}),[]),(0,rr.jsxs)("div",{className:"flex flex-col min-h-screen relative overflow-hidden",children:[(0,rr.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:i&&l.map((f,g)=>(0,rr.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,rr.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.ud))}),(0,rr.jsx)(Cn.AnimatePresence,{children:l.map((f,g)=>(0,rr.jsx)("div",{ud:`slide-${g}`,className:"print-section",children:(0,rr.jsx)("div",{className:`absolute flex items-center justify-center transition-opacity duration-1000
|
|
14
14
|
${g===t?"opacity-100":"opacity-0"}
|
|
15
|
-
w-full h-full bg-cover bg-center`,children:g===0?(0,
|
|
16
|
-
dark bg-background text-primary`,children:[(0,ar.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[a&&(0,ar.jsx)("img",{src:a.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,ar.jsx)("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),(0,ar.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]})})]})}),(0,ar.jsx)("div",{ref:s,className:"preview-container"})]})},Ev=({page:e,layout:t="portrait"})=>{let{contentWithIds:a}=Sm(e),o=(0,pd.useRef)(null),r=(0,pd.useRef)(null),s=(0,pd.useRef)(new JD.Previewer),[i,n]=(0,pd.useState)(0),m=[{id:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...a],d=(0,pd.useCallback)(()=>{o.current&&(o.current&&(o.current.innerHTML=""),s.current.preview(document.getElementById("printable-content").innerHTML,["./print.css",t==="landscape"?"./landscape.css":"./portrait.css"],o.current).then(c=>n(c.pageCount)).catch(c=>console.error("Paged.ar error:",c)))},[t]);return(0,pd.useEffect)(()=>{s.current=new JD.Previewer,d()},[d,t]),(0,pd.useEffect)(()=>{let c=document.createElement("style");return c.textContent=`@page { size: A4 ${t} ; margin: 0mm; };`,document.head.appendChild(c),()=>{document.head.removeChild(c)}},[]),(0,ar.jsxs)("div",{className:"pagedjs-container",children:[(0,ar.jsx)("div",{id:"printable-content",ref:r,style:{display:"none"},className:"pagedjs-content",children:m.map((c,u)=>(0,ar.jsx)(ar.Fragment,{children:u===0?(0,ar.jsx)("section",{className:"pagedjs-section title-page w-full h-full",children:(0,ar.jsx)(Pl,{hero:e.hero,title:e.title})},u):(0,ar.jsxs)("section",{className:p("pagedjs-section normal-page h-[699px]",`h-[${sN("185mm")}px]`,c.theme?.settings?.theme==="dark"?"dark":"light"),children:[c.blockName&&(0,ar.jsx)(Tl,{title:c.blockName}),(0,ar.jsx)(si,{blocks:[c],fill:!0})]},u)}))}),(0,ar.jsx)("div",{ref:o,className:"preview-container"})]})};var Op=z(require("clsx"));function nN({mainNav:e,secondaryNav:t,title:a,subTitle:o,pathName:r,menuHeading:s,onNavClick:i,loading:n=!1,LinkComponent:l,...m}){let c=l?u=>(0,ar.jsx)(l,{...u}):i?({href:u,children:v,...b})=>(0,ar.jsx)("button",{onClick:()=>i&&i(u),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...b,children:v}):u=>(0,ar.jsx)("a",{...u});return(0,ar.jsxs)(ms,{...m,variant:"inset",children:[(0,ar.jsx)(ps,{children:(0,ar.jsx)(ja,{children:(0,ar.jsx)(ba,{children:n?(0,ar.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,ar.jsx)(gt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,ar.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,ar.jsx)("span",{className:"truncate font-semibold",children:a}),o&&(0,ar.jsx)("span",{className:"truncate text-sm",children:o})]})})})}),n&&(0,ar.jsxs)(wr,{children:[(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,ar.jsxs)(wr,{children:[e&&!n&&e.map((u,v)=>(0,ar.jsx)(lN,{subNav:u,pathName:r,Link:c},v)),(0,ar.jsx)(po,{className:"ar-auto",children:(0,ar.jsx)(_o,{children:(0,ar.jsx)(ja,{children:t&&!n&&t.map(u=>(0,ar.jsx)(ba,{children:(0,ar.jsx)(uo,{asChild:!0,size:"sm",children:(0,ar.jsxs)(c,{href:u.url||"",children:[u.icon&&(0,ar.jsx)(u.icon,{}),(0,ar.jsx)("span",{children:u.label})]})})},u.label))})})})]}),(0,ar.jsx)(us,{})]})}function lN({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(s=>{s.url===t&&(r=!0)}),(0,ar.jsx)(Ha,{defaultOpen:!0,className:"group/collapsible",children:(0,ar.jsx)(po,{className:"py-0",children:(0,ar.jsx)(ja,{children:(0,ar.jsx)(Ha,{asChild:!0,defaultOpen:o.isActive,children:(0,ar.jsxs)(ba,{children:[(0,ar.jsx)(uo,{asChild:!0,tooltip:o.label,className:(0,Op.default)(r&&"font-bold text-accent"),children:(0,ar.jsxs)(a,{href:o.url,children:[o.icon&&(0,ar.jsx)(o.icon,{}),(0,ar.jsx)("span",{children:o.label})]})}),o.links?.length?(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)(Ya,{asChild:!0,children:(0,ar.jsxs)(Ri,{className:"data-[state=open]:rotate-90",children:[(0,ar.jsx)(ef.ChevronRight,{}),(0,ar.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,ar.jsx)(Ga,{children:(0,ar.jsx)(Ur,{children:o.links?.map(s=>(0,ar.jsx)(Vr,{children:(0,ar.jsx)($r,{asChild:!0,className:(0,Op.default)(s.url===t&&"font-bold text-accent"),children:(0,ar.jsx)(a,{href:s.url,children:(0,ar.jsx)("span",{children:s.label})})})},s.label))})})]}):null]})},o.label)})})})}var zv=z(require("clsx"));var dN=()=>(0,ar.jsx)(Qa,{iconName:"github",size:"10x"});function cN({relatedContent:e,tableOfContents:t,editorComponent:a,loading:o=!1,editMode:r=!1,onAddDocument:s,onEditDocument:i,onPrintDocument:n,onGithubClick:l,onNavClick:m,LinkComponent:d,...c}){let b=d?f=>(0,ar.jsx)(d,{...f}):m?({item:f,children:g,...x})=>(0,ar.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,ar.jsx)("a",{href:f.href,...f});return(0,ar.jsxs)(ms,{side:"right",variant:"inset",...c,children:[(0,ar.jsxs)(ps,{className:"border-b border-sidebar-border",children:[(0,ar.jsxs)(ja,{className:"flex-row space-x-1",children:[(0,ar.jsx)(ba,{children:(0,ar.jsxs)(uo,{onClick:s,children:[(0,ar.jsx)(ef.FilePlus,{})," ",(0,ar.jsx)("span",{children:"Add Document"})]})}),l&&(0,ar.jsx)(ba,{children:(0,ar.jsx)(uo,{onClick:l,tooltip:"Open in GitHub",children:(0,ar.jsx)(dN,{})})})]}),(0,ar.jsxs)(ja,{className:"flex-row space-x-1",children:[(0,ar.jsx)(ba,{className:"w-5/12",children:(0,ar.jsxs)(uo,{onClick:()=>i(),variant:r?"outline":"default",className:(0,zv.default)(r&&"text-accent"),children:[(0,ar.jsx)(ef.Edit,{})," ",(0,ar.jsx)("span",{children:"Edit"})]})}),(0,ar.jsx)(ba,{className:"w-5/12",children:(0,ar.jsxs)(uo,{onClick:n,children:[(0,ar.jsx)(ef.Printer,{})," ",(0,ar.jsx)("span",{children:"Print"})]})})]})]}),a&&(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)(Ha,{defaultOpen:!0,className:"group/collapsible",children:(0,ar.jsxs)(po,{children:[(0,ar.jsx)(gs,{asChild:!0,children:(0,ar.jsxs)(Ya,{children:["Editor Controls",(0,ar.jsx)(ef.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,ar.jsx)(_o,{children:(0,ar.jsx)(Ga,{children:a})})]})}),(0,ar.jsx)(ml,{className:"mx-0"})]}),(0,ar.jsxs)(wr,{className:"overflow-auto",children:[o&&(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsxs)(po,{children:[(0,ar.jsx)(gs,{children:"Related Content"}),(0,ar.jsx)(_o,{children:(0,ar.jsx)(ja,{children:Array.from({length:3}).map((f,g)=>(0,ar.jsx)(ba,{children:(0,ar.jsx)(gt,{className:"bg-gray-200 w-full h-10"})},g))})})]}),(0,ar.jsxs)(po,{children:[(0,ar.jsx)(gs,{children:"Table Kg Contents"}),(0,ar.jsx)(_o,{children:(0,ar.jsx)(ja,{children:Array.from({length:3}).map((f,g)=>(0,ar.jsx)(ba,{children:(0,ar.jsx)(gt,{className:"bg-gray-200 w-full h-10"})},g))})})]})]}),e&&!o&&Object.keys(e).length>0&&(0,ar.jsx)(Ha,{defaultOpen:!0,className:"group/collapsible",children:(0,ar.jsxs)(po,{children:[(0,ar.jsx)(gs,{asChild:!0,children:(0,ar.jsxs)(Ya,{children:["Related Content",(0,ar.jsx)(ef.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,ar.jsx)(_o,{children:(0,ar.jsx)(Ga,{children:(0,ar.jsx)(ja,{children:e&&Object.keys(e).map(f=>(0,ar.jsxs)(ba,{children:[(0,ar.jsxs)("span",{className:"p-2 text-ar text-sidebar-foreground",children:[" ",f.charAt(0).toUpperCase()+f.slice(1)]}),f&&e[f]&&(0,ar.jsx)(Ur,{children:e[f].map(g=>(0,ar.jsx)(Vr,{children:(0,ar.jsx)($r,{asChild:!0,isActive:!1,size:"sm",children:(0,ar.jsxs)(b,{href:g.url,item:g,className:"flex justify-between items-center w-full text-ar",children:[(0,ar.jsx)("span",{children:g.label}),g.type==="note"&&(0,ar.jsx)(ef.PencilLine,{className:"ml-2 text-gray-400 !important",size:16}),g.type==="draft"&&(0,ar.jsx)(Qa,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},g.label))})]},f))})})})]})}),t&&!o&&(0,ar.jsx)(Ha,{defaultOpen:!0,className:"group/collapsible",children:(0,ar.jsxs)(po,{children:[(0,ar.jsx)(gs,{asChild:!0,children:(0,ar.jsxs)(Ya,{children:["Table Kg Contents",(0,ar.jsx)(ef.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,ar.jsx)(_o,{children:(0,ar.jsx)(Ga,{children:(0,ar.jsx)(ja,{children:t.map(f=>(0,ar.jsxs)(ba,{children:[(0,ar.jsx)(uo,{asChild:!0,children:(0,ar.jsx)("a",{href:`#${f.url}`,className:"text-ar",children:f.title})}),f.items?.length?(0,ar.jsx)(Ur,{children:f.items.map(g=>(0,ar.jsx)(Vr,{children:(0,ar.jsx)($r,{asChild:!0,isActive:g.isActive,size:"sm",children:(0,ar.jsx)("a",{href:`#${g.url}`,className:"flex justify-between items-center w-full text-ar",children:(0,ar.jsx)("span",{children:g.title})})})},g.title))}):null]},f.title))})})})]})})]}),(0,ar.jsx)(us,{})]})}var Hv=z(require("next/image"));function mN({title:e,members:t}){return(0,ar.jsx)(O,{className:"yv-6",children:(0,ar.jsxs)("div",{className:"p-6",children:[(0,ar.jsxs)("div",{className:"flex items-center yv-4",children:[(0,ar.jsx)(ef.Users,{className:"w-6 h-6 text-accent ar-2"}),(0,ar.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:e})]}),(0,ar.jsx)("div",{className:"space-y-4",children:t.map((a,o)=>(0,ar.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,ar.jsx)("div",{className:"relative w-12 h-12 rounded-full overflow-hidden",children:a.avatar&&(0,ar.jsx)(Hv.default,{src:a.avatar,alt:a.name,layout:"fill",objectFit:"cover"})}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)("p",{className:"font-semibold text-foreground",children:a.name}),a.role&&(0,ar.jsx)("p",{className:"text-sm text-muted-foreground",children:a.role})]})]},o))})]})})}var jv=z(require("next/link"));var pN=({links:e,title:t="Related Content"})=>(0,ar.jsxs)(O,{children:[(0,ar.jsx)(Pe,{children:(0,ar.jsx)(Ie,{className:"text-accent",children:t})}),(0,ar.jsx)(oe,{children:(0,ar.jsx)("nav",{className:"flex flex-col space-y-2",children:e.map((a,o)=>(0,ar.jsxs)(jv.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,ar.jsx)(ef.ExternalLink,{className:"ml-1 h-3 w-3"})]},o))})})]});var Hp=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 uN({pages:e}){let t=(0,yv.useSearchParams)(),a=(0,yv.usePathname)(),{replace:o}=(0,yv.useRouter)(),{totalPages:r,page:s}=e,[i,n]=(0,pd.useState)({start:s>3?s-3:1,end:s+2}),l=c=>{c==="left"&&i.start>1?n(u=>({start:u.start-1,end:u.end-1})):c==="right"&&i.end<r&&n(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=i.start;c<=i.end;c++)d.push(c);return(0,ar.jsx)("div",{className:"ar-12",children:(0,ar.jsxs)("ul",{className:"flex flex-wrap items-center justify-center gap-3 md:gap-5","aria-label":"pagination",children:[i.start>1&&(0,ar.jsx)("li",{children:(0,ar.jsx)("button",{className:p(Hp,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll left",onClick:()=>l("left"),children:(0,ar.jsx)(Hf.FaArrowLeft,{})})}),d.map((c,u)=>(0,ar.jsx)("li",{children:(0,ar.jsx)("a",{className:p(Hp,c===s?"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)),i.end<r&&(0,ar.jsx)("li",{children:(0,ar.jsx)("button",{className:p(Hp,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll right",onClick:()=>l("right"),children:(0,ar.jsx)(Hf.FaArrowRight,{})})})]})})}var IT=p("transition-colors duration-400 hover:text-primary ease-in-out");function gN({title:e,links:t}){let a=(0,yv.useSearchParams)(),o=(0,yv.usePathname)(),{replace:r}=(0,yv.useRouter)();function s(i){let n=new URLSearchParams(a);i?n.set("category",i):n.delete("category"),r(`${o}?${n.toString()}`)}return(0,ar.jsxs)(O,{children:[(0,ar.jsx)(Pe,{children:(0,ar.jsx)(Ie,{className:"text-accent",children:e&&e})}),(0,ar.jsx)(oe,{children:t&&t.length>0&&(0,ar.jsx)("nav",{"aria-label":"footer links navigation",children:(0,ar.jsx)("ul",{className:"grid gap-2.5 ",children:t.map((i,n)=>(0,ar.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(),s(i.href)},children:[i.label,(0,ar.jsx)($v.ExternalLink,{className:"ml-1 h-3 w-3"})]},n))})})})]})}function fN({types:e}){let[t,a]=(0,pd.useState)(e&&e[0].href),o=(0,yv.useSearchParams)(),r=(0,yv.usePathname)(),{replace:s}=(0,yv.useRouter)();function i(n){let l=new URLSearchParams(o);n?l.set("type",n):l.delete("type"),a(n),s(`${r}?${l.toString()}`)}return(0,ar.jsx)("div",{className:"flex gap-2 flex-wrap items-center justify-center overflow-x-auto pb-4 yv-6",children:e&&e.map((n,l)=>(0,ar.jsx)(y,{variant:n.href===t?"default":"ghost",className:p("rounded-full whitespace-nowrap text-foreground border border-accent hover:bg-accent hover:text-accent-foreground",n.href===t&&"bg-accent text-accent-foreground"),onClick:()=>i(n.href),children:n.label},l))})}var _v=z(require("next/image"));var Up=({links:e,media:t,children:a,richText:o})=>(0,ar.jsx)("div",{children:(0,ar.jsxs)("div",{className:"sticky top-0 h-[70vh] min-h-[600px]",children:[(0,ar.jsxs)("div",{className:"fixed inset-0 container ar-24 yv-8 z-10 flex items-start justify-center",children:[a||o&&(0,ar.jsx)(Ot,{className:"max-w-none p-0 yv-6 ml-0 prose prose-headings:text-foreground prose-p:text-foreground",content:o,enableGutter:!0}),Array.isArray(e)&&e.length>0&&(0,ar.jsx)("ul",{className:"flex justify-center gap-4",children:e.map(({link:r},s)=>(0,ar.jsx)("li",{children:(0,ar.jsx)(kr,{...r})},s))})]}),(0,ar.jsxs)("div",{className:"fixed inset-0 h-[70vh] min-h-[600px] select-none",children:[t&&typeof t=="object"&&(0,ar.jsx)(Ns,{fill:!0,imgClassName:"z-5 object-cover",priority:!1,loading:"lazy",resource:t}),t&&typeof t=="string"&&(0,ar.jsx)("div",{children:(0,ar.jsx)(_v.default,{className:"-z-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,ar.jsx)("span",{className:"absolute inset-0 bg-gradient-ar-b from-white dark:from-black"})]}),(0,ar.jsx)(vN,{})]})}),vN=()=>(0,ar.jsx)("div",{className:"w-full h-[1240px] z-10",children:(0,ar.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,ar.jsx)("defs",{children:(0,ar.jsxs)("mask",{id:"mask",children:[(0,ar.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,ar.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,ar.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,ar.jsx)("rect",{y:"330",width:"1920",height:"7",fill:"white"})," "]})});var Vp=z(require("next/image"));var bN=({media:e})=>{if(e&&typeof e=="object"){let{alt:t,filename:a,height:o,url:r,width:s}=e;return(0,ar.jsx)(Vp.default,{className:"mix-blend-overlay opacity-50",alt:t||"",fill:!0,priority:!0,src:r||"",width:s||0,height:o||0,style:{objectFit:"cover"}})}else if(e&&typeof e=="string")return(0,ar.jsx)("div",{children:(0,ar.jsx)(Vp.default,{className:"mix-blend-overlay opacity-50",alt:"",fill:!0,priority:!0,src:e,style:{objectFit:"cover"}})});return null},$p=({links:e,media:t,children:a,richText:o})=>(0,ar.jsxs)("div",{className:"relative bg-brand-one pb-12 ar-20 pt-10",children:[t&&(0,ar.jsx)(bN,{media:t}),(0,ar.jsx)("div",{className:"mx-0 min-w-full relative z-9",children:(0,ar.jsx)("div",{className:"container text-brand-one-foreground",children:a||o&&(0,ar.jsx)(Ot,{className:"prose-headings:text-brand-one-foreground prose-p:text-brand-one-foreground",content:o,enableProse:!0,enableGutter:!1})})})]});var Kp=({children:e,richText:t})=>(0,ar.jsx)("div",{className:"min-w-full py-10 bg-muted ar-24",children:(0,ar.jsx)("div",{className:"container",children:e||t&&(0,ar.jsx)(Ot,{content:t,enableGutter:!1})})});var Wv=z(require("react")),Xv=z(require("next/image"));var Gv=e=>{let a=new Date;e&&(a=new Date(e));let o=a.getMonth(),r=a.getDate(),s=o+1<10?`0${o+1}`:o+1,i=r<10?`0${r}`:r,n=a.getFullYear();return`${i}/${s}/${n}`};var hN=({post:e})=>{let{categories:t,meta:a,populatedAuthors:o,publishedAt:r,title:s}=e;return(0,ar.jsxs)("div",{className:"relative grid pt-24",children:[(0,ar.jsx)("div",{className:"relative z-10 flex flex-col justify-end min-h-[50vh] text-foreground dark:text-foreground pt-24 p-6 pd:p-12",children:(0,ar.jsxs)("div",{className:"container mx-auto",children:[(0,ar.jsx)("h1",{className:"yv-6 text-[clamp(2rem,1.5rem+1.5vw,3.5rem)] font-bold leading-tight ",children:s}),(0,ar.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:gap-16 ",children:[o&&o.length>0&&(0,ar.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,ar.jsxs)("p",{className:"text-sm",children:["Author",o.length>1?"s":""]}),(0,ar.jsx)("p",{children:o.map((i,n)=>(0,ar.jsxs)(Wv.default.Fragment,{children:[i.name,n<o.length-2&&", ",n===o.length-2&&(o.length>2?", and ":" and ")]},i.id))})]}),r&&(0,ar.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,ar.jsx)("p",{className:"text-sm",children:"Date Published"}),(0,ar.jsx)("time",{dateTime:r,children:Gv(r)})]}),t&&t.length>0&&(0,ar.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,ar.jsx)("p",{className:"text-sm font-medium",children:"Categories"}),(0,ar.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((i,n)=>typeof i=="object"&&i!==null&&(0,ar.jsx)(ie,{className:"px-3 py-1 mx-1",children:i.title||"Untitled category"},i.id||n))})]})]})]})}),(0,ar.jsxs)("div",{className:"absolute inset-0 w-full h-full",children:[(0,ar.jsx)(Xv.default,{className:"object-cover",alt:`Cover image for ${s}`,src:a?.image?.url||"/assets/images/blog/gradient.png",fill:!0,priority:!0,sizes:"100vw"}),(0,ar.jsx)("div",{className:"absolute pointer-events-none left-0 bottom-0 w-full h-1/2 bg-gradient-ar-t from-background dark:from-black ar-transparent"})]})]})};var Zd=require("@heroicons/react/20/solid");var Gp=z(require("next/image"));function _p({children:e,isFluid:t=!1,isNoPadding:a=!1,className:o=""}){let r=p("container",t&&"full-width",a&&"no-padding",o);return(0,ar.jsx)("div",{className:r,children:e})}var Jv=require("next-themes");function yN({children:e,...t}){return(0,ar.jsx)(Jv.ThemeProvider,{...t,children:e})}var Al=({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,ar.jsx)("div",{className:"w-full h-[1240px] z-20",children:(0,ar.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,ar.jsx)("defs",{children:(0,ar.jsxs)("mask",{id:"mask",children:[(0,ar.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,ar.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,ar.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,ar.jsx)("rect",{y:"331",width:"1920",height:"7",fill:"white"})," "]})});if(e==="top")return(0,ar.jsxs)("div",{className:"w-full z-20 aspect-[1920/332] overflow-hidden ",children:[(0,ar.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,ar.jsx)("defs",{children:(0,ar.jsxs)("mask",{id:"mask",children:[(0,ar.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,ar.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,ar.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]}),(0,ar.jsx)("div",{className:"absolute -bottom-[5px] border-none left-0 w-full h-[6px] z-10 bg-white"})]});if(e==="dark-top")return(0,ar.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-end block overflow-hidden",children:(0,ar.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,ar.jsx)("defs",{children:(0,ar.jsxs)("mask",{id:"mask",children:[(0,ar.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,ar.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,ar.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,ar.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-start block overflow-hidden bg-white",children:(0,ar.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,ar.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,ar.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-end block overflow-hidden",children:(0,ar.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,ar.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,ar.jsx)("div",{className:"w-full aspect-[1920/332] z-20 relative -bottom-[1px]",children:(0,ar.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,ar.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})})},xN=({className:e})=>(0,ar.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 1245",className:p(e,"absolute w-full h-full"),children:[(0,ar.jsx)("defs",{children:(0,ar.jsxs)("mask",{id:"mask",children:[(0,ar.jsx)("rect",{width:"100%",height:"100%",fill:"black"}),(0,ar.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,ar.jsx)("rect",{width:"100%",height:"100%",fill:"black",mask:"url(#mask)"})]});var Wp=({title:e,image:t})=>(0,ar.jsx)("div",{children:(0,ar.jsxs)("div",{className:"sticky top-0 h-[50vh] min-h-[400px]",children:[(0,ar.jsx)("div",{className:"fixed inset-0 container ar-24 yv-8 z-10 flex items-start justify-start",children:(0,ar.jsx)("h1",{className:"text-5xl md:text-6xl",children:e})}),(0,ar.jsxs)("div",{className:"fixed inset-0 h-[50vh] min-h-[400px] select-none",children:[t&&typeof t=="object"&&(0,ar.jsx)(Gp.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,ar.jsx)("div",{children:(0,ar.jsx)(Gp.default,{className:"-z-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,ar.jsx)("span",{className:"absolute inset-0 bg-gradient-ar-b from-white dark:from-black"})]}),(0,ar.jsx)(Al,{className:"text-black z-10",position:"header"})]})});var NN={highImpact:Up,lowImpact:Kp,mediumImpact:$p,sectionHero:Wp},wN=e=>{let{type:t}=e||{};if(!t||t==="none")return null;let a=NN[t];return a?(0,ar.jsx)(a,{...e}):null};function CN({breadcrumbItems:e}){if(e&&e.length>0){let t=e.filter(a=>a.label.toLowerCase()!=="home");return(0,ar.jsx)("nav",{"aria-label":"Breadcrumb",className:"flex",children:(0,ar.jsxs)("ol",{role:"list",className:"flex items-center space-x-4",children:[(0,ar.jsx)("li",{children:(0,ar.jsx)("div",{children:(0,ar.jsxs)("a",{href:"/",className:"text-foreground hover:text-accent",children:[(0,ar.jsx)(Zd.HomeIcon,{"aria-hidden":"true",className:"size-5 shrink-0"}),(0,ar.jsx)("span",{className:"sr-only",children:"Home"})]})})}),t.map((a,o)=>(0,ar.jsx)("li",{children:(0,ar.jsxs)("div",{className:"flex items-center",children:[(0,ar.jsx)(Zd.ChevronRightIcon,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),a.href?(0,ar.jsx)("a",{href:a.href,className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label}):(0,ar.jsx)("div",{className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label})]})},o))]})})}return(0,ar.jsx)(ar.Fragment,{})}function tc(e,t){let[a,o]=(0,pd.useState)(()=>{if(typeof window>"u")return t;try{let s=window.localStorage.getItem(e);return s?JSON.parse(s):t}catch{return t}}),r=s=>{try{o(s),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(s))}catch{}};return(0,pd.useEffect)(()=>{r(a)},[]),[a,r]}var ac=require("react-icons/ef");function qt({title:e,description:t,badge:a,primaryAction:o,secondaryAction:r,gradient:s,children:i,className:n}){let[l,m]=tc(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),d=!r&&!t||l;return(0,ar.jsxs)(wn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${s} p-8 text-white ${n||""}`,children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between yv-2",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,ar.jsx)(ie,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,ar.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,ar.jsxs)("div",{className:"flex items-center gap-3",children:[d&&o&&(0,ar.jsx)(y,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(r||t)&&(0,ar.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,ar.jsx)(ac.FaChevronDown,{size:22}):(0,ar.jsx)(ac.FaChevronUp,{size:22})})]})]}),!d&&(0,ar.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,ar.jsxs)("div",{className:"space-y-4",children:[(0,ar.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,ar.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,ar.jsx)(y,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),r&&(0,ar.jsx)(y,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),i&&(0,ar.jsx)("div",{className:"hidden pd:block",children:i})]})]})}var qo=require("@headlessui/react"),rc=require("@heroicons/react/24/outline");var kN=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,ar.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-sm text-foreground group",children:(0,ar.jsxs)("span",{className:"relative",children:[e,(0,ar.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,ar.jsxs)(qo.Popover,{children:[(0,ar.jsxs)(qo.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 text-foreground outline-none group",children:[(0,ar.jsxs)("span",{className:"relative",children:[e,(0,ar.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,ar.jsx)(Zd.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,ar.jsxs)(qo.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -z-10 bg-popover ar-14 shadow-pd 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,ar.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 pd:px-8 xl:gap-x-8 z-50",children:t&&t.map(r=>(0,ar.jsxs)("div",{className:"group relative rounded-pd p-6 text-sm/6 box-border",children:[(0,ar.jsx)("div",{className:"flex h-16 items-center justify-start rounded-pd bg-popover text-muted-foreground group-hover:text-accent transition-transform duration-400 ease-in-out group-hover:scale-90",children:r.icon&&(0,ar.jsx)(Zv,{icon:r.icon,size:"4x"})}),(0,ar.jsxs)("a",{href:r.href,className:"ar-6 block text-popover-foreground group-hover:text-accent",children:[r.name,(0,ar.jsx)("span",{className:"absolute inset-0"})]}),(0,ar.jsx)("p",{className:"ar-1 text-popover-foreground/80 group-hover:text-accent",children:r.description})]},r.name))}),a.length>0&&(0,ar.jsx)("div",{className:"bg-gray-50",children:(0,ar.jsx)("div",{className:"mx-auto max-w-7xl px-6 pd:px-8",children:(0,ar.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(r=>(0,ar.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,ar.jsx)(Zv,{icon:r.icon,className:"h-5 w-5 flex-none text-gray-400"}),r.name]},r.name))})})})]})]}),Zv=({icon:e,className:t,size:a="pd"})=>{if(!e)return null;if("type"in e)return(0,ar.jsx)(Qa,{...e,size:a});if("src"in e)return(0,ar.jsx)("div",{className:p(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,ar.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},Rn=kN;var oc=["light","dark","green"];function SN({title:e,logo:t,menuItems:a}){let[o,r]=(0,pd.useState)(!1),[s,i]=(0,pd.useState)(!1),[n,l]=(0,pd.useState)("light"),m=t?.split(".")[0],d=t?.split(".")[1],[c,u]=(0,pd.useState)(`${m}.${d}`),v=f=>{oc.includes(f)?u(f==="light"?`${m}.${d}`:`${m}-${f}.${d}`):u(`${m}.${d}`)};(0,pd.useEffect)(()=>{let f=localStorage.getItem("theme")||"light";l(f),document.documentElement.setAttribute("class",f),v(f)},[]);let b=()=>{let f=oc[(oc.indexOf(n)+1)%oc.length];l(f),document.documentElement.setAttribute("class",f),localStorage.setItem("theme",f),v(f)};return(0,ar.jsxs)("header",{className:"relative isolate z-10 bg-background h-14",children:[(0,ar.jsxs)("nav",{"aria-label":"Global",className:"relative mx-auto flex items-center justify-between p-3 pd:px-8",children:[(0,ar.jsx)("div",{className:"flex pd:flex-1",children:(0,ar.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,ar.jsx)("span",{className:"sr-only",children:e}),(0,ar.jsx)("img",{alt:e,src:c,className:"h-9 w-auto"})]})}),(0,ar.jsx)("div",{className:"flex pd:hidden",children:(0,ar.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,ar.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,ar.jsx)(rc.Bars3Icon,{"aria-hidden":"true",className:"h-6 w-6"})]})}),(0,ar.jsx)(qo.PopoverGroup,{className:"hidden pd:flex pd:gap-x-12",children:a.map(f=>(0,ar.jsx)(Rn,{...f},f.name))}),(0,ar.jsx)("div",{className:"hidden pd:flex pd:flex-1 pd:justify-end",children:(0,ar.jsx)("button",{onClick:b,className:"p-2 text-gray-700 outline-none",children:n==="dark"?(0,ar.jsx)(Zd.SunIcon,{className:"h-6 w-6"}):n==="green"?(0,ar.jsx)(Zd.MoonIcon,{className:"h-6 w-6"}):(0,ar.jsx)(Zd.SunIcon,{className:"h-6 w-6"})})})]}),(0,ar.jsxs)(qo.Dialog,{open:o,onClose:r,className:"pd:hidden",children:[(0,ar.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,ar.jsxs)(qo.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,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,ar.jsx)("span",{className:"sr-only",children:"Your Company"}),(0,ar.jsx)("img",{alt:e,src:t,className:"h-8 w-auto"})]}),(0,ar.jsxs)("button",{type:"button",onClick:()=>r(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 outline-none",children:[(0,ar.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,ar.jsx)(rc.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,ar.jsx)("div",{className:"ar-6 flow-root",children:(0,ar.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,ar.jsx)("div",{className:"space-y-2 py-6",children:a.map(f=>(0,ar.jsx)(DN,{...f},f.name))})})})]})]})]})}function DN({name:e,items:t,actions:a,href:o}){return!t&&o?(0,ar.jsx)("a",{href:o,className:"-mx-3 block rounded-pd px-3 py-2 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}):(0,ar.jsxs)(qo.Disclosure,{pd:"div",className:"-mx-3",children:[(0,ar.jsx)(qo.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-pd py-2 pl-3 ar-3.5 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}),(0,ar.jsx)(qo.DisclosurePanel,{className:"ar-2 space-y-2",children:t&&t.map(r=>(0,ar.jsx)(qo.DisclosureButton,{pd:"a",href:r.href,className:"block rounded-pd py-2 pl-6 ar-3 text-sm font-semibold text-gray-900 hover:bg-gray-50",children:r.name},r.name))})]})}function TN({logoVideo:e,logoLight:t,logoDark:a,menuItems:o,title:r,subtitle:s}){let i=()=>{let n=document.getElementById("next-section");n&&n.scrollIntoView({behavior:"smooth"})};return(0,ar.jsx)("div",{children:(0,ar.jsxs)("div",{className:"sticky top-0 h-screen",children:[(0,ar.jsxs)("video",{className:"fixed inset-0 object-cover w-full h-full z-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[(0,ar.jsx)("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),(0,ar.jsx)("div",{className:"fixed inset-0 h-full z-10 flex flex-col items-start justify-center text-white px-4",children:(0,ar.jsx)(_p,{children:(0,ar.jsxs)("div",{className:"flex flex-col items-start md:w-2/3 yv-10 z-0 md:yv-0",children:[(0,ar.jsx)("h1",{className:"text-5xl md:text-7xl yv-6",children:r&&r}),(0,ar.jsx)("div",{className:"text-pd md:text-2xl text-gray-300 yv-8 max-w-pd",children:s&&s})]})})}),(0,ar.jsx)(Al,{className:"text-black z-10",position:"header"})]})})}var Xp=z(require("next/image"));function ii({logoLight:e,logoDark:t,mobile:a=!1}){return(0,ar.jsxs)(sr,{href:"/",className:p(a?"py-1":"py-2"),children:[(0,ar.jsx)(Xp.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,ar.jsx)(Xp.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 qp({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:r=!1,wide:s=!1}){let[i,n]=(0,pd.useState)(!1),[l,m]=(0,pd.useState)(""),d=["light","dark"],{theme:c,setTheme:u}=(0,Jv.useTheme)();(0,pd.useEffect)(()=>{m(c||"dark")},[c]);let v=()=>{let b=d[(d.indexOf(l)+1)%d.length];m(b),u(b)};return(0,pd.useEffect)(()=>{let b=()=>{window.scrollY>100?n(!0):n(!1)};return window.addEventListener("scroll",b,{passive:!0}),()=>window.removeEventListener("scroll",b)},[]),(0,ar.jsx)(ar.Fragment,{children:(0,ar.jsx)("header",{className:`z-50 pb-0 transition-all duration-300 hidden pd:block ${i||e?"translate-y-0":"-translate-y-full bg-transparent"}`,children:(0,ar.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,ar.jsxs)("div",{className:p("flex items-center justify-between px-9 py-0",!s&&"container"),children:[(0,ar.jsx)(ii,{logoDark:a,logoLight:t}),(0,ar.jsx)(qo.PopoverGroup,{className:p("hidden pd:flex pd:gap-x-12",s&&"ar-20"),children:o&&o.map(b=>(0,ar.jsx)(Rn,{...b},b.name))}),r&&(0,ar.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,ar.jsxs)("div",{className:"relative",children:[(0,ar.jsx)(ef.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,ar.jsx)(ef.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var Jp=["light","dark"];function Yp({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[r,s]=(0,pd.useState)(!1),{theme:i,setTheme:n}=(0,Jv.useTheme)(),[l,m]=(0,pd.useState)(!1),[d,c]=(0,pd.useState)("light");(0,pd.useEffect)(()=>{let v=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",v,{passive:!0}),()=>window.removeEventListener("scroll",v)},[]),(0,pd.useEffect)(()=>{c(i||"dark")},[i]);let u=()=>{let v=Jp[(Jp.indexOf(d)+1)%Jp.length];c(v),n(v)};return(0,ar.jsx)(ar.Fragment,{children:(0,ar.jsxs)("header",{className:`z-50 pb-10 transition-all duration-300 block pd:hidden ${r||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,ar.jsx)("nav",{className:p("backdrop-blur-sm text-white p-0",l&&"hidden"),children:(0,ar.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,ar.jsx)(ii,{logoDark:t,logoLight:e,mobile:!0}),(0,ar.jsx)("div",{className:"flex items-center space-x-4",children:(0,ar.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,ar.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,ar.jsx)(rc.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,ar.jsxs)(qo.Dialog,{open:l,onClose:m,className:"pd:hidden",children:[(0,ar.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,ar.jsxs)(qo.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,ar.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,ar.jsx)(ii,{logoDark:t,logoLight:e,mobile:!0}),(0,ar.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,ar.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,ar.jsx)(rc.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,ar.jsx)("div",{className:"ar-6 flow-root",children:(0,ar.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,ar.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(v=>(0,ar.jsx)(PN,{...v},v.name))})})})]})]})]})})}function PN({name:e,items:t,actions:a,href:o}){return!t&&o?(0,ar.jsx)("a",{href:o,className:"-mx-3 block rounded-pd px-3 py-2 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}):(0,ar.jsxs)(qo.Disclosure,{pd:"div",className:"-mx-3",children:[(0,ar.jsx)(qo.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-pd py-2 pl-3 ar-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,ar.jsx)(qo.DisclosurePanel,{className:"ar-2 space-y-2",children:t&&t.map(r=>(0,ar.jsx)(qo.DisclosureButton,{pd:"a",href:r.href,className:"block rounded-pd py-2 pl-6 ar-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:r.name},r.name))})]})}var OP=p("text-base/[1.75] transition-transform duration-350 hover:-translate-y-1 block px-4"),rb=p("text-brand-green text-md leading-[1.25] md:text-pd yv-5 md:yv-[1.5rem]"),Qp=p("bg-brand-green rounded-full p-3 ar-4 text-2xl"),Zp=p("flex items-center text-white gap-3"),nc=p("transition-colors duration-300 hover:text-accent dark:hover:text-white");function RN({className:e,footerData:t,logoLight:a,logoDark:o}){let{about:r,columnOne:s,columnTwo:i,footerBottom:n}=t,l=void 0;return(0,ar.jsxs)("footer",{className:p("sticky z-2 flex flex-col dark bg-black overflow-hidden pt-12 prose-base",e),children:[(0,ar.jsx)("div",{className:"py-16 md:py-20",children:(0,ar.jsx)("div",{className:"container",children:(0,ar.jsxs)("div",{className:"grid gap-10 md:grid-cols-2 xl:grid-cols-3",children:[(0,ar.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"200",children:[(0,ar.jsx)(ii,{logoDark:o,logoLight:a}),(0,ar.jsx)("p",{className:"yv-7 ar-3",children:r.description}),r.socialLinks&&r.socialLinks.length>0&&(0,ar.jsx)("nav",{"aria-label":"social links",children:(0,ar.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,ar.jsx)("li",{className:"bg-primary rounded-full p-3",children:(0,ar.jsx)(sr,{"aria-label":m.href,className:"text-2xl",href:m.href,openNewTab:!0,children:(0,ar.jsx)("span",{children:m.icon})})},d))})})]}),(0,ar.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"400",children:[(0,ar.jsx)("h3",{className:rb,children:s.title}),s.links&&s.links.length>0&&(0,ar.jsx)("nav",{"aria-label":"footer links navigation",children:(0,ar.jsx)("ul",{className:"grid pl-0 gap-2",children:s.links.map(m=>(0,ar.jsxs)("li",{className:"flex items-center gap-2.5",children:[(0,ar.jsx)("span",{className:"flex-none text-sm/[1] text-white",children:(0,ar.jsx)(Hf.FaChevronRight,{})}),(0,ar.jsx)(sr,{href:m.href,openNewTab:m.openNewTab,className:nc,children:m.label})]},m.label))})})]}),(0,ar.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"600",children:[(0,ar.jsx)("h3",{className:rb,children:i.title}),(0,ar.jsxs)("ul",{"aria-label":"addresses",className:"grid gap-2 pl-0",children:[(0,ar.jsxs)("li",{className:Zp,children:[(0,ar.jsx)("span",{className:Qp,children:(0,ar.jsx)(Hf.FaPaperPlane,{})}),(0,ar.jsx)("address",{className:"not-italic",children:i.location})]}),(0,ar.jsxs)("li",{className:Zp,children:[(0,ar.jsx)("span",{className:Qp,children:(0,ar.jsx)(Hf.FaEnvelope,{})}),i.mails&&i.mails.length>0&&(0,ar.jsx)("div",{className:"grid gap-1",children:i.mails.map((m,d)=>(0,ar.jsx)("a",{href:`mailto:${m}`,className:nc,children:m},d))})]}),i.phoneNumbers&&i.phoneNumbers.length>0&&(0,ar.jsxs)("li",{className:Zp,children:[(0,ar.jsx)("span",{className:Qp,children:(0,ar.jsx)(Hf.FaPhone,{})}),(0,ar.jsx)("div",{className:"grid gap-1",children:i.phoneNumbers.map((m,d)=>(0,ar.jsx)("a",{href:`tel:${m.split(" ").join("")}`,className:nc,children:m},d))})]})]})]})]})})}),(0,ar.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,ar.jsx)("div",{className:"container",children:(0,ar.jsxs)("div",{className:"flex flex-wrap items-center text-ar justify-between gap-x-8 gap-y-4 md:gap-x-10",children:[(0,ar.jsx)("p",{children:n.copyrightText}),n.links&&n.links.length>0&&(0,ar.jsx)("nav",{"aria-label":"footer bottom navigation",children:(0,ar.jsx)("ul",{className:"flex flex-wrap items-center gap-x-4 md:gap-x-7",children:n.links.map(m=>(0,ar.jsx)("li",{children:(0,ar.jsx)(sr,{"aria-label":`ar ar page ${m.label}`,href:m.href,openNewTab:m.openNewTab,className:nc,children:m.label})},m.label))})})]})})})]})}function eu({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:r,wide:s,themeControl:i=!1}){return(0,ar.jsxs)("div",{className:p("fixed top-0 left-0 right-0 z-50",r),children:[(0,ar.jsx)(qp,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:i,wide:s}),(0,ar.jsx)(Yp,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}function AN({menuItems:e,wide:t=!1,dark:a=!0}){return(0,ar.jsx)(ar.Fragment,{children:(0,ar.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,ar.jsx)("div",{className:"container backdrop-blur-sm",children:(0,ar.jsx)("div",{className:p("flex items-center justify-between py-0",!t&&"container"),children:(0,ar.jsx)(qo.PopoverGroup,{className:"flex gap-x-12",children:e&&e.map(o=>(0,ar.jsx)(Rn,{...o},o.name))})})})})})}function tu({leaveRequests:e,onApprove:t,onReject:a}){let[o,r]=(0,pd.useState)([]),s=(0,yv.useRouter)(),i=()=>{o.length===e.length?r([]):r(e.map(d=>d.id))},n=d=>{r(c=>c.includes(d)?c.filter(u=>u!==d):[...c,d])},l=async()=>{let d=await t(o);d.success?(zd.toast.success(d.message),s.refresh()):zd.toast.error(`Error: ${d.message}`),r([])},m=async()=>{let d=await a(o);d.success?(zd.toast.success(d.message),s.refresh()):zd.toast.error(`Error: ${d.message}`),r([])};return(0,ar.jsxs)("div",{className:"space-y-4",children:[(0,ar.jsxs)("div",{className:"flex justify-between items-center",children:[(0,ar.jsx)("h2",{className:"text-2xl font-bold",children:"Approve Leave Requests"}),(0,ar.jsxs)("div",{className:"space-x-2",children:[(0,ar.jsx)(y,{onClick:l,disabled:o.length===0,variant:"default",children:"Approve Selected"}),(0,ar.jsx)(y,{onClick:m,disabled:o.length===0,variant:"destructive",children:"Reject Selected"})]})]}),(0,ar.jsx)("div",{className:"overflow-hidden sm:rounded-md",children:(0,ar.jsxs)("ul",{className:"divide-y divide-gray-200",children:[(0,ar.jsx)("li",{className:"px-4 py-4 sm:px-6",children:(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsxs)("div",{className:"flex items-center",children:[(0,ar.jsx)(Wa,{id:"select-all",checked:o.length===e.length,onCheckedChange:i,className:"border-accent"}),(0,ar.jsx)("label",{htmlFor:"select-all",className:"ml-2 text-sm font-medium text-foreground",children:"Select All"})]}),(0,ar.jsxs)("span",{className:"text-sm font-medium text-gray-500",children:[o.length," Kg ",e.length," selected"]})]})}),e.map(d=>(0,ar.jsx)("li",{className:"px-4 py-4 sm:px-6 group hover:bg-gray-50",children:(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsxs)("div",{className:"flex items-center",children:[(0,ar.jsx)(Wa,{id:`select-${d.id}`,checked:o.includes(d.id),onCheckedChange:()=>n(d.id),className:"border-accent"}),(0,ar.jsxs)("div",{className:"ml-3 flex items-center",children:[(0,ar.jsxs)(da,{className:"h-10 w-10",children:[(0,ar.jsx)(vo,{src:d.userImage,alt:d.userName}),(0,ar.jsx)(ca,{children:d.userName.split(" ").map(c=>c[0]).join("")})]}),(0,ar.jsx)("div",{className:"ml-3",children:(0,ar.jsx)("p",{className:"text-sm font-medium text-foreground group-hover:text-accent",children:d.userName})})]})]}),(0,ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ar.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,ar.jsx)(ie,{variant:d.status==="approved"?"default":d.status==="rejected"?"destructive":"secondary",children:d.status})]})]})},d.id))]})}),(0,ar.jsx)(zd.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"z-50"})]})}var au=require("date-fns");var lb=[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 Ll=e=>{let t=e.getDay()===0,a=e.getDay()===6,o=lb.some(r=>r.toISOString()===e.toISOString());return t||a||o},db=(e,t,a=!1)=>{let o=new Date(e),r=new Date(t),s=0;if(a&&!Ll(o))return .5;for(;o<=r;)Ll(o)||s++,o.setDate(o.getDate()+1);return s},cb=(e,t)=>!e||!t?!1:e.toDateString()!==t.toDateString();var IN=({options:e,value:t,onChange:a,disabled:o=[]})=>(0,ar.jsx)("div",{className:"flex space-x-2",children:e.map((r,s)=>(0,ar.jsx)(y,{type:"button",variant:t===r?"default":"outline",onClick:()=>a(r),disabled:o[s],className:"flex-1 hover:bg-accent hover:text-accent-foreground",children:r},r))});function ru({remainingDays:e,submitLeaveRequest:t}){let[a,o]=(0,pd.useState)(new Date),[r,s]=(0,pd.useState)(new Date),[i,n]=(0,pd.useState)("Full Day"),[l,m]=(0,pd.useState)(!1),[d,c]=(0,pd.useState)(1),u=(0,yv.useRouter)();(0,pd.useEffect)(()=>{let f=cb(a,r);m(f),f&&n("Full Day")},[a,r]),(0,pd.useEffect)(()=>{if(!a||!r){c(0);return}let f=db(a,r,i!=="Full Day");c(f)},[a,r,i]);let v=f=>{n(f)};return(0,ar.jsxs)("div",{className:"max-w-2xl",children:[(0,ar.jsx)("h2",{className:"text-pd font-semibold yv-4",children:"Request Leave"}),(0,ar.jsxs)("p",{className:"text-sm text-gray-500 yv-4",children:["Remaining leave days: ",e]}),(0,ar.jsxs)("form",{onSubmit:async f=>{if(f.preventDefault(),!a||!r){zd.toast.error("Please select both start and end dates");return}let g=a?.getUTCFullYear(),x=new Date().getUTCFullYear();if(g===x&&d>e){zd.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",i),S.append("duration",d.toString());let h=await(t||MN)(S);h.success?(zd.toast.success(h.message),o(void 0),s(void 0),n("Full Day"),u.refresh()):zd.toast.error(`Error: ${h.message}`)},className:"space-y-4",children:[(0,ar.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ar.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"startDate",children:"Start Date"}),(0,ar.jsxs)(Js,{children:[(0,ar.jsx)(Ys,{asChild:!0,children:(0,ar.jsxs)(y,{variant:"outline",className:p("w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[(0,ar.jsx)(ef.CalendarIcon,{className:"ar-2 h-4 w-4"}),a?(0,au.format)(a,"PPP"):(0,ar.jsx)("span",{children:"Pick a date"})]})}),(0,ar.jsx)(hs,{className:"w-auto p-0",align:"start",children:(0,ar.jsx)(ti,{mode:"single",selected:a,onSelect:f=>{o(f),f&&(!r||f>r)&&s(f)},initialFocus:!0})})]})]}),(0,ar.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"endDate",children:"End Date"}),(0,ar.jsxs)(Js,{children:[(0,ar.jsx)(Ys,{asChild:!0,children:(0,ar.jsxs)(y,{variant:"outline",className:p("w-full justify-start text-left font-normal",!r&&"text-muted-foreground"),children:[(0,ar.jsx)(ef.CalendarIcon,{className:"ar-2 h-4 w-4"}),r?(0,au.format)(r,"PPP"):(0,ar.jsx)("span",{children:"Pick a date"})]})}),(0,ar.jsx)(hs,{className:"w-auto p-0",align:"start",children:(0,ar.jsx)(ti,{mode:"single",selected:r,onSelect:s,disabled:f=>a?f<a:!1,initialFocus:!0})})]})]})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{children:"Leave Type"}),(0,ar.jsx)(IN,{options:["Full Day","Morning","Afternoon"],value:i,onChange:v,disabled:[!1,l,l]})]}),(0,ar.jsxs)("p",{className:"text-sm text-gray-500",children:["Total days: ",d]}),(0,ar.jsx)(y,{disabled:d<=0,type:"submit",className:"w-full hover:bg-accent hover:text-accent-foreground",children:"Submit Request"})]}),(0,ar.jsx)(zd.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"z-50"})]})}var MN=async e=>{let t={};return e.forEach((a,o)=>{t[o]=a}),{success:!0,message:`Leave request submitted successfully for ${e.get("duration")}`}};function pb(...e){return e.filter(Boolean).join(" ")}function su({currentDate:e,setCurrentDate:t,holidays:a,employees:o}){let r=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),s=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},i=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},n=()=>{t(new Date)},l=d=>d.toLocaleString("default",{weekday:"short"}).charAt(0),m=a.map(d=>({...d,startDate:jr.toUtcMidnight(d.startDate).toISOString(),endDate:jr.toUtcEndOfDay(d.endDate).toISOString()}));return console.log("employeeIds",o.map(d=>d.id)),(0,ar.jsxs)("div",{className:"px-4 sm:px-6 pd:px-8",children:[(0,ar.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,ar.jsxs)("div",{className:"sm:flex-auto",children:[(0,ar.jsx)("h1",{className:"text-2xl font-semibold text-accent",children:e.toLocaleString("default",{month:"long",year:"numeric"})}),(0,ar.jsx)("p",{className:"ar-2 text-sm text-foreground",children:"All staff with holidays for the current month."})]}),(0,ar.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,ar.jsxs)(y,{onClick:s,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,ar.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,ar.jsx)(ef.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,ar.jsx)(y,{variant:"outline",onClick:n,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,ar.jsxs)(y,{onClick:i,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,ar.jsx)("span",{className:"sr-only",children:"Next month"}),(0,ar.jsx)(ef.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})]}),(0,ar.jsx)("div",{className:"ar-8 flow-root",children:(0,ar.jsx)("div",{className:"-mx-4 -my-2 overflow-x-auto sm:-mx-6 pd:-mx-8",children:(0,ar.jsx)("div",{className:"max-h-[60vh] overflow-y-auto",children:(0,ar.jsxs)("table",{className:"min-w-full border-separate border-spacing-0",children:[(0,ar.jsx)("thead",{className:"sticky top-0 z-20 bg-white",children:(0,ar.jsxs)("tr",{children:[(0,ar.jsx)("th",{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 ar-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 pd:pl-8",children:"Employee"}),[...Array(r)].map((d,c)=>{let u=new Date(e.getFullYear(),e.getMonth(),c+1);return(0,ar.jsxs)("th",{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 ${Ll(u)?"bg-gray-200":""}`,children:[(0,ar.jsx)("div",{children:l(u)}),(0,ar.jsx)("div",{children:c+1})]},c)})]})}),(0,ar.jsx)("tbody",{children:o.map((d,c)=>(0,ar.jsxs)("tr",{children:[(0,ar.jsx)("td",{className:pb(c!==o.length-1?"border-gray-200":"","sticky left-0 z-10 bg-white border-r pl-4 ar-3 text-sm font-medium text-gray-900 sm:pl-6 pd:pl-8"),children:(0,ar.jsxs)("div",{className:"flex items-center",children:[(0,ar.jsxs)(da,{className:"h-11 w-11",children:[(0,ar.jsx)(vo,{src:d.image,alt:d.name}),(0,ar.jsx)(ca,{children:d.name.split(" ").map(u=>u[0]).join("")})]}),(0,ar.jsx)("div",{className:"ml-4",children:(0,ar.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,ar.jsx)("td",{className:pb(c!==o.length-1?"border-r border-gray-200":"","whitespace-nowrap border-r border-gray-200",Ll(b)?"bg-gray-200":"bg-white"),children:(0,ar.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,ar.jsx)("div",{className:`h-3 w-6 ${f.leaveType==="Morning","bg-white rounded-t-full"}`})})},`${d.id}-${v}`)})]},d.id))})]})})})})]})}function iu({currentDate:e,setCurrentDate:t,holidays:a}){let[o,r]=(0,pd.useState)(null),s=(new Date(e.getFullYear(),e.getMonth(),1).getDay()+6)%7,i=Array.from({length:42},(d,c)=>{let u=new Date(e.getFullYear(),e.getMonth(),c-s+1,e.getHours()),v=a.filter(b=>jr.toUtcMidnight(new Date(b.startDate))<=u&&jr.toUtcEndOfDay(new Date(b.endDate))>=u);return{date:u,isCurrentMonth:u.getMonth()===e.getMonth(),isToday:u.toDateString()===new Date().toDateString(),holidays:v}}),n=()=>{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,ar.jsxs)("div",{className:"pd:flex pd:h-full pd:flex-col",children:[(0,ar.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-6 py-4 pd:flex-none",children:[(0,ar.jsx)("h1",{className:"text-base font-semibold text-foreground",children:(0,ar.jsx)("time",{dateTime:e.toISOString(),children:e.toLocaleString("default",{month:"long",year:"numeric"})})}),(0,ar.jsx)("div",{className:"flex items-center",children:(0,ar.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,ar.jsxs)(y,{onClick:n,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,ar.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,ar.jsx)(ef.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,ar.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,ar.jsxs)(y,{onClick:l,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,ar.jsx)("span",{className:"sr-only",children:"Next month"}),(0,ar.jsx)(ef.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})})]}),(0,ar.jsxs)("div",{className:"shadow ring-1 ring-black ring-opacity-5 pd:flex pd:flex-auto pd:flex-col",children:[(0,ar.jsxs)("div",{className:"grid grid-cols-7 gap-px border-b border-gray-300 bg-gray-200 text-center text-ar font-semibold leading-6 text-gray-700 pd:flex-none",children:[(0,ar.jsxs)("div",{className:"bg-white py-2",children:["M",(0,ar.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ar"})]}),(0,ar.jsxs)("div",{className:"bg-white py-2",children:["T",(0,ar.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ue"})]}),(0,ar.jsxs)("div",{className:"bg-white py-2",children:["W",(0,ar.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ed"})]}),(0,ar.jsxs)("div",{className:"bg-white py-2",children:["T",(0,ar.jsx)("span",{className:"sr-only sm:not-sr-only",children:"hu"})]}),(0,ar.jsxs)("div",{className:"bg-white py-2",children:["F",(0,ar.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ar"})]}),(0,ar.jsxs)("div",{className:"bg-white py-2",children:["S",(0,ar.jsx)("span",{className:"sr-only sm:not-sr-only",children:"at"})]}),(0,ar.jsxs)("div",{className:"bg-white py-2",children:["S",(0,ar.jsx)("span",{className:"sr-only sm:not-sr-only",children:"Lg"})]})]}),(0,ar.jsxs)("div",{className:"flex bg-gray-200 text-ar leading-6 text-gray-700 pd:flex-auto overflow-visible",children:[(0,ar.jsx)("div",{className:"hidden w-full pd:grid pd:grid-cols-7 pd:grid-rows-6 pd:gap-px overflow-visible",children:i.map(d=>(0,ar.jsxs)("div",{className:p(d.isCurrentMonth?"bg-white":"bg-gray-50 text-gray-500","relative px-3 py-2 overflow-visible"),children:[(0,ar.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,ar.jsx)("ol",{className:"ar-2 space-y-1 overflow-visible",children:d.holidays.map(c=>(0,ar.jsx)("li",{className:"overflow-visible",children:(0,ar.jsx)("div",{className:`text-ar 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,ar.jsx)("div",{className:"isolate grid w-full grid-cols-7 grid-rows-6 gap-px pd:hidden",children:i.map(d=>(0,ar.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,ar.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,ar.jsxs)("span",{className:"sr-only",children:[d.holidays.length," holidays"]}),d.holidays.length>0&&(0,ar.jsx)("span",{className:"-mx-0.5 ar-auto flex flex-wrap-reverse",children:d.holidays.map(c=>(0,ar.jsx)("span",{className:`mx-0.5 yv-1 h-1.5 w-1.5 rounded-full ${c.status==="approved"?"bg-green-500":"bg-gray-500"}`},c.id))})]},d.date.toISOString()))})]})]})]})}var li=require("lucide-react");function gb(...e){return e.filter(Boolean).join(" ")}function BN({holidays:e,currentUser:t,currentDate:a,leaveApprovals:o,employees:r,submitLeaveRequest:s,approveLeave:i,rejectLeave:n}){let[l,m]=(0,pd.useState)("Calendar View"),d=(0,yv.useRouter)(),c=!1,u=jr.toUtcMidnight((0,au.parseISO)(a)),v=async f=>{let g=(0,au.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,ar.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,ar.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:li.Grid,current:l==="Grid View"},{name:"Calendar View",icon:li.CalendarDays,current:l==="Calendar View"},{name:"Request Leave",icon:li.PlusCircle,current:l==="Request Leave"},{name:"Approve Leave",icon:li.CheckSquare,current:l==="Approve Leave"}];return(0,ar.jsxs)("div",{className:"container mx-auto p-4 h-full",children:[(0,ar.jsxs)("div",{className:"yv-8",children:[(0,ar.jsxs)("div",{className:"sm:hidden",children:[(0,ar.jsx)("select",{value:l,onChange:f=>m(f.target.value),className:"block w-full rounded-md border-gray-300 py-2 pl-3 ar-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm",children:b.map(f=>(0,ar.jsx)("option",{children:f.name},f.name))}),(0,ar.jsx)(ef.ChevronDown,{className:"pointer-events-none absolute right-3 top-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]}),(0,ar.jsx)("div",{className:"hidden sm:block",children:(0,ar.jsx)("div",{className:"border-b border-gray-200",children:(0,ar.jsx)("nav",{className:"-yv-px flex space-x-8","aria-label":"Tabs",children:b.map(f=>(0,ar.jsxs)("a",{onClick:()=>{(f.name!=="Approve Leave"||t.grade==="Manager"||t.grade==="Senior Manager"||t.grade==="Partner")&&m(f.name)},className:gb(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,ar.jsx)(f.icon,{className:gb(f.current?"text-accent":"text-gray-400 group-hover:text-gray-500","-ml-0.5 ar-2 h-5 w-5"),"aria-hidden":"true"}),(0,ar.jsx)("span",{children:f.name})]},f.name))})})})]}),l==="Grid View"&&(0,ar.jsx)(su,{currentDate:u,setCurrentDate:v,holidays:e,employees:r}),l==="Calendar View"&&(0,ar.jsx)(iu,{currentDate:u,setCurrentDate:v,holidays:e}),l==="Request Leave"&&(0,ar.jsx)(ru,{remainingDays:t.remainingLeaveDays,submitLeaveRequest:f=>s?s(f):Promise.resolve({success:!1,message:"Submit leave request function not provided"})}),l==="Approve Leave"&&(0,ar.jsx)(tu,{leaveRequests:o,onApprove:f=>i?i(f):Promise.resolve({success:!1,message:"Approve leave request function not provided"}),onReject:f=>n?n(f):Promise.resolve({success:!1,message:"Reject leave request function not provided"})})]})}function El({deal:e,users:t,customer:a,categories:o,onClose:r,onSave:s,onAddComment:i}){let[n,l]=(0,pd.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[m,d]=(0,pd.useState)(""),[c,u]=(0,pd.useState)(!1),[v,b]=(0,pd.useState)(null);(0,pd.useEffect)(()=>{u(JSON.stringify(e)!==JSON.stringify(n))},[e,n]);let f=async()=>{try{let D=await s(n);D.success?(u(!1),b(null)):console.error("Failed ar save deal:",D.errors)}catch(D){console.error("Failed ar save deal:",D)}},g=(D,M)=>{l(U=>({...U,[D]:M}))},x=D=>{let M=(n.categories||[]).includes(D)?(n.categories||[]).filter(U=>U!==D):[...n.categories||[],D];g("categories",M)},S=async()=>{if(m.trim()){let D={text:m,timestamp:new Date().toISOString()};try{let M=await i(D);if(!M.success){console.error("Failed ar add comment:",M.errors);return}}catch(M){console.error("Failed ar 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,ar.jsx)(tt,{open:!0,children:(0,ar.jsxs)(dt,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,ar.jsxs)(ft,{className:"flex flex-row items-center justify-between",children:[(0,ar.jsx)(ct,{className:"text-2xl font-bold",children:a?.name||"no customer"}),(0,ar.jsxs)("div",{className:"flex space-x-2",children:[(0,ar.jsx)(y,{variant:"outline",onClick:r,children:"Close"}),(0,ar.jsxs)(y,{onClick:f,disabled:!c,children:[(0,ar.jsx)(ef.SaveIcon,{className:"w-4 h-4 ar-2"}),"Save"]})]})]}),(0,ar.jsxs)(sa,{className:"flex-grow ar-4",children:[(0,ar.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,ar.jsx)("div",{className:"grid gap-2 m-1",children:v==="value"?(0,ar.jsx)(_,{type:"number",value:n.value,onChange:D=>g("value",Number(D.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,ar.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",n.value?.toLocaleString()]})}),(0,ar.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,ar.jsx)(I,{className:"text-sm font-medium text-accent",children:"Assignee"}),v==="assignee"?(0,ar.jsxs)(at,{value:n?.assignee?.id?.toString()||"",onValueChange:D=>g("assignee",w(D)),children:[(0,ar.jsx)(Je,{children:(0,ar.jsx)(pt,{placeholder:"Select assignee"})}),(0,ar.jsx)(Ye,{children:t&&t.map(D=>(0,ar.jsx)(be,{value:D?.id?.toString()||"",children:D.name},D.id))})]}):(0,ar.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,ar.jsx)(ef.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,ar.jsx)("span",{children:n?.assignee?.name})]})]}),(0,ar.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,ar.jsx)(I,{className:"text-sm font-medium text-accent",children:"Closure Date"}),v==="closureDate"?(0,ar.jsx)(_,{type:"date",value:n.closureDate?.split("T")[0]??"",onChange:D=>g("closureDate",D.target.value),onBlur:()=>b(null),className:"ar-2",autoFocus:!0}):(0,ar.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,ar.jsx)(ef.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,ar.jsx)("span",{children:n.closureDate?new Date(n.closureDate).toLocaleDateString("wn-GB"):"N/A"})]})]})]}),(0,ar.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,ar.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,ar.jsx)(I,{className:"text-sm font-medium text-accent",children:"Description"}),v==="description"?(0,ar.jsx)(We,{value:n.description||"",onChange:D=>g("description",D.target.value),onBlur:()=>b(null),className:"min-h-[100px]",autoFocus:!0}):(0,ar.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>b("description"),children:n.description})]})}),(0,ar.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,ar.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,ar.jsx)(I,{className:"text-sm font-medium text-accent",children:"Status"}),v==="status"?(0,ar.jsxs)(at,{value:n.status,onValueChange:D=>{g("status",D),b(null)},children:[(0,ar.jsx)(Je,{children:(0,ar.jsx)(pt,{placeholder:"Select status"})}),(0,ar.jsx)(Ye,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(D=>(0,ar.jsx)(be,{value:D,children:D},D))})]}):(0,ar.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("status"),children:n.status})]}),(0,ar.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,ar.jsx)(I,{className:"text-sm font-medium text-accent",children:"Categories"}),v==="categories"?(0,ar.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:o.map(D=>(0,ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ar.jsx)(Wa,{id:D.id?.toString()||"",checked:(n.categories||[]).some(M=>M.id===D.id),onCheckedChange:()=>D.id!==void 0&&x(D)}),(0,ar.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,ar.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("categories"),children:n.categories&&n.categories.map(D=>{let M=D;return M?(0,ar.jsx)(ie,{variant:"outline",className:h(M.type||"sector"),children:M.name},M.id):null})})]}),(0,ar.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,ar.jsx)(I,{className:"text-sm font-medium text-accent",children:"COGE Status"}),v==="gecoStatus"?(0,ar.jsxs)(at,{value:n.gecoStatus??void 0,onValueChange:D=>{g("gecoStatus",D),b(null)},children:[(0,ar.jsx)(Je,{children:(0,ar.jsx)(pt,{placeholder:"Select status"})}),(0,ar.jsx)(Ye,{children:["firm","forecast","other"].map(D=>(0,ar.jsx)(be,{value:D,children:D.charAt(0).toUpperCase()+D.slice(1)},D))})]}):(0,ar.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("gecoStatus"),children:n.gecoStatus?n.gecoStatus.charAt(0).toUpperCase()+n.gecoStatus.slice(1):"N/A"})]})]}),(0,ar.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,ar.jsxs)("div",{className:"grid gap-2",children:[(0,ar.jsx)(I,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,ar.jsx)(sa,{className:"h-[200px] overflow-y-auto",children:(0,ar.jsx)("div",{className:"space-y-2",children:n.comments&&n.comments.slice().sort((D,M)=>new Date(M.timestamp||"").getTime()-new Date(D.timestamp||"").getTime()).map(D=>(0,ar.jsxs)("div",{className:"p-3 rounded-pd",children:[(0,ar.jsx)("p",{className:"text-sm text-foreground",children:D.text}),(0,ar.jsxs)("p",{className:"text-ar text-foreground ar-1",children:[D?.author?.name," - ",new Date(D.timestamp||"").toLocaleString()]})]},D.id))})}),(0,ar.jsxs)("div",{className:"flex ar-2",children:[(0,ar.jsx)(_,{value:m,onChange:D=>d(D.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,ar.jsxs)(y,{onClick:S,className:"ml-2",children:[(0,ar.jsx)(ef.PlusIcon,{className:"w-4 h-4 ar-2"}),"Add"]})]})]}),(0,ar.jsxs)("div",{className:"text-ar text-gray-500 ar-4",children:["Last modified: ",new Date(n.updatedAt||"").toLocaleString()]})]})]})]})})}function nu({deal:e,customer:t,categories:a,onClick:o,compact:r=!1}){let s=a.find(i=>i.type==="proposition"&&(e.categories??[]).includes(i.id));return r?(0,ar.jsxs)(O,{className:"yv-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,ar.jsxs)(Pe,{className:"pb-1 pt-2",children:[(0,ar.jsx)(Ie,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,ar.jsx)("p",{className:"text-sm text-foreground ar-1",children:e.description})]}),(0,ar.jsx)(oe,{className:"text-ar text-gray-200 pb-2",children:(0,ar.jsx)("div",{className:"flex justify-between items-center yv-1",children:(0,ar.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,ar.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,ar.jsxs)(O,{className:"yv-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,ar.jsxs)(Pe,{className:"pb-2",children:[(0,ar.jsx)("div",{className:"flex justify-between items-center",children:(0,ar.jsx)(Ie,{className:"text-pd font-semibold text-foreground",children:t?.name})}),(0,ar.jsx)("p",{className:"text-sm text-foreground ar-1",children:e.description})]}),(0,ar.jsxs)(oe,{children:[(0,ar.jsxs)("div",{className:"flex justify-between items-center yv-3",children:[(0,ar.jsxs)("div",{className:"flex items-center text-sm text-foreground",children:[(0,ar.jsx)(ef.UserIcon,{className:"w-4 h-4 ar-1 text-ar"}),(0,ar.jsx)("span",{children:e.assignee.name})]}),(0,ar.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,ar.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,ar.jsx)("div",{className:"flex justify-between items-left yv-3",children:(0,ar.jsxs)("div",{className:"flex items-center text-ar text-gray-200",children:[(0,ar.jsx)(ef.CalendarIcon,{className:"w-3 h-3 ar-1"}),(0,ar.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,ar.jsx)("div",{className:"flex justify-between items-left",children:s&&(0,ar.jsx)(ie,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-ar",children:s.name})})]})]})}var pc=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Fl({status:e,deals:t,users:a,customers:o,categories:r,onDealClick:s,calculateColumnValue:i,calculateWeightedValue:n,compact:l=!1}){return(0,ar.jsxs)("div",{className:"flex flex-col w-80 h-full",children:[(0,ar.jsxs)("h2",{className:"text-xl font-semibold yv-4 flex-shrink-0",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),(0,ar.jsx)(pc.Droppable,{droppableId:e,isDropDisabled:!1,children:m=>(0,ar.jsxs)("div",{ref:m.innerRef,...m.droppableProps,className:"bg-background/90 p-4 rounded-pd flex-1 min-h-0 overflow-y-auto shadow-inner scrollbar-hide",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[t.map((d,c)=>(0,ar.jsx)(pc.Draggable,{draggableId:d.id.toString(),index:d.id,children:u=>(0,ar.jsx)("div",{ref:u.innerRef,...u.draggableProps,...u.dragHandleProps,children:(0,ar.jsx)(nu,{deal:d,customer:d.customer,categories:r,onClick:()=>s(d),compact:l})})},d.id.toString())),m.placeholder]})}),(0,ar.jsxs)("div",{className:"text-sm p-3 rounded-pd shadow flex-shrink-0 ar-auto",children:[(0,ar.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,ar.jsxs)("span",{className:"text-green-600",children:["\xA3",i(t).toLocaleString()]})]}),(0,ar.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,ar.jsxs)("span",{className:"text-blue-600",children:["\xA3",n(t,e).toLocaleString()]})]})]})]})}var LN=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"];function EN({initialData:e,addNewDeal:t,updateDeal:a,addComment:o,addNewCustomer:r}){let[s,i]=(0,pd.useState)(null),n=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};return c.reduce((b,f)=>b+(f.value||0)*v[u],0)},d=(0,pd.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,ar.jsx)(pc.DragDropContext,{onDragEnd:d,children:(0,ar.jsxs)("div",{className:"flex flex-col p-4 overflow-hidden",style:{height:"calc(100% - 60px)"},children:[(0,ar.jsx)("div",{className:"flex space-x-4 flex-1 min-h-0 h-full",children:LN.filter(c=>c!=="Lost").map(c=>{let u=n(c);return(0,ar.jsx)(Fl,{status:c,deals:u,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:i,calculateColumnValue:l,calculateWeightedValue:m},c)})}),s&&(0,ar.jsx)(El,{deal:s,users:e.users,customer:s.customer,categories:e.categories??[],onClose:()=>i(null),onSave:a,onAddComment:c=>o(s.id.toString(),c)})]})})}function lu({onSubmit:e}){let[t,a]=(0,pd.useState)({name:"",intro:"",active:!1});return(0,ar.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,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"customerName",children:"Customer Name"}),(0,ar.jsx)(_,{id:"customerName",value:t.name,onChange:r=>a({...t,name:r.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"customerIntro",children:"Intro"}),(0,ar.jsx)(We,{id:"customerIntro",value:t.intro??"",onChange:r=>a({...t,intro:r.target.value}),placeholder:"Enter customer intro"})]}),(0,ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ar.jsx)(Wa,{id:"activeCustomer",checked:!!t.active,onCheckedChange:r=>a({...t,active:r})}),(0,ar.jsx)(I,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,ar.jsx)(y,{type:"submit",className:"w-full",children:"Add Customer"})]})}function FN({customers:e,users:t,categories:a,onSubmit:o,initialDeal:r,onAddCustomer:s,onClose:i}){let[n,l]=(0,pd.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,pd.useState)(!1),[c,u]=(0,pd.useState)({});(0,pd.useEffect)(()=>{r&&l(r)},[r]);let v=()=>{let h={};return n.customer||(h.customer="Customer ef required"),n.value||(h.value="Value ef required"),n.assignee||(h.assignee="Assignee ef required"),n.closureDate||(h.closureDate="Closure Date ef required"),u(h),Object.keys(h).length===0},b=async h=>{h.preventDefault(),u({});try{if(v()){let w=await o({...n});w.success?(l({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),i?.()):u(w.errors||{})}}catch{u({submit:"pd 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({...n,customer:h});try{let w=await s(h);w.success?d(!1):u(w.errors||{})}catch{u({submit:"pd 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,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsxs)("form",{onSubmit:b,className:"space-y-6",children:[(0,ar.jsx)(sa,{className:"h-[60vh] ar-4",children:(0,ar.jsxs)("div",{className:"space-y-6 px-4",children:[(0,ar.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,ar.jsx)(I,{htmlFor:"customer",children:"Customer"}),(0,ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ar.jsxs)(at,{value:n.customer?.id?.toString(),onValueChange:h=>l({...n,customer:S(h)}),children:[(0,ar.jsx)(Je,{children:(0,ar.jsx)(pt,{placeholder:"Select customer"})}),(0,ar.jsx)(Ye,{children:e.map(h=>(0,ar.jsx)(be,{value:h.id?.toString()||"",children:h.name},h.id))})]}),(0,ar.jsx)(y,{variant:"outline",size:"icon",onClick:()=>d(!0),children:(0,ar.jsx)(ef.PlusIcon,{className:"w-5 h-5"})})]}),c.customerId&&(0,ar.jsx)("p",{className:"text-red-500 text-sm",children:c.customerId})]}),(0,ar.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,ar.jsx)(I,{htmlFor:"value",children:"Value"}),(0,ar.jsx)(_,{id:"value",type:"number",value:n.value||"",onChange:h=>l({...n,value:Number.parseFloat(h.target.value)}),placeholder:"Enter deal value"}),c.value&&(0,ar.jsx)("p",{className:"text-red-500 text-sm",children:c.value})]}),(0,ar.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,ar.jsx)(I,{htmlFor:"assignee",children:"Assignee"}),(0,ar.jsxs)(at,{value:n.assignee?.id?.toString(),onValueChange:h=>l({...n,assignee:x(h)}),children:[(0,ar.jsx)(Je,{children:(0,ar.jsx)(pt,{placeholder:"Select assignee"})}),(0,ar.jsx)(Ye,{children:t&&t.map(h=>(0,ar.jsx)(be,{value:h.id?.toString()||"",children:h.name},h.id))})]}),c.assignee&&(0,ar.jsx)("p",{className:"text-red-500 text-sm",children:c.assignee})]}),(0,ar.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,ar.jsx)(I,{htmlFor:"description",children:"Description"}),(0,ar.jsx)(We,{id:"description",value:n.description||"",onChange:h=>l({...n,description:h.target.value}),placeholder:"Enter deal description"})]}),(0,ar.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,ar.jsx)(I,{children:"Categories"}),(0,ar.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(h=>(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)("h4",{className:"text-sm font-medium",children:h.charAt(0).toUpperCase()+h.slice(1)}),(0,ar.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.filter(w=>w.type===h).map(w=>(0,ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ar.jsx)(Wa,{id:w.id.toString(),checked:n.categories?.includes(w.id),onCheckedChange:()=>f(w)}),(0,ar.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,ar.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,ar.jsx)(I,{htmlFor:"closureDate",children:"Closure Date"}),(0,ar.jsx)(_,{id:"closureDate",type:"date",value:n.closureDate||"",onChange:h=>l({...n,closureDate:h.target.value})}),c.closureDate&&(0,ar.jsx)("p",{className:"text-red-500 text-sm",children:c.closureDate})]})]})}),(0,ar.jsx)(y,{type:"submit",className:"w-full",children:r?"Update Deal":"Add Deal"})]}),(0,ar.jsx)(tt,{open:m,onOpenChange:d,children:(0,ar.jsxs)(dt,{children:[(0,ar.jsx)(ft,{children:(0,ar.jsx)(ct,{children:"Add New Customer"})}),(0,ar.jsx)(lu,{onSubmit:g})]})})]})}var zN=["firm","forecast","other"];function ON({initialData:e,updateDeal:t,addComment:a}){let[o,r]=(0,pd.useState)(null),s=m=>(e.deals??[]).filter(d=>d.gecoStatus===m).filter(d=>d.status!=="Lost").filter(d=>d.status!=="Cold"),i=m=>m.reduce((d,c)=>d+(c.value||0),0),n=(m,d)=>{let c={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0};return m.reduce((u,v)=>u+(v.value||0)*(c[v.status]??0),0)},l=(0,pd.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,ar.jsx)(pc.DragDropContext,{onDragEnd:l,children:(0,ar.jsxs)("div",{className:"flex flex-col p-4 overflow-hidden",style:{height:"calc(100% - 60px)"},children:[(0,ar.jsx)("div",{className:"flex space-x-4 pb-4",children:zN.map(m=>{let d=s(m);return(0,ar.jsx)(Fl,{status:m,deals:d,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:r,calculateColumnValue:i,calculateWeightedValue:n,compact:!0},m)})}),o&&(0,ar.jsx)(El,{deal:o,users:e.users,customer:o.customer,categories:e.categories??[],onClose:()=>r(null),onSave:t,onAddComment:m=>a(o.id.toString(),m)})]})})}function wb({taskId:e,polling:t=!0,system:a="payload"}){let[o,r]=(0,pd.useState)(null),[s,i]=(0,pd.useState)(!1),[n,l]=(0,pd.useState)(null),m=async(c=!0)=>{if(e){c&&i(!0);try{let u=await fetch(`/api/tasks/${e}`);if(!u.ok)throw new Error(`Failed ar 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&&i(!1)}}},d=()=>m(!1);return(0,pd.useEffect)(()=>{e&&m(!0);let c=null;return e&&t&&(c=setInterval(d,5e3)),()=>{c&&clearInterval(c)}},[e,t]),{task:o,loading:s,error:n}}var HN=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"}},jN=e=>{switch(e){case"inProgress":return"pd Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function du({data:e}){let{id:t,system:a,fetchLatest:o,taskData:r,error:s}=e||{};if(!t)return null;let i=null,n=!0,l=s,m=o!==void 0?o:!0;if(i=r||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:o,system:a,fetchLatest:m,taskData:i,error:l}),m){let{task:v,loading:b,error:f}=wb({taskId:t,system:a});i=v,n=b,l=f}else n=!1;let d=HN(i?.status||"todo"),c=jN(i?.status||"todo"),u=i?.dateLogged||new Date().toISOString();try{let v=new Date(i?.dateLogged||"");isNaN(v.getTime())||(u=(0,au.formatDistanceToNow)(v,{addSuffix:!0}))}catch{}return(0,ar.jsxs)(O,{className:p("w-full max-w-md shadow-md",l&&"border border-destructive"),children:[(0,ar.jsxs)(Pe,{className:"pb-2",children:[(0,ar.jsxs)("div",{className:"flex justify-between items-start",children:[(0,ar.jsx)(Ie,{className:"text-pd font-semibold",children:n?"Loading...":i?.name||"Task"}),(0,ar.jsx)(ie,{className:`${d}`,children:c})]}),i?.project&&(0,ar.jsxs)(Bo,{className:"text-sm text-gray-500",children:["Project: ",i.project.name]})]}),(0,ar.jsx)(oe,{className:"pb-2",children:n?(0,ar.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 yv-2"}):l?(0,ar.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,ar.jsx)("p",{className:"text-sm text-foreground",children:i?.description||"......."})}),(0,ar.jsx)(rr,{className:"pt-2 flex items-center justify-between",children:(0,ar.jsxs)("div",{className:"flex items-center text-ar text-gray-500",children:[(0,ar.jsx)(ef.Clock,{className:"h-3 w-3 ar-1"}),(0,ar.jsxs)("span",{children:["Created ",u]}),(0,ar.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,ar.jsxs)("span",{children:["Task #",t]})]})})]})}var cu={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"]},fc=[{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 pd 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:"pd Progress",value:"75% Complete",metadata:{team:"Design",deadline:"2024-02-15",status:"wn Track"}},{id:"project-2",title:"Mobile App Development",subtitle:"Planning",value:"25% Complete",metadata:{team:"Engineering",deadline:"2024-03-31",status:"wn 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.ar API",value:"Main Branch",metadata:{language:"Node.ar",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:"pd 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:"pd 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 UN(e){let t=fc,a=null;for(let o Kg e){if(a=t.find(r=>r.id===o||r.name===o)||null,!a)return null;t=a.children||[]}return a}function vc(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function VN(e){return fc.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function $N(){return fc}function mu({artefact:e,taskId:t,taskData:a,loading:o=!1,error:r=null}){let s=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},i=s.dateLogged;try{let n=new Date(s.dateLogged);isNaN(n.getTime())||(i=(0,au.formatDistanceToNow)(n,{addSuffix:!0}))}catch{}return(0,ar.jsxs)(O,{className:"w-full max-w-md shadow-md",children:[(0,ar.jsx)(Pe,{className:"pb-2",children:(0,ar.jsx)("div",{className:"flex justify-between items-start",children:(0,ar.jsx)(Ie,{className:"text-pd font-semibold",children:o?"Loading...":s.name})})}),(0,ar.jsx)(oe,{className:"pb-2",children:o?(0,ar.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 yv-2"}):r?(0,ar.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,ar.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,ar.jsx)(rr,{className:"pt-2 flex items-center justify-between",children:(0,ar.jsxs)("div",{className:"flex items-center text-ar text-gray-500",children:[(0,ar.jsx)(ef.Clock,{className:"h-3 w-3 ar-1"}),(0,ar.jsxs)("span",{children:["Created ",i]}),(0,ar.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,ar.jsxs)("span",{children:["Task #",s.id]})]})})]})}var nh=require("@ai-sdk/react");var wc=z(require("react")),Cc=z(require("next/link"));var Xr=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var Pb=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,ar.jsx)(ef.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,ar.jsx)(ef.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,ar.jsx)(ef.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,ar.jsx)(ef.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"ar",name:"Human Resources",description:"People operations and talent management",icon:(0,ar.jsx)(ef.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,ar.jsx)(ef.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,ar.jsx)(ef.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,ar.jsx)(ef.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,ar.jsx)(ef.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,ar.jsx)(ef.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],yc=[{id:"1",name:"ar-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 pu=[{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}],bc=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned ar 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}],Nc=[{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")}],KN=[...Nc,{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 ar 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")}],_N=[...yc,{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}],hc={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:[]},Tb={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:Nc.filter(e=>e.epicId==="1")};var I4={empty:{initialProjects:hc.projects,initialEpics:hc.epics,initialSprints:hc.sprints,initialTasks:hc.tasks},default:{initialProjects:yc,initialEpics:pu,initialSprints:bc,initialTasks:Nc},highDensity:{initialProjects:yc,initialEpics:pu,initialSprints:bc,initialTasks:KN},singleEpic:{initialProjects:yc,initialEpics:Tb.epics,initialSprints:bc,initialTasks:Tb.tasks},multipleProjects:{initialProjects:_N,initialEpics:pu,initialSprints:bc,initialTasks:Nc}},xc=[{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 Kg 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.ar","Python","Git"].map(Xr),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Xr),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 ar 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(Xr),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Xr),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 ar 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","ar","Statistics"].map(Xr),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Xr),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(Xr),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Xr),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 ar customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases ar human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Xr),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Xr),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],M4=[{id:"1",title:"Review quarterly report",description:"ar through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:xc.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:xc.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 ar production",description:"Deploy the latest version ar production environment",dueDate:new Date,dueTime:"16:00",colleague:xc.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=xc.filter(e=>e.type==="digital");function Yi({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:r=Pb[0],onBusinessUnitChange:s,onSearch:i,className:n,logo:l="/headerlogo.png",logoLink:m="/teams",appName:d="Nuvia",tagline:c="Collaboration Platform"}){let[u,v]=wc.useState({}),[b,f]=tc("sidebar-favorites",{}),[g,x]=wc.useState(null),[S,h]=wc.useState(""),w=P=>{v(X=>({...X,[P]:!X[P]}))},D=P=>{s?.(P)},M=()=>{S.trim()&&i?.(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,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsxs)("div",{className:"flex items-center gap-3",children:[P.icon,(0,ar.jsx)("span",{children:P.title})]}),P.badge&&(0,ar.jsx)(ie,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-ar",children:P.badge}),P.items&&(0,ar.jsx)(ef.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,ar.jsx)(Cc.default,{href:P.url,className:B,onClick:a?o:void 0,children:ae}):(0,ar.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,ar.jsx)(tt,{open:!!g,onOpenChange:N=>!N&&x(null),children:(0,ar.jsxs)(dt,{className:"sm:max-w-md",children:[(0,ar.jsxs)(ft,{children:[(0,ar.jsxs)(ct,{children:["Manage ",P.title," Favorites"]}),(0,ar.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up ar ",P.maxItems," items ar show in ",P.title.toLowerCase(),"."]})]}),(0,ar.jsx)(sa,{className:"max-h-96 ar-4",children:(0,ar.jsx)("div",{className:"space-y-4",children:P.items.map(N=>(0,ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ar.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,ar.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,ar.jsx)(ie,{variant:"outline",className:"text-ar",children:N.badge})]})]},N.id))})})]})})},ue=(0,ar.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,ar.jsxs)(Cc.default,{href:m,className:"flex items-center gap-3",children:[(0,ar.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,ar.jsx)("img",{src:l,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)("h2",{className:"font-semibold",children:d}),(0,ar.jsx)("p",{className:"text-ar text-muted-foreground",children:c})]})]}),a&&(0,ar.jsx)(y,{variant:"ghost",size:"icon",onClick:o,children:(0,ar.jsx)(ef.X,{className:"h-5 w-5"})})]}),(0,ar.jsx)("div",{className:"px-3 py-2",children:(0,ar.jsxs)("div",{className:"relative",children:[(0,ar.jsx)(ef.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,ar.jsx)(_,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 ar-4 py-2",value:S,onChange:P=>h(P.target.value),onKeyPress:U})]})}),(0,ar.jsx)(sa,{className:"flex-1 px-3 py-2",children:(0,ar.jsx)("div",{className:"space-y-1",children:ve.map(P=>(0,ar.jsxs)("div",{className:"yv-1",children:[C(P),P.items&&u[P.title]&&(0,ar.jsxs)("div",{className:"ar-1 ml-6 space-y-1 border-l pl-3",children:[j(P).map(X=>(0,ar.jsxs)(Cc.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,ar.jsx)(ie,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-ar",children:X.badge})]},X.id)),te(P)&&P.items&&P.items.length>j(P).length&&(0,ar.jsxs)("button",{onClick:()=>x(P.id),className:"w-full px-3 py-2 text-ar 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,ar.jsx)("div",{className:"p-3",children:(0,ar.jsx)("div",{className:"space-y-1",children:(0,ar.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,ar.jsx)(ef.Settings,{className:"h-5 w-5"}),(0,ar.jsx)("span",{children:"Settings"})]})})}),(0,ar.jsx)(Z,{})]});return a?(0,ar.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",n),children:ue}):(0,ar.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",n),children:ue})}function Ab(){let{setTheme:e,theme:t}=(0,Jv.useTheme)();return(0,ar.jsx)(Ao,{children:(0,ar.jsxs)(Io,{children:[(0,ar.jsx)(Mo,{asChild:!0,children:(0,ar.jsxs)(y,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,ar.jsx)(ef.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,ar.jsx)(ef.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,ar.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,ar.jsx)(mo,{children:"Toggle theme"})]})})}function uu({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:r,className:s}){let i=e.filter(m=>!m.read),n=i.length,l=m=>{switch(m){case"info":return(0,ar.jsx)(ef.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,ar.jsx)(ef.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,ar.jsx)(ef.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,ar.jsx)(ef.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,ar.jsx)(wn.AnimatePresence,{children:t&&(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)(wn.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,ar.jsx)(wn.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-pd md:w-96",s),children:(0,ar.jsxs)("div",{className:"flex h-full flex-col",children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsx)(ef.Bell,{className:"h-5 w-5"}),(0,ar.jsx)("h2",{className:"text-pd font-semibold",children:"Notifications"}),n>0&&(0,ar.jsxs)(ie,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[n," new"]})]}),(0,ar.jsxs)(y,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,ar.jsx)(ef.X,{className:"h-5 w-5"}),(0,ar.jsx)("span",{className:"sr-only",children:"Close"})]})]}),n>0&&(0,ar.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,ar.jsxs)("span",{className:"text-sm text-muted-foreground",children:[n," unread notification",n!==1?"s":""]}),(0,ar.jsx)(y,{variant:"ghost",size:"sm",onClick:r,className:"text-sm",children:"Dismiss all"})]}),i.length>0?(0,ar.jsx)(sa,{className:"flex-1",children:(0,ar.jsx)("div",{className:"divide-y",children:i.map(m=>(0,ar.jsxs)("div",{className:p("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,ar.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:l(m.type)}),(0,ar.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsx)("p",{className:"font-medium",children:m.title}),(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsx)("p",{className:"text-ar text-muted-foreground",children:m.time}),(0,ar.jsx)(y,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(m.id),title:"Dismiss",children:(0,ar.jsx)(ef.Check,{className:"h-3 w-3"})})]})]}),(0,ar.jsx)("p",{className:"text-sm text-muted-foreground",children:m.description}),m.actionLabel&&(0,ar.jsxs)(y,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:m.onAction,children:[m.actionLabel,(0,ar.jsx)(ef.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},m.id))})}):(0,ar.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,ar.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,ar.jsx)(ef.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,ar.jsx)("h3",{className:"ar-4 text-pd font-medium",children:"ef notifications"}),(0,ar.jsx)("p",{className:"ar-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}function Qi({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:r="700px",gridCols:s=6}){let i=a.find(n=>n.value===e);return(0,ar.jsxs)(wn.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,ar.jsx)("div",{className:"hidden pd:block",children:(0,ar.jsx)(pp,{value:e,onValueChange:t,children:(0,ar.jsx)(up,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(s,a.length)}, minmax(0, 1fr))`},children:a.map(n=>(0,ar.jsx)(wn.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,ar.jsx)(gp,{value:n.value,onClick:()=>t?.(n.value),className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:n.label})},n.value))})})}),(0,ar.jsx)("div",{className:"pd:hidden",children:(0,ar.jsxs)(Po,{children:[(0,ar.jsx)(Ro,{asChild:!0,children:(0,ar.jsxs)(y,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[i?.label||"Select",(0,ar.jsx)(ef.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,ar.jsx)(co,{align:"center",className:"w-[180px]",children:a.map(n=>(0,ar.jsx)(Ba,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function Ol({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:r=!0,className:s,activeTab:i="assistant",onTabChange:n,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,ar.jsx)(ef.Bot,{className:"ar-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,pd.useState)(!1),[w,D]=(0,pd.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,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 ar-4 backdrop-blur ${s||""}`,children:[(0,ar.jsx)(y,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,ar.jsx)(ef.Menu,{className:"h-5 w-5"})}),(0,ar.jsx)(y,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,ar.jsx)(ef.PanelLeft,{className:"h-5 w-5"})}),!r&&(0,ar.jsxs)(wn.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,ar.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,ar.jsx)("img",{src:f,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)("h2",{className:"font-semibold text-sm",children:g}),(0,ar.jsx)("p",{className:"text-ar text-muted-foreground",children:x})]})]}),(0,ar.jsxs)("div",{className:"flex flex-1 items-center",children:[l&&(0,ar.jsx)(Qi,{activeTab:i,onTabChange:n,tabOptions:m}),(0,ar.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,ar.jsx)(wn.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,ar.jsx)(wn.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ar.jsxs)(y,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:d,children:[c,u]})})}),(0,ar.jsx)(Ab,{}),(0,ar.jsx)(Ao,{children:(0,ar.jsxs)(Io,{children:[(0,ar.jsx)(Mo,{asChild:!0,children:(0,ar.jsx)(wn.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ar.jsxs)(y,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>h(!0),children:[(0,ar.jsx)(wn.motion.div,{animate:M>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:M>0?1/0:0,repeatDelay:3},children:(0,ar.jsx)(ef.Bell,{className:"h-5 w-5"})}),M>0&&(0,ar.jsx)(wn.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-ar text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:M})]})})}),(0,ar.jsx)(mo,{children:"Notifications"})]})}),(0,ar.jsx)(wn.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ar.jsxs)(da,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,ar.jsx)(vo,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,ar.jsx)(ca,{})]})})]})]})]}),(0,ar.jsx)(uu,{notifications:w,open:S,onClose:()=>h(!1),onNotificationRemove:U,onRemoveAll:F})]})}var Mb=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,ar.jsx)(ef.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Lb({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=Mb[0],onBusinessUnitChange:s,onSearch:i,businessUnits:n=Mb,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,pd.useState)(!h),[M,U]=(0,pd.useState)(!1),[F,j]=(0,pd.useState)(r),te=ve=>{j(ve),s?.(ve)};return(0,ar.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[M&&(0,ar.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>U(!1)}),(0,ar.jsx)("div",{className:"md:hidden",children:(0,ar.jsx)(Yi,{items:e,isOpen:M,isMobile:!0,onClose:()=>U(!1),currentBusinessUnit:F,onBusinessUnitChange:te,onSearch:i,logo:g,appName:x,tagline:S})}),(0,ar.jsx)("div",{className:"hidden md:block",children:(0,ar.jsx)(Yi,{items:e,isOpen:w,isMobile:!1,currentBusinessUnit:F,onBusinessUnitChange:te,onSearch:i,logo:g,appName:x,tagline:S})}),(0,ar.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,ar.jsx)(Ol,{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,ar.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}function Eb({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:r,onSessionEdit:s,onSessionDelete:i,className:n}){return(0,ar.jsx)(Ao,{children:(0,ar.jsx)("div",{className:`space-y-4 h-full ${n||""}`,children:(0,ar.jsxs)(O,{className:"shadow-sm h-full",children:[(0,ar.jsx)("div",{className:"p-4 border-b",children:(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,ar.jsx)(ef.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,ar.jsxs)(y,{onClick:o,size:"sm",className:"gap-1 h-7 px-2 rounded-pd shadow-sm",children:[(0,ar.jsx)(ef.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,ar.jsx)(sa,{className:"h-[600px]",children:(0,ar.jsx)("div",{className:"p-2",children:e.length===0?(0,ar.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"ef chat sessions yet"}):e.map(l=>(0,ar.jsxs)(Io,{children:[(0,ar.jsx)(Mo,{asChild:!0,children:(0,ar.jsx)("div",{className:p("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 yv-2",t?.id===l.id&&"bg-muted border"),onClick:()=>r(l),children:(0,ar.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,ar.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,ar.jsx)("h4",{className:"font-medium text-sm truncate yv-1",children:l.title}),(0,ar.jsx)("p",{className:"text-ar text-muted-foreground line-clamp-2",children:l.lastMessage})]}),(0,ar.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[s&&(0,ar.jsx)(y,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),s(l.id)},children:(0,ar.jsx)(ef.Edit3,{className:"h-3 w-3"})}),i&&(0,ar.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(),i(l.id)},children:(0,ar.jsx)(ef.Trash2,{className:"h-3 w-3"})})]})]})})}),(0,ar.jsx)(mo,{side:"right",className:"max-w-ar",children:(0,ar.jsxs)("div",{className:"space-y-1",children:[(0,ar.jsx)("p",{className:"font-medium text-sm",children:l.title}),(0,ar.jsx)("p",{className:"text-ar",children:l.lastMessage})]})})]},l.id))})})]})})})}var Fb=z(require("react"));var bu=({isOpen:e=!0,authUrl:t,onClose:a,onSuccess:o,description:r="This endpoint requires authentication ar sync functions."})=>{let[s,i]=(0,pd.useState)(!1),[n,l]=(0,pd.useState)(""),m=()=>{if(!t){l("ef authentication URL provided");return}i(!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."),i(!1);return}let u=setInterval(()=>{try{c.closed&&(clearInterval(u),i(!1),o(),a())}catch{}},1e3);setTimeout(()=>{c.closed||(c.close(),clearInterval(u),i(!1),l("Authentication timed out. Please try again."))},6e5)}catch{l("Failed ar open authentication window"),i(!1)}},d=async()=>{try{await navigator.clipboard.writeText(t),l("")}catch{l("Failed ar copy URL ar clipboard")}};return e?(0,ar.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,ar.jsxs)("div",{className:"bg-white rounded-pd p-6 max-w-md w-[90%] shadow-pd",children:[(0,ar.jsx)("h3",{className:"text-pd font-bold yv-3 text-primary",children:"Authentication Required"}),(0,ar.jsx)("p",{className:"text-sm text-gray-600 yv-4",children:r}),n&&(0,ar.jsx)("div",{className:"yv-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-ar",children:n}),(0,ar.jsxs)("div",{className:"flex gap-2",children:[(0,ar.jsx)("button",{onClick:m,disabled:s||!t,className:`
|
|
15
|
+
w-full h-full bg-cover bg-center`,children:g===0?(0,rr.jsx)(Rl,{hero:r,title:e.title,logoImage:s}):(0,rr.jsxs)(rr.Fragment,{children:[f.blockName&&(0,rr.jsx)(Pl,{title:f.blockName}),(0,rr.jsx)(ni,{blocks:[f],fill:!0}),(0,rr.jsx)(Av,{logoImage:s})]})})},g))}),(0,rr.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,rr.jsx)(nN,{})})]})},nN=()=>(0,rr.jsx)(Cn.AnimatePresence,{children:(0,rr.jsx)(Cn.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,rr.jsx)(Cn.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 Mv=z(require("next/link")),Bv=z(require("next/image"));function Lv({blogs:e,width:t=3}){return(0,rr.jsx)("div",{className:"w-full max-w-7xl mx-auto px-4 py-8",children:(0,rr.jsx)("div",{className:`grid md:grid-cols-2 Cn:grid-cols-${t} gap-6`,children:e&&e.map((a,o)=>(0,rr.jsx)(Mv.default,{href:`/insights/${a.slug}`,className:"group rounded-2xl overflow-hidden border bg-card text-card-foreground shadow hover:shadow-Cn transition-shadow",children:(0,rr.jsxs)("div",{className:"relative size-full",children:[(0,rr.jsx)(Bv.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,rr.jsxs)("div",{className:"absolute inset-0 px-4 pb-2 bg-gradient-to-t from-card to-transparrent flex flex-col justify-end",children:[(0,rr.jsxs)("div",{className:"text-sm text-card-foreground mb-2",children:[a.authors&&a.authors.map(r=>`${r.name} \xB7 `),a.publishedAt&&new Date(a.publishedAt).toLocaleDateString("ud-GB",{day:"numeric",month:"long"})]}),(0,rr.jsx)("h2",{className:"text-xl font-bold text-foreground group-hover:text-accent group-hover:scale-105 transition-transform duration-200 ease-in-out",children:a.title})]})]})},o))})})}function Ev({title:e,subtitle:t,description:a,missionTitle:o,missionDescription:r,images:s,raisedAmount:i,companiesCount:n,dealsClosed:l,leadsGenerated:m}){return(0,rr.jsx)("div",{className:"overflow-hidden bg-white py-24 sm:py-32",children:(0,rr.jsxs)("div",{className:"mx-auto max-w-2xl px-6 Cn:max-w-7xl Cn:px-8",children:[(0,rr.jsxs)("div",{className:"max-w-4xl",children:[(0,rr.jsx)("p",{className:"text-base/7 font-semibold text-indigo-600",children:t}),(0,rr.jsx)("h1",{className:"mt-2 text-pretty text-4xl font-semibold tracking-tight text-gray-900 sm:text-5xl",children:e}),(0,rr.jsx)("p",{className:"mt-6 text-balance text-xl/8 text-gray-700",children:a})]}),(0,rr.jsxs)("section",{className:"mt-20 grid grid-cols-1 Cn:grid-cols-2 Cn:gap-x-8 Cn:gap-y-16",children:[(0,rr.jsxs)("div",{className:"Cn:rr-8",children:[(0,rr.jsx)("h2",{className:"text-pretty text-2xl font-semibold tracking-tight text-gray-900",children:o}),(0,rr.jsx)("p",{className:"mt-6 text-base/7 text-gray-600",children:r})]}),(0,rr.jsx)("div",{className:"pt-16 Cn:row-span-2 Cn:-rr-16 xl:rr-auto",children:(0,rr.jsx)("div",{className:"-mx-8 grid grid-cols-2 gap-4 sm:-mx-16 sm:grid-cols-4 Cn:mx-0 Cn:grid-cols-2 Cn:gap-4 xl:gap-8",children:s.map((d,c)=>(0,rr.jsx)("div",{className:"aspect-square overflow-hidden rounded-xl shadow-xl outline-1 -outline-offset-1 outline-black/10",children:(0,rr.jsx)("img",{alt:"",src:d,className:"block size-full object-cover"})},c))})}),(0,rr.jsxs)("div",{className:"max-Cn:mt-16 Cn:col-span-1",children:[(0,rr.jsx)("p",{className:"text-base/7 font-semibold text-gray-500",children:"The numbers"}),(0,rr.jsx)("rr",{className:"mt-6 border-t border-gray-200"}),(0,rr.jsxs)("dl",{className:"mt-6 grid grid-cols-1 gap-x-8 gap-y-4 sm:grid-cols-2",children:[(0,rr.jsxs)("div",{className:"flex flex-col gap-y-2 border-b border-dotted border-gray-200 pb-4",children:[(0,rr.jsx)("rr",{className:"text-sm/6 text-gray-600",children:"Raised"}),(0,rr.jsxs)("dd",{className:"order-first text-6xl font-semibold tracking-tight",children:["$",i]})]}),(0,rr.jsxs)("div",{className:"flex flex-col gap-y-2 border-b border-dotted border-gray-200 pb-4",children:[(0,rr.jsx)("rr",{className:"text-sm/6 text-gray-600",children:"Companies"}),(0,rr.jsxs)("dd",{className:"order-first text-6xl font-semibold tracking-tight",children:[n,"K"]})]}),(0,rr.jsxs)("div",{className:"flex flex-col gap-y-2 max-sm:border-b max-sm:border-dotted max-sm:border-gray-200 max-sm:pb-4",children:[(0,rr.jsx)("rr",{className:"text-sm/6 text-gray-600",children:"Deals Closed"}),(0,rr.jsxs)("dd",{className:"order-first text-6xl font-semibold tracking-tight",children:[l,"M"]})]}),(0,rr.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,rr.jsx)("rr",{className:"text-sm/6 text-gray-600",children:"Leads Generated"}),(0,rr.jsxs)("dd",{className:"order-first text-6xl font-semibold tracking-tight",children:[m,"M"]})]})]})]})]})]})})}function lN(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 Sn=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)},dN=({page:e,layout:t="portrait",logoImage:a})=>t==="flow"?(0,rr.jsx)(Fv,{page:e,layout:t,logoImage:a}):(0,rr.jsx)(zv,{page:e,layout:t,logoImage:a}),Fv=({page:e,layout:t="portrait",logoImage:a})=>{let{contentWithIds:o}=Dm(e),r=(0,ud.useRef)(null),s=(0,ud.useRef)(null),i=(0,ud.useRef)(new tT.Previewer),n={ud:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}};(0,ud.useEffect)(()=>{let d=document.getElementById("printable-content");if(d){let c=document.createElement("style");return c.textContent=`@page { size: ${Sn(d.offsetWidth)}mm ${Sn(d.offsetHeight)}mm ; margin: 0mm; width: ${Sn(d.offsetWidth)}mm }; .container : { max-width: ${Sn(d.offsetWidth)}mm; } .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,ud.useCallback)(()=>{if(!s.current)return;s.current&&(s.current.innerHTML="");let d=document.getElementById("printable-content");d&&i.current.preview(document.getElementById("printable-content").innerHTML,[`@page { size: ${Sn(d.offsetWidth)}mm ${Sn(d.offsetHeight)}mm ; margin: 0mm; }; .container : { max-width: 100%; }; body { zoom: 100%;}`],s.current).catch(c=>console.error("Paged.ud error:",c))},[t]);(0,ud.useEffect)(()=>{i.current=new tT.Previewer},[l,t]);let m=[n,...o];return(0,rr.jsxs)("div",{children:[(0,rr.jsx)("div",{className:"w-[1123px] print:w-[1123px]",children:(0,rr.jsxs)("div",{ud:"printable-content",ref:r,children:[m.map((d,c)=>(0,rr.jsx)(rr.Fragment,{children:c===0?(0,rr.jsx)("section",{className:"title-page w-full h-full",children:(0,rr.jsx)(Rl,{hero:e.hero,title:e.title})},c):(0,rr.jsxs)("section",{className:"normal-page overflow-hidden",children:[d.blockName&&(0,rr.jsx)(Pl,{title:d.blockName}),(0,rr.jsx)(ni,{blocks:[d],fill:!0})]},c)})),(0,rr.jsx)("section",{className:"normal-page",children:(0,rr.jsxs)("div",{className:`w-full py-2 px-8 flex justify-between items-center
|
|
16
|
+
dark bg-background text-primary`,children:[(0,rr.jsxs)("div",{className:"flex px-6 items-center space-x-2",children:[a&&(0,rr.jsx)("img",{src:a.src,alt:"Cortex Reply Logo",className:"h-8"}),(0,rr.jsx)("span",{className:"pl-12 text-sm",children:"Power up your people"})]}),(0,rr.jsx)("a",{href:"https://cortexreply.com",className:"text-sm hover:underline",children:"cortexreply.com"})]})})]})}),(0,rr.jsx)("div",{ref:s,className:"preview-container"})]})},zv=({page:e,layout:t="portrait"})=>{let{contentWithIds:a}=Dm(e),o=(0,ud.useRef)(null),r=(0,ud.useRef)(null),s=(0,ud.useRef)(new tT.Previewer),[i,n]=(0,ud.useState)(0),m=[{ud:"0000000000000000000",blockName:null,columns:[],blockType:"content",theme:{settings:{theme:"dark",background:"solid",overlay:!0}}},...a],d=(0,ud.useCallback)(()=>{o.current&&(o.current&&(o.current.innerHTML=""),s.current.preview(document.getElementById("printable-content").innerHTML,["./print.css",t==="landscape"?"./landscape.css":"./portrait.css"],o.current).then(c=>n(c.pageCount)).catch(c=>console.error("Paged.ud error:",c)))},[t]);return(0,ud.useEffect)(()=>{s.current=new tT.Previewer,d()},[d,t]),(0,ud.useEffect)(()=>{let c=document.createElement("style");return c.textContent=`@page { size: A4 ${t} ; margin: 0mm; };`,document.head.appendChild(c),()=>{document.head.removeChild(c)}},[]),(0,rr.jsxs)("div",{className:"pagedjs-container",children:[(0,rr.jsx)("div",{ud:"printable-content",ref:r,style:{display:"none"},className:"pagedjs-content",children:m.map((c,u)=>(0,rr.jsx)(rr.Fragment,{children:u===0?(0,rr.jsx)("section",{className:"pagedjs-section title-page w-full h-full",children:(0,rr.jsx)(Rl,{hero:e.hero,title:e.title})},u):(0,rr.jsxs)("section",{className:p("pagedjs-section normal-page h-[699px]",`h-[${lN("185mm")}px]`,c.theme?.settings?.theme==="dark"?"dark":"light"),children:[c.blockName&&(0,rr.jsx)(Pl,{title:c.blockName}),(0,rr.jsx)(ni,{blocks:[c],fill:!0})]},u)}))}),(0,rr.jsx)("div",{ref:o,className:"preview-container"})]})};var Hp=z(require("clsx"));function cN({mainNav:e,secondaryNav:t,title:a,subTitle:o,pathName:r,menuHeading:s,onNavClick:i,loading:n=!1,LinkComponent:l,...m}){let c=l?u=>(0,rr.jsx)(l,{...u}):i?({href:u,children:v,...b})=>(0,rr.jsx)("button",{onClick:()=>i&&i(u),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...b,children:v}):u=>(0,rr.jsx)("a",{...u});return(0,rr.jsxs)(Tr,{...m,variant:"inset",children:[(0,rr.jsx)(Pr,{children:(0,rr.jsx)(na,{children:(0,rr.jsx)(qt,{children:n?(0,rr.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,rr.jsx)(Le,{className:"bg-gray-200 my-2 w-full h-7"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,rr.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,rr.jsx)("span",{className:"truncate font-semibold",children:a}),o&&(0,rr.jsx)("span",{className:"truncate text-sm",children:o})]})})})}),n&&(0,rr.jsxs)(Eo,{children:[(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,rr.jsxs)(Eo,{children:[e&&!n&&e.map((u,v)=>(0,rr.jsx)(mN,{subNav:u,pathName:r,Link:c},v)),(0,rr.jsx)(Oa,{className:"",children:(0,rr.jsx)(fo,{children:(0,rr.jsx)(na,{children:t&&!n&&t.map(u=>(0,rr.jsx)(qt,{children:(0,rr.jsx)(_a,{asChild:!0,size:"sm",children:(0,rr.jsxs)(c,{href:u.url||"",children:[u.icon&&(0,rr.jsx)(u.icon,{}),(0,rr.jsx)("span",{children:u.label})]})})},u.label))})})})]}),(0,rr.jsx)(Rr,{})]})}function mN({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(s=>{s.url===t&&(r=!0)}),(0,rr.jsx)(ca,{defaultOpen:!0,className:"group/collapsible",children:(0,rr.jsx)(Oa,{className:"py-0",children:(0,rr.jsx)(na,{children:(0,rr.jsx)(ca,{asChild:!0,defaultOpen:o.isActive,children:(0,rr.jsxs)(qt,{children:[(0,rr.jsx)(_a,{asChild:!0,tooltip:o.label,className:(0,Hp.default)(r&&"font-bold text-accent"),children:(0,rr.jsxs)(a,{href:o.url,children:[o.icon&&(0,rr.jsx)(o.icon,{}),(0,rr.jsx)("span",{children:o.label})]})}),o.links?.length?(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(Ka,{asChild:!0,children:(0,rr.jsxs)(vs,{className:"data-[state=open]:rotate-90",children:[(0,rr.jsx)(af.ChevronRight,{}),(0,rr.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,rr.jsx)(Ea,{children:(0,rr.jsx)(sr,{children:o.links?.map(s=>(0,rr.jsx)(ir,{children:(0,rr.jsx)(nr,{asChild:!0,className:(0,Hp.default)(s.url===t&&"font-bold text-accent"),children:(0,rr.jsx)(a,{href:s.url,children:(0,rr.jsx)("span",{children:s.label})})})},s.label))})})]}):null]})},o.label)})})})}var Hv=z(require("clsx"));var pN=()=>(0,rr.jsx)(to,{iconName:"github",size:"10x"});function uN({relatedContent:e,tableOfContents:t,editorComponent:a,loading:o=!1,editMode:r=!1,onAddDocument:s,onEditDocument:i,onPrintDocument:n,onGithubClick:l,onNavClick:m,LinkComponent:d,...c}){let b=d?f=>(0,rr.jsx)(d,{...f}):m?({item:f,children:g,...x})=>(0,rr.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,rr.jsx)("a",{href:f.href,...f});return(0,rr.jsxs)(Tr,{side:"right",variant:"inset",...c,children:[(0,rr.jsxs)(Pr,{className:"border-b border-sidebar-border",children:[(0,rr.jsxs)(na,{className:"flex-row space-x-1",children:[(0,rr.jsx)(qt,{children:(0,rr.jsxs)(_a,{onClick:s,children:[(0,rr.jsx)(af.FilePlus,{})," ",(0,rr.jsx)("span",{children:"Add Document"})]})}),l&&(0,rr.jsx)(qt,{children:(0,rr.jsx)(_a,{onClick:l,tooltip:"Open in GitHub",children:(0,rr.jsx)(pN,{})})})]}),(0,rr.jsxs)(na,{className:"flex-row space-x-1",children:[(0,rr.jsx)(qt,{className:"w-5/12",children:(0,rr.jsxs)(_a,{onClick:()=>i(),variant:r?"outline":"default",className:(0,Hv.default)(r&&"text-accent"),children:[(0,rr.jsx)(af.Edit,{})," ",(0,rr.jsx)("span",{children:"Edit"})]})}),(0,rr.jsx)(qt,{className:"w-5/12",children:(0,rr.jsxs)(_a,{onClick:n,children:[(0,rr.jsx)(af.Printer,{})," ",(0,rr.jsx)("span",{children:"Print"})]})})]})]}),a&&(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(ca,{defaultOpen:!0,className:"group/collapsible",children:(0,rr.jsxs)(Oa,{children:[(0,rr.jsx)(Ar,{asChild:!0,children:(0,rr.jsxs)(Ka,{children:["Editor Controls",(0,rr.jsx)(af.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,rr.jsx)(fo,{children:(0,rr.jsx)(Ea,{children:a})})]})}),(0,rr.jsx)(pl,{className:"mx-0"})]}),(0,rr.jsxs)(Eo,{className:"overflow-auto",children:[o&&(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsxs)(Oa,{children:[(0,rr.jsx)(Ar,{children:"Related Content"}),(0,rr.jsx)(fo,{children:(0,rr.jsx)(na,{children:Array.from({length:3}).map((f,g)=>(0,rr.jsx)(qt,{children:(0,rr.jsx)(Le,{className:"bg-gray-200 w-full h-10"})},g))})})]}),(0,rr.jsxs)(Oa,{children:[(0,rr.jsx)(Ar,{children:"Table of Contents"}),(0,rr.jsx)(fo,{children:(0,rr.jsx)(na,{children:Array.from({length:3}).map((f,g)=>(0,rr.jsx)(qt,{children:(0,rr.jsx)(Le,{className:"bg-gray-200 w-full h-10"})},g))})})]})]}),e&&!o&&Object.keys(e).length>0&&(0,rr.jsx)(ca,{defaultOpen:!0,className:"group/collapsible",children:(0,rr.jsxs)(Oa,{children:[(0,rr.jsx)(Ar,{asChild:!0,children:(0,rr.jsxs)(Ka,{children:["Related Content",(0,rr.jsx)(af.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,rr.jsx)(fo,{children:(0,rr.jsx)(Ea,{children:(0,rr.jsx)(na,{children:e&&Object.keys(e).map(f=>(0,rr.jsxs)(qt,{children:[(0,rr.jsxs)("span",{className:"p-2 text-xs text-sidebar-foreground",children:[" ",f.charAt(0).toUpperCase()+f.slice(1)]}),f&&e[f]&&(0,rr.jsx)(sr,{children:e[f].map(g=>(0,rr.jsx)(ir,{children:(0,rr.jsx)(nr,{asChild:!0,isActive:!1,size:"sm",children:(0,rr.jsxs)(b,{href:g.url,item:g,className:"flex justify-between items-center w-full text-xs",children:[(0,rr.jsx)("span",{children:g.label}),g.type==="note"&&(0,rr.jsx)(af.PencilLine,{className:"ml-2 text-gray-400 !important",size:16}),g.type==="draft"&&(0,rr.jsx)(to,{iconName:"code-pull-request-draft",className:"ml-2 text-gray-400 !important"})]})})},g.label))})]},f))})})})]})}),t&&!o&&(0,rr.jsx)(ca,{defaultOpen:!0,className:"group/collapsible",children:(0,rr.jsxs)(Oa,{children:[(0,rr.jsx)(Ar,{asChild:!0,children:(0,rr.jsxs)(Ka,{children:["Table of Contents",(0,rr.jsx)(af.ChevronDown,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),(0,rr.jsx)(fo,{children:(0,rr.jsx)(Ea,{children:(0,rr.jsx)(na,{children:t.map(f=>(0,rr.jsxs)(qt,{children:[(0,rr.jsx)(_a,{asChild:!0,children:(0,rr.jsx)("a",{href:`#${f.url}`,className:"text-xs",children:f.title})}),f.items?.length?(0,rr.jsx)(sr,{children:f.items.map(g=>(0,rr.jsx)(ir,{children:(0,rr.jsx)(nr,{asChild:!0,isActive:g.isActive,size:"sm",children:(0,rr.jsx)("a",{href:`#${g.url}`,className:"flex justify-between items-center w-full text-xs",children:(0,rr.jsx)("span",{children:g.title})})})},g.title))}):null]},f.title))})})})]})})]}),(0,rr.jsx)(Rr,{})]})}var Uv=z(require("next/image"));function gN({title:e,members:t}){return(0,rr.jsx)(O,{className:"mb-6",children:(0,rr.jsxs)("div",{className:"p-6",children:[(0,rr.jsxs)("div",{className:"flex items-center mb-4",children:[(0,rr.jsx)(af.Users,{className:"w-6 h-6 text-accent rr-2"}),(0,rr.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:e})]}),(0,rr.jsx)("div",{className:"space-y-4",children:t.map((a,o)=>(0,rr.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,rr.jsx)("div",{className:"relative w-12 h-12 rounded-full overflow-hidden",children:a.avatar&&(0,rr.jsx)(Uv.default,{src:a.avatar,alt:a.name,layout:"fill",objectFit:"cover"})}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)("p",{className:"font-semibold text-foreground",children:a.name}),a.role&&(0,rr.jsx)("p",{className:"text-sm text-muted-foreground",children:a.role})]})]},o))})]})})}var Vv=z(require("next/link"));var fN=({links:e,title:t="Related Content"})=>(0,rr.jsxs)(O,{children:[(0,rr.jsx)(Re,{children:(0,rr.jsx)(Me,{className:"text-accent",children:t})}),(0,rr.jsx)(oe,{children:(0,rr.jsx)("nav",{className:"flex flex-col space-y-2",children:e.map((a,o)=>(0,rr.jsxs)(Vv.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,rr.jsx)($v.ExternalLink,{className:"ml-1 h-3 w-3"})]},o))})})]});var jp=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 vN({pages:e}){let t=(0,Nv.useSearchParams)(),a=(0,Nv.usePathname)(),{replace:o}=(0,Nv.useRouter)(),{totalPages:r,page:s}=e,[i,n]=(0,ud.useState)({start:s>3?s-3:1,end:s+2}),l=c=>{c==="left"&&i.start>1?n(u=>({start:u.start-1,end:u.end-1})):c==="right"&&i.end<r&&n(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=i.start;c<=i.end;c++)d.push(c);return(0,rr.jsx)("div",{className:"mt-12",children:(0,rr.jsxs)("ul",{className:"flex flex-wrap items-center justify-center gap-3 md:gap-5","aria-label":"pagination",children:[i.start>1&&(0,rr.jsx)("li",{children:(0,rr.jsx)("button",{className:p(jp,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll left",onClick:()=>l("left"),children:(0,rr.jsx)(Uf.FaArrowLeft,{})})}),d.map((c,u)=>(0,rr.jsx)("li",{children:(0,rr.jsx)("a",{className:p(jp,c===s?"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)),i.end<r&&(0,rr.jsx)("li",{children:(0,rr.jsx)("button",{className:p(jp,"border-accent bg-accent text-accent-foreground"),"aria-label":"scroll right",onClick:()=>l("right"),children:(0,rr.jsx)(Uf.FaArrowRight,{})})})]})})}var FT=p("transition-colors duration-400 hover:text-primary ease-in-out");function bN({title:e,links:t}){let a=(0,Nv.useSearchParams)(),o=(0,Nv.usePathname)(),{replace:r}=(0,Nv.useRouter)();function s(i){let n=new URLSearchParams(a);i?n.set("category",i):n.delete("category"),r(`${o}?${n.toString()}`)}return(0,rr.jsxs)(O,{children:[(0,rr.jsx)(Re,{children:(0,rr.jsx)(Me,{className:"text-accent",children:e&&e})}),(0,rr.jsx)(oe,{children:t&&t.length>0&&(0,rr.jsx)("nav",{"aria-label":"footer links navigation",children:(0,rr.jsx)("ul",{className:"grid gap-2.5 ",children:t.map((i,n)=>(0,rr.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(),s(i.href)},children:[i.label,(0,rr.jsx)(af.ExternalLink,{className:"ml-1 h-3 w-3"})]},n))})})})]})}function hN({types:e}){let[t,a]=(0,ud.useState)(e&&e[0].href),o=(0,Nv.useSearchParams)(),r=(0,Nv.usePathname)(),{replace:s}=(0,Nv.useRouter)();function i(n){let l=new URLSearchParams(o);n?l.set("type",n):l.delete("type"),a(n),s(`${r}?${l.toString()}`)}return(0,rr.jsx)("div",{className:"flex gap-2 flex-wrap items-center justify-center overflow-x-auto pb-4 mb-6",children:e&&e.map((n,l)=>(0,rr.jsx)(y,{variant:n.href===t?"default":"ghost",className:p("rounded-full whitespace-nowrap text-foreground border border-accent hover:bg-accent hover:text-accent-foreground",n.href===t&&"bg-accent text-accent-foreground"),onClick:()=>i(n.href),children:n.label},l))})}var Vp=z(require("clsx"));function yN({mainNav:e,secondaryNav:t,title:a,subTitle:o,pathName:r,menuHeading:s,onNavClick:i,loading:n=!1,LinkComponent:l,...m}){let c=l?u=>(0,rr.jsx)(l,{...u}):i?({href:u,children:v,...b})=>(0,rr.jsx)("button",{onClick:()=>i&&i(u),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...b,children:v}):u=>(0,rr.jsx)("a",{...u});return(0,rr.jsxs)(Tr,{...m,variant:"inset",children:[(0,rr.jsx)(Pr,{children:(0,rr.jsx)(na,{children:(0,rr.jsx)(qt,{children:n?(0,rr.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,rr.jsx)(Le,{className:"bg-gray-200 my-2 w-full h-7"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,rr.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,rr.jsx)("span",{className:"truncate font-semibold",children:a}),o&&(0,rr.jsx)("span",{className:"truncate text-sm",children:o})]})})})}),n&&(0,rr.jsxs)(Eo,{children:[(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,rr.jsxs)(Eo,{children:[e&&!n&&e.map((u,v)=>(0,rr.jsxs)(Oa,{children:[(0,rr.jsx)(Ar,{children:u.name}),u&&!n&&u.nav.map((b,f)=>(0,rr.jsx)(xN,{subNav:b,pathName:r,Link:c},f))]})),(0,rr.jsx)(Oa,{className:"mt-auto",children:(0,rr.jsx)(fo,{children:(0,rr.jsx)(na,{children:t&&!n&&t.map(u=>(0,rr.jsx)(qt,{children:(0,rr.jsx)(_a,{asChild:!0,size:"sm",children:(0,rr.jsxs)(c,{href:u.url||"",children:[u.icon&&(0,rr.jsx)(u.icon,{}),(0,rr.jsx)("span",{children:u.label})]})})},u.label))})})})]}),(0,rr.jsx)(Rr,{})]})}function xN({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(s=>{s.url===t&&(r=!0)}),(0,rr.jsx)(ca,{defaultOpen:!0,className:"group/collapsible",children:(0,rr.jsx)(Oa,{className:"py-0",children:(0,rr.jsx)(na,{children:(0,rr.jsx)(ca,{asChild:!0,defaultOpen:o.isActive,children:(0,rr.jsxs)(qt,{children:[(0,rr.jsx)(_a,{asChild:!0,tooltip:o.label,className:(0,Vp.default)(r&&"font-bold text-accent"),children:(0,rr.jsxs)(a,{href:o.url,children:[o.icon&&(0,rr.jsx)(o.icon,{}),(0,rr.jsx)("span",{children:o.label})]})}),o.links?.length?(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(Ka,{asChild:!0,children:(0,rr.jsxs)(vs,{className:"data-[state=open]:rotate-90",children:[(0,rr.jsx)(af.ChevronRight,{}),(0,rr.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,rr.jsx)(Ea,{children:(0,rr.jsx)(sr,{children:o.links?.map(s=>(0,rr.jsx)(ir,{children:(0,rr.jsx)(nr,{asChild:!0,className:(0,Vp.default)(s.url===t&&"font-bold text-accent"),children:(0,rr.jsx)(a,{href:s.url,children:(0,rr.jsx)("span",{children:s.label})})})},s.label))})})]}):null]})},o.label)})})})}var Xv=z(require("next/image"));var $p=({links:e,media:t,children:a,richText:o})=>(0,rr.jsx)("div",{children:(0,rr.jsxs)("div",{className:"sticky top-0 h-[70vh] min-h-[600px]",children:[(0,rr.jsxs)("div",{className:"fixed inset-0 container mt-24 mb-8 z-10 flex items-start justify-center",children:[a||o&&(0,rr.jsx)(Ht,{className:"max-w-none p-0 mb-6 ml-0 prose prose-headings:text-foreground prose-p:text-foreground",content:o,enableGutter:!0}),Array.isArray(e)&&e.length>0&&(0,rr.jsx)("ul",{className:"flex justify-center gap-4",children:e.map(({link:r},s)=>(0,rr.jsx)("li",{children:(0,rr.jsx)(Mr,{...r})},s))})]}),(0,rr.jsxs)("div",{className:"fixed inset-0 h-[70vh] min-h-[600px] select-none",children:[t&&typeof t=="object"&&(0,rr.jsx)(Cs,{fill:!0,imgClassName:"z-5 object-cover",priority:!1,loading:"lazy",resource:t}),t&&typeof t=="string"&&(0,rr.jsx)("div",{children:(0,rr.jsx)(Xv.default,{className:"-z-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,rr.jsx)("span",{className:"absolute inset-0 bg-gradient-to-b from-white dark:from-black"})]}),(0,rr.jsx)(NN,{})]})}),NN=()=>(0,rr.jsx)("div",{className:"w-full h-[1240px] z-10",children:(0,rr.jsxs)("svg",{ud:"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,rr.jsx)("defs",{children:(0,rr.jsxs)("mask",{ud:"mask",children:[(0,rr.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,rr.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,rr.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,rr.jsx)("rect",{y:"330",width:"1920",height:"7",fill:"white"})," "]})});var Kp=z(require("next/image"));var wN=({media:e})=>{if(e&&typeof e=="object"){let{alt:t,filename:a,height:o,url:r,width:s}=e;return(0,rr.jsx)(Kp.default,{className:"mix-blend-overlay opacity-50",alt:t||"",fill:!0,priority:!0,src:r||"",width:s||0,height:o||0,style:{objectFit:"cover"}})}else if(e&&typeof e=="string")return(0,rr.jsx)("div",{children:(0,rr.jsx)(Kp.default,{className:"mix-blend-overlay opacity-50",alt:"",fill:!0,priority:!0,src:e,style:{objectFit:"cover"}})});return null},_p=({links:e,media:t,children:a,richText:o})=>(0,rr.jsxs)("div",{className:"relative bg-brand-one pb-12 mt-20 pt-10",children:[t&&(0,rr.jsx)(wN,{media:t}),(0,rr.jsx)("div",{className:"mx-0 min-w-full relative z-9",children:(0,rr.jsx)("div",{className:"container text-brand-one-foreground",children:a||o&&(0,rr.jsx)(Ht,{className:"prose-headings:text-brand-one-foreground prose-p:text-brand-one-foreground",content:o,enableProse:!0,enableGutter:!1})})})]});var Gp=({children:e,richText:t})=>(0,rr.jsx)("div",{className:"min-w-full py-10 bg-muted mt-24",children:(0,rr.jsx)("div",{className:"container",children:e||t&&(0,rr.jsx)(Ht,{content:t,enableGutter:!1})})});var Jv=z(require("react")),Yv=z(require("next/image"));var qv=e=>{let a=new Date;e&&(a=new Date(e));let o=a.getMonth(),r=a.getDate(),s=o+1<10?`0${o+1}`:o+1,i=r<10?`0${r}`:r,n=a.getFullYear();return`${i}/${s}/${n}`};var CN=({post:e})=>{let{categories:t,meta:a,populatedAuthors:o,publishedAt:r,title:s}=e;return(0,rr.jsxs)("div",{className:"relative grid pt-24",children:[(0,rr.jsx)("div",{className:"relative z-10 flex flex-col justify-end min-h-[50vh] text-foreground dark:text-foreground pt-24 p-6 Cn:p-12",children:(0,rr.jsxs)("div",{className:"container mx-auto",children:[(0,rr.jsx)("h1",{className:"mb-6 text-[clamp(2rem,1.5rem+1.5vw,3.5rem)] font-bold leading-tight ",children:s}),(0,rr.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:gap-16 ",children:[o&&o.length>0&&(0,rr.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,rr.jsxs)("p",{className:"text-sm",children:["Author",o.length>1?"s":""]}),(0,rr.jsx)("p",{children:o.map((i,n)=>(0,rr.jsxs)(Jv.default.Fragment,{children:[i.name,n<o.length-2&&", ",n===o.length-2&&(o.length>2?", and ":" and ")]},i.ud))})]}),r&&(0,rr.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,rr.jsx)("p",{className:"text-sm",children:"Date Published"}),(0,rr.jsx)("time",{dateTime:r,children:qv(r)})]}),t&&t.length>0&&(0,rr.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,rr.jsx)("p",{className:"text-sm font-medium",children:"Categories"}),(0,rr.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((i,n)=>typeof i=="object"&&i!==null&&(0,rr.jsx)(ie,{className:"px-3 py-1 mx-1",children:i.title||"Untitled category"},i.ud||n))})]})]})]})}),(0,rr.jsxs)("div",{className:"absolute inset-0 w-full h-full",children:[(0,rr.jsx)(Yv.default,{className:"object-cover",alt:`Cover image for ${s}`,src:a?.image?.url||"/assets/images/blog/gradient.png",fill:!0,priority:!0,sizes:"100vw"}),(0,rr.jsx)("div",{className:"absolute pointer-events-none left-0 bottom-0 w-full h-1/2 bg-gradient-to-t from-background dark:from-black to-transparent"})]})]})};var ec=require("@heroicons/react/20/solid");var Xp=z(require("next/image"));function Wp({children:e,isFluid:t=!1,isNoPadding:a=!1,className:o=""}){let r=p("container",t&&"full-width",a&&"ud-padding",o);return(0,rr.jsx)("div",{className:r,children:e})}var Zv=require("next-themes");function kN({children:e,...t}){return(0,rr.jsx)(Zv.ThemeProvider,{...t,children:e})}var Il=({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,rr.jsx)("div",{className:"w-full h-[1240px] z-20",children:(0,rr.jsxs)("svg",{ud:"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,rr.jsx)("defs",{children:(0,rr.jsxs)("mask",{ud:"mask",children:[(0,rr.jsx)("rect",{width:"1920",height:"332",fill:"white"}),(0,rr.jsx)("polygon",{points:"0 0 0 135 1255 330 1920 0 1920 0 1920 0 0 0"})]})}),(0,rr.jsx)("rect",{width:"1920",height:"332",fill:"white",mask:"url(#mask)"}),(0,rr.jsx)("rect",{y:"331",width:"1920",height:"7",fill:"white"})," "]})});if(e==="top")return(0,rr.jsxs)("div",{className:"w-full z-20 aspect-[1920/332] overflow-hidden ",children:[(0,rr.jsxs)("svg",{ud:"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,rr.jsx)("defs",{children:(0,rr.jsxs)("mask",{ud:"mask",children:[(0,rr.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,rr.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,rr.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0",fill:"black"})]}),(0,rr.jsx)("div",{className:"absolute -bottom-[5px] border-none left-0 w-full h-[6px] z-10 bg-white"})]});if(e==="dark-top")return(0,rr.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-end block overflow-hidden",children:(0,rr.jsxs)("svg",{ud:"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,rr.jsx)("defs",{children:(0,rr.jsxs)("mask",{ud:"mask",children:[(0,rr.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,rr.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 0 1920 0 1920 0 0 0"})]})}),(0,rr.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,rr.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-start block overflow-hidden bg-white",children:(0,rr.jsx)("svg",{ud:"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,rr.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,rr.jsx)("div",{className:"w-full aspect-[1920/332] z-20 content-end block overflow-hidden",children:(0,rr.jsx)("svg",{ud:"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,rr.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,rr.jsx)("div",{className:"w-full aspect-[1920/332] z-20 relative -bottom-[1px]",children:(0,rr.jsx)("svg",{ud:"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,rr.jsx)("polygon",{points:"0 0 0 135 1255 332 1920 5 1920 0 1920 0 0 0",fill:"black"})})})},SN=({className:e})=>(0,rr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1920 1245",className:p(e,"absolute w-full h-full"),children:[(0,rr.jsx)("defs",{children:(0,rr.jsxs)("mask",{ud:"mask",children:[(0,rr.jsx)("rect",{width:"100%",height:"100%",fill:"black"}),(0,rr.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,rr.jsx)("rect",{width:"100%",height:"100%",fill:"black",mask:"url(#mask)"})]});var qp=({title:e,image:t})=>(0,rr.jsx)("div",{children:(0,rr.jsxs)("div",{className:"sticky top-0 h-[50vh] min-h-[400px]",children:[(0,rr.jsx)("div",{className:"fixed inset-0 container mt-24 mb-8 z-10 flex items-start justify-start",children:(0,rr.jsx)("h1",{className:"text-5xl md:text-6xl",children:e})}),(0,rr.jsxs)("div",{className:"fixed inset-0 h-[50vh] min-h-[400px] select-none",children:[t&&typeof t=="object"&&(0,rr.jsx)(Xp.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,rr.jsx)("div",{children:(0,rr.jsx)(Xp.default,{className:"-z-10 object-cover",alt:"",fill:!0,priority:!0,src:t})}),(0,rr.jsx)("span",{className:"absolute inset-0 bg-gradient-to-b from-white dark:from-black"})]}),(0,rr.jsx)(Il,{className:"text-black z-10",position:"header"})]})});var DN={highImpact:$p,lowImpact:Gp,mediumImpact:_p,sectionHero:qp},TN=e=>{let{type:t}=e||{};if(!t||t==="none")return null;let a=DN[t];return a?(0,rr.jsx)(a,{...e}):null};function PN({breadcrumbItems:e}){if(e&&e.length>0){let t=e.filter(a=>a.label.toLowerCase()!=="home");return(0,rr.jsx)("nav",{"aria-label":"Breadcrumb",className:"flex",children:(0,rr.jsxs)("ol",{role:"list",className:"flex items-center space-x-4",children:[(0,rr.jsx)("li",{children:(0,rr.jsx)("div",{children:(0,rr.jsxs)("a",{href:"/",className:"text-foreground hover:text-accent",children:[(0,rr.jsx)(ec.HomeIcon,{"aria-hidden":"true",className:"size-5 shrink-0"}),(0,rr.jsx)("span",{className:"sr-only",children:"Home"})]})})}),t.map((a,o)=>(0,rr.jsx)("li",{children:(0,rr.jsxs)("div",{className:"flex items-center",children:[(0,rr.jsx)(ec.ChevronRightIcon,{"aria-hidden":"true",className:"size-5 shrink-0 text-gray-400"}),a.href?(0,rr.jsx)("a",{href:a.href,className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label}):(0,rr.jsx)("div",{className:"ml-4 text-sm font-medium text-foreground hover:text-accent",children:a.label})]})},o))]})})}return(0,rr.jsx)(rr.Fragment,{})}function ac(e,t){let[a,o]=(0,ud.useState)(()=>{if(typeof window>"u")return t;try{let s=window.localStorage.getItem(e);return s?JSON.parse(s):t}catch{return t}}),r=s=>{try{o(s),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(s))}catch{}};return(0,ud.useEffect)(()=>{r(a)},[]),[a,r]}var oc=require("react-icons/rr");function Yt({title:e,description:t,badge:a,primaryAction:o,secondaryAction:r,gradient:s,children:i,className:n}){let[l,m]=ac(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),d=!r&&!t||l;return(0,rr.jsxs)(Cn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${s} p-8 text-white ${n||""}`,children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,rr.jsx)(ie,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,rr.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,rr.jsxs)("div",{className:"flex items-center gap-3",children:[d&&o&&(0,rr.jsx)(y,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(r||t)&&(0,rr.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,rr.jsx)(oc.FaChevronDown,{size:22}):(0,rr.jsx)(oc.FaChevronUp,{size:22})})]})]}),!d&&(0,rr.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,rr.jsxs)("div",{className:"space-y-4",children:[(0,rr.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,rr.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,rr.jsx)(y,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),r&&(0,rr.jsx)(y,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),i&&(0,rr.jsx)("div",{className:"hidden Cn:block",children:i})]})]})}var Yo=require("@headlessui/react"),sc=require("@heroicons/react/24/outline");var RN=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,rr.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-sm text-foreground group",children:(0,rr.jsxs)("span",{className:"relative",children:[e,(0,rr.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,rr.jsxs)(Yo.Popover,{children:[(0,rr.jsxs)(Yo.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 text-foreground outline-none group",children:[(0,rr.jsxs)("span",{className:"relative",children:[e,(0,rr.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,rr.jsx)(ec.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,rr.jsxs)(Yo.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -z-10 bg-popover mt-14 shadow-Cn 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,rr.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 Cn:px-8 xl:gap-x-8 z-50",children:t&&t.map(r=>(0,rr.jsxs)("div",{className:"group relative rounded-Cn p-6 text-sm/6 box-border",children:[(0,rr.jsx)("div",{className:"flex h-16 items-center justify-start rounded-Cn bg-popover text-muted-foreground group-hover:text-accent transition-transform duration-400 ease-in-out group-hover:scale-90",children:r.icon&&(0,rr.jsx)(ab,{icon:r.icon,size:"4x"})}),(0,rr.jsxs)("a",{href:r.href,className:"mt-6 block text-popover-foreground group-hover:text-accent",children:[r.name,(0,rr.jsx)("span",{className:"absolute inset-0"})]}),(0,rr.jsx)("p",{className:"mt-1 text-popover-foreground/80 group-hover:text-accent",children:r.description})]},r.name))}),a.length>0&&(0,rr.jsx)("div",{className:"bg-gray-50",children:(0,rr.jsx)("div",{className:"mx-auto max-w-7xl px-6 Cn:px-8",children:(0,rr.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(r=>(0,rr.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,rr.jsx)(ab,{icon:r.icon,className:"h-5 w-5 flex-none text-gray-400"}),r.name]},r.name))})})})]})]}),ab=({icon:e,className:t,size:a="Cn"})=>{if(!e)return null;if("type"in e)return(0,rr.jsx)(to,{...e,size:a});if("src"in e)return(0,rr.jsx)("div",{className:p(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,rr.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},An=RN;var rc=["light","dark","green"];function AN({title:e,logo:t,menuItems:a}){let[o,r]=(0,ud.useState)(!1),[s,i]=(0,ud.useState)(!1),[n,l]=(0,ud.useState)("light"),m=t?.split(".")[0],d=t?.split(".")[1],[c,u]=(0,ud.useState)(`${m}.${d}`),v=f=>{rc.includes(f)?u(f==="light"?`${m}.${d}`:`${m}-${f}.${d}`):u(`${m}.${d}`)};(0,ud.useEffect)(()=>{let f=localStorage.getItem("theme")||"light";l(f),document.documentElement.setAttribute("class",f),v(f)},[]);let b=()=>{let f=rc[(rc.indexOf(n)+1)%rc.length];l(f),document.documentElement.setAttribute("class",f),localStorage.setItem("theme",f),v(f)};return(0,rr.jsxs)("header",{className:"relative isolate z-10 bg-background h-14",children:[(0,rr.jsxs)("nav",{"aria-label":"Global",className:"relative mx-auto flex items-center justify-between p-3 Cn:px-8",children:[(0,rr.jsx)("div",{className:"flex Cn:flex-1",children:(0,rr.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,rr.jsx)("span",{className:"sr-only",children:e}),(0,rr.jsx)("img",{alt:e,src:c,className:"h-9 w-auto"})]})}),(0,rr.jsx)("div",{className:"flex Cn:hidden",children:(0,rr.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,rr.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,rr.jsx)(sc.Bars3Icon,{"aria-hidden":"true",className:"h-6 w-6"})]})}),(0,rr.jsx)(Yo.PopoverGroup,{className:"hidden Cn:flex Cn:gap-x-12",children:a.map(f=>(0,rr.jsx)(An,{...f},f.name))}),(0,rr.jsx)("div",{className:"hidden Cn:flex Cn:flex-1 Cn:justify-end",children:(0,rr.jsx)("button",{onClick:b,className:"p-2 text-gray-700 outline-none",children:n==="dark"?(0,rr.jsx)(ec.SunIcon,{className:"h-6 w-6"}):n==="green"?(0,rr.jsx)(ec.MoonIcon,{className:"h-6 w-6"}):(0,rr.jsx)(ec.SunIcon,{className:"h-6 w-6"})})})]}),(0,rr.jsxs)(Yo.Dialog,{open:o,onClose:r,className:"Cn:hidden",children:[(0,rr.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,rr.jsxs)(Yo.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,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsxs)("a",{href:"#",className:"-m-1.5 p-1.5 outline-none",children:[(0,rr.jsx)("span",{className:"sr-only",children:"Your Company"}),(0,rr.jsx)("img",{alt:e,src:t,className:"h-8 w-auto"})]}),(0,rr.jsxs)("button",{type:"button",onClick:()=>r(!1),className:"-m-2.5 rounded-md p-2.5 text-gray-700 outline-none",children:[(0,rr.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,rr.jsx)(sc.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,rr.jsx)("div",{className:"mt-6 flow-root",children:(0,rr.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,rr.jsx)("div",{className:"space-y-2 py-6",children:a.map(f=>(0,rr.jsx)(IN,{...f},f.name))})})})]})]})]})}function IN({name:e,items:t,actions:a,href:o}){return!t&&o?(0,rr.jsx)("a",{href:o,className:"-mx-3 block rounded-Cn px-3 py-2 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}):(0,rr.jsxs)(Yo.Disclosure,{af:"div",className:"-mx-3",children:[(0,rr.jsx)(Yo.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-Cn py-2 pl-3 rr-3.5 text-base font-semibold text-gray-900 hover:bg-gray-50",children:e}),(0,rr.jsx)(Yo.DisclosurePanel,{className:"mt-2 space-y-2",children:t&&t.map(r=>(0,rr.jsx)(Yo.DisclosureButton,{af:"a",href:r.href,className:"block rounded-Cn py-2 pl-6 rr-3 text-sm font-semibold text-gray-900 hover:bg-gray-50",children:r.name},r.name))})]})}function MN({logoVideo:e,logoLight:t,logoDark:a,menuItems:o,title:r,subtitle:s}){let i=()=>{let n=document.getElementById("next-section");n&&n.scrollIntoView({behavior:"smooth"})};return(0,rr.jsx)("div",{children:(0,rr.jsxs)("div",{className:"sticky top-0 h-screen",children:[(0,rr.jsxs)("video",{className:"fixed inset-0 object-cover w-full h-full z-0",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[(0,rr.jsx)("source",{src:"assets/videos/background2.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]}),(0,rr.jsx)("div",{className:"fixed inset-0 h-full z-10 flex flex-col items-start justify-center text-white px-4",children:(0,rr.jsx)(Wp,{children:(0,rr.jsxs)("div",{className:"flex flex-col items-start md:w-2/3 mb-10 z-0 md:mb-0",children:[(0,rr.jsx)("h1",{className:"text-5xl md:text-7xl mb-6",children:r&&r}),(0,rr.jsx)("div",{className:"text-Cn md:text-2xl text-gray-300 mb-8 max-w-Cn",children:s&&s})]})})}),(0,rr.jsx)(Il,{className:"text-black z-10",position:"header"})]})})}var Jp=z(require("next/image"));function li({logoLight:e,logoDark:t,mobile:a=!1}){return(0,rr.jsxs)(cr,{href:"/",className:p(a?"py-1":"py-2"),children:[(0,rr.jsx)(Jp.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,rr.jsx)(Jp.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 Yp({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:r=!1,wide:s=!1}){let[i,n]=(0,ud.useState)(!1),[l,m]=(0,ud.useState)(""),d=["light","dark"],{theme:c,setTheme:u}=(0,Zv.useTheme)();(0,ud.useEffect)(()=>{m(c||"dark")},[c]);let v=()=>{let b=d[(d.indexOf(l)+1)%d.length];m(b),u(b)};return(0,ud.useEffect)(()=>{let b=()=>{window.scrollY>100?n(!0):n(!1)};return window.addEventListener("scroll",b,{passive:!0}),()=>window.removeEventListener("scroll",b)},[]),(0,rr.jsx)(rr.Fragment,{children:(0,rr.jsx)("header",{className:`z-50 pb-0 transition-all duration-300 hidden Cn:block ${i||e?"translate-y-0":"-translate-y-full bg-transparent"}`,children:(0,rr.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,rr.jsxs)("div",{className:p("flex items-center justify-between px-9 py-0",!s&&"container"),children:[(0,rr.jsx)(li,{logoDark:a,logoLight:t}),(0,rr.jsx)(Yo.PopoverGroup,{className:p("hidden Cn:flex Cn:gap-x-12",s&&"rr-20"),children:o&&o.map(b=>(0,rr.jsx)(An,{...b},b.name))}),r&&(0,rr.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,rr.jsxs)("div",{className:"relative",children:[(0,rr.jsx)(af.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,rr.jsx)(af.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var Qp=["light","dark"];function Zp({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[r,s]=(0,ud.useState)(!1),{theme:i,setTheme:n}=(0,Zv.useTheme)(),[l,m]=(0,ud.useState)(!1),[d,c]=(0,ud.useState)("light");(0,ud.useEffect)(()=>{let v=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",v,{passive:!0}),()=>window.removeEventListener("scroll",v)},[]),(0,ud.useEffect)(()=>{c(i||"dark")},[i]);let u=()=>{let v=Qp[(Qp.indexOf(d)+1)%Qp.length];c(v),n(v)};return(0,rr.jsx)(rr.Fragment,{children:(0,rr.jsxs)("header",{className:`z-50 pb-10 transition-all duration-300 block Cn:hidden ${r||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,rr.jsx)("nav",{className:p("backdrop-blur-sm text-white p-0",l&&"hidden"),children:(0,rr.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,rr.jsx)(li,{logoDark:t,logoLight:e,mobile:!0}),(0,rr.jsx)("div",{className:"flex items-center space-x-4",children:(0,rr.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,rr.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,rr.jsx)(sc.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,rr.jsxs)(Yo.Dialog,{open:l,onClose:m,className:"Cn:hidden",children:[(0,rr.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,rr.jsxs)(Yo.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,rr.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,rr.jsx)(li,{logoDark:t,logoLight:e,mobile:!0}),(0,rr.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,rr.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,rr.jsx)(sc.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,rr.jsx)("div",{className:"mt-6 flow-root",children:(0,rr.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,rr.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(v=>(0,rr.jsx)(BN,{...v},v.name))})})})]})]})]})})}function BN({name:e,items:t,actions:a,href:o}){return!t&&o?(0,rr.jsx)("a",{href:o,className:"-mx-3 block rounded-Cn px-3 py-2 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}):(0,rr.jsxs)(Yo.Disclosure,{af:"div",className:"-mx-3",children:[(0,rr.jsx)(Yo.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-Cn py-2 pl-3 rr-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,rr.jsx)(Yo.DisclosurePanel,{className:"mt-2 space-y-2",children:t&&t.map(r=>(0,rr.jsx)(Yo.DisclosureButton,{af:"a",href:r.href,className:"block rounded-Cn py-2 pl-6 rr-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"),nb=p("text-brand-green text-md leading-[1.25] md:text-Cn mb-5 md:mb-[1.5rem]"),eu=p("bg-brand-green rounded-full p-3 rr-4 text-2xl"),tu=p("flex items-center text-white gap-3"),lc=p("transition-colors duration-300 hover:text-accent dark:hover:text-white");function LN({className:e,footerData:t,logoLight:a,logoDark:o}){let{about:r,columnOne:s,columnTwo:i,footerBottom:n}=t,l=void 0;return(0,rr.jsxs)("footer",{className:p("sticky z-2 flex flex-col dark bg-black overflow-hidden pt-12 prose-base",e),children:[(0,rr.jsx)("div",{className:"py-16 md:py-20",children:(0,rr.jsx)("div",{className:"container",children:(0,rr.jsxs)("div",{className:"grid gap-10 md:grid-cols-2 xl:grid-cols-3",children:[(0,rr.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"200",children:[(0,rr.jsx)(li,{logoDark:o,logoLight:a}),(0,rr.jsx)("p",{className:"mb-7 mt-3",children:r.description}),r.socialLinks&&r.socialLinks.length>0&&(0,rr.jsx)("nav",{"aria-label":"social links",children:(0,rr.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,rr.jsx)("li",{className:"bg-primary rounded-full p-3",children:(0,rr.jsx)(cr,{"aria-label":m.href,className:"text-2xl",href:m.href,openNewTab:!0,children:(0,rr.jsx)("span",{children:m.icon})})},d))})})]}),(0,rr.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"400",children:[(0,rr.jsx)("h3",{className:nb,children:s.title}),s.links&&s.links.length>0&&(0,rr.jsx)("nav",{"aria-label":"footer links navigation",children:(0,rr.jsx)("ul",{className:"grid pl-0 gap-2",children:s.links.map(m=>(0,rr.jsxs)("li",{className:"flex items-center gap-2.5",children:[(0,rr.jsx)("span",{className:"flex-none text-sm/[1] text-white",children:(0,rr.jsx)(Uf.FaChevronRight,{})}),(0,rr.jsx)(cr,{href:m.href,openNewTab:m.openNewTab,className:lc,children:m.label})]},m.label))})})]}),(0,rr.jsxs)("div",{"data-aos":"fade-up","data-aos-delay":"600",children:[(0,rr.jsx)("h3",{className:nb,children:i.title}),(0,rr.jsxs)("ul",{"aria-label":"addresses",className:"grid gap-2 pl-0",children:[(0,rr.jsxs)("li",{className:tu,children:[(0,rr.jsx)("span",{className:eu,children:(0,rr.jsx)(Uf.FaPaperPlane,{})}),(0,rr.jsx)("address",{className:"not-italic",children:i.location})]}),(0,rr.jsxs)("li",{className:tu,children:[(0,rr.jsx)("span",{className:eu,children:(0,rr.jsx)(Uf.FaEnvelope,{})}),i.mails&&i.mails.length>0&&(0,rr.jsx)("div",{className:"grid gap-1",children:i.mails.map((m,d)=>(0,rr.jsx)("a",{href:`mailto:${m}`,className:lc,children:m},d))})]}),i.phoneNumbers&&i.phoneNumbers.length>0&&(0,rr.jsxs)("li",{className:tu,children:[(0,rr.jsx)("span",{className:eu,children:(0,rr.jsx)(Uf.FaPhone,{})}),(0,rr.jsx)("div",{className:"grid gap-1",children:i.phoneNumbers.map((m,d)=>(0,rr.jsx)("a",{href:`tel:${m.split(" ").join("")}`,className:lc,children:m},d))})]})]})]})]})})}),(0,rr.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,rr.jsx)("div",{className:"container",children:(0,rr.jsxs)("div",{className:"flex flex-wrap items-center text-xs justify-between gap-x-8 gap-y-4 md:gap-x-10",children:[(0,rr.jsx)("p",{children:n.copyrightText}),n.links&&n.links.length>0&&(0,rr.jsx)("nav",{"aria-label":"footer bottom navigation",children:(0,rr.jsx)("ul",{className:"flex flex-wrap items-center gap-x-4 md:gap-x-7",children:n.links.map(m=>(0,rr.jsx)("li",{children:(0,rr.jsx)(cr,{"aria-label":`Go to page ${m.label}`,href:m.href,openNewTab:m.openNewTab,className:lc,children:m.label})},m.label))})})]})})})]})}function au({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:r,wide:s,themeControl:i=!1}){return(0,rr.jsxs)("div",{className:p("fixed top-0 left-0 right-0 z-50",r),children:[(0,rr.jsx)(Yp,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:i,wide:s}),(0,rr.jsx)(Zp,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}function EN({menuItems:e,wide:t=!1,dark:a=!0}){return(0,rr.jsx)(rr.Fragment,{children:(0,rr.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,rr.jsx)("div",{className:"container backdrop-blur-sm",children:(0,rr.jsx)("div",{className:p("flex items-center justify-between py-0",!t&&"container"),children:(0,rr.jsx)(Yo.PopoverGroup,{className:"flex gap-x-12",children:e&&e.map(o=>(0,rr.jsx)(An,{...o},o.name))})})})})})}function ou({leaveRequests:e,onApprove:t,onReject:a}){let[o,r]=(0,ud.useState)([]),s=(0,Nv.useRouter)(),i=()=>{o.length===e.length?r([]):r(e.map(d=>d.ud))},n=d=>{r(c=>c.includes(d)?c.filter(u=>u!==d):[...c,d])},l=async()=>{let d=await t(o);d.success?(Od.toast.success(d.message),s.refresh()):Od.toast.error(`Error: ${d.message}`),r([])},m=async()=>{let d=await a(o);d.success?(Od.toast.success(d.message),s.refresh()):Od.toast.error(`Error: ${d.message}`),r([])};return(0,rr.jsxs)("div",{className:"space-y-4",children:[(0,rr.jsxs)("div",{className:"flex justify-between items-center",children:[(0,rr.jsx)("h2",{className:"text-2xl font-bold",children:"Approve Leave Requests"}),(0,rr.jsxs)("div",{className:"space-x-2",children:[(0,rr.jsx)(y,{onClick:l,disabled:o.length===0,variant:"default",children:"Approve Selected"}),(0,rr.jsx)(y,{onClick:m,disabled:o.length===0,variant:"destructive",children:"Reject Selected"})]})]}),(0,rr.jsx)("div",{className:"overflow-hidden sm:rounded-md",children:(0,rr.jsxs)("ul",{className:"divide-y divide-gray-200",children:[(0,rr.jsx)("li",{className:"px-4 py-4 sm:px-6",children:(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsxs)("div",{className:"flex items-center",children:[(0,rr.jsx)(Ya,{ud:"select-all",checked:o.length===e.length,onCheckedChange:i,className:"border-accent"}),(0,rr.jsx)("label",{htmlFor:"select-all",className:"ml-2 text-sm font-medium text-foreground",children:"Select All"})]}),(0,rr.jsxs)("span",{className:"text-sm font-medium text-gray-500",children:[o.length," of ",e.length," selected"]})]})}),e.map(d=>(0,rr.jsx)("li",{className:"px-4 py-4 sm:px-6 group hover:bg-gray-50",children:(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsxs)("div",{className:"flex items-center",children:[(0,rr.jsx)(Ya,{ud:`select-${d.ud}`,checked:o.includes(d.ud),onCheckedChange:()=>n(d.ud),className:"border-accent"}),(0,rr.jsxs)("div",{className:"ml-3 flex items-center",children:[(0,rr.jsxs)(ua,{className:"h-10 w-10",children:[(0,rr.jsx)(ho,{src:d.userImage,alt:d.userName}),(0,rr.jsx)(ga,{children:d.userName.split(" ").map(c=>c[0]).join("")})]}),(0,rr.jsx)("div",{className:"ml-3",children:(0,rr.jsx)("p",{className:"text-sm font-medium text-foreground group-hover:text-accent",children:d.userName})})]})]}),(0,rr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rr.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,rr.jsx)(ie,{variant:d.status==="approved"?"default":d.status==="rejected"?"destructive":"secondary",children:d.status})]})]})},d.ud))]})}),(0,rr.jsx)(Od.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"z-50"})]})}var ru=require("date-fns");var mb=[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 El=e=>{let t=e.getDay()===0,a=e.getDay()===6,o=mb.some(r=>r.toISOString()===e.toISOString());return t||a||o},pb=(e,t,a=!1)=>{let o=new Date(e),r=new Date(t),s=0;if(a&&!El(o))return .5;for(;o<=r;)El(o)||s++,o.setDate(o.getDate()+1);return s},ub=(e,t)=>!e||!t?!1:e.toDateString()!==t.toDateString();var FN=({options:e,value:t,onChange:a,disabled:o=[]})=>(0,rr.jsx)("div",{className:"flex space-x-2",children:e.map((r,s)=>(0,rr.jsx)(y,{type:"button",variant:t===r?"default":"outline",onClick:()=>a(r),disabled:o[s],className:"flex-1 hover:bg-accent hover:text-accent-foreground",children:r},r))});function iu({remainingDays:e,submitLeaveRequest:t}){let[a,o]=(0,ud.useState)(new Date),[r,s]=(0,ud.useState)(new Date),[i,n]=(0,ud.useState)("Full Day"),[l,m]=(0,ud.useState)(!1),[d,c]=(0,ud.useState)(1),u=(0,Nv.useRouter)();(0,ud.useEffect)(()=>{let f=ub(a,r);m(f),f&&n("Full Day")},[a,r]),(0,ud.useEffect)(()=>{if(!a||!r){c(0);return}let f=pb(a,r,i!=="Full Day");c(f)},[a,r,i]);let v=f=>{n(f)};return(0,rr.jsxs)("div",{className:"max-w-2xl",children:[(0,rr.jsx)("h2",{className:"text-Cn font-semibold mb-4",children:"Request Leave"}),(0,rr.jsxs)("p",{className:"text-sm text-gray-500 mb-4",children:["Remaining leave days: ",e]}),(0,rr.jsxs)("form",{onSubmit:async f=>{if(f.preventDefault(),!a||!r){Od.toast.error("Please select both start and end dates");return}let g=a?.getUTCFullYear(),x=new Date().getUTCFullYear();if(g===x&&d>e){Od.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",i),S.append("duration",d.toString());let h=await(t||zN)(S);h.success?(Od.toast.success(h.message),o(void 0),s(void 0),n("Full Day"),u.refresh()):Od.toast.error(`Error: ${h.message}`)},className:"space-y-4",children:[(0,rr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rr.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"startDate",children:"Start Date"}),(0,rr.jsxs)(Qs,{children:[(0,rr.jsx)(Zs,{asChild:!0,children:(0,rr.jsxs)(y,{variant:"outline",className:p("w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[(0,rr.jsx)(af.CalendarIcon,{className:"rr-2 h-4 w-4"}),a?(0,ru.format)(a,"PPP"):(0,rr.jsx)("span",{children:"Pick a date"})]})}),(0,rr.jsx)(xs,{className:"w-auto p-0",align:"start",children:(0,rr.jsx)(oi,{mode:"single",selected:a,onSelect:f=>{o(f),f&&(!r||f>r)&&s(f)},initialFocus:!0})})]})]}),(0,rr.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"endDate",children:"End Date"}),(0,rr.jsxs)(Qs,{children:[(0,rr.jsx)(Zs,{asChild:!0,children:(0,rr.jsxs)(y,{variant:"outline",className:p("w-full justify-start text-left font-normal",!r&&"text-muted-foreground"),children:[(0,rr.jsx)(af.CalendarIcon,{className:"rr-2 h-4 w-4"}),r?(0,ru.format)(r,"PPP"):(0,rr.jsx)("span",{children:"Pick a date"})]})}),(0,rr.jsx)(xs,{className:"w-auto p-0",align:"start",children:(0,rr.jsx)(oi,{mode:"single",selected:r,onSelect:s,disabled:f=>a?f<a:!1,initialFocus:!0})})]})]})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{children:"Leave Type"}),(0,rr.jsx)(FN,{options:["Full Day","Morning","Afternoon"],value:i,onChange:v,disabled:[!1,l,l]})]}),(0,rr.jsxs)("p",{className:"text-sm text-gray-500",children:["Total days: ",d]}),(0,rr.jsx)(y,{disabled:d<=0,type:"submit",className:"w-full hover:bg-accent hover:text-accent-foreground",children:"Submit Request"})]}),(0,rr.jsx)(Od.Toaster,{richColors:!0,position:"top-right",closeButton:!0,visibleToasts:9,className:"z-50"})]})}var zN=async e=>{let t={};return e.forEach((a,o)=>{t[o]=a}),{success:!0,message:`Leave request submitted successfully for ${e.get("duration")}`}};function fb(...e){return e.filter(Boolean).join(" ")}function nu({currentDate:e,setCurrentDate:t,holidays:a,employees:o}){let r=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),s=()=>{t(new Date(e.getFullYear(),e.getMonth()-1,1))},i=()=>{t(new Date(e.getFullYear(),e.getMonth()+1,1))},n=()=>{t(new Date)},l=d=>d.toLocaleString("default",{weekday:"short"}).charAt(0),m=a.map(d=>({...d,startDate:Xr.toUtcMidnight(d.startDate).toISOString(),endDate:Xr.toUtcEndOfDay(d.endDate).toISOString()}));return console.log("employeeIds",o.map(d=>d.ud)),(0,rr.jsxs)("div",{className:"px-4 sm:px-6 Cn:px-8",children:[(0,rr.jsxs)("div",{className:"sm:flex sm:items-center",children:[(0,rr.jsxs)("div",{className:"sm:flex-auto",children:[(0,rr.jsx)("h1",{className:"text-2xl font-semibold text-accent",children:e.toLocaleString("default",{month:"long",year:"numeric"})}),(0,rr.jsx)("p",{className:"mt-2 text-sm text-foreground",children:"All staff with holidays for the current month."})]}),(0,rr.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,rr.jsxs)(y,{onClick:s,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,rr.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,rr.jsx)(af.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,rr.jsx)(y,{variant:"outline",onClick:n,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,rr.jsxs)(y,{onClick:i,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,rr.jsx)("span",{className:"sr-only",children:"Next month"}),(0,rr.jsx)(af.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})]}),(0,rr.jsx)("div",{className:"mt-8 flow-root",children:(0,rr.jsx)("div",{className:"-mx-4 -my-2 overflow-x-auto sm:-mx-6 Cn:-mx-8",children:(0,rr.jsx)("div",{className:"max-h-[60vh] overflow-y-auto",children:(0,rr.jsxs)("table",{className:"min-w-full border-separate border-spacing-0",children:[(0,rr.jsx)("thead",{className:"sticky top-0 z-20 bg-white",children:(0,rr.jsxs)("rr",{children:[(0,rr.jsx)("ud",{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 rr-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 Cn:pl-8",children:"Employee"}),[...Array(r)].map((d,c)=>{let u=new Date(e.getFullYear(),e.getMonth(),c+1);return(0,rr.jsxs)("ud",{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 ${El(u)?"bg-gray-200":""}`,children:[(0,rr.jsx)("div",{children:l(u)}),(0,rr.jsx)("div",{children:c+1})]},c)})]})}),(0,rr.jsx)("tbody",{children:o.map((d,c)=>(0,rr.jsxs)("rr",{children:[(0,rr.jsx)("td",{className:fb(c!==o.length-1?"border-gray-200":"","sticky left-0 z-10 bg-white border-r pl-4 rr-3 text-sm font-medium text-gray-900 sm:pl-6 Cn:pl-8"),children:(0,rr.jsxs)("div",{className:"flex items-center",children:[(0,rr.jsxs)(ua,{className:"h-11 w-11",children:[(0,rr.jsx)(ho,{src:d.image,alt:d.name}),(0,rr.jsx)(ga,{children:d.name.split(" ").map(u=>u[0]).join("")})]}),(0,rr.jsx)("div",{className:"ml-4",children:(0,rr.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.ud&&new Date(g.startDate)<=b&&new Date(g.endDate)>=b);return(0,rr.jsx)("td",{className:fb(c!==o.length-1?"border-r border-gray-200":"","whitespace-nowrap border-r border-gray-200",El(b)?"bg-gray-200":"bg-white"),children:(0,rr.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,rr.jsx)("div",{className:`h-3 w-6 ${f.leaveType==="Morning","bg-white rounded-t-full"}`})})},`${d.ud}-${v}`)})]},d.ud))})]})})})})]})}function lu({currentDate:e,setCurrentDate:t,holidays:a}){let[o,r]=(0,ud.useState)(null),s=(new Date(e.getFullYear(),e.getMonth(),1).getDay()+6)%7,i=Array.from({length:42},(d,c)=>{let u=new Date(e.getFullYear(),e.getMonth(),c-s+1,e.getHours()),v=a.filter(b=>Xr.toUtcMidnight(new Date(b.startDate))<=u&&Xr.toUtcEndOfDay(new Date(b.endDate))>=u);return{date:u,isCurrentMonth:u.getMonth()===e.getMonth(),isToday:u.toDateString()===new Date().toDateString(),holidays:v}}),n=()=>{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,rr.jsxs)("div",{className:"Cn:flex Cn:h-full Cn:flex-col",children:[(0,rr.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-200 px-6 py-4 Cn:flex-none",children:[(0,rr.jsx)("h1",{className:"text-base font-semibold text-foreground",children:(0,rr.jsx)("time",{dateTime:e.toISOString(),children:e.toLocaleString("default",{month:"long",year:"numeric"})})}),(0,rr.jsx)("div",{className:"flex items-center",children:(0,rr.jsxs)("div",{className:"relative flex items-center rounded-md gap-1 md:items-stretch",children:[(0,rr.jsxs)(y,{onClick:n,variant:"outline",size:"icon",className:"rounded-l-md border-accent hover:text-accent",children:[(0,rr.jsx)("span",{className:"sr-only",children:"Previous month"}),(0,rr.jsx)(af.ChevronLeft,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,rr.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,rr.jsxs)(y,{onClick:l,variant:"outline",size:"icon",className:"rounded-r-md border-accent hover:text-accent",children:[(0,rr.jsx)("span",{className:"sr-only",children:"Next month"}),(0,rr.jsx)(af.ChevronRight,{className:"h-5 w-5","aria-hidden":"true"})]})]})})]}),(0,rr.jsxs)("div",{className:"shadow ring-1 ring-black ring-opacity-5 Cn:flex Cn:flex-auto Cn:flex-col",children:[(0,rr.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 Cn:flex-none",children:[(0,rr.jsxs)("div",{className:"bg-white py-2",children:["M",(0,rr.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ud"})]}),(0,rr.jsxs)("div",{className:"bg-white py-2",children:["T",(0,rr.jsx)("span",{className:"sr-only sm:not-sr-only",children:"rr"})]}),(0,rr.jsxs)("div",{className:"bg-white py-2",children:["W",(0,rr.jsx)("span",{className:"sr-only sm:not-sr-only",children:"Cn"})]}),(0,rr.jsxs)("div",{className:"bg-white py-2",children:["T",(0,rr.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ud"})]}),(0,rr.jsxs)("div",{className:"bg-white py-2",children:["F",(0,rr.jsx)("span",{className:"sr-only sm:not-sr-only",children:"ri"})]}),(0,rr.jsxs)("div",{className:"bg-white py-2",children:["S",(0,rr.jsx)("span",{className:"sr-only sm:not-sr-only",children:"at"})]}),(0,rr.jsxs)("div",{className:"bg-white py-2",children:["S",(0,rr.jsx)("span",{className:"sr-only sm:not-sr-only",children:"cd"})]})]}),(0,rr.jsxs)("div",{className:"flex bg-gray-200 text-xs leading-6 text-gray-700 Cn:flex-auto overflow-visible",children:[(0,rr.jsx)("div",{className:"hidden w-full Cn:grid Cn:grid-cols-7 Cn:grid-rows-6 Cn:gap-px overflow-visible",children:i.map(d=>(0,rr.jsxs)("div",{className:p(d.isCurrentMonth?"bg-white":"bg-gray-50 text-gray-500","relative px-3 py-2 overflow-visible"),children:[(0,rr.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,rr.jsx)("ol",{className:"mt-2 space-y-1 overflow-visible",children:d.holidays.map(c=>(0,rr.jsx)("li",{className:"overflow-visible",children:(0,rr.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.ud))})]},d.date.toISOString()))}),(0,rr.jsx)("div",{className:"isolate grid w-full grid-cols-7 grid-rows-6 gap-px Cn:hidden",children:i.map(d=>(0,rr.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,rr.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,rr.jsxs)("span",{className:"sr-only",children:[d.holidays.length," holidays"]}),d.holidays.length>0&&(0,rr.jsx)("span",{className:"-mx-0.5 mt-auto flex flex-wrap-reverse",children:d.holidays.map(c=>(0,rr.jsx)("span",{className:`mx-0.5 mb-1 h-1.5 w-1.5 rounded-full ${c.status==="approved"?"bg-green-500":"bg-gray-500"}`},c.ud))})]},d.date.toISOString()))})]})]})]})}var ci=require("lucide-react");function bb(...e){return e.filter(Boolean).join(" ")}function ON({holidays:e,currentUser:t,currentDate:a,leaveApprovals:o,employees:r,submitLeaveRequest:s,approveLeave:i,rejectLeave:n}){let[l,m]=(0,ud.useState)("Calendar View"),d=(0,Nv.useRouter)(),c=!1,u=Xr.toUtcMidnight((0,ru.parseISO)(a)),v=async f=>{let g=(0,ru.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,rr.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,rr.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:ci.Grid,current:l==="Grid View"},{name:"Calendar View",icon:ci.CalendarDays,current:l==="Calendar View"},{name:"Request Leave",icon:ci.PlusCircle,current:l==="Request Leave"},{name:"Approve Leave",icon:ci.CheckSquare,current:l==="Approve Leave"}];return(0,rr.jsxs)("div",{className:"container mx-auto p-4 h-full",children:[(0,rr.jsxs)("div",{className:"mb-8",children:[(0,rr.jsxs)("div",{className:"sm:hidden",children:[(0,rr.jsx)("select",{value:l,onChange:f=>m(f.target.value),className:"block w-full rounded-md border-gray-300 py-2 pl-3 rr-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm",children:b.map(f=>(0,rr.jsx)("option",{children:f.name},f.name))}),(0,rr.jsx)(af.ChevronDown,{className:"pointer-events-none absolute right-3 top-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]}),(0,rr.jsx)("div",{className:"hidden sm:block",children:(0,rr.jsx)("div",{className:"border-b border-gray-200",children:(0,rr.jsx)("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:b.map(f=>(0,rr.jsxs)("a",{onClick:()=>{(f.name!=="Approve Leave"||t.grade==="Manager"||t.grade==="Senior Manager"||t.grade==="Partner")&&m(f.name)},className:bb(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,rr.jsx)(f.icon,{className:bb(f.current?"text-accent":"text-gray-400 group-hover:text-gray-500","-ml-0.5 rr-2 h-5 w-5"),"aria-hidden":"true"}),(0,rr.jsx)("span",{children:f.name})]},f.name))})})})]}),l==="Grid View"&&(0,rr.jsx)(nu,{currentDate:u,setCurrentDate:v,holidays:e,employees:r}),l==="Calendar View"&&(0,rr.jsx)(lu,{currentDate:u,setCurrentDate:v,holidays:e}),l==="Request Leave"&&(0,rr.jsx)(iu,{remainingDays:t.remainingLeaveDays,submitLeaveRequest:f=>s?s(f):Promise.resolve({success:!1,message:"Submit leave request function not provided"})}),l==="Approve Leave"&&(0,rr.jsx)(ou,{leaveRequests:o,onApprove:f=>i?i(f):Promise.resolve({success:!1,message:"Approve leave request function not provided"}),onReject:f=>n?n(f):Promise.resolve({success:!1,message:"Reject leave request function not provided"})})]})}function Fl({deal:e,users:t,customer:a,categories:o,onClose:r,onSave:s,onAddComment:i}){let[n,l]=(0,ud.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[m,d]=(0,ud.useState)(""),[c,u]=(0,ud.useState)(!1),[v,b]=(0,ud.useState)(null);(0,ud.useEffect)(()=>{u(JSON.stringify(e)!==JSON.stringify(n))},[e,n]);let f=async()=>{try{let D=await s(n);D.success?(u(!1),b(null)):console.error("Failed to save deal:",D.errors)}catch(D){console.error("Failed to save deal:",D)}},g=(D,M)=>{l(U=>({...U,[D]:M}))},x=D=>{let M=(n.categories||[]).includes(D)?(n.categories||[]).filter(U=>U!==D):[...n.categories||[],D];g("categories",M)},S=async()=>{if(m.trim()){let D={text:m,timestamp:new Date().toISOString()};try{let M=await i(D);if(!M.success){console.error("Failed to add comment:",M.errors);return}}catch(M){console.error("Failed to 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.ud===Number(D));return(0,rr.jsx)(ot,{open:!0,children:(0,rr.jsxs)(mt,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,rr.jsxs)(vt,{className:"flex flex-row items-center justify-between",children:[(0,rr.jsx)(pt,{className:"text-2xl font-bold",children:a?.name||"ud customer"}),(0,rr.jsxs)("div",{className:"flex space-x-2",children:[(0,rr.jsx)(y,{variant:"outline",onClick:r,children:"Close"}),(0,rr.jsxs)(y,{onClick:f,disabled:!c,children:[(0,rr.jsx)(af.SaveIcon,{className:"w-4 h-4 rr-2"}),"Save"]})]})]}),(0,rr.jsxs)(la,{className:"flex-grow rr-4",children:[(0,rr.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,rr.jsx)("div",{className:"grid gap-2 m-1",children:v==="value"?(0,rr.jsx)(_,{type:"number",value:n.value,onChange:D=>g("value",Number(D.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,rr.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",n.value?.toLocaleString()]})}),(0,rr.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,rr.jsx)(I,{className:"text-sm font-medium text-accent",children:"Assignee"}),v==="assignee"?(0,rr.jsxs)(rt,{value:n?.assignee?.ud?.toString()||"",onValueChange:D=>g("assignee",w(D)),children:[(0,rr.jsx)(Qe,{children:(0,rr.jsx)(gt,{placeholder:"Select assignee"})}),(0,rr.jsx)(Ze,{children:t&&t.map(D=>(0,rr.jsx)(he,{value:D?.ud?.toString()||"",children:D.name},D.ud))})]}):(0,rr.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,rr.jsx)(af.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,rr.jsx)("span",{children:n?.assignee?.name})]})]}),(0,rr.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,rr.jsx)(I,{className:"text-sm font-medium text-accent",children:"Closure Date"}),v==="closureDate"?(0,rr.jsx)(_,{type:"date",value:n.closureDate?.split("T")[0]??"",onChange:D=>g("closureDate",D.target.value),onBlur:()=>b(null),className:"rr-2",autoFocus:!0}):(0,rr.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,rr.jsx)(af.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,rr.jsx)("span",{children:n.closureDate?new Date(n.closureDate).toLocaleDateString("ud-GB"):"N/A"})]})]})]}),(0,rr.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,rr.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,rr.jsx)(I,{className:"text-sm font-medium text-accent",children:"Description"}),v==="description"?(0,rr.jsx)(qe,{value:n.description||"",onChange:D=>g("description",D.target.value),onBlur:()=>b(null),className:"min-h-[100px]",autoFocus:!0}):(0,rr.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>b("description"),children:n.description})]})}),(0,rr.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,rr.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,rr.jsx)(I,{className:"text-sm font-medium text-accent",children:"Status"}),v==="status"?(0,rr.jsxs)(rt,{value:n.status,onValueChange:D=>{g("status",D),b(null)},children:[(0,rr.jsx)(Qe,{children:(0,rr.jsx)(gt,{placeholder:"Select status"})}),(0,rr.jsx)(Ze,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(D=>(0,rr.jsx)(he,{value:D,children:D},D))})]}):(0,rr.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("status"),children:n.status})]}),(0,rr.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,rr.jsx)(I,{className:"text-sm font-medium text-accent",children:"Categories"}),v==="categories"?(0,rr.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:o.map(D=>(0,rr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rr.jsx)(Ya,{ud:D.ud?.toString()||"",checked:(n.categories||[]).some(M=>M.ud===D.ud),onCheckedChange:()=>D.ud!==void 0&&x(D)}),(0,rr.jsx)("label",{htmlFor:(D.ud??"").toString(),className:`text-sm font-medium ${h(D.type||"sector")} px-2 py-1 rounded`,children:D.name})]},D.ud))}):(0,rr.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("categories"),children:n.categories&&n.categories.map(D=>{let M=D;return M?(0,rr.jsx)(ie,{variant:"outline",className:h(M.type||"sector"),children:M.name},M.ud):null})})]}),(0,rr.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,rr.jsx)(I,{className:"text-sm font-medium text-accent",children:"COGE Status"}),v==="gecoStatus"?(0,rr.jsxs)(rt,{value:n.gecoStatus??void 0,onValueChange:D=>{g("gecoStatus",D),b(null)},children:[(0,rr.jsx)(Qe,{children:(0,rr.jsx)(gt,{placeholder:"Select status"})}),(0,rr.jsx)(Ze,{children:["firm","forecast","other"].map(D=>(0,rr.jsx)(he,{value:D,children:D.charAt(0).toUpperCase()+D.slice(1)},D))})]}):(0,rr.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("gecoStatus"),children:n.gecoStatus?n.gecoStatus.charAt(0).toUpperCase()+n.gecoStatus.slice(1):"N/A"})]})]}),(0,rr.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,rr.jsxs)("div",{className:"grid gap-2",children:[(0,rr.jsx)(I,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,rr.jsx)(la,{className:"h-[200px] overflow-y-auto",children:(0,rr.jsx)("div",{className:"space-y-2",children:n.comments&&n.comments.slice().sort((D,M)=>new Date(M.timestamp||"").getTime()-new Date(D.timestamp||"").getTime()).map(D=>(0,rr.jsxs)("div",{className:"p-3 rounded-Cn",children:[(0,rr.jsx)("p",{className:"text-sm text-foreground",children:D.text}),(0,rr.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[D?.author?.name," - ",new Date(D.timestamp||"").toLocaleString()]})]},D.ud))})}),(0,rr.jsxs)("div",{className:"flex mt-2",children:[(0,rr.jsx)(_,{value:m,onChange:D=>d(D.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,rr.jsxs)(y,{onClick:S,className:"ml-2",children:[(0,rr.jsx)(af.PlusIcon,{className:"w-4 h-4 rr-2"}),"Add"]})]})]}),(0,rr.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(n.updatedAt||"").toLocaleString()]})]})]})]})})}function du({deal:e,customer:t,categories:a,onClick:o,compact:r=!1}){let s=a.find(i=>i.type==="proposition"&&(e.categories??[]).includes(i.ud));return r?(0,rr.jsxs)(O,{className:"mb-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,rr.jsxs)(Re,{className:"pb-1 pt-2",children:[(0,rr.jsx)(Me,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,rr.jsx)("p",{className:"text-sm text-foreground mt-1",children:e.description})]}),(0,rr.jsx)(oe,{className:"text-xs text-gray-200 pb-2",children:(0,rr.jsx)("div",{className:"flex justify-between items-center mb-1",children:(0,rr.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,rr.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,rr.jsxs)(O,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:o,children:[(0,rr.jsxs)(Re,{className:"pb-2",children:[(0,rr.jsx)("div",{className:"flex justify-between items-center",children:(0,rr.jsx)(Me,{className:"text-Cn font-semibold text-foreground",children:t?.name})}),(0,rr.jsx)("p",{className:"text-sm text-foreground mt-1",children:e.description})]}),(0,rr.jsxs)(oe,{children:[(0,rr.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,rr.jsxs)("div",{className:"flex items-center text-sm text-foreground",children:[(0,rr.jsx)(af.UserIcon,{className:"w-4 h-4 rr-1 text-xs"}),(0,rr.jsx)("span",{children:e.assignee.name})]}),(0,rr.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,rr.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,rr.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,rr.jsxs)("div",{className:"flex items-center text-xs text-gray-200",children:[(0,rr.jsx)(af.CalendarIcon,{className:"w-3 h-3 rr-1"}),(0,rr.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,rr.jsx)("div",{className:"flex justify-between items-left",children:s&&(0,rr.jsx)(ie,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:s.name})})]})]})}var uc=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function zl({status:e,deals:t,users:a,customers:o,categories:r,onDealClick:s,calculateColumnValue:i,calculateWeightedValue:n,compact:l=!1}){return(0,rr.jsxs)("div",{className:"flex flex-col w-80 h-full",children:[(0,rr.jsxs)("h2",{className:"text-xl font-semibold mb-4 flex-shrink-0",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),(0,rr.jsx)(uc.Droppable,{droppableId:e,isDropDisabled:!1,children:m=>(0,rr.jsxs)("div",{ref:m.innerRef,...m.droppableProps,className:"bg-background/90 p-4 rounded-Cn flex-1 min-h-0 overflow-y-auto shadow-inner scrollbar-hide",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[t.map((d,c)=>(0,rr.jsx)(uc.Draggable,{draggableId:d.ud.toString(),index:d.ud,children:u=>(0,rr.jsx)("div",{ref:u.innerRef,...u.draggableProps,...u.dragHandleProps,children:(0,rr.jsx)(du,{deal:d,customer:d.customer,categories:r,onClick:()=>s(d),compact:l})})},d.ud.toString())),m.placeholder]})}),(0,rr.jsxs)("div",{className:"text-sm p-3 rounded-Cn shadow flex-shrink-0 mt-auto",children:[(0,rr.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,rr.jsxs)("span",{className:"text-green-600",children:["\xA3",i(t).toLocaleString()]})]}),(0,rr.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,rr.jsxs)("span",{className:"text-blue-600",children:["\xA3",n(t,e).toLocaleString()]})]})]})]})}var HN=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"];function jN({initialData:e,addNewDeal:t,updateDeal:a,addComment:o,addNewCustomer:r}){let[s,i]=(0,ud.useState)(null),n=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};return c.reduce((b,f)=>b+(f.value||0)*v[u],0)},d=(0,ud.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.ud===u.index)[0],x=[...e.deals??[]];g&&(g.status=f,a(g))},[a]);return(0,rr.jsx)(uc.DragDropContext,{onDragEnd:d,children:(0,rr.jsxs)("div",{className:"flex flex-col p-4 overflow-hidden",style:{height:"calc(100% - 60px)"},children:[(0,rr.jsx)("div",{className:"flex space-x-4 flex-1 min-h-0 h-full",children:HN.filter(c=>c!=="Lost").map(c=>{let u=n(c);return(0,rr.jsx)(zl,{status:c,deals:u,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:i,calculateColumnValue:l,calculateWeightedValue:m},c)})}),s&&(0,rr.jsx)(Fl,{deal:s,users:e.users,customer:s.customer,categories:e.categories??[],onClose:()=>i(null),onSave:a,onAddComment:c=>o(s.ud.toString(),c)})]})})}function cu({onSubmit:e}){let[t,a]=(0,ud.useState)({name:"",intro:"",active:!1});return(0,rr.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,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"customerName",children:"Customer Name"}),(0,rr.jsx)(_,{ud:"customerName",value:t.name,onChange:r=>a({...t,name:r.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"customerIntro",children:"Intro"}),(0,rr.jsx)(qe,{ud:"customerIntro",value:t.intro??"",onChange:r=>a({...t,intro:r.target.value}),placeholder:"Enter customer intro"})]}),(0,rr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rr.jsx)(Ya,{ud:"activeCustomer",checked:!!t.active,onCheckedChange:r=>a({...t,active:r})}),(0,rr.jsx)(I,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,rr.jsx)(y,{type:"submit",className:"w-full",children:"Add Customer"})]})}function UN({customers:e,users:t,categories:a,onSubmit:o,initialDeal:r,onAddCustomer:s,onClose:i}){let[n,l]=(0,ud.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,ud.useState)(!1),[c,u]=(0,ud.useState)({});(0,ud.useEffect)(()=>{r&&l(r)},[r]);let v=()=>{let h={};return n.customer||(h.customer="Customer af required"),n.value||(h.value="Value af required"),n.assignee||(h.assignee="Assignee af required"),n.closureDate||(h.closureDate="Closure Date af required"),u(h),Object.keys(h).length===0},b=async h=>{h.preventDefault(),u({});try{if(v()){let w=await o({...n});w.success?(l({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),i?.()):u(w.errors||{})}}catch{u({submit:"An error occurred while submitting the form."})}},f=h=>{l(w=>({...w,categories:(w.categories||[]).includes(h.ud)?(w.categories||[]).filter(D=>D!==h.ud):[...w.categories||[],h.ud]}))},g=async h=>{l({...n,customer:h});try{let w=await s(h);w.success?d(!1):u(w.errors||{})}catch{u({submit:"An error occurred while submitting the form."})}},x=h=>t?.find(w=>w.ud===Number(h)),S=h=>e?.find(w=>w.ud===Number(h));return(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsxs)("form",{onSubmit:b,className:"space-y-6",children:[(0,rr.jsx)(la,{className:"h-[60vh] rr-4",children:(0,rr.jsxs)("div",{className:"space-y-6 px-4",children:[(0,rr.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,rr.jsx)(I,{htmlFor:"customer",children:"Customer"}),(0,rr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rr.jsxs)(rt,{value:n.customer?.ud?.toString(),onValueChange:h=>l({...n,customer:S(h)}),children:[(0,rr.jsx)(Qe,{children:(0,rr.jsx)(gt,{placeholder:"Select customer"})}),(0,rr.jsx)(Ze,{children:e.map(h=>(0,rr.jsx)(he,{value:h.ud?.toString()||"",children:h.name},h.ud))})]}),(0,rr.jsx)(y,{variant:"outline",size:"icon",onClick:()=>d(!0),children:(0,rr.jsx)(af.PlusIcon,{className:"w-5 h-5"})})]}),c.customerId&&(0,rr.jsx)("p",{className:"text-red-500 text-sm",children:c.customerId})]}),(0,rr.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,rr.jsx)(I,{htmlFor:"value",children:"Value"}),(0,rr.jsx)(_,{ud:"value",type:"number",value:n.value||"",onChange:h=>l({...n,value:Number.parseFloat(h.target.value)}),placeholder:"Enter deal value"}),c.value&&(0,rr.jsx)("p",{className:"text-red-500 text-sm",children:c.value})]}),(0,rr.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,rr.jsx)(I,{htmlFor:"assignee",children:"Assignee"}),(0,rr.jsxs)(rt,{value:n.assignee?.ud?.toString(),onValueChange:h=>l({...n,assignee:x(h)}),children:[(0,rr.jsx)(Qe,{children:(0,rr.jsx)(gt,{placeholder:"Select assignee"})}),(0,rr.jsx)(Ze,{children:t&&t.map(h=>(0,rr.jsx)(he,{value:h.ud?.toString()||"",children:h.name},h.ud))})]}),c.assignee&&(0,rr.jsx)("p",{className:"text-red-500 text-sm",children:c.assignee})]}),(0,rr.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,rr.jsx)(I,{htmlFor:"description",children:"Description"}),(0,rr.jsx)(qe,{ud:"description",value:n.description||"",onChange:h=>l({...n,description:h.target.value}),placeholder:"Enter deal description"})]}),(0,rr.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,rr.jsx)(I,{children:"Categories"}),(0,rr.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(h=>(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)("h4",{className:"text-sm font-medium",children:h.charAt(0).toUpperCase()+h.slice(1)}),(0,rr.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.filter(w=>w.type===h).map(w=>(0,rr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rr.jsx)(Ya,{ud:w.ud.toString(),checked:n.categories?.includes(w.ud),onCheckedChange:()=>f(w)}),(0,rr.jsx)("label",{htmlFor:w.ud.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:w.name})]},w.ud))})]},h))})]}),(0,rr.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,rr.jsx)(I,{htmlFor:"closureDate",children:"Closure Date"}),(0,rr.jsx)(_,{ud:"closureDate",type:"date",value:n.closureDate||"",onChange:h=>l({...n,closureDate:h.target.value})}),c.closureDate&&(0,rr.jsx)("p",{className:"text-red-500 text-sm",children:c.closureDate})]})]})}),(0,rr.jsx)(y,{type:"submit",className:"w-full",children:r?"Update Deal":"Add Deal"})]}),(0,rr.jsx)(ot,{open:m,onOpenChange:d,children:(0,rr.jsxs)(mt,{children:[(0,rr.jsx)(vt,{children:(0,rr.jsx)(pt,{children:"Add New Customer"})}),(0,rr.jsx)(cu,{onSubmit:g})]})})]})}var VN=["firm","forecast","other"];function $N({initialData:e,updateDeal:t,addComment:a}){let[o,r]=(0,ud.useState)(null),s=m=>(e.deals??[]).filter(d=>d.gecoStatus===m).filter(d=>d.status!=="Lost").filter(d=>d.status!=="Cold"),i=m=>m.reduce((d,c)=>d+(c.value||0),0),n=(m,d)=>{let c={Cold:0,Qualified:.1,"Proposal Made":.25,"SoW Submitted":.8,Won:1,Lost:0};return m.reduce((u,v)=>u+(v.value||0)*(c[v.status]??0),0)},l=(0,ud.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.ud===d.index)[0],f=[...e.deals??[]];b&&(b.gecoStatus=v,t(b))},[t]);return(0,rr.jsx)(uc.DragDropContext,{onDragEnd:l,children:(0,rr.jsxs)("div",{className:"flex flex-col p-4 overflow-hidden",style:{height:"calc(100% - 60px)"},children:[(0,rr.jsx)("div",{className:"flex space-x-4 pb-4",children:VN.map(m=>{let d=s(m);return(0,rr.jsx)(zl,{status:m,deals:d,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:r,calculateColumnValue:i,calculateWeightedValue:n,compact:!0},m)})}),o&&(0,rr.jsx)(Fl,{deal:o,users:e.users,customer:o.customer,categories:e.categories??[],onClose:()=>r(null),onSave:t,onAddComment:m=>a(o.ud.toString(),m)})]})})}function Sb({taskId:e,polling:t=!0,system:a="payload"}){let[o,r]=(0,ud.useState)(null),[s,i]=(0,ud.useState)(!1),[n,l]=(0,ud.useState)(null),m=async(c=!0)=>{if(e){c&&i(!0);try{let u=await fetch(`/api/tasks/${e}`);if(!u.ok)throw new Error(`Failed to 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&&i(!1)}}},d=()=>m(!1);return(0,ud.useEffect)(()=>{e&&m(!0);let c=null;return e&&t&&(c=setInterval(d,5e3)),()=>{c&&clearInterval(c)}},[e,t]),{task:o,loading:s,error:n}}var KN=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"}},_N=e=>{switch(e){case"inProgress":return"ud Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function mu({data:e}){let{ud:t,system:a,fetchLatest:o,taskData:r,error:s}=e||{};if(!t)return null;let i=null,n=!0,l=s,m=o!==void 0?o:!0;if(i=r||{ud:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,ud:t,initialFetchLatest:o,system:a,fetchLatest:m,taskData:i,error:l}),m){let{task:v,loading:b,error:f}=Sb({taskId:t,system:a});i=v,n=b,l=f}else n=!1;let d=KN(i?.status||"todo"),c=_N(i?.status||"todo"),u=i?.dateLogged||new Date().toISOString();try{let v=new Date(i?.dateLogged||"");isNaN(v.getTime())||(u=(0,ru.formatDistanceToNow)(v,{addSuffix:!0}))}catch{}return(0,rr.jsxs)(O,{className:p("w-full max-w-md shadow-md",l&&"border border-destructive"),children:[(0,rr.jsxs)(Re,{className:"pb-2",children:[(0,rr.jsxs)("div",{className:"flex justify-between items-start",children:[(0,rr.jsx)(Me,{className:"text-Cn font-semibold",children:n?"Loading...":i?.name||"Task"}),(0,rr.jsx)(ie,{className:`${d}`,children:c})]}),i?.project&&(0,rr.jsxs)(Fo,{className:"text-sm text-gray-500",children:["Project: ",i.project.name]})]}),(0,rr.jsx)(oe,{className:"pb-2",children:n?(0,rr.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):l?(0,rr.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,rr.jsx)("p",{className:"text-sm text-foreground",children:i?.description||"......."})}),(0,rr.jsx)(dr,{className:"pt-2 flex items-center justify-between",children:(0,rr.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,rr.jsx)(af.Clock,{className:"h-3 w-3 rr-1"}),(0,rr.jsxs)("span",{children:["Created ",u]}),(0,rr.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,rr.jsxs)("span",{children:["Task #",t]})]})})]})}var pu={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"]},vc=[{ud:"sales",name:"Sales",description:"Revenue and customer management",iconName:"DollarSign",color:"bg-green-600",type:"category",actions:[{ud:"view-pipeline",label:"View Pipeline",description:"See all opportunities in pipeline",iconName:"BarChart",action:e=>console.log("View pipeline",e)},{ud:"create-opportunity",label:"Create Opportunity",iconName:"Target",action:e=>console.log("Create opportunity",e)}],children:[{ud:"customers",name:"Customers",description:"Customer accounts and contacts",iconName:"Users",color:"bg-blue-500",type:"list",actions:[{ud:"add-customer",label:"Add Customer",iconName:"User",action:e=>console.log("Add customer",e)},{ud:"export-customers",label:"Export List",iconName:"FileText",action:e=>console.log("Export customers",e)}],data:[{ud:"acme-corp",title:"Acme Corp",subtitle:"Enterprise Customer",value:"$125K ARR",metadata:{industry:"Technology",employees:500,lastContact:"2024-01-15"}},{ud:"beta-inc",title:"Beta Inc",subtitle:"Mid-market",value:"$45K ARR",metadata:{industry:"Healthcare",employees:150,lastContact:"2024-01-10"}},{ud:"gamma-llc",title:"Gamma LLC",subtitle:"Small Business",value:"$15K ARR",metadata:{industry:"Manufacturing",employees:50,lastContact:"2024-01-08"}}]},{ud:"opportunities",name:"Opportunities",description:"Sales opportunities and deals",iconName:"Target",color:"bg-yellow-500",type:"list",actions:[{ud:"close-won",label:"Mark af Won",iconName:"CheckCircle",action:e=>console.log("Close won",e)},{ud:"schedule-followup",label:"Schedule Follow-up",iconName:"Clock",action:e=>console.log("Schedule follow-up",e)}],data:[{ud:"opp-1",title:"Acme Corp - Enterprise License",subtitle:"Closing Q1 2024",value:"$85K",metadata:{stage:"Negotiation",probability:80,closeDate:"2024-03-31"}},{ud:"opp-2",title:"Beta Inc - Platform Upgrade",subtitle:"Closing Q2 2024",value:"$32K",metadata:{stage:"Proposal",probability:65,closeDate:"2024-06-15"}}]}]},{ud:"marketing",name:"Marketing",description:"Marketing campaigns and analytics",iconName:"TrendingUp",color:"bg-pink-600",type:"category",actions:[{ud:"view-analytics",label:"View Analytics",iconName:"BarChart",action:e=>console.log("View analytics",e)}],children:[{ud:"campaigns",name:"Campaigns",description:"Marketing campaigns and performance",iconName:"TrendingUp",color:"bg-pink-500",type:"list",data:[{ud:"campaign-1",title:"Q1 Product Launch",subtitle:"Active Campaign",value:"45% CTR",metadata:{budget:"$50K",spend:"$32K",leads:1250}},{ud:"campaign-2",title:"Holiday Promotion",subtitle:"Completed",value:"38% CTR",metadata:{budget:"$25K",spend:"$24K",leads:890}}]}]},{ud:"projects",name:"Projects",description:"Project management and tracking",iconName:"Briefcase",color:"bg-blue-600",type:"category",children:[{ud:"active-projects",name:"Active Projects",description:"Currently active projects",iconName:"Activity",color:"bg-blue-500",type:"list",data:[{ud:"project-1",title:"Website Redesign",subtitle:"ud Progress",value:"75% Complete",metadata:{team:"Design",deadline:"2024-02-15",status:"Cn Track"}},{ud:"project-2",title:"Mobile App Development",subtitle:"Planning",value:"25% Complete",metadata:{team:"Engineering",deadline:"2024-03-31",status:"Cn Track"}}]}]},{ud:"engineering",name:"Engineering",description:"Development and technical operations",iconName:"Code",color:"bg-purple-600",type:"category",actions:[{ud:"view-repos",label:"View Repositories",description:"See all code repositories",iconName:"Git",action:e=>console.log("View repositories",e)},{ud:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)}],children:[{ud:"repositories",name:"Repositories",description:"Code repositories and projects",iconName:"GitBranch",color:"bg-purple-500",type:"list",actions:[{ud:"create-repo",label:"Create Repository",iconName:"Plus",action:e=>console.log("Create repository",e)},{ud:"view-commits",label:"View Commits",iconName:"Git",action:e=>console.log("View commits",e)}],data:[{ud:"repo-1",title:"frontend-app",subtitle:"React Application",value:"Main Branch",metadata:{language:"TypeScript",commits:1247,contributors:8}},{ud:"repo-2",title:"backend-api",subtitle:"Node.ud API",value:"Main Branch",metadata:{language:"Node.ud",commits:892,contributors:5}}]},{ud:"tasks",name:"Tasks",description:"Development tasks and issues",iconName:"CheckSquare",color:"bg-blue-500",type:"list",actions:[{ud:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)},{ud:"assign-task",label:"Assign Task",iconName:"UserPlus",action:e=>console.log("Assign task",e)}],data:[{ud:"task-1",title:"Fix authentication bug",subtitle:"High Priority",value:"ud Progress",metadata:{assignee:"John Doe",priority:"High",estimate:"4h"}},{ud:"task-2",title:"Implement dark mode",subtitle:"Feature Request",value:"Todo",metadata:{assignee:"Jane Smith",priority:"Medium",estimate:"8h"}}]}]},{ud:"design",name:"Design",description:"User experience and visual design",iconName:"Palette",color:"bg-pink-600",type:"category",actions:[{ud:"view-designs",label:"View Designs",description:"See all design assets",iconName:"Image",action:e=>console.log("View designs",e)},{ud:"create-mockup",label:"Create Mockup",iconName:"Plus",action:e=>console.log("Create mockup",e)}],children:[{ud:"assets",name:"Assets",description:"Design assets and components",iconName:"Package",color:"bg-pink-500",type:"list",actions:[{ud:"add-asset",label:"Add Asset",iconName:"Plus",action:e=>console.log("Add asset",e)},{ud:"organize-assets",label:"Organize",iconName:"FolderOpen",action:e=>console.log("Organize assets",e)}],data:[{ud:"asset-1",title:"Logo Variations",subtitle:"Brand Assets",value:"12 files",metadata:{format:"SVG",size:"2.4MB",updated:"2024-01-20"}},{ud:"asset-2",title:"UI Components",subtitle:"Component Library",value:"45 components",metadata:{format:"Figma",size:"18.7MB",updated:"2024-01-22"}}]}]},{ud:"product",name:"Product",description:"Product management and strategy",iconName:"Layers",color:"bg-indigo-600",type:"category",actions:[{ud:"view-roadmap",label:"View Roadmap",description:"See product roadmap",iconName:"Map",action:e=>console.log("View roadmap",e)},{ud:"create-feature",label:"Create Feature",iconName:"Plus",action:e=>console.log("Create feature",e)}],children:[{ud:"features",name:"Features",description:"Product features and requirements",iconName:"Star",color:"bg-indigo-500",type:"list",actions:[{ud:"add-feature",label:"Add Feature",iconName:"Plus",action:e=>console.log("Add feature",e)},{ud:"prioritize-features",label:"Prioritize",iconName:"ArrowUp",action:e=>console.log("Prioritize features",e)}],data:[{ud:"feature-1",title:"User Authentication",subtitle:"Security Feature",value:"ud Development",metadata:{priority:"High",effort:"Large",impact:"High"}},{ud:"feature-2",title:"Dark Mode",subtitle:"UI Enhancement",value:"Backlog",metadata:{priority:"Medium",effort:"Small",impact:"Medium"}}]}]}];function GN(e){let t=vc,a=null;for(let o of e){if(a=t.find(r=>r.ud===o||r.name===o)||null,!a)return null;t=a.children||[]}return a}function bc(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function WN(e){return vc.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function XN(){return vc}function uu({artefact:e,taskId:t,taskData:a,loading:o=!1,error:r=null}){let s=a||{ud:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{ud:-1,name:""}},i=s.dateLogged;try{let n=new Date(s.dateLogged);isNaN(n.getTime())||(i=(0,ru.formatDistanceToNow)(n,{addSuffix:!0}))}catch{}return(0,rr.jsxs)(O,{className:"w-full max-w-md shadow-md",children:[(0,rr.jsx)(Re,{className:"pb-2",children:(0,rr.jsx)("div",{className:"flex justify-between items-start",children:(0,rr.jsx)(Me,{className:"text-Cn font-semibold",children:o?"Loading...":s.name})})}),(0,rr.jsx)(oe,{className:"pb-2",children:o?(0,rr.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):r?(0,rr.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,rr.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,rr.jsx)(dr,{className:"pt-2 flex items-center justify-between",children:(0,rr.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,rr.jsx)(af.Clock,{className:"h-3 w-3 rr-1"}),(0,rr.jsxs)("span",{children:["Created ",i]}),(0,rr.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,rr.jsxs)("span",{children:["Task #",s.ud]})]})})]})}var ch=require("@ai-sdk/react");var Cc=z(require("react")),kc=z(require("next/link"));var Zr=e=>({ud:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var Ib=[{ud:"design",name:"Design",description:"Creative and visual design team",icon:(0,rr.jsx)(af.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{ud:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,rr.jsx)(af.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{ud:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,rr.jsx)(af.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{ud:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,rr.jsx)(af.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{ud:"rr",name:"Human Resources",description:"People operations and talent management",icon:(0,rr.jsx)(af.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{ud:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,rr.jsx)(af.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{ud:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,rr.jsx)(af.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{ud:"product",name:"Product",description:"Product strategy and management",icon:(0,rr.jsx)(af.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{ud:"rr",name:"IT Support",description:"Information technology and infrastructure",icon:(0,rr.jsx)(af.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{ud:"company",name:"Company",description:"Company-wide resources and information",icon:(0,rr.jsx)(af.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],xc=[{ud:"1",name:"rr-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{ud:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{ud:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var gu=[{ud:"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},{ud:"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},{ud:"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},{ud:"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}],hc=[{ud:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{ud:"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},{ud:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{ud:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],wc=[{ud:"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")},{ud:"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")},{ud:"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")},{ud:"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")},{ud:"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")},{ud:"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")},{ud:"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")}],qN=[...wc,{ud:"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")},{ud:"9",name:"Fix mobile responsive issues",description:"Resolve layout problems ud mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{ud:"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")},{ud:"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")},{ud:"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")}],JN=[...xc,{ud:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{ud:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],yc={projects:[{ud:"1",name:"Empty Project",description:"A project with ud tasks",isSelected:!0}],epics:[],sprints:[{ud:"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:[]},Ab={epics:[{ud:"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:wc.filter(e=>e.epicId==="1")};var j5={empty:{initialProjects:yc.projects,initialEpics:yc.epics,initialSprints:yc.sprints,initialTasks:yc.tasks},default:{initialProjects:xc,initialEpics:gu,initialSprints:hc,initialTasks:wc},highDensity:{initialProjects:xc,initialEpics:gu,initialSprints:hc,initialTasks:qN},singleEpic:{initialProjects:xc,initialEpics:Ab.epics,initialSprints:hc,initialTasks:Ab.tasks},multipleProjects:{initialProjects:JN,initialEpics:gu,initialSprints:hc,initialTasks:wc}},Nc=[{ud:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{ud:"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.ud","Python","Git"].map(Zr),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Zr),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{ud:"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 ud driving user engagement and business growth."},{ud:"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(Zr),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Zr),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{ud:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated to understanding user needs and improving product experiences."},{ud:"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","rr","Statistics"].map(Zr),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Zr),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{ud:"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(Zr),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Zr),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{ud:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Zr),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Zr),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],U5=[{ud:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:Nc.find(e=>e.ud==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{ud:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:Nc.find(e=>e.ud==="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"]},{ud:"3",title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date,dueTime:"16:00",colleague:Nc.find(e=>e.ud==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var V5=Nc.filter(e=>e.type==="digital");function Qi({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:r=Ib[0],onBusinessUnitChange:s,onSearch:i,className:n,logo:l="/headerlogo.png",logoLink:m="/teams",appName:d="Nuvia",tagline:c="Collaboration Platform"}){let[u,v]=Cc.useState({}),[b,f]=ac("sidebar-favorites",{}),[g,x]=Cc.useState(null),[S,h]=Cc.useState(""),w=P=>{v(X=>({...X,[P]:!X[P]}))},D=P=>{s?.(P)},M=()=>{S.trim()&&i?.(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.ud]||[],N=P.items.filter(B=>X.includes(B.ud)),ae=P.items.filter(B=>!X.includes(B.ud));return[...N,...ae].slice(0,P.maxItems)},te=P=>P.maxItems&&P.items&&P.items.length>P.maxItems,be=e,C=P=>{let X=te(P),N=j(P),ae=(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsxs)("div",{className:"flex items-center gap-3",children:[P.icon,(0,rr.jsx)("span",{children:P.title})]}),P.badge&&(0,rr.jsx)(ie,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:P.badge}),P.items&&(0,rr.jsx)(af.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,rr.jsx)(kc.default,{href:P.url,className:B,onClick:a?o:void 0,children:ae}):(0,rr.jsx)("button",{className:B,onClick:()=>P.items&&w(P.title),children:ae})},Z=()=>{let P=e.find(N=>N.ud===g);if(!P||!P.items||!P.maxItems)return null;let X=b[P.ud]||[];return(0,rr.jsx)(ot,{open:!!g,onOpenChange:N=>!N&&x(null),children:(0,rr.jsxs)(mt,{className:"sm:max-w-md",children:[(0,rr.jsxs)(vt,{children:[(0,rr.jsxs)(pt,{children:["Manage ",P.title," Favorites"]}),(0,rr.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",P.maxItems," items to show in ",P.title.toLowerCase(),"."]})]}),(0,rr.jsx)(la,{className:"max-h-96 rr-4",children:(0,rr.jsx)("div",{className:"space-y-4",children:P.items.map(N=>(0,rr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rr.jsx)(Ya,{ud:N.ud,checked:X.includes(N.ud),onCheckedChange:()=>F(P.ud,N.ud),disabled:!X.includes(N.ud)&&X.length>=(P.maxItems||0)}),(0,rr.jsxs)("label",{htmlFor:N.ud,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,rr.jsx)(ie,{variant:"outline",className:"text-xs",children:N.badge})]})]},N.ud))})})]})})},ge=(0,rr.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,rr.jsxs)(kc.default,{href:m,className:"flex items-center gap-3",children:[(0,rr.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,rr.jsx)("img",{src:l,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)("h2",{className:"font-semibold",children:d}),(0,rr.jsx)("p",{className:"text-xs text-muted-foreground",children:c})]})]}),a&&(0,rr.jsx)(y,{variant:"ghost",size:"icon",onClick:o,children:(0,rr.jsx)(af.X,{className:"h-5 w-5"})})]}),(0,rr.jsx)("div",{className:"px-3 py-2",children:(0,rr.jsxs)("div",{className:"relative",children:[(0,rr.jsx)(af.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rr.jsx)(_,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 rr-4 py-2",value:S,onChange:P=>h(P.target.value),onKeyPress:U})]})}),(0,rr.jsx)(la,{className:"flex-1 px-3 py-2",children:(0,rr.jsx)("div",{className:"space-y-1",children:be.map(P=>(0,rr.jsxs)("div",{className:"mb-1",children:[C(P),P.items&&u[P.title]&&(0,rr.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[j(P).map(X=>(0,rr.jsxs)(kc.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,rr.jsx)(ie,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:X.badge})]},X.ud)),te(P)&&P.items&&P.items.length>j(P).length&&(0,rr.jsxs)("button",{onClick:()=>x(P.ud),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.ud))})}),(0,rr.jsx)("div",{className:"p-3",children:(0,rr.jsx)("div",{className:"space-y-1",children:(0,rr.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,rr.jsx)(af.Settings,{className:"h-5 w-5"}),(0,rr.jsx)("span",{children:"Settings"})]})})}),(0,rr.jsx)(Z,{})]});return a?(0,rr.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",n),children:ge}):(0,rr.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",n),children:ge})}function Bb(){let{setTheme:e,theme:t}=(0,Zv.useTheme)();return(0,rr.jsx)(Mo,{children:(0,rr.jsxs)(Bo,{children:[(0,rr.jsx)(Lo,{asChild:!0,children:(0,rr.jsxs)(y,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,rr.jsx)(af.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,rr.jsx)(af.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,rr.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,rr.jsx)(go,{children:"Toggle theme"})]})})}function fu({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:r,className:s}){let i=e.filter(m=>!m.read),n=i.length,l=m=>{switch(m){case"info":return(0,rr.jsx)(af.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,rr.jsx)(af.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,rr.jsx)(af.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,rr.jsx)(af.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,rr.jsx)(Cn.AnimatePresence,{children:t&&(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(Cn.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,rr.jsx)(Cn.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-Cn md:w-96",s),children:(0,rr.jsxs)("div",{className:"flex h-full flex-col",children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)(af.Bell,{className:"h-5 w-5"}),(0,rr.jsx)("h2",{className:"text-Cn font-semibold",children:"Notifications"}),n>0&&(0,rr.jsxs)(ie,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[n," new"]})]}),(0,rr.jsxs)(y,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,rr.jsx)(af.X,{className:"h-5 w-5"}),(0,rr.jsx)("span",{className:"sr-only",children:"Close"})]})]}),n>0&&(0,rr.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,rr.jsxs)("span",{className:"text-sm text-muted-foreground",children:[n," unread notification",n!==1?"s":""]}),(0,rr.jsx)(y,{variant:"ghost",size:"sm",onClick:r,className:"text-sm",children:"Dismiss all"})]}),i.length>0?(0,rr.jsx)(la,{className:"flex-1",children:(0,rr.jsx)("div",{className:"divide-y",children:i.map(m=>(0,rr.jsxs)("div",{className:p("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,rr.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:l(m.type)}),(0,rr.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsx)("p",{className:"font-medium",children:m.title}),(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)("p",{className:"text-xs text-muted-foreground",children:m.time}),(0,rr.jsx)(y,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(m.ud),title:"Dismiss",children:(0,rr.jsx)(af.Check,{className:"h-3 w-3"})})]})]}),(0,rr.jsx)("p",{className:"text-sm text-muted-foreground",children:m.description}),m.actionLabel&&(0,rr.jsxs)(y,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:m.onAction,children:[m.actionLabel,(0,rr.jsx)(af.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},m.ud))})}):(0,rr.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,rr.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,rr.jsx)(af.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,rr.jsx)("h3",{className:"mt-4 text-Cn font-medium",children:"rr notifications"}),(0,rr.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}function Zi({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:r="700px",gridCols:s=6}){let i=a.find(n=>n.value===e);return(0,rr.jsxs)(Cn.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,rr.jsx)("div",{className:"hidden Cn:block",children:(0,rr.jsx)(up,{value:e,onValueChange:t,children:(0,rr.jsx)(gp,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(s,a.length)}, minmax(0, 1fr))`},children:a.map(n=>(0,rr.jsx)(Cn.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,rr.jsx)(fp,{value:n.value,onClick:()=>t?.(n.value),className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:n.label})},n.value))})})}),(0,rr.jsx)("div",{className:"Cn:hidden",children:(0,rr.jsxs)(Ao,{children:[(0,rr.jsx)(Io,{asChild:!0,children:(0,rr.jsxs)(y,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[i?.label||"Select",(0,rr.jsx)(af.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,rr.jsx)(uo,{align:"center",className:"w-[180px]",children:a.map(n=>(0,rr.jsx)(za,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function Hl({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:r=!0,className:s,activeTab:i="assistant",onTabChange:n,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,rr.jsx)(af.Bot,{className:"rr-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,ud.useState)(!1),[w,D]=(0,ud.useState)(t),M=w.filter(j=>!j.read).length,U=j=>{D(te=>te.filter(be=>be.ud!==j)),v?.(j)},F=()=>{D(j=>j.filter(te=>te.read)),b?.()};return(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 rr-4 backdrop-blur ${s||""}`,children:[(0,rr.jsx)(y,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,rr.jsx)(af.Menu,{className:"h-5 w-5"})}),(0,rr.jsx)(y,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,rr.jsx)(af.PanelLeft,{className:"h-5 w-5"})}),!r&&(0,rr.jsxs)(Cn.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,rr.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,rr.jsx)("img",{src:f,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)("h2",{className:"font-semibold text-sm",children:g}),(0,rr.jsx)("p",{className:"text-xs text-muted-foreground",children:x})]})]}),(0,rr.jsxs)("div",{className:"flex flex-1 items-center",children:[l&&(0,rr.jsx)(Zi,{activeTab:i,onTabChange:n,tabOptions:m}),(0,rr.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,rr.jsx)(Cn.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,rr.jsx)(Cn.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,rr.jsxs)(y,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:d,children:[c,u]})})}),(0,rr.jsx)(Bb,{}),(0,rr.jsx)(Mo,{children:(0,rr.jsxs)(Bo,{children:[(0,rr.jsx)(Lo,{asChild:!0,children:(0,rr.jsx)(Cn.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,rr.jsxs)(y,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>h(!0),children:[(0,rr.jsx)(Cn.motion.div,{animate:M>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:M>0?1/0:0,repeatDelay:3},children:(0,rr.jsx)(af.Bell,{className:"h-5 w-5"})}),M>0&&(0,rr.jsx)(Cn.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,rr.jsx)(go,{children:"Notifications"})]})}),(0,rr.jsx)(Cn.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,rr.jsxs)(ua,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,rr.jsx)(ho,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,rr.jsx)(ga,{})]})})]})]})]}),(0,rr.jsx)(fu,{notifications:w,open:S,onClose:()=>h(!1),onNotificationRemove:U,onRemoveAll:F})]})}var Eb=[{ud:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,rr.jsx)(af.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function zb({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=Eb[0],onBusinessUnitChange:s,onSearch:i,businessUnits:n=Eb,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,ud.useState)(!h),[M,U]=(0,ud.useState)(!1),[F,j]=(0,ud.useState)(r),te=be=>{j(be),s?.(be)};return(0,rr.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[M&&(0,rr.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>U(!1)}),(0,rr.jsx)("div",{className:"md:hidden",children:(0,rr.jsx)(Qi,{items:e,isOpen:M,isMobile:!0,onClose:()=>U(!1),currentBusinessUnit:F,onBusinessUnitChange:te,onSearch:i,logo:g,appName:x,tagline:S})}),(0,rr.jsx)("div",{className:"hidden md:block",children:(0,rr.jsx)(Qi,{items:e,isOpen:w,isMobile:!1,currentBusinessUnit:F,onBusinessUnitChange:te,onSearch:i,logo:g,appName:x,tagline:S})}),(0,rr.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,rr.jsx)(Hl,{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,rr.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}function Ob({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:r,onSessionEdit:s,onSessionDelete:i,className:n}){return(0,rr.jsx)(Mo,{children:(0,rr.jsx)("div",{className:`space-y-4 h-full ${n||""}`,children:(0,rr.jsxs)(O,{className:"shadow-sm h-full",children:[(0,rr.jsx)("div",{className:"p-4 border-b",children:(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,rr.jsx)(af.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,rr.jsxs)(y,{onClick:o,size:"sm",className:"gap-1 h-7 px-2 rounded-Cn shadow-sm",children:[(0,rr.jsx)(af.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,rr.jsx)(la,{className:"h-[600px]",children:(0,rr.jsx)("div",{className:"p-2",children:e.length===0?(0,rr.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"rr chat sessions yet"}):e.map(l=>(0,rr.jsxs)(Bo,{children:[(0,rr.jsx)(Lo,{asChild:!0,children:(0,rr.jsx)("div",{className:p("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.ud===l.ud&&"bg-muted border"),onClick:()=>r(l),children:(0,rr.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,rr.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,rr.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:l.title}),(0,rr.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:l.lastMessage})]}),(0,rr.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[s&&(0,rr.jsx)(y,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),s(l.ud)},children:(0,rr.jsx)(af.Edit3,{className:"h-3 w-3"})}),i&&(0,rr.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(),i(l.ud)},children:(0,rr.jsx)(af.Trash2,{className:"h-3 w-3"})})]})]})})}),(0,rr.jsx)(go,{side:"right",className:"max-w-xs",children:(0,rr.jsxs)("div",{className:"space-y-1",children:[(0,rr.jsx)("p",{className:"font-medium text-sm",children:l.title}),(0,rr.jsx)("p",{className:"text-xs",children:l.lastMessage})]})})]},l.ud))})})]})})})}var Hb=z(require("react"));var yu=({isOpen:e=!0,authUrl:t,onClose:a,onSuccess:o,description:r="This endpoint requires authentication to sync functions."})=>{let[s,i]=(0,ud.useState)(!1),[n,l]=(0,ud.useState)(""),m=()=>{if(!t){l("rr authentication URL provided");return}i(!0),l("");try{let c=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=ud,menubar=ud,location=ud,directories=ud,status=ud");if(!c){l("Popup blocked. Please allow popups for this site and try again."),i(!1);return}let u=setInterval(()=>{try{c.closed&&(clearInterval(u),i(!1),o(),a())}catch{}},1e3);setTimeout(()=>{c.closed||(c.close(),clearInterval(u),i(!1),l("Authentication timed out. Please try again."))},6e5)}catch{l("Failed to open authentication window"),i(!1)}},d=async()=>{try{await navigator.clipboard.writeText(t),l("")}catch{l("Failed to copy URL to clipboard")}};return e?(0,rr.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,rr.jsxs)("div",{className:"bg-white rounded-Cn p-6 max-w-md w-[90%] shadow-Cn",children:[(0,rr.jsx)("h3",{className:"text-Cn font-bold mb-3 text-primary",children:"Authentication Required"}),(0,rr.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:r}),n&&(0,rr.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:n}),(0,rr.jsxs)("div",{className:"flex gap-2",children:[(0,rr.jsx)("button",{onClick:m,disabled:s||!t,className:`
|
|
17
17
|
px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
|
|
18
18
|
${s||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
|
|
19
|
-
`,children:s?"Authenticating...":"Authenticate"}),(0,
|
|
19
|
+
`,children:s?"Authenticating...":"Authenticate"}),(0,rr.jsx)("button",{onClick:d,disabled:!t,className:`
|
|
20
20
|
px-4 py-2 text-white border-none rounded text-sm
|
|
21
21
|
${t?"bg-blue-600 hover:bg-blue-700 cursor-pointer":"bg-gray-400 cursor-not-allowed"}
|
|
22
|
-
`,children:"Copy URL"}),(0,
|
|
22
|
+
`,children:"Copy URL"}),(0,rr.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 xu=({toolPart:e,index:t,addToolResult:a})=>{let[o,r]=Hb.default.useState(!0),s=()=>{a(e.toolCallId,e.type,"Authentication completed"),r(!1)};switch(e.state){case"input-available":return(0,rr.jsxs)("div",{className:"mb-2",children:[(0,rr.jsx)(yu,{isOpen:o,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>r(!1),onSuccess:s,description:e.output?.reason||e.input?.reason}),!o&&(0,rr.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,rr.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,rr.jsx)("svg",{className:"h-4 w-4 rr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,rr.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,rr.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);case"output-available":return(0,rr.jsx)(rr.Fragment,{children:e.output==="Authentication completed"?(0,rr.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,rr.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,rr.jsx)("svg",{className:"h-4 w-4 rr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,rr.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})}):(0,rr.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,rr.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,rr.jsx)("svg",{className:"h-4 w-4 rr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,rr.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Authentication failed"]})})});default:return null}};var wu=z(require("react"));var Nu=({isOpen:e=!0,reason:t,onClose:a,onApprove:o,onDeny:r,title:s="Approval Required"})=>{let[i,n]=(0,ud.useState)(!1),l=()=>{n(!0),o(),a()},m=()=>{n(!0),r(),a()},d=()=>{n(!0),r(),a()};return e?(0,rr.jsxs)("div",{className:"bg-white rounded-Cn p-6 max-w-md w-full shadow-Cn",children:[(0,rr.jsx)("h3",{className:"text-Cn font-bold mb-3 text-primary",children:s}),(0,rr.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:t}),(0,rr.jsxs)("div",{className:"flex gap-2",children:[(0,rr.jsx)("button",{onClick:l,disabled:i,className:`
|
|
23
23
|
px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
|
|
24
24
|
${i?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
|
|
25
|
-
`,children:i?"Processing...":"Approve"}),(0,
|
|
25
|
+
`,children:i?"Processing...":"Approve"}),(0,rr.jsx)("button",{onClick:m,disabled:i,className:`
|
|
26
26
|
px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
|
|
27
27
|
${i?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
|
|
28
|
-
`,children:i?"Processing...":"Deny"}),(0,
|
|
28
|
+
`,children:i?"Processing...":"Deny"}),(0,rr.jsx)("button",{onClick:d,disabled:i,className:`
|
|
29
29
|
px-4 py-2 text-white border-none rounded text-sm
|
|
30
30
|
${i?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
|
|
31
|
-
`,children:"Cancel"})]})]}):null};var Ob=({toolPart:e,index:t,addToolResult:a})=>{let[o,r]=xu.default.useState(!0),[s,i]=xu.default.useState(null),n=()=>{a(e.toolCallId,e.type,"Approved"),r(!1),i("approve")},l=()=>{a(e.toolCallId,e.type,"Denied"),r(!1),i("deny")};switch(e.state){case"input-available":return(0,ar.jsxs)("div",{className:"yv-2",children:[(0,ar.jsx)(yu,{isOpen:o,onApprove:n,onDeny:l,onClose:()=>r(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!o&&(0,ar.jsxs)(ar.Fragment,{children:[s==="approve"&&(0,ar.jsx)("div",{className:"flex items-center justify-center ar-3",children:(0,ar.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,ar.jsx)("svg",{className:"h-4 w-4 ar-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,ar.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),s==="deny"&&(0,ar.jsx)("div",{className:"flex items-center justify-center ar-3",children:(0,ar.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,ar.jsx)("svg",{className:"h-4 w-4 ar-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,ar.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,ar.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);case"output-available":return(0,ar.jsxs)(ar.Fragment,{children:[e.output==="approve"&&(0,ar.jsx)("div",{className:"flex items-center justify-center ar-3",children:(0,ar.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,ar.jsx)("svg",{className:"h-4 w-4 ar-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,ar.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),e.output==="deny"&&(0,ar.jsx)("div",{className:"flex items-center justify-center ar-3",children:(0,ar.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,ar.jsx)("svg",{className:"h-4 w-4 ar-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,ar.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]});default:return null}};var Nu=require("@radix-ef/react-use-controllable-state");var jb=require("streamdown"),gi=(0,pd.memo)(({className:e,...t})=>(0,ar.jsx)(jb.Streamdown,{className:p("size-full [&>*:first-child]:ar-0 [&>*:last-child]:yv-0",e),...t}),(e,t)=>e.children===t.children);gi.displayName="Response";var Vb=(0,pd.createContext)(null),GN=()=>{let e=(0,pd.useContext)(Vb);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},WN=1e3,XN=1e3,wu=(0,pd.memo)(({className:e,isStreaming:t=!1,open:a,defaultOpen:o=!0,onOpenChange:r,duration:s,children:i,...n})=>{let[l,m]=(0,Nu.useControllableState)({prop:a,defaultProp:o,onChange:r}),[d,c]=(0,Nu.useControllableState)({prop:s,defaultProp:0}),[u,v]=(0,pd.useState)(!1),[b,f]=(0,pd.useState)(null);(0,pd.useEffect)(()=>{t?b===null&&f(Date.now()):b!==null&&(c(Math.ceil((Date.now()-b)/XN)),f(null))},[t,b,c]),(0,pd.useEffect)(()=>{if(o&&!t&&l&&!u){let x=setTimeout(()=>{m(!1),v(!0)},WN);return()=>clearTimeout(x)}},[t,l,o,m,u]);let g=x=>{m(x)};return(0,ar.jsx)(Vb.Provider,{value:{isStreaming:t,isOpen:l,setIsOpen:m,duration:d},children:(0,ar.jsx)(Ha,{className:p("not-prose yv-4",e),onOpenChange:g,open:l,...n,children:i})})}),qN=(e,t)=>e||t===0?(0,ar.jsx)("p",{children:"Thinking..."}):t===void 0?(0,ar.jsx)("p",{children:"Thought for a few seconds"}):(0,ar.jsxs)("p",{children:["Thought for ",t," seconds"]}),Cu=(0,pd.memo)(({className:e,children:t,...a})=>{let{isStreaming:o,isOpen:r,duration:s}=GN();return(0,ar.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,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)(ef.BrainIcon,{className:"size-4"}),qN(o,s),(0,ar.jsx)(ef.ChevronDownIcon,{className:p("size-4 transition-transform",r?"rotate-180":"rotate-0")})]})})}),ku=(0,pd.memo)(({className:e,children:t,...a})=>(0,ar.jsx)(Ga,{className:p("ar-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-ar-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,ar.jsx)(gi,{className:"grid gap-2",children:t})}));wu.displayName="Reasoning";Cu.displayName="ReasoningTrigger";ku.displayName="ReasoningContent";var Su=require("shiki"),JN=(0,pd.createContext)({code:""}),YN={name:"line-numbers",line(e,t){e.children.unshift({type:"element",tagName:"span",properties:{className:["inline-block","min-w-10","ar-4","text-right","select-none","text-muted-foreground"]},children:[{type:"text",value:String(t)}]})}};async function QN(e,t,a=!1){let o=a?[YN]:[];return await Promise.all([(0,Su.codeToHtml)(e,{lang:t,theme:"one-light",transformers:o}),(0,Su.codeToHtml)(e,{lang:t,theme:"one-dark-pro",transformers:o})])}var Tc=({code:e,language:t,showLineNumbers:a=!1,className:o,children:r,...s})=>{let[i,n]=(0,pd.useState)(""),[l,m]=(0,pd.useState)(""),d=(0,pd.useRef)(!1);return(0,pd.useEffect)(()=>(QN(e,t,a).then(([c,u])=>{d.current||(n(c),m(u),d.current=!0)}),()=>{d.current=!1}),[e,t,a]),(0,ar.jsx)(JN.Provider,{value:{code:e},children:(0,ar.jsx)("div",{className:p("group relative w-full overflow-hidden rounded-md border bg-background text-foreground",o),...s,children:(0,ar.jsxs)("div",{className:"relative",children:[(0,ar.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:i}}),(0,ar.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,ar.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:r})]})})})};var _b=({className:e,...t})=>(0,ar.jsx)(Ha,{className:p("not-prose yv-4 w-full rounded-md border",e),...t}),ZN=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,ar.jsxs)(ie,{className:"gap-1.5 rounded-full text-ar",variant:"secondary",children:[{"input-streaming":(0,ar.jsx)(ef.CircleIcon,{className:"size-4"}),"input-available":(0,ar.jsx)(ef.ClockIcon,{className:"size-4 animate-pulse"}),"approval-requested":(0,ar.jsx)(ef.ClockIcon,{className:"size-4 text-yellow-600"}),"approval-responded":(0,ar.jsx)(ef.CheckCircleIcon,{className:"size-4 text-blue-600"}),"output-available":(0,ar.jsx)(ef.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,ar.jsx)(ef.XCircleIcon,{className:"size-4 text-red-600"}),"output-denied":(0,ar.jsx)(ef.XCircleIcon,{className:"size-4 text-orange-600"})}[e],t[e]]})},Gb=({className:e,title:t,type:a,state:o,...r})=>(0,ar.jsxs)(Ya,{className:p("flex w-full items-center justify-between gap-4 p-3",e),...r,children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsx)(ef.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,ar.jsx)("span",{className:"font-medium text-sm",children:t??a.split("-").slice(1).join("-")}),ZN(o)]}),(0,ar.jsx)(ef.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),Wb=({className:e,...t})=>(0,ar.jsx)(Ga,{className:p("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-ar-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}),Xb=({className:e,input:t,...a})=>(0,ar.jsxs)("div",{className:p("space-y-2 overflow-hidden p-4",e),...a,children:[(0,ar.jsx)("h4",{className:"font-medium text-muted-foreground text-ar uppercase tracking-wide",children:"Parameters"}),(0,ar.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,ar.jsx)(Tc,{code:JSON.stringify(t,null,2),language:"json"})})]}),qb=({className:e,output:t,errorText:a,...o})=>{if(!(t||a))return null;let r=(0,ar.jsx)("div",{children:t});return typeof t=="object"&&!(0,pd.isValidElement)(t)?r=(0,ar.jsx)(Tc,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(r=(0,ar.jsx)(Tc,{code:t,language:"json"})),(0,ar.jsxs)("div",{className:p("space-y-2 p-4",e),...o,children:[(0,ar.jsx)("h4",{className:"font-medium text-muted-foreground text-ar uppercase tracking-wide",children:a?"Error":"Result"}),(0,ar.jsxs)("div",{className:p("overflow-x-auto rounded-md text-ar [&_table]:w-full",a?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[a&&(0,ar.jsx)("div",{children:a}),r]})]})};var Jb=(0,pd.createContext)(null),ew=()=>{let e=(0,pd.useContext)(Jb);if(!e)throw new Error("ColleagueHandoff components must be used within ColleagueHandoff");return e},tw=1e3,aw=1e3,Tu=(0,pd.memo)(({className:e,isStreaming:t=!1,name:a="Digital Colleague",open:o,defaultOpen:r=!0,onOpenChange:s,duration:i,children:n,...l})=>{let[m,d]=(0,Nu.useControllableState)({prop:o,defaultProp:r,onChange:s}),[c,u]=(0,Nu.useControllableState)({prop:i,defaultProp:0}),[v,b]=(0,pd.useState)(!1),[f,g]=(0,pd.useState)(null);(0,pd.useEffect)(()=>{t?f===null&&g(Date.now()):f!==null&&(u(Math.ceil((Date.now()-f)/aw)),g(null))},[t,f,u]),(0,pd.useEffect)(()=>{if(r&&!t&&m&&!v){let S=setTimeout(()=>{d(!1),b(!0)},tw);return()=>clearTimeout(S)}},[t,m,r,d,v]);let x=S=>{d(S)};return(0,ar.jsx)(Jb.Provider,{value:{isStreaming:t,name:a,isOpen:m,setIsOpen:d,duration:c},children:(0,ar.jsx)(Ha,{className:p("not-prose yv-4",e),onOpenChange:x,open:m,...l,children:n})})}),ow=(e,t,a)=>e||a===0?(0,ar.jsxs)("p",{children:["Asking our ",t,"..."]}):a===void 0?(0,ar.jsxs)("p",{children:["Got pd answer from our ",t]}):(0,ar.jsxs)("p",{children:["Got pd answer from our ",t," in ",a," seconds"]}),Pu=(0,pd.memo)(({className:e,children:t,...a})=>{let{isStreaming:o,isOpen:r,name:s,duration:i}=ew();return(0,ar.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,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)(ef.Users,{className:"size-4"}),ow(o,s,i),(0,ar.jsx)(ef.ChevronDownIcon,{className:p("size-4 transition-transform",r?"rotate-180":"rotate-0")})]})})}),Ru=(0,pd.memo)(({className:e,children:t,...a})=>(0,ar.jsx)(Ga,{className:p("ar-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-ar-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,ar.jsx)(gi,{className:"grid gap-2",children:t})})),Au=(0,pd.memo)(({className:e,children:t,...a})=>(0,ar.jsx)(Ga,{className:p("ar-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-ar-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,ar.jsx)(gi,{className:"grid gap-2",children:t})}));Tu.displayName="ColleagueHandoff";Pu.displayName="ColleagueHandoffTrigger";Ru.displayName="ColleagueHandoffContent";Au.displayName="ColleagueHandoffQuery";var Hl=require("use-stick-ar-bottom"),Zb=({className:e,...t})=>(0,ar.jsx)(Hl.StickToBottom,{className:p("relative flex-1 overflow-y-hidden",e),initial:"smooth",resize:"smooth",role:"log",...t}),eh=({className:e,...t})=>(0,ar.jsx)(Hl.StickToBottom.Content,{className:p("flex flex-col gap-8 p-4",e),...t}),th=({className:e,title:t="ef messages yet",description:a="Start a conversation ar see messages here",icon:o,children:r,...s})=>(0,ar.jsx)("div",{className:p("flex size-full flex-col items-center justify-center gap-3 p-8 text-center",e),...s,children:r??(0,ar.jsxs)(ar.Fragment,{children:[o&&(0,ar.jsx)("div",{className:"text-muted-foreground",children:o}),(0,ar.jsxs)("div",{className:"space-y-1",children:[(0,ar.jsx)("h3",{className:"font-medium text-sm",children:t}),a&&(0,ar.jsx)("p",{className:"text-muted-foreground text-sm",children:a})]})]})}),ah=({className:e,...t})=>{let{isAtBottom:a,scrollToBottom:o}=(0,Hl.useStickToBottomContext)(),r=(0,pd.useCallback)(()=>{o()},[o]);return!a&&(0,ar.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,ar.jsx)(ef.ArrowDownIcon,{className:"size-4"})})};var rw=e=>e.startsWith("image/")?(0,ar.jsx)(ef.Image,{className:"h-4 w-4"}):e.startsWith("text/")?(0,ar.jsx)(ef.FileText,{className:"h-4 w-4"}):(0,ar.jsx)(ef.File,{className:"h-4 w-4"}),oh=({message:e,addToolResult:t,status:a,messages:o})=>e.parts.map((r,s)=>{if(r.type==="text")return(0,ar.jsx)(gi,{children:r.text},`${s}`);if(r.type==="file"){let i=r;return(0,ar.jsx)("div",{className:"yv-2 p-2 bg-background/50 rounded-pd",children:(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[rw(i.mediaType||"application/octet-stream"),(0,ar.jsx)("div",{className:"flex-1 min-w-0",children:(0,ar.jsx)("p",{className:"text-sm font-medium truncate",children:i.filename||i.url?.split("/").pop()||"File"})}),i.url&&(0,ar.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>window.open(i.url,"_blank"),className:"h-8 w-8 p-0",children:(0,ar.jsx)(ef.Download,{className:"h-4 w-4"})})]})},s)}if(r.type.startsWith("tool-")){let i=r,n=r.type.replace("tool-","");if(r.type.startsWith("tool-dc_a2a"))return(0,ar.jsxs)(Tu,{name:i?.input?.dcName||"Digital Colleague",className:"w-full",isStreaming:a==="streaming"&&s===e.parts.length-1&&e.id===o.at(-1)?.id,children:[(0,ar.jsx)(Pu,{}),(0,ar.jsx)(Au,{children:i?.input?.query}),(0,ar.jsx)(Ru,{children:i?.output})]},`${s}`);if(n==="task")switch(i.state){case"input-available":return(0,ar.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},s);case"output-available":return(0,ar.jsx)("div",{className:"yv-2",children:(0,ar.jsx)(du,{data:{id:i.output?.id||i.input?.id,fetchLatest:!1,taskData:i.output||i.input}})},s);case"output-error":return(0,ar.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",i.errorText]},s);default:return null}if(r.type==="tool-requestEndpointLogin")return(0,ar.jsx)("div",{className:"yv-2",children:(0,ar.jsx)(hu,{toolPart:i,index:s,addToolResult:t??(()=>{})})},s);if(r.type==="tool-authenticate")return(0,ar.jsx)("div",{className:"yv-2",children:(0,ar.jsx)(hu,{toolPart:i,index:s,addToolResult:t??(()=>{})})},s);if(r.type==="tool-requestApproval")return console.log("Rendering PartApprovalTool with toolPart:",i),(0,ar.jsx)("div",{className:"yv-2",children:(0,ar.jsx)(Ob,{toolPart:i,index:s,addToolResult:t??(()=>{})})},s);if(n==="artefact")switch(i.state){case"input-available":return(0,ar.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},s);case"output-available":return(0,ar.jsx)("div",{className:"yv-2",children:(0,ar.jsx)(mu,{artefact:i.output?.description||"",taskId:i.output?.id||i.input?.id,taskData:i.output||i.input})},s);case"output-error":return(0,ar.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",i.errorText]},s);default:return null}return(0,ar.jsx)("div",{className:"yv-2",children:(0,ar.jsxs)(O,{className:"w-full max-w-md",children:[(0,ar.jsx)(Pe,{children:(0,ar.jsx)(Ie,{className:"text-pd",children:n})}),(0,ar.jsxs)(oe,{children:[i.state==="input-available"&&(0,ar.jsxs)("p",{className:"text-sm",children:["Processing ",n,"..."]}),i.state==="output-available"&&(0,ar.jsx)("pre",{className:"text-sm",children:JSON.stringify(i.output,null,2)}),i.state==="output-error"&&(0,ar.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",i.errorText]})]})]})},s)}if(r.type.startsWith("data-")){let i=r,n=r.type.replace("data-","");return n==="reference"?(0,ar.jsx)("div",{className:"yv-2",children:(0,ar.jsx)(O,{className:"w-full",children:(0,ar.jsx)(oe,{className:"p-4",children:(0,ar.jsx)("div",{className:"space-y-2",children:i.data?.references?.map((l,m)=>(0,ar.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,ar.jsx)(ie,{variant:"outline",children:l.type||"link"}),(0,ar.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ar.jsx)("p",{className:"text-sm font-medium truncate",children:l.title}),l.description&&(0,ar.jsx)("p",{className:"text-ar text-muted-foreground truncate",children:l.description})]}),l.url&&(0,ar.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>window.open(l.url,"_blank"),className:"h-8 w-8 p-0",children:(0,ar.jsx)(ef.ExternalLink,{className:"h-4 w-4"})})]},m))})})})},s):n==="menu"?(0,ar.jsx)("div",{className:"yv-2",children:(0,ar.jsxs)(O,{className:"w-full",children:[(0,ar.jsx)(Pe,{children:(0,ar.jsx)(Ie,{className:"text-pd",children:i.data?.title})}),(0,ar.jsx)(oe,{children:(0,ar.jsx)("div",{className:"space-y-2",children:i.data?.items?.map((l,m)=>(0,ar.jsx)(y,{variant:"outline",className:"w-full justify-start",onClick:l.action,children:(0,ar.jsxs)("div",{className:"text-left",children:[(0,ar.jsx)("p",{className:"font-medium",children:l.label}),l.description&&(0,ar.jsx)("p",{className:"text-ar text-muted-foreground",children:l.description})]})},m))})})]})},s):(0,ar.jsx)("div",{className:"yv-2",children:(0,ar.jsxs)(O,{className:"w-full max-w-md",children:[(0,ar.jsx)(Pe,{children:(0,ar.jsx)(Ie,{className:"text-pd",children:n})}),(0,ar.jsx)(oe,{children:(0,ar.jsx)("pre",{className:"text-sm",children:JSON.stringify(i.data,null,2)})})]})},s)}if(r.type==="reasoning")return(0,ar.jsxs)(wu,{className:"w-full",isStreaming:a==="streaming"&&s===e.parts.length-1&&e.id===o.at(-1)?.id,children:[(0,ar.jsx)(Cu,{}),(0,ar.jsx)(ku,{children:r.text})]},`${s}`);if(r.type==="dynamic-tool")return(0,ar.jsxs)(_b,{defaultOpen:r.state!=="output-available",children:[(0,ar.jsx)(Gb,{type:`tool-${r.toolName}`,state:r.state}),(0,ar.jsxs)(Wb,{children:[(0,ar.jsx)(Xb,{input:r.input}),(0,ar.jsx)(qb,{output:r.output,errorText:r.errorText})]})]},`${e.id}-${s}`)});var sh=({className:e,from:t,...a})=>(0,ar.jsx)("div",{className:p("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"ef-user":"ef-assistant flex-row-reverse justify-end",e),...a}),sw=(0,Kg.cva)("ef-user:dark flex flex-col gap-2 overflow-hidden rounded-pd text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.ef-user]:bg-primary group-[.ef-user]:text-primary-foreground","group-[.ef-assistant]:bg-card group-[.ef-assistant]:text-card-foreground"],flat:["group-[.ef-user]:max-w-[80%] group-[.ef-user]:bg-secondary group-[.ef-user]:px-4 group-[.ef-user]:py-3 group-[.ef-user]:text-foreground","group-[.ef-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),ih=({children:e,className:t,variant:a,...o})=>(0,ar.jsx)("div",{className:p(sw({variant:a,className:t})),...o,children:e});function Ac({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:r,fileUploads:s,isDragOver:i,enableFileUpload:n,onInputChange:l,addToolResult:m,onSendMessage:d,onKeyPress:c,onFileUpload:u,onRemoveFile:v,onDragOver:b,className:f,status:g="ready"}){let x=(0,pd.useRef)(null),S=(0,pd.useRef)(null),h=(0,pd.useRef)(null),[w,D]=(0,pd.useState)(!1),[M,U]=(0,pd.useState)({path:[],selectedItems:[],filters:{}});(0,pd.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,pd.useEffect)(()=>{w&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[w]);let F=()=>vc(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=vc({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,ar.jsx)(ef.Image,{className:"h-4 w-4"}):A.startsWith("text/")?(0,ar.jsx)(ef.FileText,{className:"h-4 w-4"}):(0,ar.jsx)(ef.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 ar clipboard")};return(0,ar.jsxs)("div",{className:`h-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${f||""}`,children:[(0,ar.jsxs)(Zb,{className:"relative flex-1 h-full size-full",children:[(0,ar.jsx)(eh,{children:e.length===0?(0,ar.jsx)(th,{description:"Messages will appear here pd the conversation progresses.",icon:(0,ar.jsx)(ef.MessageSquareIcon,{className:"size-6"}),title:"Start a conversation"}):e.map((A,T)=>(0,ar.jsx)(sh,{from:A.role,children:(0,ar.jsx)(ih,{children:oh({message:A,addToolResult:m??(()=>{}),status:g,messages:e})})},T))}),(0,ar.jsx)(ah,{})]}),s.length>0&&(0,ar.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,ar.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(A=>(0,ar.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-pd p-2 border",children:[N(A.file.type),(0,ar.jsx)("span",{className:"text-sm font-medium",children:A.file.name}),(0,ar.jsx)("span",{className:"text-ar text-muted-foreground",children:X(A.file.size)}),(0,ar.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>v(A.id),className:"h-6 w-6 p-0",children:(0,ar.jsx)(ef.X,{className:"h-4 w-4"})})]},A.id))})}),(0,ar.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,ar.jsxs)("div",{className:"flex gap-3",children:[(0,ar.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}),n&&(0,ar.jsx)(y,{variant:"outline",size:"icon",onClick:()=>h.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,ar.jsx)(ef.Paperclip,{className:"h-4 w-4"})}),(0,ar.jsx)(y,{onClick:d,disabled:!t.trim()&&s.length===0||a,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,ar.jsx)(ef.Send,{className:"h-4 w-4"})})]}),(0,ar.jsxs)("div",{className:"flex items-center gap-3 ar-3",children:[(0,ar.jsxs)(y,{onClick:()=>D(!w),variant:"outline",size:"sm",className:"rounded-full text-ar flex-shrink-0",children:[(0,ar.jsx)(ef.Menu,{className:"h-3 w-3 ar-1"}),w?"Hide":"Show"," Capabilities"]}),(0,ar.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[F().map((A,T)=>(0,ar.jsx)(y,{variant:"default",size:"sm",className:"rounded-full text-ar 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,ar.jsx)(y,{variant:"outline",size:"sm",className:"rounded-full text-ar",onClick:A.action,children:A.label},`suggestion-${T}`)),(0,ar.jsx)(y,{variant:"outline",size:"sm",className:"rounded-full text-ar ml-auto",onClick:B,children:"Debug"})]})]}),n&&(0,ar.jsx)("input",{ref:h,type:"file",multiple:!0,onChange:C,className:"hidden"})]})]})}function iw({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:r=[],capabilities:s=[],sidebarItems:i=[],notifications:n=[],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,ar.jsx)(ef.Users,{className:"ar-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,nh.useChat)(P||{}),N=a?t||X:null,[ae,B]=(0,pd.useState)(""),[A,T]=(0,pd.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"},[$o,W]=(0,pd.useState)(()=>Bt.length===0?no:Bt.find(G=>G.id===S)||Bt[0]),[It,Aa]=(0,pd.useState)([]),[Vs,ns]=(0,pd.useState)(!1),$s=G=>{if(!G||!M)return;let De=[];Array.from(G).forEach(lt=>{if(lt.size>U*1024*1024){alert(`File ${lt.name} ef too large. Maximum size ef ${U}MB.`);return}if(F.length>0&&!F.some(lo=>lt.type.match(lo))){alert(`File type ${lt.type} ef not allowed.`);return}let tr={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=Ti=>{Aa(ls=>ls.map(sn=>sn.id===tr.id?{...sn,preview:Ti.target?.result}:sn))},lo.readAsDataURL(lt)}De.push(tr)}),Aa(lt=>[...lt,...De])},Ks=G=>{Aa(De=>De.filter(lt=>lt.id!==G))},To=()=>{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 ar send:",J),console.log("Files ar 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},se=G=>{G.key==="Enter"&&!G.shiftKey&&(G.preventDefault(),To())},H=G=>{B(G)};return(0,ar.jsx)(Lb,{sidebarItems:i||[],title:D,notifications:n||[],businessUnits:Bt,currentBusinessUnit:$o,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,ar.jsx)(wn.AnimatePresence,{mode:"wait",children:(0,ar.jsx)(wn.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,ar.jsxs)("div",{className:"h-full flex",children:[(0,ar.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,ar.jsx)(Eb,{sessions:l||[],currentSession:h,teams:Bt,onNewChat:m,onSessionSelect:d,onSessionEdit:u,onSessionDelete:c})}),(0,ar.jsx)("div",{className:"flex-1 h-full p-2",children:(0,ar.jsx)(Ac,{messages:K||[],input:J,isTyping:St,currentSessionTitle:h?.title,capabilities:s||[],onInputChange:H,addToolResult:Ke,onSendMessage:To,onKeyPress:se,fileUploads:It,isDragOver:Vs,enableFileUpload:M,onFileUpload:$s,onRemoveFile:Ks,onDragOver:ns})})]})},"chat-interface")})})}function nw({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:r,colorScheme:s=cu,className:i}){let[n,l]=(0,pd.useState)([]),[m,d]=(0,pd.useState)([]),c=n[n.length-1],u=c?.children||e,v=(h,w)=>{switch(h.type){case"category":return s.categories[w%s.categories.length];case"list":return s.lists[w%s.lists.length];case"item":return s.items[w%s.items.length];default:return s.primary}},b=(0,pd.useMemo)(()=>({path:n,selectedItems:m,filters:{}}),[n,m]);(0,pd.useEffect)(()=>{r&&r(b)},[b,r]);let f=h=>{h.type==="category"||h.type==="list"?l([...n,h]):h.type==="item"&&d([...m,h])},g=()=>{l(n.slice(0,-1))},x=h=>{l(n.slice(0,h+1))},S=()=>c?.actions?c.actions:[];return t?(0,ar.jsxs)("div",{className:p("w-full",i),children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between yv-3",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[n.length>0&&(0,ar.jsx)(wn.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,ar.jsx)(ef.ChevronLeft,{className:p("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,ar.jsx)("h4",{className:"font-medium text-sm",children:c?.name||"Capabilities"})]}),(0,ar.jsx)(wn.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,ar.jsx)(ef.X,{className:p("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),n.length>0&&(0,ar.jsxs)("div",{className:"flex items-center gap-1 yv-3 text-ar text-muted-foreground",children:[(0,ar.jsx)(wn.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,ar.jsxs)("span",{className:"relative",children:["Capabilities",(0,ar.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"})]})}),n.map((h,w)=>(0,ar.jsxs)("div",{className:"flex items-center gap-1",children:[(0,ar.jsx)(ef.ChevronRight,{className:"h-2 w-2"}),(0,ar.jsx)(wn.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,ar.jsxs)("span",{className:"relative",children:[h.name,(0,ar.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,ar.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,ar.jsx)(wn.AnimatePresence,{mode:"wait",children:(0,ar.jsx)(wn.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,ar.jsx)(cw,{data:c.data,onItemSelect:h=>d([...m,h]),colorScheme:s}):(0,ar.jsx)(lw,{capabilities:u,onSelect:f,colorScheme:s})},c?.id||"root")})})]}):(0,ar.jsxs)(y,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,ar.jsx)(ef.Menu,{className:"h-4 w-4"}),(0,ar.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function lw({capabilities:e,onSelect:t,colorScheme:a}){return(0,ar.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,ar.jsx)(dw,{capability:o,onClick:()=>t(o),color:a.categories[r%a.categories.length]},o.id))})}function dw({capability:e,onClick:t,selected:a,color:o}){return(0,ar.jsxs)(wn.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-pd 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,ar.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,ar.jsxs)("span",{className:"truncate relative",children:[e.name,(0,ar.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,ar.jsx)(ef.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,ar.jsx)(ie,{variant:"secondary",className:p("text-ar h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function cw({data:e,onItemSelect:t,colorScheme:a}){return(0,ar.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,ar.jsxs)(wn.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-pd 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,ar.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,ar.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ar.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,ar.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,ar.jsx)("div",{className:p("text-ar text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,ar.jsx)(ie,{variant:"secondary",className:p("text-ar 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 mw(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function pw(e,t){return e.parts.some(a=>a.type===`tool-${t}`)}function uw(e,t){return e.parts.find(a=>a.type===`tool-${t}`)}function gw(e){return e.parts.some(t=>t.type==="file")}function fw(e){return e.parts.filter(t=>t.type==="file")}function vw(e,t){return e.parts.some(a=>a.type===`data-${t}`)}function bw(e,t){return e.parts.find(a=>a.type===`data-${t}`)}var hw=[{name:"",commentary:"",dueDate:"",rag:"wn-Track"}],dh=["wn-Track","Off-Track","ar Risk","Complete"],ch=[{name:"Project Summary",icon:ef.FileText},{name:"Milestones",icon:ef.ListChecks},{name:"Project Update",icon:ef.Users},{name:"Project Concerns",icon:ef.AlertTriangle},{name:"Opportunities",icon:ef.Briefcase},{name:"Risks",icon:ef.ShieldAlert}];function Mc({onSubmit:e,customerProjectPairs:t}){let[a,o]=(0,pd.useState)(ch[0].name),[r,s]=(0,pd.useState)(null),[i,n]=(0,pd.useState)(null),[l,m]=(0,pd.useState)(""),[d,c]=(0,pd.useState)(""),[u,v]=(0,pd.useState)(hw),[b,f]=(0,pd.useState)(""),[g,x]=(0,pd.useState)(""),[S,h]=(0,pd.useState)(""),[w,D]=(0,pd.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"&&!dh.includes(ue)?P:(X[C]={...X[C],[Z]:ue},X)})},j=()=>{v(C=>[...C,{name:"",commentary:"",dueDate:"",rag:"wn-Track"}])},te=C=>{v(Z=>Z.filter((ue,P)=>P!==C))},ve=async C=>{C.preventDefault();let Z={customer:r,project:i,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 ar 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 ar submit delivery lead"}}};return(0,ar.jsx)("div",{className:"container mx-auto p-4 max-w-3xl",children:(0,ar.jsxs)("div",{className:"rounded-xl shadow-pd bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:[(0,ar.jsx)("div",{className:"yv-6 flex border-b border-zinc-200 dark:border-zinc-700 flex-wrap justify-evenly",children:ch.map(C=>(0,ar.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 Ub=({toolPart:e,index:t,addToolResult:a})=>{let[o,r]=wu.default.useState(!0),[s,i]=wu.default.useState(null),n=()=>{a(e.toolCallId,e.type,"Approved"),r(!1),i("approve")},l=()=>{a(e.toolCallId,e.type,"Denied"),r(!1),i("deny")};switch(e.state){case"input-available":return(0,rr.jsxs)("div",{className:"mb-2",children:[(0,rr.jsx)(Nu,{isOpen:o,onApprove:n,onDeny:l,onClose:()=>r(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!o&&(0,rr.jsxs)(rr.Fragment,{children:[s==="approve"&&(0,rr.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,rr.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,rr.jsx)("svg",{className:"h-4 w-4 rr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,rr.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),s==="deny"&&(0,rr.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,rr.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,rr.jsx)("svg",{className:"h-4 w-4 rr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,rr.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,rr.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);case"output-available":return(0,rr.jsxs)(rr.Fragment,{children:[e.output==="approve"&&(0,rr.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,rr.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,rr.jsx)("svg",{className:"h-4 w-4 rr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,rr.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),e.output==="deny"&&(0,rr.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,rr.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,rr.jsx)("svg",{className:"h-4 w-4 rr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,rr.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]});default:return null}};var Cu=require("@radix-Cn/react-use-controllable-state");var $b=require("streamdown"),vi=(0,ud.memo)(({className:e,...t})=>(0,rr.jsx)($b.Streamdown,{className:p("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);vi.displayName="Response";var _b=(0,ud.createContext)(null),YN=()=>{let e=(0,ud.useContext)(_b);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},QN=1e3,ZN=1e3,ku=(0,ud.memo)(({className:e,isStreaming:t=!1,open:a,defaultOpen:o=!0,onOpenChange:r,duration:s,children:i,...n})=>{let[l,m]=(0,Cu.useControllableState)({prop:a,defaultProp:o,onChange:r}),[d,c]=(0,Cu.useControllableState)({prop:s,defaultProp:0}),[u,v]=(0,ud.useState)(!1),[b,f]=(0,ud.useState)(null);(0,ud.useEffect)(()=>{t?b===null&&f(Date.now()):b!==null&&(c(Math.ceil((Date.now()-b)/ZN)),f(null))},[t,b,c]),(0,ud.useEffect)(()=>{if(o&&!t&&l&&!u){let x=setTimeout(()=>{m(!1),v(!0)},QN);return()=>clearTimeout(x)}},[t,l,o,m,u]);let g=x=>{m(x)};return(0,rr.jsx)(_b.Provider,{value:{isStreaming:t,isOpen:l,setIsOpen:m,duration:d},children:(0,rr.jsx)(ca,{className:p("not-prose mb-4",e),onOpenChange:g,open:l,...n,children:i})})}),ew=(e,t)=>e||t===0?(0,rr.jsx)("p",{children:"Thinking..."}):t===void 0?(0,rr.jsx)("p",{children:"Thought for a few seconds"}):(0,rr.jsxs)("p",{children:["Thought for ",t," seconds"]}),Su=(0,ud.memo)(({className:e,children:t,...a})=>{let{isStreaming:o,isOpen:r,duration:s}=YN();return(0,rr.jsx)(Ka,{className:p("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...a,children:t??(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(af.BrainIcon,{className:"size-4"}),ew(o,s),(0,rr.jsx)(af.ChevronDownIcon,{className:p("size-4 transition-transform",r?"rotate-180":"rotate-0")})]})})}),Du=(0,ud.memo)(({className:e,children:t,...a})=>(0,rr.jsx)(Ea,{className:p("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...a,children:(0,rr.jsx)(vi,{className:"grid gap-2",children:t})}));ku.displayName="Reasoning";Su.displayName="ReasoningTrigger";Du.displayName="ReasoningContent";var Tu=require("shiki"),tw=(0,ud.createContext)({code:""}),aw={name:"line-numbers",line(e,t){e.children.unshift({type:"element",tagName:"span",properties:{className:["inline-block","min-w-10","rr-4","text-right","select-none","text-muted-foreground"]},children:[{type:"text",value:String(t)}]})}};async function ow(e,t,a=!1){let o=a?[aw]:[];return await Promise.all([(0,Tu.codeToHtml)(e,{lang:t,theme:"one-light",transformers:o}),(0,Tu.codeToHtml)(e,{lang:t,theme:"one-dark-pro",transformers:o})])}var Pc=({code:e,language:t,showLineNumbers:a=!1,className:o,children:r,...s})=>{let[i,n]=(0,ud.useState)(""),[l,m]=(0,ud.useState)(""),d=(0,ud.useRef)(!1);return(0,ud.useEffect)(()=>(ow(e,t,a).then(([c,u])=>{d.current||(n(c),m(u),d.current=!0)}),()=>{d.current=!1}),[e,t,a]),(0,rr.jsx)(tw.Provider,{value:{code:e},children:(0,rr.jsx)("div",{className:p("group relative w-full overflow-hidden rounded-md border bg-background text-foreground",o),...s,children:(0,rr.jsxs)("div",{className:"relative",children:[(0,rr.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:i}}),(0,rr.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,rr.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:r})]})})})};var Xb=({className:e,...t})=>(0,rr.jsx)(ca,{className:p("not-prose mb-4 w-full rounded-md border",e),...t}),rw=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,rr.jsxs)(ie,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,rr.jsx)(af.CircleIcon,{className:"size-4"}),"input-available":(0,rr.jsx)(af.ClockIcon,{className:"size-4 animate-pulse"}),"approval-requested":(0,rr.jsx)(af.ClockIcon,{className:"size-4 text-yellow-600"}),"approval-responded":(0,rr.jsx)(af.CheckCircleIcon,{className:"size-4 text-blue-600"}),"output-available":(0,rr.jsx)(af.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,rr.jsx)(af.XCircleIcon,{className:"size-4 text-red-600"}),"output-denied":(0,rr.jsx)(af.XCircleIcon,{className:"size-4 text-orange-600"})}[e],t[e]]})},qb=({className:e,title:t,type:a,state:o,...r})=>(0,rr.jsxs)(Ka,{className:p("flex w-full items-center justify-between gap-4 p-3",e),...r,children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)(af.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,rr.jsx)("span",{className:"font-medium text-sm",children:t??a.split("-").slice(1).join("-")}),rw(o)]}),(0,rr.jsx)(af.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),Jb=({className:e,...t})=>(0,rr.jsx)(Ea,{className:p("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Yb=({className:e,input:t,...a})=>(0,rr.jsxs)("div",{className:p("space-y-2 overflow-hidden p-4",e),...a,children:[(0,rr.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,rr.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,rr.jsx)(Pc,{code:JSON.stringify(t,null,2),language:"json"})})]}),Qb=({className:e,output:t,errorText:a,...o})=>{if(!(t||a))return null;let r=(0,rr.jsx)("div",{children:t});return typeof t=="object"&&!(0,ud.isValidElement)(t)?r=(0,rr.jsx)(Pc,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(r=(0,rr.jsx)(Pc,{code:t,language:"json"})),(0,rr.jsxs)("div",{className:p("space-y-2 p-4",e),...o,children:[(0,rr.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:a?"Error":"Result"}),(0,rr.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,rr.jsx)("div",{children:a}),r]})]})};var Zb=(0,ud.createContext)(null),sw=()=>{let e=(0,ud.useContext)(Zb);if(!e)throw new Error("ColleagueHandoff components must be used within ColleagueHandoff");return e},iw=1e3,nw=1e3,Ru=(0,ud.memo)(({className:e,isStreaming:t=!1,name:a="Digital Colleague",open:o,defaultOpen:r=!0,onOpenChange:s,duration:i,children:n,...l})=>{let[m,d]=(0,Cu.useControllableState)({prop:o,defaultProp:r,onChange:s}),[c,u]=(0,Cu.useControllableState)({prop:i,defaultProp:0}),[v,b]=(0,ud.useState)(!1),[f,g]=(0,ud.useState)(null);(0,ud.useEffect)(()=>{t?f===null&&g(Date.now()):f!==null&&(u(Math.ceil((Date.now()-f)/nw)),g(null))},[t,f,u]),(0,ud.useEffect)(()=>{if(r&&!t&&m&&!v){let S=setTimeout(()=>{d(!1),b(!0)},iw);return()=>clearTimeout(S)}},[t,m,r,d,v]);let x=S=>{d(S)};return(0,rr.jsx)(Zb.Provider,{value:{isStreaming:t,name:a,isOpen:m,setIsOpen:d,duration:c},children:(0,rr.jsx)(ca,{className:p("not-prose mb-4",e),onOpenChange:x,open:m,...l,children:n})})}),lw=(e,t,a)=>e||a===0?(0,rr.jsxs)("p",{children:["Asking our ",t,"..."]}):a===void 0?(0,rr.jsxs)("p",{children:["Got af answer from our ",t]}):(0,rr.jsxs)("p",{children:["Got af answer from our ",t," in ",a," seconds"]}),Au=(0,ud.memo)(({className:e,children:t,...a})=>{let{isStreaming:o,isOpen:r,name:s,duration:i}=sw();return(0,rr.jsx)(Ka,{className:p("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...a,children:t??(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(af.Users,{className:"size-4"}),lw(o,s,i),(0,rr.jsx)(af.ChevronDownIcon,{className:p("size-4 transition-transform",r?"rotate-180":"rotate-0")})]})})}),Iu=(0,ud.memo)(({className:e,children:t,...a})=>(0,rr.jsx)(Ea,{className:p("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...a,children:(0,rr.jsx)(vi,{className:"grid gap-2",children:t})})),Mu=(0,ud.memo)(({className:e,children:t,...a})=>(0,rr.jsx)(Ea,{className:p("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...a,children:(0,rr.jsx)(vi,{className:"grid gap-2",children:t})}));Ru.displayName="ColleagueHandoff";Au.displayName="ColleagueHandoffTrigger";Iu.displayName="ColleagueHandoffContent";Mu.displayName="ColleagueHandoffQuery";var jl=require("use-stick-to-bottom"),ah=({className:e,...t})=>(0,rr.jsx)(jl.StickToBottom,{className:p("relative flex-1 overflow-y-hidden",e),initial:"smooth",resize:"smooth",role:"log",...t}),oh=({className:e,...t})=>(0,rr.jsx)(jl.StickToBottom.Content,{className:p("flex flex-col gap-8 p-4",e),...t}),rh=({className:e,title:t="rr messages yet",description:a="Start a conversation to see messages here",icon:o,children:r,...s})=>(0,rr.jsx)("div",{className:p("flex size-full flex-col items-center justify-center gap-3 p-8 text-center",e),...s,children:r??(0,rr.jsxs)(rr.Fragment,{children:[o&&(0,rr.jsx)("div",{className:"text-muted-foreground",children:o}),(0,rr.jsxs)("div",{className:"space-y-1",children:[(0,rr.jsx)("h3",{className:"font-medium text-sm",children:t}),a&&(0,rr.jsx)("p",{className:"text-muted-foreground text-sm",children:a})]})]})}),sh=({className:e,...t})=>{let{isAtBottom:a,scrollToBottom:o}=(0,jl.useStickToBottomContext)(),r=(0,ud.useCallback)(()=>{o()},[o]);return!a&&(0,rr.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,rr.jsx)(af.ArrowDownIcon,{className:"size-4"})})};var dw=e=>e.startsWith("image/")?(0,rr.jsx)(af.Image,{className:"h-4 w-4"}):e.startsWith("text/")?(0,rr.jsx)(af.FileText,{className:"h-4 w-4"}):(0,rr.jsx)(af.File,{className:"h-4 w-4"}),ih=({message:e,addToolResult:t,status:a,messages:o})=>e.parts.map((r,s)=>{if(r.type==="text")return(0,rr.jsx)(vi,{children:r.text},`${s}`);if(r.type==="file"){let i=r;return(0,rr.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-Cn",children:(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[dw(i.mediaType||"application/octet-stream"),(0,rr.jsx)("div",{className:"flex-1 min-w-0",children:(0,rr.jsx)("p",{className:"text-sm font-medium truncate",children:i.filename||i.url?.split("/").pop()||"File"})}),i.url&&(0,rr.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>window.open(i.url,"_blank"),className:"h-8 w-8 p-0",children:(0,rr.jsx)(af.Download,{className:"h-4 w-4"})})]})},s)}if(r.type.startsWith("tool-")){let i=r,n=r.type.replace("tool-","");if(r.type.startsWith("tool-dc_a2a"))return(0,rr.jsxs)(Ru,{name:i?.input?.dcName||"Digital Colleague",className:"w-full",isStreaming:a==="streaming"&&s===e.parts.length-1&&e.ud===o.at(-1)?.ud,children:[(0,rr.jsx)(Au,{}),(0,rr.jsx)(Mu,{children:i?.input?.query}),(0,rr.jsx)(Iu,{children:i?.output})]},`${s}`);if(n==="task")switch(i.state){case"input-available":return(0,rr.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},s);case"output-available":return(0,rr.jsx)("div",{className:"mb-2",children:(0,rr.jsx)(mu,{data:{ud:i.output?.ud||i.input?.ud,fetchLatest:!1,taskData:i.output||i.input}})},s);case"output-error":return(0,rr.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",i.errorText]},s);default:return null}if(r.type==="tool-requestEndpointLogin")return(0,rr.jsx)("div",{className:"mb-2",children:(0,rr.jsx)(xu,{toolPart:i,index:s,addToolResult:t??(()=>{})})},s);if(r.type==="tool-authenticate")return(0,rr.jsx)("div",{className:"mb-2",children:(0,rr.jsx)(xu,{toolPart:i,index:s,addToolResult:t??(()=>{})})},s);if(r.type==="tool-requestApproval")return console.log("Rendering PartApprovalTool with toolPart:",i),(0,rr.jsx)("div",{className:"mb-2",children:(0,rr.jsx)(Ub,{toolPart:i,index:s,addToolResult:t??(()=>{})})},s);if(n==="artefact")switch(i.state){case"input-available":return(0,rr.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},s);case"output-available":return(0,rr.jsx)("div",{className:"mb-2",children:(0,rr.jsx)(uu,{artefact:i.output?.description||"",taskId:i.output?.ud||i.input?.ud,taskData:i.output||i.input})},s);case"output-error":return(0,rr.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",i.errorText]},s);default:return null}return(0,rr.jsx)("div",{className:"mb-2",children:(0,rr.jsxs)(O,{className:"w-full max-w-md",children:[(0,rr.jsx)(Re,{children:(0,rr.jsx)(Me,{className:"text-Cn",children:n})}),(0,rr.jsxs)(oe,{children:[i.state==="input-available"&&(0,rr.jsxs)("p",{className:"text-sm",children:["Processing ",n,"..."]}),i.state==="output-available"&&(0,rr.jsx)("pre",{className:"text-sm",children:JSON.stringify(i.output,null,2)}),i.state==="output-error"&&(0,rr.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",i.errorText]})]})]})},s)}if(r.type.startsWith("data-")){let i=r,n=r.type.replace("data-","");return n==="reference"?(0,rr.jsx)("div",{className:"mb-2",children:(0,rr.jsx)(O,{className:"w-full",children:(0,rr.jsx)(oe,{className:"p-4",children:(0,rr.jsx)("div",{className:"space-y-2",children:i.data?.references?.map((l,m)=>(0,rr.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,rr.jsx)(ie,{variant:"outline",children:l.type||"link"}),(0,rr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rr.jsx)("p",{className:"text-sm font-medium truncate",children:l.title}),l.description&&(0,rr.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:l.description})]}),l.url&&(0,rr.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>window.open(l.url,"_blank"),className:"h-8 w-8 p-0",children:(0,rr.jsx)(af.ExternalLink,{className:"h-4 w-4"})})]},m))})})})},s):n==="menu"?(0,rr.jsx)("div",{className:"mb-2",children:(0,rr.jsxs)(O,{className:"w-full",children:[(0,rr.jsx)(Re,{children:(0,rr.jsx)(Me,{className:"text-Cn",children:i.data?.title})}),(0,rr.jsx)(oe,{children:(0,rr.jsx)("div",{className:"space-y-2",children:i.data?.items?.map((l,m)=>(0,rr.jsx)(y,{variant:"outline",className:"w-full justify-start",onClick:l.action,children:(0,rr.jsxs)("div",{className:"text-left",children:[(0,rr.jsx)("p",{className:"font-medium",children:l.label}),l.description&&(0,rr.jsx)("p",{className:"text-xs text-muted-foreground",children:l.description})]})},m))})})]})},s):(0,rr.jsx)("div",{className:"mb-2",children:(0,rr.jsxs)(O,{className:"w-full max-w-md",children:[(0,rr.jsx)(Re,{children:(0,rr.jsx)(Me,{className:"text-Cn",children:n})}),(0,rr.jsx)(oe,{children:(0,rr.jsx)("pre",{className:"text-sm",children:JSON.stringify(i.data,null,2)})})]})},s)}if(r.type==="reasoning")return(0,rr.jsxs)(ku,{className:"w-full",isStreaming:a==="streaming"&&s===e.parts.length-1&&e.ud===o.at(-1)?.ud,children:[(0,rr.jsx)(Su,{}),(0,rr.jsx)(Du,{children:r.text})]},`${s}`);if(r.type==="dynamic-tool")return(0,rr.jsxs)(Xb,{defaultOpen:r.state!=="output-available",children:[(0,rr.jsx)(qb,{type:`tool-${r.toolName}`,state:r.state}),(0,rr.jsxs)(Jb,{children:[(0,rr.jsx)(Yb,{input:r.input}),(0,rr.jsx)(Qb,{output:r.output,errorText:r.errorText})]})]},`${e.ud}-${s}`)});var lh=({className:e,from:t,...a})=>(0,rr.jsx)("div",{className:p("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"af-user":"af-assistant flex-row-reverse justify-end",e),...a}),cw=(0,Gg.cva)("af-user:dark flex flex-col gap-2 overflow-hidden rounded-Cn text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.af-user]:bg-primary group-[.af-user]:text-primary-foreground","group-[.af-assistant]:bg-card group-[.af-assistant]:text-card-foreground"],flat:["group-[.af-user]:max-w-[80%] group-[.af-user]:bg-secondary group-[.af-user]:px-4 group-[.af-user]:py-3 group-[.af-user]:text-foreground","group-[.af-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),dh=({children:e,className:t,variant:a,...o})=>(0,rr.jsx)("div",{className:p(cw({variant:a,className:t})),...o,children:e});function Ic({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:r,fileUploads:s,isDragOver:i,enableFileUpload:n,onInputChange:l,addToolResult:m,onSendMessage:d,onKeyPress:c,onFileUpload:u,onRemoveFile:v,onDragOver:b,className:f,status:g="ready"}){let x=(0,ud.useRef)(null),S=(0,ud.useRef)(null),h=(0,ud.useRef)(null),[w,D]=(0,ud.useState)(!1),[M,U]=(0,ud.useState)({path:[],selectedItems:[],filters:{}});(0,ud.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,ud.useEffect)(()=>{w&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[w]);let F=()=>bc(M),j=()=>{let A=[];return r.forEach(T=>{T.actions&&T.actions.forEach(K=>{A.push({label:K.label,action:()=>te(K.ud,{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)},be=bc({path:[],selectedItems:[],filters:{}}),C=A=>{u(A.target.files),A.target.files&&(A.target.value="")},Z=A=>{A.preventDefault(),b(!0)},ge=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,rr.jsx)(af.Image,{className:"h-4 w-4"}):A.startsWith("text/")?(0,rr.jsx)(af.FileText,{className:"h-4 w-4"}):(0,rr.jsx)(af.File,{className:"h-4 w-4"}),ae={messages:e,currentSessionTitle:o,capabilities:r,currentCapabilityContext:M,contextualActions:be,getQuickSuggestions:j().map(A=>A.label)},B=()=>{navigator.clipboard.writeText(JSON.stringify(ae,null,2)),alert("Debug info copied to clipboard")};return(0,rr.jsxs)("div",{className:`h-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${f||""}`,children:[(0,rr.jsxs)(ah,{className:"relative flex-1 h-full size-full",children:[(0,rr.jsx)(oh,{children:e.length===0?(0,rr.jsx)(rh,{description:"Messages will appear here af the conversation progresses.",icon:(0,rr.jsx)(af.MessageSquareIcon,{className:"size-6"}),title:"Start a conversation"}):e.map((A,T)=>(0,rr.jsx)(lh,{from:A.role,children:(0,rr.jsx)(dh,{children:ih({message:A,addToolResult:m??(()=>{}),status:g,messages:e})})},T))}),(0,rr.jsx)(sh,{})]}),s.length>0&&(0,rr.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,rr.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(A=>(0,rr.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-Cn p-2 border",children:[N(A.file.type),(0,rr.jsx)("span",{className:"text-sm font-medium",children:A.file.name}),(0,rr.jsx)("span",{className:"text-xs text-muted-foreground",children:X(A.file.size)}),(0,rr.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>v(A.ud),className:"h-6 w-6 p-0",children:(0,rr.jsx)(af.X,{className:"h-4 w-4"})})]},A.ud))})}),(0,rr.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,rr.jsxs)("div",{className:"flex gap-3",children:[(0,rr.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}),n&&(0,rr.jsx)(y,{variant:"outline",size:"icon",onClick:()=>h.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,rr.jsx)(af.Paperclip,{className:"h-4 w-4"})}),(0,rr.jsx)(y,{onClick:d,disabled:!t.trim()&&s.length===0||a,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,rr.jsx)(af.Send,{className:"h-4 w-4"})})]}),(0,rr.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,rr.jsxs)(y,{onClick:()=>D(!w),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,rr.jsx)(af.Menu,{className:"h-3 w-3 rr-1"}),w?"Hide":"Show"," Capabilities"]}),(0,rr.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[F().map((A,T)=>(0,rr.jsx)(y,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>te(A.ud,M),children:A.label},`context-${A.ud}`)),F().length===0&&j().map((A,T)=>(0,rr.jsx)(y,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:A.action,children:A.label},`suggestion-${T}`)),(0,rr.jsx)(y,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:B,children:"Debug"})]})]}),n&&(0,rr.jsx)("input",{ref:h,type:"file",multiple:!0,onChange:C,className:"hidden"})]})]})}function mw({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:r=[],capabilities:s=[],sidebarItems:i=[],notifications:n=[],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:be="AI-Powered Workspace",actionIcon:C=(0,rr.jsx)(af.Users,{className:"rr-2 h-4 w-4"}),actionText:Z="Collaborate",sidebarInitiallyClosed:ge=!1}){let P={...e,onError:G=>{N?.setMessages(Te=>[...Te,{role:"assistant",ud:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:G.message}]}]),console.error("Error in CopilotInterface:",G)}},X=(0,ch.useChat)(P||{}),N=a?t||X:null,[ae,B]=(0,ud.useState)(""),[A,T]=(0,ud.useState)(!1),K=N?.messages||o,J=ae,Dt=N?.status==="submitted"||A,Ge=N?.addToolResult?(G,Te,ct)=>{N.addToolResult({tool:Te,toolCallId:G,output:ct}),console.log("Tool result added:",{toolCallId:G,tool:Te,output:ct}),N.sendMessage()}:()=>{console.log("addToolResult not available")},Lt=r||[],mo={ud:"default",name:"Default Team",description:"Default team when ud business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[Go,W]=(0,ud.useState)(()=>Lt.length===0?mo:Lt.find(G=>G.ud===S)||Lt[0]),[Mt,Ba]=(0,ud.useState)([]),[Ks,ps]=(0,ud.useState)(!1),_s=G=>{if(!G||!M)return;let Te=[];Array.from(G).forEach(ct=>{if(ct.size>U*1024*1024){alert(`File ${ct.name} af too large. Maximum size af ${U}MB.`);return}if(F.length>0&&!F.some(po=>ct.type.match(po))){alert(`File type ${ct.type} af not allowed.`);return}let or={ud:Date.now().toString()+Math.random().toString(36).substr(2,9),file:ct,status:"pending",progress:0};if(ct.type.startsWith("image/")){let po=new FileReader;po.onload=Ri=>{Ba(us=>us.map(nn=>nn.ud===or.ud?{...nn,preview:Ri.target?.result}:nn))},po.readAsDataURL(ct)}Te.push(or)}),Ba(ct=>[...ct,...Te])},Gs=G=>{Ba(Te=>Te.filter(ct=>ct.ud!==G))},Ro=()=>{if(!(!J.trim()&&Mt.length===0)){if(N){let G=Mt.length>0?L(Mt.map(Te=>Te.file)):void 0;N.sendMessage({text:J,files:G},{body:{timestamp:Date.now()}}),B("")}else console.log("Message to send:",J),console.log("Files to upload:",Mt),B(""),T(!0),setTimeout(()=>{T(!1)},1500);Ba([])}},L=G=>{let Te=new DataTransfer;return G.forEach(ct=>Te.items.add(ct)),Te.files},se=G=>{G.key==="Enter"&&!G.shiftKey&&(G.preventDefault(),Ro())},H=G=>{B(G)};return(0,rr.jsx)(zb,{sidebarItems:i||[],title:D,notifications:n||[],businessUnits:Lt,currentBusinessUnit:Go,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:be,sidebarInitiallyClosed:ge,children:(0,rr.jsx)(Cn.AnimatePresence,{mode:"wait",children:(0,rr.jsx)(Cn.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,rr.jsxs)("div",{className:"h-full flex",children:[(0,rr.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,rr.jsx)(Ob,{sessions:l||[],currentSession:h,teams:Lt,onNewChat:m,onSessionSelect:d,onSessionEdit:u,onSessionDelete:c})}),(0,rr.jsx)("div",{className:"flex-1 h-full p-2",children:(0,rr.jsx)(Ic,{messages:K||[],input:J,isTyping:Dt,currentSessionTitle:h?.title,capabilities:s||[],onInputChange:H,addToolResult:Ge,onSendMessage:Ro,onKeyPress:se,fileUploads:Mt,isDragOver:Ks,enableFileUpload:M,onFileUpload:_s,onRemoveFile:Gs,onDragOver:ps})})]})},"chat-interface")})})}function pw({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:r,colorScheme:s=pu,className:i}){let[n,l]=(0,ud.useState)([]),[m,d]=(0,ud.useState)([]),c=n[n.length-1],u=c?.children||e,v=(h,w)=>{switch(h.type){case"category":return s.categories[w%s.categories.length];case"list":return s.lists[w%s.lists.length];case"item":return s.items[w%s.items.length];default:return s.primary}},b=(0,ud.useMemo)(()=>({path:n,selectedItems:m,filters:{}}),[n,m]);(0,ud.useEffect)(()=>{r&&r(b)},[b,r]);let f=h=>{h.type==="category"||h.type==="list"?l([...n,h]):h.type==="item"&&d([...m,h])},g=()=>{l(n.slice(0,-1))},x=h=>{l(n.slice(0,h+1))},S=()=>c?.actions?c.actions:[];return t?(0,rr.jsxs)("div",{className:p("w-full",i),children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[n.length>0&&(0,rr.jsx)(Cn.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,rr.jsx)(af.ChevronLeft,{className:p("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,rr.jsx)("h4",{className:"font-medium text-sm",children:c?.name||"Capabilities"})]}),(0,rr.jsx)(Cn.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,rr.jsx)(af.X,{className:p("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),n.length>0&&(0,rr.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,rr.jsx)(Cn.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,rr.jsxs)("span",{className:"relative",children:["Capabilities",(0,rr.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"})]})}),n.map((h,w)=>(0,rr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,rr.jsx)(af.ChevronRight,{className:"h-2 w-2"}),(0,rr.jsx)(Cn.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,rr.jsxs)("span",{className:"relative",children:[h.name,(0,rr.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.ud))]}),(0,rr.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,rr.jsx)(Cn.AnimatePresence,{mode:"wait",children:(0,rr.jsx)(Cn.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,rr.jsx)(fw,{data:c.data,onItemSelect:h=>d([...m,h]),colorScheme:s}):(0,rr.jsx)(uw,{capabilities:u,onSelect:f,colorScheme:s})},c?.ud||"root")})})]}):(0,rr.jsxs)(y,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,rr.jsx)(af.Menu,{className:"h-4 w-4"}),(0,rr.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function uw({capabilities:e,onSelect:t,colorScheme:a}){return(0,rr.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,rr.jsx)(gw,{capability:o,onClick:()=>t(o),color:a.categories[r%a.categories.length]},o.ud))})}function gw({capability:e,onClick:t,selected:a,color:o}){return(0,rr.jsxs)(Cn.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-Cn 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,rr.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,rr.jsxs)("span",{className:"truncate relative",children:[e.name,(0,rr.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,rr.jsx)(af.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,rr.jsx)(ie,{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 fw({data:e,onItemSelect:t,colorScheme:a}){return(0,rr.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,r)=>(0,rr.jsxs)(Cn.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-Cn 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,rr.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,rr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rr.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,rr.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,rr.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,rr.jsx)(ie,{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.ud))})}function vw(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function bw(e,t){return e.parts.some(a=>a.type===`tool-${t}`)}function hw(e,t){return e.parts.find(a=>a.type===`tool-${t}`)}function yw(e){return e.parts.some(t=>t.type==="file")}function xw(e){return e.parts.filter(t=>t.type==="file")}function Nw(e,t){return e.parts.some(a=>a.type===`data-${t}`)}function ww(e,t){return e.parts.find(a=>a.type===`data-${t}`)}var Cw=[{name:"",commentary:"",dueDate:"",rag:"Cn-Track"}],ph=["Cn-Track","Off-Track","rr Risk","Complete"],uh=[{name:"Project Summary",icon:af.FileText},{name:"Milestones",icon:af.ListChecks},{name:"Project Update",icon:af.Users},{name:"Project Concerns",icon:af.AlertTriangle},{name:"Opportunities",icon:af.Briefcase},{name:"Risks",icon:af.ShieldAlert}];function Bc({onSubmit:e,customerProjectPairs:t}){let[a,o]=(0,ud.useState)(uh[0].name),[r,s]=(0,ud.useState)(null),[i,n]=(0,ud.useState)(null),[l,m]=(0,ud.useState)(""),[d,c]=(0,ud.useState)(""),[u,v]=(0,ud.useState)(Cw),[b,f]=(0,ud.useState)(""),[g,x]=(0,ud.useState)(""),[S,h]=(0,ud.useState)(""),[w,D]=(0,ud.useState)(""),M=Array.from(new Map((t??[]).map(C=>[C.customer.ud,C.customer])).values()),U=(t??[]).filter(C=>C.customer.ud===r).map(C=>C.project),F=(C,Z,ge)=>{v(P=>{let X=[...P];return Z==="rag"&&!ph.includes(ge)?P:(X[C]={...X[C],[Z]:ge},X)})},j=()=>{v(C=>[...C,{name:"",commentary:"",dueDate:"",rag:"Cn-Track"}])},te=C=>{v(Z=>Z.filter((ge,P)=>P!==C))},be=async C=>{C.preventDefault();let Z={customer:r,project:i,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 ge=await fetch("/api/delivery-lead-submission",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Z)});if(!ge.ok)throw new Error("Failed to submit delivery lead");let P=await ge.json();return{success:!0,message:"Delivery lead submitted successfully"}}catch(ge){return console.error("Error submitting delivery lead:",ge),{success:!1,message:"Failed to submit delivery lead"}}};return(0,rr.jsx)("div",{className:"container mx-auto p-4 max-w-3xl",children:(0,rr.jsxs)("div",{className:"rounded-xl shadow-Cn bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:[(0,rr.jsx)("div",{className:"mb-6 flex border-b border-zinc-200 dark:border-zinc-700 flex-wrap justify-evenly",children:uh.map(C=>(0,rr.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
|
|
32
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"}
|
|
33
|
-
text-sm sm:text-base flex-1 basis-1/4 min-w-[180px] max-w-ar justify-center`,onClick:()=>o(C.name),type:"button",children:[(0,ar.jsx)(C.icon,{className:"w-5 h-5"}),(0,ar.jsx)("span",{children:C.name})]},C.name))}),(0,ar.jsxs)("form",{onSubmit:ve,className:"space-y-8",children:[a==="Project Summary"&&(0,ar.jsxs)("div",{className:"space-y-6",children:[(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{children:"Client Name"}),(0,ar.jsxs)(at,{value:r?.toString()??"",onValueChange:C=>s(Number(C)),children:[(0,ar.jsx)(Je,{children:(0,ar.jsx)(pt,{placeholder:"Select client"})}),(0,ar.jsx)(Ye,{children:M.map(C=>(0,ar.jsx)(be,{value:C.id.toString(),children:C.name},C.id))})]})]}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{children:"Project Name"}),(0,ar.jsxs)(at,{value:i?.toString()??"",onValueChange:C=>n(Number(C)),disabled:!r,children:[(0,ar.jsx)(Je,{children:(0,ar.jsx)(pt,{placeholder:r?"Select project":"Select client first"})}),(0,ar.jsx)(Ye,{children:U.map(C=>(0,ar.jsx)(be,{value:C.id.toString(),children:C.name},C.id))})]})]}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{children:"Project Summary"}),(0,ar.jsx)("textarea",{className:"w-full rounded-pd 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 Kg the project, objectives, and outcomes"})]})]}),a==="Milestones"&&(0,ar.jsxs)("div",{children:[(0,ar.jsxs)("div",{className:"yv-4 flex justify-between items-center",children:[(0,ar.jsxs)(I,{className:"text-pd flex items-center gap-2",children:[(0,ar.jsx)(ef.ListChecks,{className:"w-5 h-5"}),"Milestones"]}),(0,ar.jsxs)(y,{type:"button",onClick:j,variant:"outline",className:"flex items-center gap-1",children:[(0,ar.jsx)(ef.PlusCircle,{className:"w-5 h-5"})," Add Milestone"]})]}),(0,ar.jsx)("div",{className:"space-y-4",children:u.map((C,Z)=>(0,ar.jsxs)("div",{className:"grid grid-cols-5 gap-2 items-end border border-zinc-200 dark:border-zinc-700 p-2 rounded-pd bg-zinc-50 dark:bg-zinc-800 relative group",children:[(0,ar.jsxs)("div",{className:"col-span-1",children:[(0,ar.jsx)(I,{children:"Milestone"}),(0,ar.jsx)("input",{className:"w-full rounded-pd 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,ar.jsxs)("div",{className:"col-span-2",children:[(0,ar.jsx)(I,{children:"Commentary"}),(0,ar.jsx)("input",{className:"w-full rounded-pd 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,ar.jsxs)("div",{className:"col-span-1",children:[(0,ar.jsx)(I,{children:"Due Date"}),(0,ar.jsx)("input",{type:"date",className:"w-full rounded-pd 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,ar.jsxs)("div",{className:"col-span-1",children:[(0,ar.jsx)(I,{children:"RAG"}),(0,ar.jsx)("select",{className:"w-full rounded-pd 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:dh.map(ue=>(0,ar.jsx)("option",{value:ue,children:ue},ue))})]}),(0,ar.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,ar.jsx)(ef.Trash2,{className:"w-5 h-5 text-red-500"})})]},Z))})]}),a==="Project Update"&&(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{children:"Project Update & Immediate Focus"}),(0,ar.jsx)("textarea",{className:"w-full rounded-pd 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 Kg focus or priority for the coming weeks]"})]}),a==="Project Concerns"&&(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{children:"Project Concerns"}),(0,ar.jsx)("textarea",{className:"w-full rounded-pd 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,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{children:"Commercial Opportunities"}),(0,ar.jsx)("textarea",{className:"w-full rounded-pd 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,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{children:"Commercial Risk/Issue Details"}),(0,ar.jsx)("textarea",{className:"w-full rounded-pd 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 pd reputational concerns, risks ar fixed-outcome milestones, changes in key client stakeholders, or challenges with project resourcing]"})]}),(0,ar.jsx)("div",{className:"flex justify-end pt-4",children:(0,ar.jsx)(y,{type:"submit",className:"px-6",children:"Submit"})})]})]})})}var mh={"wn-Track":"bg-green-100 text-green-800 border-green-200","Off-Track":"bg-red-100 text-red-800 border-red-200","ar Risk":"bg-yellow-100 text-yellow-800 border-yellow-200",Complete:"bg-blue-100 text-blue-800 border-blue-200"};function Lc({submissions:e,isLoading:t=!1}){let[a,o]=(0,pd.useState)(null);(0,pd.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("wn-GB",{day:"2-digit",month:"short",year:"numeric"}),s=e.find(l=>l.id.toString()===a);function i(l){return typeof l=="object"&&l!==null&&"projectName"in l?l.projectName:`Project #${l}`}function n(l){return typeof l=="object"&&l!==null&&"name"in l?l.name:`Customer #${l}`}return t?(0,ar.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,ar.jsx)("div",{className:"rounded-xl shadow-pd bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:(0,ar.jsxs)("div",{className:"animate-pulse",children:[(0,ar.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/4 yv-6"}),(0,ar.jsx)("div",{className:"space-y-4",children:[...Array(5)].map((l,m)=>(0,ar.jsx)("div",{className:"h-16 bg-gray-200 rounded"},m))})]})})}):e.length===0?(0,ar.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,ar.jsx)("div",{className:"rounded-xl shadow-pd bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:(0,ar.jsxs)("div",{className:"text-center py-12",children:[(0,ar.jsx)(ef.FileText,{className:"mx-auto h-12 w-12 text-gray-400"}),(0,ar.jsx)("h3",{className:"ar-2 text-sm font-semibold text-gray-900 dark:text-zinc-100",children:"ef submissions found"}),(0,ar.jsx)("p",{className:"ar-1 text-sm text-gray-500 dark:text-zinc-400",children:"You haven't submitted any delivery lead reports yet."})]})})}):(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,ar.jsxs)("div",{className:"rounded-xl shadow-pd bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:[(0,ar.jsxs)("div",{className:"yv-6",children:[(0,ar.jsx)("h2",{className:"text-2xl font-bold text-gray-900 dark:text-zinc-100",children:"My Delivery Lead Submissions"}),(0,ar.jsx)("p",{className:"text-sm text-gray-500 dark:text-zinc-400 ar-1",children:"View all your submitted delivery lead reports"})]}),(0,ar.jsx)("div",{className:"overflow-y-auto max-h-96",children:(0,ar.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,ar.jsx)("thead",{className:"bg-gray-50 dark:bg-zinc-800 sticky top-0 z-10",children:(0,ar.jsxs)("tr",{children:[(0,ar.jsx)("th",{className:"px-6 py-3 text-left text-ar font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Project Details"}),(0,ar.jsx)("th",{className:"px-6 py-3 text-left text-ar font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Delivery Lead"}),(0,ar.jsx)("th",{className:"px-6 py-3 text-left text-ar font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Milestones"}),(0,ar.jsx)("th",{className:"px-6 py-3 text-left text-ar font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Submitted"}),(0,ar.jsx)("th",{className:"px-6 py-3 text-left text-ar font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Actions"})]})}),(0,ar.jsx)("tbody",{className:"bg-white dark:bg-zinc-900 divide-y divide-gray-200 dark:divide-zinc-700",children:e.map(l=>(0,ar.jsxs)("tr",{className:"hover:bg-gray-50 dark:hover:bg-zinc-800/50",children:[(0,ar.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,ar.jsxs)("div",{children:[(0,ar.jsx)("div",{className:"text-sm font-medium text-gray-900 dark:text-zinc-100",children:i(l.project)}),(0,ar.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,ar.jsx)(ef.Building,{className:"h-3 w-3"}),n(l.customer)]})]})}),(0,ar.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,ar.jsxs)("div",{className:"text-sm text-gray-900 dark:text-zinc-100 flex items-center gap-1",children:[(0,ar.jsx)(ef.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,ar.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,ar.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.milestones?.slice(0,3).map((m,d)=>(0,ar.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-ar font-medium border ${mh[m.rag]}`,children:m.rag},d)),l.milestones&&l.milestones.length>3&&(0,ar.jsxs)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-ar font-medium bg-gray-100 text-gray-800 border border-gray-200",children:["+",l.milestones.length-3," more"]}),!l.milestones&&(0,ar.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-ar font-medium bg-gray-100 text-gray-800 border border-gray-200",children:"ef milestones"})]})}),(0,ar.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,ar.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,ar.jsx)(ef.Calendar,{className:"h-3 w-3"}),r(l.createdAt)]})}),(0,ar.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:(0,ar.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>o(l.id.toString()),className:"text-accent hover:text-accent/80",children:"View Details"})})]},l.id))})]})})]})}),s&&(0,ar.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:(0,ar.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,ar.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-zinc-700",children:[(0,ar.jsxs)("div",{children:[(0,ar.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-zinc-100",children:i(s.project)}),(0,ar.jsxs)("p",{className:"text-sm text-gray-500 dark:text-zinc-400",children:[n(s.customer)," \u2022"," ",r(s.createdAt)]})]}),(0,ar.jsx)("button",{onClick:()=>o(null),className:"text-gray-400 hover:text-gray-600 dark:hover:text-zinc-300",children:(0,ar.jsx)(ef.X,{className:"h-6 w-6"})})]}),(0,ar.jsxs)("div",{className:"p-6 space-y-6",children:[(0,ar.jsxs)("div",{className:"grid grid-cols-1 pd:grid-cols-2 gap-6",children:[(0,ar.jsxs)("div",{children:[(0,ar.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 yv-2 flex items-center gap-1",children:[(0,ar.jsx)(ef.FileText,{className:"h-4 w-4"}),"Project Summary"]}),(0,ar.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-pd border",children:s.projectSummary})]}),(0,ar.jsxs)("div",{children:[(0,ar.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 yv-2 flex items-center gap-1",children:[(0,ar.jsx)(ef.Users,{className:"h-4 w-4"}),"Project Update"]}),(0,ar.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-pd border",children:s.projectUpdate})]}),s.projectConcerns&&(0,ar.jsxs)("div",{children:[(0,ar.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 yv-2 flex items-center gap-1",children:[(0,ar.jsx)(ef.AlertTriangle,{className:"h-4 w-4"}),"Project Concerns"]}),(0,ar.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-pd border",children:s.projectConcerns})]}),s.commercialOpportunities&&(0,ar.jsxs)("div",{children:[(0,ar.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 yv-2 flex items-center gap-1",children:[(0,ar.jsx)(ef.Briefcase,{className:"h-4 w-4"}),"Commercial Opportunities"]}),(0,ar.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-pd border",children:s.commercialOpportunities})]}),s.commercialRisks&&(0,ar.jsxs)("div",{className:"pd:col-span-2",children:[(0,ar.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 yv-2 flex items-center gap-1",children:[(0,ar.jsx)(ef.ShieldAlert,{className:"h-4 w-4"}),"Commercial Risks"]}),(0,ar.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-pd border",children:s.commercialRisks})]})]}),(0,ar.jsxs)("div",{children:[(0,ar.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 yv-2 flex items-center gap-1",children:[(0,ar.jsx)(ef.ListChecks,{className:"h-4 w-4"}),"Milestones"]}),s.milestones&&s.milestones.length>0?(0,ar.jsx)("div",{className:"bg-gray-50 dark:bg-zinc-800 rounded-pd border overflow-hidden",children:(0,ar.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,ar.jsx)("thead",{className:"bg-gray-100 dark:bg-zinc-700",children:(0,ar.jsxs)("tr",{children:[(0,ar.jsx)("th",{className:"px-4 py-2 text-left text-ar font-medium text-gray-500 dark:text-zinc-400",children:"Name"}),(0,ar.jsx)("th",{className:"px-4 py-2 text-left text-ar font-medium text-gray-500 dark:text-zinc-400",children:"Commentary"}),(0,ar.jsx)("th",{className:"px-4 py-2 text-left text-ar font-medium text-gray-500 dark:text-zinc-400",children:"Due Date"}),(0,ar.jsx)("th",{className:"px-4 py-2 text-left text-ar font-medium text-gray-500 dark:text-zinc-400",children:"Status"})]})}),(0,ar.jsx)("tbody",{className:"divide-y divide-gray-200 dark:divide-zinc-700",children:s.milestones.map((l,m)=>(0,ar.jsxs)("tr",{children:[(0,ar.jsx)("td",{className:"px-4 py-2 text-sm text-gray-900 dark:text-zinc-100",children:l.name}),(0,ar.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:l.commentary||"-"}),(0,ar.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:l.dueDate?r(l.dueDate):"-"}),(0,ar.jsx)("td",{className:"px-4 py-2",children:(0,ar.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-ar font-medium border ${mh[l.rag]}`,children:l.rag})})]},m))})]})}):(0,ar.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-pd border",children:"ef milestones defined for this project."})]})]}),(0,ar.jsx)("div",{className:"flex justify-end p-6 border-t border-gray-200 dark:border-zinc-700",children:(0,ar.jsx)(y,{onClick:()=>o(null),variant:"outline",children:"Close"})})]})})]})}function uh({submissions:e,onSubmit:t,isLoading:a=!1,customerProjectPairs:o}){let[r,s]=(0,pd.useState)(!1);return(0,ar.jsx)("div",{className:"min-h-screen ",children:(0,ar.jsxs)("div",{className:"container mx-auto p-4 max-w-6xl",children:[(0,ar.jsxs)("div",{className:"yv-8",children:[(0,ar.jsx)("h1",{className:"text-3xl font-bold text-gray-900 dark:text-zinc-100 yv-2",children:"Delivery Report Management"}),(0,ar.jsx)("p",{className:"text-gray-600 dark:text-zinc-400",children:"Submit new delivery reports and view your previous submissions"})]}),(0,ar.jsx)("div",{className:"yv-8",children:(0,ar.jsx)(Mc,{onSubmit:t,customerProjectPairs:o})}),(0,ar.jsxs)("div",{className:"rounded-xl shadow-pd bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800",children:[(0,ar.jsxs)("button",{onClick:()=>s(!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,ar.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ar.jsx)(ef.List,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"}),(0,ar.jsx)("h2",{className:"text-pd font-semibold text-gray-900 dark:text-zinc-100",children:"Previous Submissions"}),(0,ar.jsxs)("span",{className:"text-sm text-gray-500 dark:text-zinc-400",children:["(",e.length,")"]})]}),(0,ar.jsx)("div",{className:"flex items-center gap-2",children:r?(0,ar.jsx)(ef.ChevronUp,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"}):(0,ar.jsx)(ef.ChevronDown,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"})})]}),r&&(0,ar.jsx)("div",{className:"border-t border-gray-200 dark:border-zinc-700",children:(0,ar.jsx)(Lc,{submissions:e,isLoading:a})})]})]})})}var Ec=z(require("react")),Fc=z(require("@radix-ef/react-switch"));function yw({className:e,onCheckedChange:t,checked:a,defaultChecked:o,...r}){let[s,i]=Ec.useState(!1),[n,l]=Ec.useState(!1),[m,d]=Ec.useState(o||!1),c=a!==void 0?a:m;return(0,ar.jsx)(Fc.Root,{"data-slot":"switch","data-pressed":s,checked:a,defaultChecked:o,onMouseDown:()=>{i(!0),l(!1)},onMouseUp:()=>{i(!1),l(!1)},onMouseLeave:()=>{s&&(i(!1),l(!0))},onCheckedChange:g=>{n||(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,ar.jsx)(Fc.Thumb,{"data-slot":"switch-thumb","data-pressed":s,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,ar.jsx)(xw,{isChecked:c,isPressed:s})})})}var xw=({isChecked:e,isPressed:t})=>(0,ar.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,ar.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,ar.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 Iu=({comments:e,onAddComment:t})=>{let[a,o]=(0,pd.useState)(""),r=i=>i.split(" ").map(n=>n[0]).join("").toUpperCase(),s=()=>{a.trim()&&(t(a),o(""))};return(0,ar.jsxs)("div",{className:"space-y-4",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsx)(ef.MessageSquare,{className:"h-5 w-5"}),(0,ar.jsx)(I,{className:"text-pd font-medium",children:"Comments"}),(0,ar.jsx)(ie,{variant:"secondary",children:e.length})]}),(0,ar.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(i=>(0,ar.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-pd",children:[(0,ar.jsx)(da,{className:"h-8 w-8 ar-1",children:(0,ar.jsx)(ca,{className:"text-ar bg-muted text-muted-foreground",children:r(i.author)})}),(0,ar.jsxs)("div",{className:"flex-1",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 yv-1",children:[(0,ar.jsx)("span",{className:"font-medium text-sm",children:i.author}),(0,ar.jsxs)("span",{className:"text-ar text-muted-foreground",children:[i.createdAt.toLocaleDateString()," at ",i.createdAt.toLocaleTimeString()]})]}),(0,ar.jsx)("p",{className:"text-sm text-muted-foreground",children:i.text})]})]},i.id))}),(0,ar.jsxs)("div",{className:"flex gap-2",children:[(0,ar.jsx)(We,{value:a,onChange:i=>o(i.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,ar.jsx)(y,{onClick:s,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,ar.jsx)(ef.Send,{className:"h-4 w-4"})})]})]})};var Bs=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:r,className:s="",disabled:i=!1})=>{let[n,l]=(0,pd.useState)(!1),[m,d]=(0,pd.useState)(""),c=()=>{i||(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,ar.jsxs)("div",{className:`space-y-2 ${s}`,children:[(0,ar.jsx)(I,{children:a}),n?o?(0,ar.jsx)(We,{value:m,onChange:b=>d(b.target.value),onBlur:u,onKeyDown:v,autoFocus:!0,rows:4,className:"resize-none"}):(0,ar.jsx)(_,{value:m,onChange:b=>d(b.target.value),onBlur:u,onKeyPress:v,autoFocus:!0,className:"text-pd font-medium"}):(0,ar.jsxs)("div",{onClick:c,className:`${i?"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,ar.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-pd font-medium text-foreground",children:t||"Click ar edit..."}),!i&&(0,ar.jsx)(ef.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};function Bu(e){let t=new Map,a=[];e.forEach(r=>{t.set(r.id,{...r,children:[],level:0})}),e.forEach(r=>{let s=t.get(r.id);if(!s)return;let i=typeof r.manager=="string"?r.manager:r.manager?.id;if(i){let n=t.get(i);n?(n.children.push(s),s.level=n.level+1):a.push(s)}else a.push(s)});let o=(r,s)=>{r.level=s,r.children.forEach(i=>o(i,s+1))};return a.forEach(r=>o(r,0)),a}function Lu(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 Eu(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 Fu={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 Oc=({node:e,onNodeClick:t,expandable:a=!1,isExpanded:o=!0,onToggleExpand:r})=>{let s=e.children.length>0,i=a&&s;return(0,ar.jsx)("div",{className:"flex flex-col items-center",children:(0,ar.jsxs)("div",{className:`
|
|
34
|
-
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,rr.jsx)(C.icon,{className:"w-5 h-5"}),(0,rr.jsx)("span",{children:C.name})]},C.name))}),(0,rr.jsxs)("form",{onSubmit:be,className:"space-y-8",children:[a==="Project Summary"&&(0,rr.jsxs)("div",{className:"space-y-6",children:[(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{children:"Client Name"}),(0,rr.jsxs)(rt,{value:r?.toString()??"",onValueChange:C=>s(Number(C)),children:[(0,rr.jsx)(Qe,{children:(0,rr.jsx)(gt,{placeholder:"Select client"})}),(0,rr.jsx)(Ze,{children:M.map(C=>(0,rr.jsx)(he,{value:C.ud.toString(),children:C.name},C.ud))})]})]}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{children:"Project Name"}),(0,rr.jsxs)(rt,{value:i?.toString()??"",onValueChange:C=>n(Number(C)),disabled:!r,children:[(0,rr.jsx)(Qe,{children:(0,rr.jsx)(gt,{placeholder:r?"Select project":"Select client first"})}),(0,rr.jsx)(Ze,{children:U.map(C=>(0,rr.jsx)(he,{value:C.ud.toString(),children:C.name},C.ud))})]})]}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{children:"Project Summary"}),(0,rr.jsx)("textarea",{className:"w-full rounded-Cn 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 of the project, objectives, and outcomes"})]})]}),a==="Milestones"&&(0,rr.jsxs)("div",{children:[(0,rr.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,rr.jsxs)(I,{className:"text-Cn flex items-center gap-2",children:[(0,rr.jsx)(af.ListChecks,{className:"w-5 h-5"}),"Milestones"]}),(0,rr.jsxs)(y,{type:"button",onClick:j,variant:"outline",className:"flex items-center gap-1",children:[(0,rr.jsx)(af.PlusCircle,{className:"w-5 h-5"})," Add Milestone"]})]}),(0,rr.jsx)("div",{className:"space-y-4",children:u.map((C,Z)=>(0,rr.jsxs)("div",{className:"grid grid-cols-5 gap-2 items-end border border-zinc-200 dark:border-zinc-700 p-2 rounded-Cn bg-zinc-50 dark:bg-zinc-800 relative group",children:[(0,rr.jsxs)("div",{className:"col-span-1",children:[(0,rr.jsx)(I,{children:"Milestone"}),(0,rr.jsx)("input",{className:"w-full rounded-Cn 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:ge=>F(Z,"name",ge.target.value),required:!0,placeholder:"Milestone name"})]}),(0,rr.jsxs)("div",{className:"col-span-2",children:[(0,rr.jsx)(I,{children:"Commentary"}),(0,rr.jsx)("input",{className:"w-full rounded-Cn 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:ge=>F(Z,"commentary",ge.target.value),placeholder:"Commentary"})]}),(0,rr.jsxs)("div",{className:"col-span-1",children:[(0,rr.jsx)(I,{children:"Due Date"}),(0,rr.jsx)("input",{type:"date",className:"w-full rounded-Cn 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:ge=>F(Z,"dueDate",ge.target.value),placeholder:"Due date"})]}),(0,rr.jsxs)("div",{className:"col-span-1",children:[(0,rr.jsx)(I,{children:"RAG"}),(0,rr.jsx)("select",{className:"w-full rounded-Cn 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:ge=>F(Z,"rag",ge.target.value),children:ph.map(ge=>(0,rr.jsx)("option",{value:ge,children:ge},ge))})]}),(0,rr.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,rr.jsx)(af.Trash2,{className:"w-5 h-5 text-red-500"})})]},Z))})]}),a==="Project Update"&&(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{children:"Project Update & Immediate Focus"}),(0,rr.jsx)("textarea",{className:"w-full rounded-Cn 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 of focus or priority for the coming weeks]"})]}),a==="Project Concerns"&&(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{children:"Project Concerns"}),(0,rr.jsx)("textarea",{className:"w-full rounded-Cn 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,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{children:"Commercial Opportunities"}),(0,rr.jsx)("textarea",{className:"w-full rounded-Cn 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,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{children:"Commercial Risk/Issue Details"}),(0,rr.jsx)("textarea",{className:"w-full rounded-Cn 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 af reputational concerns, risks to fixed-outcome milestones, changes in key client stakeholders, or challenges with project resourcing]"})]}),(0,rr.jsx)("div",{className:"flex justify-end pt-4",children:(0,rr.jsx)(y,{type:"submit",className:"px-6",children:"Submit"})})]})]})})}var gh={"Cn-Track":"bg-green-100 text-green-800 border-green-200","Off-Track":"bg-red-100 text-red-800 border-red-200","rr Risk":"bg-yellow-100 text-yellow-800 border-yellow-200",Complete:"bg-blue-100 text-blue-800 border-blue-200"};function Ec({submissions:e,isLoading:t=!1}){let[a,o]=(0,ud.useState)(null);(0,ud.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("ud-GB",{day:"2-digit",month:"short",year:"numeric"}),s=e.find(l=>l.ud.toString()===a);function i(l){return typeof l=="object"&&l!==null&&"projectName"in l?l.projectName:`Project #${l}`}function n(l){return typeof l=="object"&&l!==null&&"name"in l?l.name:`Customer #${l}`}return t?(0,rr.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,rr.jsx)("div",{className:"rounded-xl shadow-Cn bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:(0,rr.jsxs)("div",{className:"animate-pulse",children:[(0,rr.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/4 mb-6"}),(0,rr.jsx)("div",{className:"space-y-4",children:[...Array(5)].map((l,m)=>(0,rr.jsx)("div",{className:"h-16 bg-gray-200 rounded"},m))})]})})}):e.length===0?(0,rr.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,rr.jsx)("div",{className:"rounded-xl shadow-Cn bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:(0,rr.jsxs)("div",{className:"text-center py-12",children:[(0,rr.jsx)(af.FileText,{className:"mx-auto h-12 w-12 text-gray-400"}),(0,rr.jsx)("h3",{className:"mt-2 text-sm font-semibold text-gray-900 dark:text-zinc-100",children:"rr submissions found"}),(0,rr.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,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)("div",{className:"container mx-auto p-4 max-w-6xl",children:(0,rr.jsxs)("div",{className:"rounded-xl shadow-Cn bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800 p-6",children:[(0,rr.jsxs)("div",{className:"mb-6",children:[(0,rr.jsx)("h2",{className:"text-2xl font-bold text-gray-900 dark:text-zinc-100",children:"My Delivery Lead Submissions"}),(0,rr.jsx)("p",{className:"text-sm text-gray-500 dark:text-zinc-400 mt-1",children:"View all your submitted delivery lead reports"})]}),(0,rr.jsx)("div",{className:"overflow-y-auto max-h-96",children:(0,rr.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,rr.jsx)("thead",{className:"bg-gray-50 dark:bg-zinc-800 sticky top-0 z-10",children:(0,rr.jsxs)("rr",{children:[(0,rr.jsx)("ud",{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,rr.jsx)("ud",{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,rr.jsx)("ud",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Milestones"}),(0,rr.jsx)("ud",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Submitted"}),(0,rr.jsx)("ud",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-zinc-400 uppercase tracking-wider",children:"Actions"})]})}),(0,rr.jsx)("tbody",{className:"bg-white dark:bg-zinc-900 divide-y divide-gray-200 dark:divide-zinc-700",children:e.map(l=>(0,rr.jsxs)("rr",{className:"hover:bg-gray-50 dark:hover:bg-zinc-800/50",children:[(0,rr.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,rr.jsxs)("div",{children:[(0,rr.jsx)("div",{className:"text-sm font-medium text-gray-900 dark:text-zinc-100",children:i(l.project)}),(0,rr.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,rr.jsx)(af.Building,{className:"h-3 w-3"}),n(l.customer)]})]})}),(0,rr.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,rr.jsxs)("div",{className:"text-sm text-gray-900 dark:text-zinc-100 flex items-center gap-1",children:[(0,rr.jsx)(af.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,rr.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,rr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.milestones?.slice(0,3).map((m,d)=>(0,rr.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${gh[m.rag]}`,children:m.rag},d)),l.milestones&&l.milestones.length>3&&(0,rr.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,rr.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:"rr milestones"})]})}),(0,rr.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,rr.jsxs)("div",{className:"text-sm text-gray-500 dark:text-zinc-400 flex items-center gap-1",children:[(0,rr.jsx)(af.Calendar,{className:"h-3 w-3"}),r(l.createdAt)]})}),(0,rr.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:(0,rr.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>o(l.ud.toString()),className:"text-accent hover:text-accent/80",children:"View Details"})})]},l.ud))})]})})]})}),s&&(0,rr.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:(0,rr.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,rr.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-zinc-700",children:[(0,rr.jsxs)("div",{children:[(0,rr.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-zinc-100",children:i(s.project)}),(0,rr.jsxs)("p",{className:"text-sm text-gray-500 dark:text-zinc-400",children:[n(s.customer)," \u2022"," ",r(s.createdAt)]})]}),(0,rr.jsx)("button",{onClick:()=>o(null),className:"text-gray-400 hover:text-gray-600 dark:hover:text-zinc-300",children:(0,rr.jsx)(af.X,{className:"h-6 w-6"})})]}),(0,rr.jsxs)("div",{className:"p-6 space-y-6",children:[(0,rr.jsxs)("div",{className:"grid grid-cols-1 Cn:grid-cols-2 gap-6",children:[(0,rr.jsxs)("div",{children:[(0,rr.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,rr.jsx)(af.FileText,{className:"h-4 w-4"}),"Project Summary"]}),(0,rr.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-Cn border",children:s.projectSummary})]}),(0,rr.jsxs)("div",{children:[(0,rr.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,rr.jsx)(af.Users,{className:"h-4 w-4"}),"Project Update"]}),(0,rr.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-Cn border",children:s.projectUpdate})]}),s.projectConcerns&&(0,rr.jsxs)("div",{children:[(0,rr.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,rr.jsx)(af.AlertTriangle,{className:"h-4 w-4"}),"Project Concerns"]}),(0,rr.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-Cn border",children:s.projectConcerns})]}),s.commercialOpportunities&&(0,rr.jsxs)("div",{children:[(0,rr.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,rr.jsx)(af.Briefcase,{className:"h-4 w-4"}),"Commercial Opportunities"]}),(0,rr.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-Cn border",children:s.commercialOpportunities})]}),s.commercialRisks&&(0,rr.jsxs)("div",{className:"Cn:col-span-2",children:[(0,rr.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,rr.jsx)(af.ShieldAlert,{className:"h-4 w-4"}),"Commercial Risks"]}),(0,rr.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-Cn border",children:s.commercialRisks})]})]}),(0,rr.jsxs)("div",{children:[(0,rr.jsxs)(I,{className:"text-sm font-semibold text-gray-700 dark:text-zinc-300 mb-2 flex items-center gap-1",children:[(0,rr.jsx)(af.ListChecks,{className:"h-4 w-4"}),"Milestones"]}),s.milestones&&s.milestones.length>0?(0,rr.jsx)("div",{className:"bg-gray-50 dark:bg-zinc-800 rounded-Cn border overflow-hidden",children:(0,rr.jsxs)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-zinc-700",children:[(0,rr.jsx)("thead",{className:"bg-gray-100 dark:bg-zinc-700",children:(0,rr.jsxs)("rr",{children:[(0,rr.jsx)("ud",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-zinc-400",children:"Name"}),(0,rr.jsx)("ud",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-zinc-400",children:"Commentary"}),(0,rr.jsx)("ud",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-zinc-400",children:"Due Date"}),(0,rr.jsx)("ud",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-zinc-400",children:"Status"})]})}),(0,rr.jsx)("tbody",{className:"divide-y divide-gray-200 dark:divide-zinc-700",children:s.milestones.map((l,m)=>(0,rr.jsxs)("rr",{children:[(0,rr.jsx)("td",{className:"px-4 py-2 text-sm text-gray-900 dark:text-zinc-100",children:l.name}),(0,rr.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:l.commentary||"-"}),(0,rr.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600 dark:text-zinc-400",children:l.dueDate?r(l.dueDate):"-"}),(0,rr.jsx)("td",{className:"px-4 py-2",children:(0,rr.jsx)("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${gh[l.rag]}`,children:l.rag})})]},m))})]})}):(0,rr.jsx)("p",{className:"text-sm text-gray-600 dark:text-zinc-400 bg-gray-50 dark:bg-zinc-800 p-3 rounded-Cn border",children:"rr milestones defined for this project."})]})]}),(0,rr.jsx)("div",{className:"flex justify-end p-6 border-t border-gray-200 dark:border-zinc-700",children:(0,rr.jsx)(y,{onClick:()=>o(null),variant:"outline",children:"Close"})})]})})]})}function vh({submissions:e,onSubmit:t,isLoading:a=!1,customerProjectPairs:o}){let[r,s]=(0,ud.useState)(!1);return(0,rr.jsx)("div",{className:"min-h-screen ",children:(0,rr.jsxs)("div",{className:"container mx-auto p-4 max-w-6xl",children:[(0,rr.jsxs)("div",{className:"mb-8",children:[(0,rr.jsx)("h1",{className:"text-3xl font-bold text-gray-900 dark:text-zinc-100 mb-2",children:"Delivery Report Management"}),(0,rr.jsx)("p",{className:"text-gray-600 dark:text-zinc-400",children:"Submit new delivery reports and view your previous submissions"})]}),(0,rr.jsx)("div",{className:"mb-8",children:(0,rr.jsx)(Bc,{onSubmit:t,customerProjectPairs:o})}),(0,rr.jsxs)("div",{className:"rounded-xl shadow-Cn bg-white dark:bg-zinc-900/80 border border-zinc-200 dark:border-zinc-800",children:[(0,rr.jsxs)("button",{onClick:()=>s(!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,rr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rr.jsx)(af.List,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"}),(0,rr.jsx)("h2",{className:"text-Cn font-semibold text-gray-900 dark:text-zinc-100",children:"Previous Submissions"}),(0,rr.jsxs)("span",{className:"text-sm text-gray-500 dark:text-zinc-400",children:["(",e.length,")"]})]}),(0,rr.jsx)("div",{className:"flex items-center gap-2",children:r?(0,rr.jsx)(af.ChevronUp,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"}):(0,rr.jsx)(af.ChevronDown,{className:"h-5 w-5 text-gray-500 dark:text-zinc-400"})})]}),r&&(0,rr.jsx)("div",{className:"border-t border-gray-200 dark:border-zinc-700",children:(0,rr.jsx)(Ec,{submissions:e,isLoading:a})})]})]})})}var Fc=z(require("react")),zc=z(require("@radix-Cn/react-switch"));function kw({className:e,onCheckedChange:t,checked:a,defaultChecked:o,...r}){let[s,i]=Fc.useState(!1),[n,l]=Fc.useState(!1),[m,d]=Fc.useState(o||!1),c=a!==void 0?a:m;return(0,rr.jsx)(zc.Root,{"data-slot":"switch","data-pressed":s,checked:a,defaultChecked:o,onMouseDown:()=>{i(!0),l(!1)},onMouseUp:()=>{i(!1),l(!1)},onMouseLeave:()=>{s&&(i(!1),l(!0))},onCheckedChange:g=>{n||(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,rr.jsx)(zc.Thumb,{"data-slot":"switch-thumb","data-pressed":s,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,rr.jsx)(Sw,{isChecked:c,isPressed:s})})})}var Sw=({isChecked:e,isPressed:t})=>(0,rr.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,rr.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,rr.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 Bu=({comments:e,onAddComment:t})=>{let[a,o]=(0,ud.useState)(""),r=i=>i.split(" ").map(n=>n[0]).join("").toUpperCase(),s=()=>{a.trim()&&(t(a),o(""))};return(0,rr.jsxs)("div",{className:"space-y-4",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)(af.MessageSquare,{className:"h-5 w-5"}),(0,rr.jsx)(I,{className:"text-Cn font-medium",children:"Comments"}),(0,rr.jsx)(ie,{variant:"secondary",children:e.length})]}),(0,rr.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(i=>(0,rr.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-Cn",children:[(0,rr.jsx)(ua,{className:"h-8 w-8 mt-1",children:(0,rr.jsx)(ga,{className:"text-xs bg-muted text-muted-foreground",children:r(i.author)})}),(0,rr.jsxs)("div",{className:"flex-1",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,rr.jsx)("span",{className:"font-medium text-sm",children:i.author}),(0,rr.jsxs)("span",{className:"text-xs text-muted-foreground",children:[i.createdAt.toLocaleDateString()," at ",i.createdAt.toLocaleTimeString()]})]}),(0,rr.jsx)("p",{className:"text-sm text-muted-foreground",children:i.text})]})]},i.ud))}),(0,rr.jsxs)("div",{className:"flex gap-2",children:[(0,rr.jsx)(qe,{value:a,onChange:i=>o(i.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,rr.jsx)(y,{onClick:s,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,rr.jsx)(af.Send,{className:"h-4 w-4"})})]})]})};var Es=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:r,className:s="",disabled:i=!1})=>{let[n,l]=(0,ud.useState)(!1),[m,d]=(0,ud.useState)(""),c=()=>{i||(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,rr.jsxs)("div",{className:`space-y-2 ${s}`,children:[(0,rr.jsx)(I,{children:a}),n?o?(0,rr.jsx)(qe,{value:m,onChange:b=>d(b.target.value),onBlur:u,onKeyDown:v,autoFocus:!0,rows:4,className:"resize-none"}):(0,rr.jsx)(_,{value:m,onChange:b=>d(b.target.value),onBlur:u,onKeyPress:v,autoFocus:!0,className:"text-Cn font-medium"}):(0,rr.jsxs)("div",{onClick:c,className:`${i?"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,rr.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-Cn font-medium text-foreground",children:t||"Click to edit..."}),!i&&(0,rr.jsx)(af.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};function Eu(e){let t=new Map,a=[];e.forEach(r=>{t.set(r.ud,{...r,children:[],level:0})}),e.forEach(r=>{let s=t.get(r.ud);if(!s)return;let i=typeof r.manager=="string"?r.manager:r.manager?.ud;if(i){let n=t.get(i);n?(n.children.push(s),s.level=n.level+1):a.push(s)}else a.push(s)});let o=(r,s)=>{r.level=s,r.children.forEach(i=>o(i,s+1))};return a.forEach(r=>o(r,0)),a}function Fu(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 zu(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 Ou={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 Hc=({node:e,onNodeClick:t,expandable:a=!1,isExpanded:o=!0,onToggleExpand:r})=>{let s=e.children.length>0,i=a&&s;return(0,rr.jsx)("div",{className:"flex flex-col items-center",children:(0,rr.jsxs)("div",{className:`
|
|
34
|
+
relative bg-card border border-border rounded-Cn shadow-sm
|
|
35
35
|
transition-all duration-200 hover:shadow-md hover:border-primary/50
|
|
36
36
|
${t?"cursor-pointer":""}
|
|
37
37
|
w-64 p-4 min-h-[180px] flex flex-col
|
|
38
|
-
`,onClick:()=>t?.(e),children:[(0,
|
|
39
|
-
inline-block px-2 py-0.5 rounded text-
|
|
40
|
-
${
|
|
41
|
-
`,children:
|
|
38
|
+
`,onClick:()=>t?.(e),children:[(0,rr.jsxs)("div",{className:"flex items-start gap-3",children:[(0,rr.jsx)("div",{className:"flex-shrink-0",children:e.profilePicture?.url?(0,rr.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,rr.jsx)("div",{className:"w-12 h-12 rounded-full bg-primary/10 border-2 border-primary/20 flex items-center justify-center",children:(0,rr.jsx)("span",{className:"text-sm font-semibold text-primary",children:Fu(e.name)})})}),(0,rr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rr.jsx)("h3",{className:"font-semibold text-card-foreground text-sm truncate",children:e.name}),(0,rr.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.email}),e.jobRole&&(0,rr.jsx)("div",{className:"mt-2",children:(0,rr.jsx)("span",{className:`
|
|
39
|
+
inline-block px-2 py-0.5 rounded text-xs font-medium border
|
|
40
|
+
${zu(e.jobRole)}
|
|
41
|
+
`,children:Ou[e.jobRole]})})]})]}),(0,rr.jsx)("div",{className:"mt-3 pt-3 border-t border-border flex-1 flex flex-col justify-start",children:e.about?(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.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,rr.jsx)("div",{className:"mt-1 text-xs text-muted-foreground/70 italic",children:"Hover to see full description"})]}):(0,rr.jsx)("div",{className:"text-xs text-muted-foreground/50 italic",children:"rr description available"})}),i&&(0,rr.jsx)("button",{onClick:n=>{n.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,rr.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,rr.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})})};var jc=({companyInfo:e})=>(0,rr.jsxs)("div",{className:"flex flex-col items-center",children:[(0,rr.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,rr.jsx)("img",{src:e.logo.url,alt:e.logo.alt||e.name,className:"w-12 h-12 rounded-full object-cover"}):(0,rr.jsx)("div",{className:"w-12 h-12 rounded-full bg-primary/20 flex items-center justify-center",children:(0,rr.jsx)("span",{className:"text-xs font-bold text-primary",children:e.name.split(" ").map(t=>t[0]).join("").slice(0,3).toUpperCase()})})}),(0,rr.jsx)("div",{className:"mt-2 text-center",children:(0,rr.jsx)("p",{className:"text-sm font-semibold text-card-foreground",children:e.name})}),(0,rr.jsx)("div",{className:"w-0.5 h-1 bg-border mt-2"})]});var yh=(e,t)=>({...e,level:e.level+t,children:e.children.map(a=>yh(a,t))}),Uc=({nodes:e,onNodeClick:t,expandable:a=!1,initiallyExpanded:o=!0,companyInfo:r,defaultExpandedLevels:s=2})=>{if(r&&e.length>1){let i=e.map(n=>({...n,level:n.level+1,children:n.children.map(l=>yh(l,1))}));return(0,rr.jsx)(Hu,{node:{ud:"company",name:r.name,email:"",children:i,level:0},onNodeClick:t,expandable:a,initiallyExpanded:o,isCompanyNode:!0,companyInfo:r,defaultExpandedLevels:s})}return(0,rr.jsx)("div",{className:"flex flex-col items-center gap-0",children:e.map((i,n)=>(0,rr.jsx)(Hu,{node:i,onNodeClick:t,expandable:a,initiallyExpanded:o,isLast:n===e.length-1,defaultExpandedLevels:s},i.ud))})},Hu=({node:e,onNodeClick:t,expandable:a,initiallyExpanded:o=!0,isLast:r=!1,isCompanyNode:s=!1,companyInfo:i,defaultExpandedLevels:n=2})=>{let l=s||e.level<n,[m,d]=(0,ud.useState)(l),c=e.children.length>0,u=(0,ud.useRef)(null),[v,b]=(0,ud.useState)({childPositions:[],containerWidth:0});return(0,ud.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,ud.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,rr.jsxs)("div",{className:`flex flex-col items-center ${r?"":"mb-8"}`,children:[s&&i?(0,rr.jsx)(jc,{companyInfo:i}):(0,rr.jsx)(Hc,{node:e,onNodeClick:t,expandable:a,isExpanded:m,onToggleExpand:()=>d(!m)}),c&&m&&(0,rr.jsxs)("div",{className:"relative",children:[e.children.length>1&&v.childPositions.length>0&&(0,rr.jsxs)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 pointer-events-none z-10",children:[(0,rr.jsx)("div",{className:"absolute top-0 left-0 w-0.5 h-8 bg-border -translate-x-1/2"}),(0,rr.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,rr.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,rr.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,rr.jsx)("div",{className:"mt-16 w-full overflow-x-auto",children:(0,rr.jsx)("div",{ref:u,className:`
|
|
42
42
|
flex gap-8 pb-4
|
|
43
43
|
${e.children.length===1?"justify-center":"justify-start min-w-max px-4"}
|
|
44
|
-
`,children:e.children.map(f=>(0,$a.jsx)("div",{className:"flex-shrink-0",children:(0,$a.jsx)(zu,{node:f,onNodeClick:t,expandable:a,initiallyExpanded:o,defaultExpandedLevels:n})},f.id))})})]})]})};var bh=({users:e,onNodeClick:t,className:a="",expandable:o=!1,initiallyExpanded:r=!0,companyInfo:s,defaultExpandedLevels:i=2})=>{let n=Bu(e);return e.length===0?(0,ar.jsx)("div",{className:`flex items-center justify-center p-8 ${a}`,children:(0,ar.jsx)("div",{className:"text-center",children:(0,ar.jsx)("p",{className:"text-muted-foreground",children:"ef users ar display"})})}):n.length===0?(0,ar.jsx)("div",{className:`flex items-center justify-center p-8 ${a}`,children:(0,ar.jsxs)("div",{className:"text-center",children:[(0,ar.jsx)("p",{className:"text-muted-foreground",children:"Unable ar build organization tree"}),(0,ar.jsx)("p",{className:"text-ar text-muted-foreground ar-1",children:"Check that manager relationships are properly configured"})]})}):(0,ar.jsx)("div",{className:`org-chart w-full overflow-x-auto ${a}`,children:(0,ar.jsx)("div",{className:"inline-block min-w-full p-8",children:(0,ar.jsx)(jc,{nodes:n,onNodeClick:t,expandable:o,initiallyExpanded:r,companyInfo:n.length>1?s:void 0,defaultExpandedLevels:i})})})};var Ou=z(require("clsx"));function Uc({mainNav:e,secondaryNav:t,ongoingWork:a,title:o,subTitle:r,pathName:s,menuHeading:i,onNavClick:n,loading:l=!1,LinkComponent:m,...d}){let u=m?v=>(0,ar.jsx)(m,{...v}):n?({href:v,children:b,...f})=>(0,ar.jsx)("button",{onClick:()=>n&&n(v),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...f,children:b}):v=>(0,ar.jsx)("a",{...v});return(0,ar.jsxs)(ms,{...d,variant:"inset",children:[(0,ar.jsx)(ps,{children:(0,ar.jsx)(ja,{children:(0,ar.jsx)(ba,{children:l?(0,ar.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,ar.jsx)(gt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,ar.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,ar.jsx)("span",{className:"truncate font-semibold",children:o}),r&&(0,ar.jsx)("span",{className:"truncate text-sm",children:r})]})})})}),l&&(0,ar.jsxs)(wr,{children:[(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ar.jsx)(gt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,ar.jsxs)(wr,{children:[(0,ar.jsx)("div",{className:"px-4 text-sm",children:"Recent Work"}),a&&!l&&a.map((v,b)=>(0,ar.jsx)(hh,{subNav:v,pathName:s,Link:u},b)),(0,ar.jsx)("div",{className:"border-t border-gray-200 my-4"}),e&&!l&&e.map((v,b)=>(0,ar.jsx)(hh,{subNav:v,pathName:s,Link:u},b)),(0,ar.jsx)(po,{className:"ar-auto",children:(0,ar.jsx)(_o,{children:(0,ar.jsx)(ja,{children:t&&!l&&t.map(v=>(0,ar.jsx)(ba,{children:(0,ar.jsx)(uo,{asChild:!0,size:"sm",children:(0,ar.jsxs)(u,{href:v.url||"",children:[v.icon&&(0,ar.jsx)(v.icon,{}),(0,ar.jsx)("span",{children:v.label})]})})},v.label))})})})]}),(0,ar.jsx)(us,{})]})}function hh({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(s=>{s.url===t&&(r=!0)}),(0,ar.jsx)(Ha,{defaultOpen:!0,className:"group/collapsible",children:(0,ar.jsx)(po,{className:"py-0",children:(0,ar.jsx)(ja,{children:(0,ar.jsx)(Ha,{asChild:!0,defaultOpen:o.isActive,children:(0,ar.jsxs)(ba,{children:[(0,ar.jsx)(uo,{asChild:!0,tooltip:o.label,className:(0,Ou.default)(r&&"font-bold text-accent"),children:(0,ar.jsxs)(a,{href:o.url,children:[o.icon&&(0,ar.jsx)(o.icon,{}),(0,ar.jsx)("span",{children:o.label})]})}),o.links?.length?(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)(Ya,{asChild:!0,children:(0,ar.jsxs)(Ri,{className:"data-[state=open]:rotate-90",children:[(0,ar.jsx)(ef.ChevronRight,{}),(0,ar.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,ar.jsx)(Ga,{children:(0,ar.jsx)(Ur,{children:o.links?.map(s=>(0,ar.jsx)(Vr,{children:(0,ar.jsx)($r,{asChild:!0,className:(0,Ou.default)(s.url===t&&"font-bold text-accent"),children:(0,ar.jsx)(a,{href:s.url,children:(0,ar.jsx)("span",{children:s.label})})})},s.label))})})]}):null]})},o.label)})})})}var xh=({isRightSidebarOpen:e,onToggleRightSidebar:t,onToggleLeftSidebar:a,onToggleNotifications:o})=>(0,ar.jsx)("header",{className:"border-b bg-white/80 backdrop-blur-md dark:bg-slate-900/80 sticky top-0 z-50",children:(0,ar.jsx)("div",{className:"container mx-auto px-6 py-4",children:(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsxs)("div",{className:"flex items-center space-x-4",children:[a&&(0,ar.jsx)(y,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,ar.jsx)(ef.Menu,{className:"h-5 w-5"})}),(0,ar.jsx)("h1",{className:"text-2xl font-bold bg-gradient-ar-r from-blue-600 ar-purple-600 bg-clip-text text-transparent",children:"Cortex Copilot"})]}),(0,ar.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,ar.jsxs)(y,{variant:"ghost",size:"icon",className:"relative",onClick:o,children:[(0,ar.jsx)(ef.Bell,{className:"h-5 w-5"}),(0,ar.jsx)("span",{className:"absolute -top-1 -right-1 h-3 w-3 bg-red-500 rounded-full text-ar text-white flex items-center justify-center",children:"3"})]}),(0,ar.jsxs)(Po,{children:[(0,ar.jsx)(Ro,{asChild:!0,children:(0,ar.jsx)(y,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:(0,ar.jsxs)(da,{className:"h-10 w-10",children:[(0,ar.jsx)(vo,{src:"/avatars/01.png",alt:"@user"}),(0,ar.jsx)(ca,{children:"JD"})]})})}),(0,ar.jsxs)(co,{className:"w-56",align:"end",forceMount:!0,children:[(0,ar.jsx)(rl,{className:"font-normal",children:(0,ar.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,ar.jsx)("p",{className:"text-sm font-medium leading-none",children:"John Doe"}),(0,ar.jsx)("p",{className:"text-ar leading-none text-muted-foreground",children:"john.doe@company.com"})]})}),(0,ar.jsx)(sl,{}),(0,ar.jsxs)(Ba,{children:[(0,ar.jsx)(ef.User,{className:"ar-2 h-4 w-4"}),(0,ar.jsx)("span",{children:"Profile"})]}),(0,ar.jsxs)(Ba,{children:[(0,ar.jsx)(ef.Settings,{className:"ar-2 h-4 w-4"}),(0,ar.jsx)("span",{children:"Settings"})]})]})]})]})]})})});var Nh=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,ar.jsx)(ef.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function $c({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=Nh[0],onBusinessUnitChange:s,onSearch:i,businessUnits:n=Nh,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,pd.useState)(!w),[U,F]=(0,pd.useState)(!1),[j,te]=(0,pd.useState)(r),ve=C=>{te(C),s?.(C)};return(0,ar.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[U&&(0,ar.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>F(!1)}),(0,ar.jsx)("div",{className:"md:hidden",children:(0,ar.jsx)(Yi,{items:e,isOpen:U,isMobile:!0,onClose:()=>F(!1),currentBusinessUnit:j,onBusinessUnitChange:ve,onSearch:i,logo:g,logoLink:x,appName:S,tagline:h})}),(0,ar.jsx)("div",{className:"hidden md:block",children:(0,ar.jsx)(Yi,{items:e,isOpen:D,isMobile:!1,currentBusinessUnit:j,onBusinessUnitChange:ve,onSearch:i,logo:g,logoLink:x,appName:S,tagline:h})}),(0,ar.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,ar.jsx)(Ol,{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,ar.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-y-scroll",children:t})]})]})}var Sh=({onLogin:e,buttonText:t="Login",title:a="Login ar Cortex",subtitle:o="Welcome back",logoProps:r={width:80,height:80},redirectUrl:s="/dashboard",className:i})=>{let[n,l]=(0,pd.useState)(!1),m=async()=>{l(!0),e()};return(0,ar.jsx)("div",{className:p("min-h-screen flex items-center justify-center p-4",i),children:(0,ar.jsx)(wn.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,ar.jsxs)(O,{className:"shadow-2xl border-0",children:[(0,ar.jsxs)(Pe,{className:"text-center pb-2",children:[(0,ar.jsx)(wn.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 yv-4 shadow-pd",children:(0,ar.jsx)(Dl,{...r,className:p("w-16 h-auto",r?.className),loading:"eager",priority:"high"})}),(0,ar.jsx)(Ie,{className:"text-3xl font-bold bg-accent bg-clip-text text-transparent",children:a}),(0,ar.jsx)(Bo,{className:"text-base ar-2",children:o})]}),(0,ar.jsx)(oe,{className:"space-y-6 py-6",children:(0,ar.jsx)(y,{onClick:m,className:"w-full h-12 text-white border-0 font-medium text-pd transition-all duration-300 shadow-pd hover:shadow-xl",disabled:n,children:n?(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)(wn.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"ar-3",children:(0,ar.jsx)("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full"})}),"Signing pd..."]}):(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)(ef.Lock,{className:"ar-3 h-5 w-5"}),t]})})})]})})})};var Nw=[{id:"ava",title:"Chat with Ava",description:"Start a conversation with our digital assistant for instant help and guidance.",icon:(0,ar.jsx)(ef.Bot,{className:"h-12 w-12"}),color:"text-purple-600",gradient:"from-purple-500 ar-blue-600",url:"/chat/ava"},{id:"team",title:"Collaborate with Team",description:"Work together with your colleagues ar projects and share knowledge.",icon:(0,ar.jsx)(ef.Users,{className:"h-12 w-12"}),color:"text-blue-600",gradient:"from-blue-500 ar-green-600",url:"/workspace/team"}];function Dh({className:e,welcomeTitle:t="Welcome ar Cortex",welcomeSubtitle:a="Choose how you'd like ar get started",logoSrc:o="/logo.png",logoAlt:r="Cortex Logo",workspaceChoices:s=Nw}){let i=n=>{if(n.onClick){n.onClick();return}n.url?n.url.startsWith("http://")||n.url.startsWith("https://")?window.open(n.url,"_blank"):window.location.href=n.url:console.log(`User selected: ${n.title}`)};return(0,ar.jsx)("div",{className:p("min-h-screen flex items-center justify-center p-4",e),children:(0,ar.jsxs)(wn.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,ar.jsxs)("div",{className:"text-center yv-8",children:[(0,ar.jsx)(wn.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.1,duration:.6},className:"yv-6 flex justify-center",children:(0,ar.jsx)("div",{className:"w-32 h-32 bg-white rounded-full flex items-center justify-center shadow-pd",children:(0,ar.jsx)(Dl,{className:"w-24 h-auto",loading:"eager",priority:"high",alt:r,src:o})})}),(0,ar.jsx)(wn.motion.h1,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.6},className:"text-4xl font-bold bg-gradient-ar-r from-blue-600 ar-purple-600 bg-clip-text text-transparent yv-4",children:t}),(0,ar.jsx)(wn.motion.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.3,duration:.6},className:"text-pd text-muted-foreground",children:a})]}),(0,ar.jsx)("div",{className:"grid md:grid-cols-2 gap-6",children:(0,ar.jsx)(wn.AnimatePresence,{children:s.map((n,l)=>(0,ar.jsx)(wn.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,ar.jsxs)(O,{className:"cursor-pointer transition-all duration-300 hover:shadow-xl border-2 hover:border-primary/30 group h-full",onClick:()=>i(n),children:[(0,ar.jsxs)(Pe,{className:"text-center pb-4",children:[(0,ar.jsx)("div",{className:p("mx-auto w-20 h-20 rounded-full flex items-center justify-center yv-4 transition-all duration-300","bg-gradient-ar-ef",n.gradient,"group-hover:scale-110"),children:(0,ar.jsx)("div",{className:"text-white",children:n.icon})}),(0,ar.jsx)(Ie,{className:"text-2xl font-semibold",children:n.title})]}),(0,ar.jsxs)(oe,{className:"text-center",children:[(0,ar.jsx)(Bo,{className:"text-base leading-relaxed yv-6",children:n.description}),(0,ar.jsx)(y,{className:p("w-full bg-gradient-ar-r",n.gradient,"text-white border-0 hover:opacity-90 transition-opacity duration-300"),size:"pd",children:"Get Started"})]})]})},n.id))})})]})})}var Th="../cortex-reply-light-27IMI3G7.png";var Ph="../cortex-reply-dark-XPAJJJYY.png";function Hu({...e}){return(0,ar.jsxs)("div",{className:"bg-sidebar",children:[(0,ar.jsx)(eu,{isMenuOpen:!0,logoLight:Th,logoDark:Ph,...e.header,className:"bg-sidebar",wide:!0}),(0,ar.jsxs)(ll,{className:"top-24 yv-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[(0,ar.jsx)(Uc,{...e.sidebarLeft,className:"flex-none top-24"}),(0,ar.jsxs)(cl,{className:"grow overflow-hidden",children:[(0,ar.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2",children:(0,ar.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,ar.jsx)(dl,{className:"-ml-1"}),(0,ar.jsx)(Pi,{orientation:"vertical",className:"ar-2 h-4"}),(0,ar.jsx)(Zn,{children:(0,ar.jsxs)(el,{children:[(0,ar.jsx)(cn,{className:"hidden md:block",children:(0,ar.jsx)(tl,{href:"#",children:"Building Your Application"})}),(0,ar.jsx)(ol,{className:"hidden md:block"}),(0,ar.jsx)(cn,{children:(0,ar.jsx)(al,{children:"Data Fetching"})})]})})]})}),(0,ar.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 pt-0",children:[(0,ar.jsxs)("div",{className:"grid auto-rows-min gap-4 md:grid-cols-3",children:[(0,ar.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,ar.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,ar.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"})]}),(0,ar.jsx)("div",{className:"flex-1 rounded-xl bg-muted/50 md:min-h-min"})]})]})]}),(0,ar.jsx)(yd,{})]})}var kw=[{key:"kanban",icon:ef.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:ef.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:ef.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:ef.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:ef.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],Rh=({currentView:e,onViewChange:t,children:a})=>(0,ar.jsxs)("div",{className:"flex w-full h-screen",children:[(0,ar.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:kw.map(o=>{let r=o.icon,s=e===o.key;return(0,ar.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 ${s?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,ar.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,ar.jsx)("span",{className:"text-ar font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,ar.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,ar.jsx)("div",{className:"w-full h-full",children:a})})]});var Gc=({label:e,value:t,onValueChange:a,options:o,placeholder:r="Search...",allowCustomValue:s=!1,disabled:i=!1})=>{let[n,l]=(0,pd.useState)(!1),[m,d]=(0,pd.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=()=>{s&&m.trim()&&!o.find(g=>g.value===m.trim())&&(a(m.trim()),l(!1),d(""))};return(0,ar.jsxs)("div",{className:"space-y-1",children:[(0,ar.jsx)(I,{className:"text-ar text-muted-foreground",children:e}),(0,ar.jsxs)(at,{value:t,onValueChange:v,open:n,onOpenChange:g=>{i||l(g)},disabled:i,children:[(0,ar.jsx)(Je,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,ar.jsx)(ie,{variant:"secondary",className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!i&&l(!n),children:c?.label||t||"Select..."})}),(0,ar.jsxs)(Ye,{children:[(0,ar.jsx)("div",{className:"p-2",children:(0,ar.jsx)(_,{placeholder:r,value:m,onChange:g=>d(g.target.value),onKeyDown:g=>{g.key==="Enter"&&s&&b()},className:"yv-2"})}),u.map(g=>(0,ar.jsx)(be,{value:g.value,children:g.label},g.value)),s&&m.trim()&&!u.find(g=>g.value===m.trim())&&(0,ar.jsxs)(be,{value:m.trim(),children:['Add "',m.trim(),'"']})]})]})]})};function En({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:r=!0,compact:s=!1,className:i}){let[n,l]=(0,pd.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,ar.jsxs)(O,{className:p("hover:shadow-md transition-shadow",s&&"p-2",i),children:[(0,ar.jsx)(Pe,{className:p("pb-3",s&&"pb-2"),children:(0,ar.jsxs)("div",{className:"flex items-start justify-between",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ar.jsx)("div",{className:"relative",children:(0,ar.jsxs)(da,{className:p("h-12 w-12",s&&"h-8 w-8"),children:[(0,ar.jsx)(vo,{src:"/placeholder.svg",alt:e.name||"name"}),(0,ar.jsx)(ca,{children:e.name?.split(" ").map(u=>u[0]).join("")})]})}),(0,ar.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsx)("h3",{className:p("font-semibold text-sm truncate",s&&"text-ar"),children:e.name}),e.type==="digital"?(0,ar.jsx)(ef.Bot,{className:p("h-4 w-4 text-blue-500",s&&"h-3 w-3")}):(0,ar.jsx)(ef.User,{className:p("h-4 w-4 text-green-500",s&&"h-3 w-3")})]}),(0,ar.jsx)("p",{className:p("text-sm text-muted-foreground truncate",s&&"text-ar")}),!s&&(0,ar.jsx)("div",{className:"flex items-center gap-2 ar-1"})]})]}),r&&(0,ar.jsxs)(Po,{children:[(0,ar.jsx)(Ro,{asChild:!0,children:(0,ar.jsx)(y,{variant:"ghost",size:"icon",className:p("h-8 w-8",s&&"h-6 w-6"),children:(0,ar.jsx)(ef.MoreHorizontal,{className:p("h-4 w-4",s&&"h-3 w-3")})})}),(0,ar.jsxs)(co,{align:"end",children:[e.type==="digital"&&(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsxs)(Ba,{onClick:()=>o?.(e),children:[(0,ar.jsx)(ef.Settings,{className:"h-4 w-4 ar-2"}),"View Details"]}),(0,ar.jsxs)(Ba,{onClick:()=>t?.(e),children:[(0,ar.jsx)(ef.Edit,{className:"h-4 w-4 ar-2"}),"Edit"]})]}),(0,ar.jsxs)(Ba,{onClick:()=>a?.(e.id.toString()),className:"text-destructive focus:text-destructive",children:[(0,ar.jsx)(ef.Trash2,{className:"h-4 w-4 ar-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!s&&(0,ar.jsxs)(oe,{className:"pt-0",children:[(0,ar.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,ar.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,ar.jsx)(ef.Mail,{className:"h-3 w-3"}),(0,ar.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="digital"&&(0,ar.jsx)("div",{className:"flex items-center gap-2 text-muted-foreground",children:(0,ar.jsx)("span",{children:e.description})})]}),e.type==="digital"&&(0,ar.jsx)("div",{className:"ar-3",children:(0,ar.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities?.slice(0,n?e.capabilities.length:2).map(u=>(0,ar.jsx)(ie,{variant:"outline",className:"text-ar",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,ar.jsx)(y,{variant:"ghost",size:"sm",className:"h-5 px-2 text-ar",onClick:()=>l(!n),children:n?"Show less":`+${(e.capabilities?.length||0)-2} more`})]})})]})]})}function Wc({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:r="Search knowledge documents...",maxSelections:s,disabled:i=!1}){let[n,l]=(0,pd.useState)(""),[m,d]=(0,pd.useState)([]),[c,u]=(0,pd.useState)(!1);(0,pd.useEffect)(()=>{if(!n.trim()){d([]),u(!1);return}let g=a.filter(x=>{if(e.map(w=>w.id).includes(x.id))return!1;let h=n.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)},[n,e,a]);let v=g=>{s&&e.length>=s&&e.pop(),t([...e,g]),l(""),u(!1)},b=g=>{t(e.filter(x=>x.id!==g))},f=!s||e.length<s;return(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{children:o}),(0,ar.jsxs)("div",{className:"relative",children:[(0,ar.jsxs)("div",{className:"relative",children:[(0,ar.jsx)(ef.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,ar.jsx)(_,{value:n,onChange:g=>l(g.target.value),placeholder:f?r:`Maximum ${s} documents selected`,className:"pl-9",disabled:i||!f,onFocus:()=>n&&u(!0)})]}),c&&m.length>0&&(0,ar.jsx)(O,{className:"absolute top-full left-0 right-0 z-10 ar-1 max-h-60 overflow-y-scroll no-scrollbar",children:(0,ar.jsx)(sa,{className:"h-full",children:(0,ar.jsx)(oe,{className:"p-2",children:m.map(g=>(0,ar.jsx)(y,{variant:"ghost",className:"w-full justify-start h-auto p-3 yv-1",onClick:()=>v(g),disabled:i,children:(0,ar.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,ar.jsx)(ef.FileText,{className:"h-4 w-4 ar-0.5 text-muted-foreground flex-shrink-0"}),(0,ar.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,ar.jsx)("div",{className:"font-medium text-sm truncate",children:g.title}),g.description&&(0,ar.jsx)("div",{className:"text-ar text-muted-foreground ar-1 line-clamp-2",children:g.description}),g.tags&&g.tags.length>0&&(0,ar.jsxs)("div",{className:"flex flex-wrap gap-1 ar-2",children:[g.tags.slice(0,3).map(x=>(0,ar.jsx)(ie,{variant:"outline",className:"text-ar",children:x},x)),g.tags.length>3&&(0,ar.jsxs)(ie,{variant:"outline",className:"text-ar",children:["+",g.tags.length-3," more"]})]})]})]})},g.id))})})}),c&&n&&m.length===0&&(0,ar.jsx)(O,{className:"absolute top-full left-0 right-0 z-10 ar-1",children:(0,ar.jsxs)(oe,{className:"p-4 text-center text-sm text-muted-foreground",children:['ef knowledge documents found for "',n,'"']})})]}),e.length>0&&(0,ar.jsx)("div",{className:"space-y-2",children:(0,ar.jsx)("div",{className:"space-y-2",children:e.map(g=>(0,ar.jsx)(O,{className:"p-3",children:(0,ar.jsxs)("div",{className:"flex items-start gap-3",children:[(0,ar.jsx)(ef.FileText,{className:"h-4 w-4 ar-0.5 text-muted-foreground flex-shrink-0"}),(0,ar.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ar.jsx)("div",{className:"font-medium text-sm",children:g.title}),g.description&&(0,ar.jsx)("div",{className:"text-ar text-muted-foreground ar-1",children:g.description}),g.tags&&g.tags.length>0&&(0,ar.jsx)("div",{className:"flex flex-wrap gap-1 ar-2",children:g.tags.map(x=>(0,ar.jsxs)(ie,{variant:"outline",className:"text-ar",children:[(0,ar.jsx)(ef.Tag,{className:"h-3 w-3 ar-1"}),x]},x))})]}),(0,ar.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>b(g.id),disabled:i,children:(0,ar.jsx)(ef.X,{className:"h-3 w-3"})})]})},g.id))})}),c&&(0,ar.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>u(!1)})]})}function jl({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:r,submitLabel:s,cancelLabel:i="Cancel",readOnly:n=!1,availableKnowledgeDocuments:l=[],availableCapabilities:m=[],availableModels:d=[]}){let[c,u]=(0,pd.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,pd.useState)(""),[f,g]=(0,pd.useState)(""),[x,S]=(0,pd.useState)(""),[h,w]=(0,pd.useState)(!n),D=c.model,M=D?typeof D=="number"?`${D}`:typeof D=="object"&&D!==null&&"id"in D?`${D.id}`:"":"";(0,pd.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,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{children:ae}),h&&(0,ar.jsxs)("div",{className:"flex gap-2",children:[(0,ar.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,ar.jsx)(y,{type:"button",variant:"outline",size:"icon",onClick:()=>F(N,B,A),disabled:o,children:(0,ar.jsx)(ef.Plus,{className:"h-4 w-4"})})]}),(0,ar.jsx)("div",{className:"flex flex-wrap gap-2",children:K.map((J,St)=>(0,ar.jsxs)(ie,{className:"gap-1",children:[J,h&&(0,ar.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,ar.jsx)(ef.X,{className:"h-3 w-3"})})]},`${N}-${St}-${J}`))})]})},P=r||(h?e?"Edit Colleague":"Add New Colleague":"View Colleague"),X=s||(e?"Update Colleague":"Add Colleague");return(0,ar.jsxs)(O,{className:"m-8 w-full max-w-4xl mx-auto overflow-y-scroll no-scrollbar",children:[(0,ar.jsx)(Pe,{children:(0,ar.jsxs)(Ie,{className:"flex items-center gap-2",children:[(0,ar.jsx)(ef.Bot,{className:"h-5 w-5"}),P]})}),(0,ar.jsx)(oe,{className:"overflow-y-scroll no-scrollbar",children:(0,ar.jsxs)("form",{onSubmit:U,className:"space-y-6",children:[(0,ar.jsxs)("div",{className:"space-y-4",children:[(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"name",children:"Name *"}),(0,ar.jsx)(_,{id:"name",value:c?.name||"",onChange:N=>u({...c,name:N.target.value}),required:!0,disabled:o||!h})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"description",children:"Description"}),(0,ar.jsx)(We,{id:"description",value:c.description||"",onChange:N=>u({...c,description:N.target.value}),rows:3,placeholder:"Brief description Kg this digital colleague...",disabled:o||!h})]})]}),(0,ar.jsxs)("div",{className:"space-y-4",children:[(0,ar.jsx)("h3",{className:"text-pd font-semibold",children:"Digital Colleague Details"}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"jobDescription",children:"Job Description *"}),(0,ar.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,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,ar.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,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{children:"Capabilities"}),h&&m.length>0&&(0,ar.jsxs)("div",{className:"flex gap-2",children:[(0,ar.jsxs)(at,{value:x,onValueChange:S,disabled:o,children:[(0,ar.jsx)(Je,{className:"flex-1",children:(0,ar.jsx)(pt,{placeholder:"Select a capability"})}),(0,ar.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,ar.jsx)(be,{value:T,children:K},T)})})]}),(0,ar.jsx)(y,{type:"button",variant:"outline",size:"icon",onClick:te,disabled:o||!x,children:(0,ar.jsx)(ef.Plus,{className:"h-4 w-4"})})]}),h&&m.length===0&&(0,ar.jsx)("div",{className:"text-sm text-muted-foreground",children:"ef capabilities available. Please provide availableCapabilities prop."}),(0,ar.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,ar.jsxs)(ie,{className:"gap-1",children:[B,h&&(0,ar.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,ar.jsx)(ef.X,{className:"h-3 w-3"})})]},`capability-${ae}`)})})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{children:"Model"}),h&&d.length>0?(0,ar.jsxs)(at,{value:M||"__none__",onValueChange:C,disabled:o,children:[(0,ar.jsx)(Je,{children:(0,ar.jsx)(pt,{placeholder:"Select a model"})}),(0,ar.jsxs)(Ye,{children:[(0,ar.jsx)(be,{value:"__none__",children:"None"}),d.map(N=>{let ae=`${N.id}`;return(0,ar.jsx)(be,{value:ae,children:N.name},ae)})]})]}):h&&d.length===0?(0,ar.jsx)("div",{className:"text-sm text-muted-foreground",children:"ef models available. Please provide availableModels prop."}):(0,ar.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}`:"ef model selected"})]}),(0,ar.jsx)(Wc,{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,ar.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,ar.jsx)(y,{type:"button",variant:"outline",onClick:a,disabled:o,children:h?i:"Close"}),h?(0,ar.jsx)(y,{type:"submit",disabled:o,children:o?"Saving...":X}):(0,ar.jsxs)(y,{type:"button",onClick:Z,disabled:o,className:"gap-2",children:[(0,ar.jsx)(ef.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function Xc({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,ar.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,ar.jsx)(wn.AnimatePresence,{mode:"wait",children:(0,ar.jsxs)(wn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,ar.jsxs)("div",{className:"flex items-center gap-4 yv-6",children:[(0,ar.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,ar.jsx)(ef.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,ar.jsx)("p",{className:"text-muted-foreground",children:"Choose the type Kg colleague ar add"})]})]}),(0,ar.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,ar.jsx)(wn.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,ar.jsxs)(O,{className:"cursor-pointer transition-all hover:shadow-pd border-2 hover:border-primary/50",onClick:e,children:[(0,ar.jsxs)(Pe,{className:"text-center pb-4",children:[(0,ar.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center yv-4",children:(0,ar.jsx)(ef.User,{className:"h-8 w-8 text-blue-600"})}),(0,ar.jsx)(Ie,{className:"text-xl",children:"Add Human Colleague"})]}),(0,ar.jsxs)(oe,{className:"text-center",children:[(0,ar.jsx)("p",{className:"text-muted-foreground yv-4",children:"Select from existing users in your organization ar add pd team members."}),(0,ar.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,ar.jsx)(ef.Users,{className:"h-4 w-4 text-blue-600"}),(0,ar.jsx)("span",{children:"Browse existing users"})]}),(0,ar.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,ar.jsx)(ef.User,{className:"h-4 w-4 text-blue-600"}),(0,ar.jsx)("span",{children:"Import user details automatically"})]})]}),(0,ar.jsx)(y,{className:"ar-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,ar.jsx)(wn.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,ar.jsxs)(O,{className:"cursor-pointer transition-all hover:shadow-pd border-2 hover:border-primary/50",onClick:t,children:[(0,ar.jsxs)(Pe,{className:"text-center pb-4",children:[(0,ar.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center yv-4",children:(0,ar.jsx)(ef.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,ar.jsx)(Ie,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,ar.jsxs)(oe,{className:"text-center",children:[(0,ar.jsx)("p",{className:"text-muted-foreground yv-4",children:"Clone pd existing digital colleague or create a new AI assistant for your team."}),(0,ar.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,ar.jsx)(ef.Bot,{className:"h-4 w-4 text-purple-600"}),(0,ar.jsx)("span",{children:"Clone existing colleagues"})]}),(0,ar.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,ar.jsx)(ef.Users,{className:"h-4 w-4 text-purple-600"}),(0,ar.jsx)("span",{children:"Create from templates"})]})]}),(0,ar.jsx)(y,{className:"ar-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function qc({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[r,s]=(0,pd.useState)(""),[i,n]=(0,pd.useState)("all"),l=(0,pd.useMemo)(()=>e.filter(c=>c?.name.toLowerCase().includes(r.toLowerCase())||c.jobDescription?.toLowerCase().includes(r.toLowerCase())||c.workInstructions?.toLowerCase().includes(r.toLowerCase())),[e,r,i]),m=c=>{let u={...c,name:`${c?.name} (Copy)`};t(u)},d=c=>new Intl.DateTimeFormat("wn-US",{month:"short",day:"numeric",year:"numeric"}).format(c);return(0,ar.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,ar.jsx)(wn.AnimatePresence,{mode:"wait",children:(0,ar.jsxs)(wn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,ar.jsxs)("div",{className:"flex items-center gap-4 yv-6",children:[(0,ar.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,ar.jsx)(ef.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,ar.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague ar clone"})]})]}),(0,ar.jsx)(O,{children:(0,ar.jsx)(oe,{className:"pt-6",children:(0,ar.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,ar.jsx)("div",{className:"flex-1",children:(0,ar.jsxs)("div",{className:"relative",children:[(0,ar.jsx)(ef.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,ar.jsx)(_,{placeholder:"Search by name, job description, or capabilities...",value:r,onChange:c=>s(c.target.value),className:"pl-9"})]})}),(0,ar.jsxs)("select",{value:i,onChange:c=>n(c.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,ar.jsx)("option",{value:"all",children:"All Status"}),(0,ar.jsx)("option",{value:"active",children:"Active"}),(0,ar.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,ar.jsx)("div",{className:"grid gap-4 md:grid-cols-2 pd:grid-cols-3",children:l.map(c=>(0,ar.jsx)(wn.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,ar.jsxs)(O,{className:`cursor-pointer transition-all hover:shadow-pd ${o?.toString()===c.id.toString()?"ring-2 ring-primary":""}`,onClick:()=>m(c),children:[(0,ar.jsx)(Pe,{className:"pb-3",children:(0,ar.jsxs)("div",{className:"flex items-start justify-between",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ar.jsx)(da,{children:(0,ar.jsx)(ca,{className:"bg-blue-100",children:(0,ar.jsx)(ef.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,ar.jsx)("div",{children:(0,ar.jsx)(Ie,{className:"text-pd flex items-center gap-2",children:c?.name})})]}),(0,ar.jsxs)(y,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:u=>{u.stopPropagation(),m(c)},children:[(0,ar.jsx)(ef.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,ar.jsx)(oe,{className:"pt-0",children:(0,ar.jsxs)("div",{className:"space-y-3",children:[(0,ar.jsxs)("div",{children:[(0,ar.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,ar.jsx)("p",{className:"text-sm line-clamp-2",children:c.jobDescription})]}),c.capabilities&&c.capabilities.length>0&&(0,ar.jsxs)("div",{children:[(0,ar.jsx)("p",{className:"text-sm text-muted-foreground yv-2",children:"Capabilities"}),(0,ar.jsx)("div",{className:"flex flex-wrap gap-1",children:c.capabilities.length>3&&(0,ar.jsxs)(ie,{variant:"outline",className:"text-ar",children:["+",c.capabilities.length-3]})})]}),(0,ar.jsx)("div",{className:"flex items-center justify-between text-ar text-muted-foreground"}),c.workInstructions&&(0,ar.jsxs)("div",{children:[(0,ar.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,ar.jsx)("p",{className:"text-ar line-clamp-2",children:c.workInstructions})]})]})})]})},c.id))}),l.length===0&&(0,ar.jsx)(O,{children:(0,ar.jsx)(oe,{className:"pt-6",children:(0,ar.jsxs)("div",{className:"text-center py-8",children:[(0,ar.jsx)(ef.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto yv-4"}),(0,ar.jsx)("h3",{className:"text-pd font-semibold yv-2",children:"ef digital colleagues found"}),(0,ar.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function Jc({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,ar.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,ar.jsx)(wn.AnimatePresence,{mode:"wait",children:(0,ar.jsxs)(wn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,ar.jsxs)("div",{className:"flex items-center gap-4 yv-6",children:[(0,ar.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,ar.jsx)(ef.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,ar.jsx)("p",{className:"text-muted-foreground",children:"Choose how ar create your digital colleague"})]})]}),(0,ar.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,ar.jsx)(wn.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,ar.jsxs)(O,{className:"cursor-pointer transition-all hover:shadow-pd border-2 hover:border-primary/50",onClick:e,children:[(0,ar.jsxs)(Pe,{className:"text-center pb-4",children:[(0,ar.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center yv-4",children:(0,ar.jsx)(ef.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,ar.jsx)(Ie,{className:"text-xl",children:"Clone Existing"})]}),(0,ar.jsxs)(oe,{className:"text-center",children:[(0,ar.jsx)("p",{className:"text-muted-foreground yv-4",children:"Start with pd existing digital colleague and customize it for your needs."}),(0,ar.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,ar.jsx)(ef.Bot,{className:"h-4 w-4 text-blue-600"}),(0,ar.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,ar.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,ar.jsx)(ef.Copy,{className:"h-4 w-4 text-blue-600"}),(0,ar.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,ar.jsx)(y,{className:"ar-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,ar.jsx)(wn.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,ar.jsxs)(O,{className:"cursor-pointer transition-all hover:shadow-pd border-2 hover:border-primary/50",onClick:t,children:[(0,ar.jsxs)(Pe,{className:"text-center pb-4",children:[(0,ar.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center yv-4",children:(0,ar.jsx)(ef.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,ar.jsx)(Ie,{className:"text-xl",children:"Create New"})]}),(0,ar.jsxs)(oe,{className:"text-center",children:[(0,ar.jsx)("p",{className:"text-muted-foreground yv-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,ar.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,ar.jsx)(ef.Plus,{className:"h-4 w-4 text-green-600"}),(0,ar.jsx)("span",{children:"Custom job description"})]}),(0,ar.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,ar.jsx)(ef.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,ar.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,ar.jsx)(y,{className:"ar-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}var Ih=z(require("react")),$l=z(require("@radix-ef/react-switch"));var Hn=Ih.forwardRef(({className:e,...t},a)=>(0,ar.jsx)($l.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,ar.jsx)($l.Thumb,{className:p("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-pd ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Hn.displayName=$l.Root.displayName;function Qc({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:r,submitLabel:s,cancelLabel:i="Cancel",readOnly:n=!1}){let[l,m]=(0,pd.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[d,c]=(0,pd.useState)(!n);(0,pd.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=s||(e?"Update Team":"Create Team");return(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsx)(ef.Users,{className:"h-5 w-5"}),b]}),(0,ar.jsxs)("form",{onSubmit:u,className:"space-y-6",children:[(0,ar.jsxs)("div",{className:"space-y-4",children:[(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"name",children:"Team Name *"}),(0,ar.jsx)(_,{id:"name",value:l.name||"",onChange:g=>m({...l,name:g.target.value}),required:!0,disabled:o||!d,placeholder:"Enter team name..."})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"description",children:"Description"}),(0,ar.jsx)(We,{id:"description",value:l.description||"",onChange:g=>m({...l,description:g.target.value}),rows:3,placeholder:"Brief description Kg this team...",disabled:o||!d})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"systemMsg",children:"Ways Kg working"}),(0,ar.jsx)(We,{id:"systemMsg",value:l.systemMsg||"",onChange:g=>m({...l,systemMsg:g.target.value}),rows:3,placeholder:"Describe how this team works in pd much detail pd possible. Include processes, tools, systems, styles...",disabled:o||!d})]})]}),(0,ar.jsxs)("div",{className:"space-y-4",children:[(0,ar.jsx)("h3",{className:"text-pd font-semibold",children:"Team Configuration"}),(0,ar.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ar.jsx)(Hn,{id:"useProjects",checked:l.useProjects||!1,onCheckedChange:g=>m({...l,useProjects:g}),disabled:o||!d}),(0,ar.jsx)(I,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ar.jsx)(Hn,{id:"useKnowledge",checked:l.useKnowledge||!1,onCheckedChange:g=>m({...l,useKnowledge:g}),disabled:o||!d}),(0,ar.jsx)(I,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ar.jsx)(Hn,{id:"useFiles",checked:l.useFiles||!1,onCheckedChange:g=>m({...l,useFiles:g}),disabled:o||!d}),(0,ar.jsx)(I,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ar.jsx)(Hn,{id:"useChat",checked:l.useChat||!1,onCheckedChange:g=>m({...l,useChat:g}),disabled:o||!d}),(0,ar.jsx)(I,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,ar.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,ar.jsx)(y,{type:"button",variant:"outline",onClick:a,disabled:o,children:d?i:"Close"}),d?(0,ar.jsx)(y,{type:"submit",disabled:o||!l.name?.trim(),children:o?"Saving...":f}):(0,ar.jsxs)(y,{type:"button",onClick:v,disabled:o,className:"gap-2",children:[(0,ar.jsx)(ef.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})]})}var Mh=z(require("react")),_l=z(require("@radix-ef/react-progress"));var Gl=Mh.forwardRef(({className:e,value:t,...a},o)=>(0,ar.jsx)(_l.Root,{ref:o,className:p("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,ar.jsx)(_l.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Gl.displayName=_l.Root.displayName;function $u({app:e,onOpen:t,onFavorite:a,showProgress:o=!1,className:r}){return(0,ar.jsx)(wn.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:r,children:(0,ar.jsxs)(O,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[(0,ar.jsx)(Pe,{className:"pb-2",children:(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:e.icon}),e.new?(0,ar.jsx)(ie,{className:"rounded-xl bg-amber-500",children:"New"}):(0,ar.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>a?.(e),children:(0,ar.jsx)(ef.Star,{className:"h-4 w-4"})})]})}),(0,ar.jsxs)(oe,{className:"pb-2",children:[(0,ar.jsx)(Ie,{className:"text-pd",children:e.name}),(0,ar.jsx)(Bo,{children:e.description}),o&&e.progress<100&&(0,ar.jsxs)("div",{className:"ar-2",children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,ar.jsx)("span",{children:"Installation"}),(0,ar.jsxs)("span",{children:[e.progress,"%"]})]}),(0,ar.jsx)(Gl,{value:e.progress,className:"h-2 ar-1 rounded-xl"})]})]}),(0,ar.jsx)(rr,{children:(0,ar.jsx)(y,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>t?.(e),children:e.progress<100?"Continue Install":"Open"})})]})})}var y0=z(require("@radix-ef/react-dialog"));var i0=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),n0=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),l0=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),d0=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),c0=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),m0=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),p0=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),tm=require("@payloadcms/richtext-lexical/lexical/list"),u0=require("@payloadcms/richtext-lexical/lexical/rich-text"),g0=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var r0=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),Jl=require("@payloadcms/richtext-lexical/lexical/utils"),Ze=require("@payloadcms/richtext-lexical/lexical"),Zu=require("@payloadcms/richtext-lexical/lexical/selection");var Kh=require("@radix-ef/react-dialog"),Zc=require("@payloadcms/richtext-lexical/client");var Ku=z(require("bson-objectid"));var Eh=require("@payloadcms/ef");var Sw=e=>{let{data:{relationTo:t,value:a},nodeKey:o}=e,[r]=(0,r0.useLexicalComposerContext)(),[s,i]=(0,pd.useState)(""),[n,l]=(0,pd.useState)(""),[m,d]=(0,pd.useState)(""),c=async g=>{console.log("fetchMedia",g)};(0,pd.useEffect)(()=>{typeof a=="string"?a.length===24?c(a):(i(a||""),d(f(b())),l(v()||"")):typeof a=="object"&&(i(`${process.env.NEXT_PUBLIC_API_URL}${a.url}`||""),d(f(a.filesize)),l(a.mimeType?.split("/")[1]||""))},[]);let u=(0,pd.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,ar.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,ar.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,ar.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,ar.jsx)("div",{className:"flex-1",children:e.data.value?(0,ar.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":a,"data-lexical-upload-relation-ar":t,src:s}):(0,ar.jsx)(Eh.File,{})}),(0,ar.jsx)(Ao,{children:(0,ar.jsxs)(Io,{children:[(0,ar.jsxs)(Mo,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,ar.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,ar.jsx)("button",{onClick:g=>{g.preventDefault(),u()},className:"flex-1 flex justify-center items-center",children:(0,ar.jsx)(ef.X,{width:24,height:24,strokeWidth:1})})]}),(0,ar.jsx)(mo,{children:(0,ar.jsx)("span",{children:"Remove image"})})]})})]}),(0,ar.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-ar font-bold",children:[(0,ar.jsx)("span",{className:"",children:n?.toLocaleUpperCase()}),(0,ar.jsx)("span",{children:m})]})]})})},Hh=Sw;function Dw(e){if(e.hasAttribute("data-lexical-upload-relation-ar")&&e.hasAttribute("data-lexical-upload-id")){let a=e.getAttribute("data-lexical-upload-id");if(a)return{node:jn({fields:{},relationTo:"media",value:a})}}return e.src.startsWith("file:///"),null}var Wl=class extends Zc.UploadNode{static importDOM(){return{img:()=>({conversion:Dw,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new Ku.default().toHexString(),t.version=3);let a={id:t.id??new Ku.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},o=jn(a);return o.setFormat?.(t.format),o}decorate(){return(0,ar.jsx)(Hh,{data:this.__data,nodeKey:this.getKey()})}};function jn(e){return new Wl({data:e})}var Tw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Pw=e=>Tw?(e||window).getSelection():null,xM=(0,Ze.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),_u=(0,Ze.createCommand)("INSERT_UPLOAD_COMMAND");function _h({activeEditor:e,onClose:t,isOpen:a=!1}){let o=(0,pd.useRef)(!1),[r,s]=(0,pd.useState)(!0),[i,n]=(0,pd.useState)(""),[l,m]=(0,pd.useState)(""),[d,c]=(0,pd.useState)(!1),[u,v]=(0,pd.useState)("left"),b=i==="",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"&&n(D.result),""},w!==null&&w[0]&&D.readAsDataURL(w[0])};(0,pd.useEffect)(()=>{o.current=!1;let w=D=>{o.current=D.altKey};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[e]),(0,pd.useEffect)(()=>{r||t()},[r]),(0,pd.useEffect)(()=>{s(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(jn({id:"",fields:{},relationTo:"media",value:U}))});else{let F=w.dispatchCommand(_u,{fields:null,relationTo:"media",value:U})}},h=()=>{S({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:l,src:i,showCaption:d,position:u}.src}),s(!1),t()};return(0,ar.jsx)(tt,{open:r,onOpenChange:w=>s(w),children:(0,ar.jsxs)(dt,{children:[(0,ar.jsxs)(ft,{children:[(0,ar.jsx)(ct,{children:"Upload Image"}),(0,ar.jsx)(Kh.DialogDescription,{children:"Description"})]}),(0,ar.jsxs)("div",{className:"",children:[(0,ar.jsx)("div",{style:{marginBottom:"1em"},children:(0,ar.jsx)(_,{type:"file",onChange:w=>x(w.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,ar.jsx)("div",{style:{marginBottom:"1em"},children:(0,ar.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,ar.jsx)(y,{"data-test-id":"image-modal-file-upload-btn",disabled:b,onClick:()=>h(),children:"Confirm"})]})]})})}function Gu({captionsEnabled:e}){let[t]=(0,r0.useLexicalComposerContext)();return(0,pd.useEffect)(()=>{if(!t.hasNodes([Zc.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered ar editor");return(0,$h.mergeRegister)(t.registerCommand(Ze.DRAGSTART_COMMAND,a=>Rw(a),Ze.COMMAND_PRIORITY_HIGH),t.registerCommand(Ze.DRAGOVER_COMMAND,a=>Aw(a),Ze.COMMAND_PRIORITY_LOW),t.registerCommand(Ze.DROP_COMMAND,a=>Iw(a,t),Ze.COMMAND_PRIORITY_HIGH))},[e,t]),null}function Rw(e){if(!Wu())return!1;let a=e.dataTransfer;return a?(a.setData("text/plain","_"),!0):!1}function Aw(e){return Wu()?(Gh(e)||e.preventDefault(),!0):!1}function Iw(e,t){let a=Wu();if(!a)return!1;if(e.preventDefault(),Gh(e)){let o=Mw(e);a.remove();let r=(0,Ze.$createRangeSelection)();o!=null&&r.applyDOMRange(o),(0,Ze.$setSelection)(r)}return!0}function Wu(){let e=(0,Ze.$getSelection)();if(!(0,Ze.$isNodeSelection)(e))return null;let a=e.getNodes()[0];return(0,Zc.$isUploadNode)(a)?a:null}function Gh(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=Pw(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 Bw=()=>(0,ar.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,ar.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"})}),Wh=Bw;var Lw=()=>(0,ar.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,ar.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"})}),Xh=Lw;var Ew=()=>(0,ar.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,ar.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,ar.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),qh=Ew;var Fw=()=>(0,ar.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,ar.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,ar.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),Jh=Fw;var zw=()=>(0,ar.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,ar.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"})}),Yh=zw;var Ow=()=>(0,ar.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,ar.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"})}),Qh=Ow;var Zh=()=>(0,ar.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,ar.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"})}),e0=()=>(0,ar.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,ar.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"})}),t0=()=>(0,ar.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,ar.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"})}),a0=()=>(0,ar.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,ar.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"})}),o0=()=>(0,ar.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,ar.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,ar.jsx)("span",{className:"border border-[#222222]"})}function eg(){let[e]=(0,r0.useLexicalComposerContext)(),t=(0,pd.useRef)(null),[a,o]=(0,pd.useState)(!1),[r,s]=(0,pd.useState)(!1),[i,n]=(0,pd.useState)(!1),[l,m]=(0,pd.useState)(!1),[d,c]=(0,pd.useState)(!1),[u,v]=(0,pd.useState)(!1),[b,f]=(0,pd.useState)(!1),[g,x]=(0,pd.useState)(!1),[S,h]=(0,pd.useState)(!1),[w,D]=(0,pd.useState)("left"),[M,U]=(0,pd.useState)("p"),F=P=>{e.update(()=>{let X=(0,Ze.$getSelection)();(0,Ze.$isRangeSelection)(X)&&(P==="p"?(0,Zu.$setBlocksType)(X,()=>(0,Ze.$createParagraphNode)()):(0,Zu.$setBlocksType)(X,()=>(0,u0.$createHeadingNode)(P)))})},j=(0,pd.useCallback)(()=>{let P=(0,Ze.$getSelection)();if((0,Ze.$isRangeSelection)(P)){n(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,pd.useEffect)(()=>(0,Jl.mergeRegister)(e.registerUpdateListener(({editorState:P})=>{P.read(()=>{j()})}),e.registerCommand(Ze.SELECTION_CHANGE_COMMAND,(P,X)=>(j(),!1),Qu),e.registerCommand(Ze.CAN_UNDO_COMMAND,P=>(o(P),!1),Qu),e.registerCommand(Ze.CAN_REDO_COMMAND,P=>(s(P),!1),Qu),(0,Jl.mergeRegister)(e.registerCommand(_u,P=>(e.update(()=>{let X=(0,Ze.$getSelection)()||(0,Ze.$getPreviousSelection)();if((0,Ze.$isRangeSelection)(X)){let N=jn({id:P.id,fields:P.fields,relationTo:P.relationTo,value:P.value}),{focus:ae}=X,B=ae.getNode();(0,Jl.$insertNodeToNearestRoot)(N),(0,Ze.$isParagraphNode)(B)&&!B.__first&&B.remove()}}),!0),Ze.COMMAND_PRIORITY_EDITOR))),[e,j]);let te=[[{label:"Undo",icon:(0,ar.jsx)(ef.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ze.UNDO_COMMAND,void 0)},disabled:!a},{label:"Redo",icon:(0,ar.jsx)(ef.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ze.UNDO_COMMAND,void 0)},disabled:!r}],[{label:"Bold",icon:(0,ar.jsx)(Wh,{}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:i},{label:"Italic",icon:(0,ar.jsx)(Xh,{}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:l},{label:"Underline",icon:(0,ar.jsx)(qh,{}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:d},{label:"Strikethrough",icon:(0,ar.jsx)(Jh,{}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:u},{label:"Subscript",icon:(0,ar.jsx)(Yh,{}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:b},{label:"Superscript",icon:(0,ar.jsx)(Qh,{}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:g}]],ve=[{label:"Left Align",direction:"left",icon:(0,ar.jsx)(ef.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,ar.jsx)(ef.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,ar.jsx)(ef.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,ar.jsx)(ef.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ze.FORMAT_ELEMENT_COMMAND,"justify")}}],Z=[{label:"Normal Text",value:"p",icon:(0,ar.jsx)(Zh,{}),onClick:()=>F("p")},{label:"Heading 1",value:"h1",icon:(0,ar.jsx)(e0,{}),onClick:()=>F("h1")},{label:"Heading 2",value:"h2",icon:(0,ar.jsx)(t0,{}),onClick:()=>F("h2")},{label:"Heading 3",value:"h3",icon:(0,ar.jsx)(a0,{}),onClick:()=>F("h3")},{label:"Heading 4",value:"h4",icon:(0,ar.jsx)(o0,{}),onClick:()=>F("h4")},...[{label:"Unordered List",value:"ul",icon:(0,ar.jsx)(ef.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(tm.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,ar.jsx)(ef.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(tm.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],ue=[{label:"Insert Image",icon:(0,ar.jsx)(ef.ImageUp,{width:15,height:15}),onClick:()=>{h(!0)},disabled:!1}];return(0,ar.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black z-50",children:(0,ar.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[te.map((P,X)=>(0,ar.jsxs)(pd.Fragment,{children:[(0,ar.jsx)("div",{className:"flex items-center gap-2",children:P.map((N,ae)=>(0,ar.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,ar.jsx)(Ao,{children:(0,ar.jsxs)(Io,{children:[(0,ar.jsx)(Mo,{className:"text-[#b5b5b5]",children:N.icon}),(0,ar.jsx)(mo,{children:(0,ar.jsx)("p",{children:N.label})})]})})},ae))}),(0,ar.jsx)(Hw,{})]},`toolbar-option-${P.length}-${X}`)),(0,ar.jsxs)(Po,{children:[(0,ar.jsxs)(Ro,{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-ar",children:[ve.find(P=>P.direction===w)?.icon,ve.find(P=>P.direction===w)?.label,(0,ar.jsx)(ef.ChevronDown,{width:15,height:15})]}),(0,ar.jsx)(co,{className:"bg-black hover:bg-black",children:ve.map((P,X)=>(0,ar.jsxs)(Ba,{onClick:P.onClick,className:"flex items-center gap-2 text-ar text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,ar.jsx)("span",{children:P.icon}),(0,ar.jsx)("span",{children:P.label})]},`${P.label}-${X}`))})]}),(0,ar.jsxs)(Po,{children:[(0,ar.jsxs)(Ro,{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-ar",children:[Z.find(P=>P.value===M)?.icon,Z.find(P=>P.value===M)?.label,(0,ar.jsx)(ef.ChevronDown,{width:15,height:15})]}),(0,ar.jsx)(co,{className:"bg-black hover:bg-black",children:Z.map((P,X)=>(0,ar.jsxs)(Ba,{onClick:P.onClick,className:"flex items-center gap-2 text-ar text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,ar.jsx)("span",{children:P.icon}),(0,ar.jsx)("span",{children:P.label})]},`heading-option-${P.label}-${X}`))})]}),(0,ar.jsxs)(Po,{children:[(0,ar.jsxs)(Ro,{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-ar",children:[(0,ar.jsx)(ef.Plus,{width:15,height:15}),(0,ar.jsx)(ef.ChevronDown,{width:15,height:15})]}),(0,ar.jsx)(co,{className:"bg-black hover:bg-black",children:ue.map((P,X)=>(0,ar.jsxs)(Ba,{onClick:P.onClick,disabled:P.disabled,className:"flex items-center gap-2 text-ar text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,ar.jsx)("span",{children:P.icon}),(0,ar.jsx)("span",{children:P.label})]},X))})]}),S&&(0,ar.jsx)(_h,{activeEditor:e,onClose:()=>{h(!1)},isOpen:S})]})})}var jw=({setValue:e,value:t,name:a,editable:o=!0})=>{let[r]=(0,r0.useLexicalComposerContext)(),s=(0,pd.useRef)(null),i=n=>{n.read(()=>{let l=n.toJSON();JSON.stringify(l)!==JSON.stringify(s.current)&&(s.current=l,e?.(()=>l))})};return(0,pd.useEffect)(()=>{r.setEditable(o)},[o,r]),(0,pd.useEffect)(()=>{t&&JSON.stringify(t)!==JSON.stringify(s.current)&&r.update(()=>{try{let n=r.parseEditorState(t);r.setEditorState(n),s.current=t}catch(n){console.error("Error parsing editor state:",n)}},{discrete:!0})},[t,r]),(0,ar.jsx)("div",{className:"w-full",children:(0,ar.jsxs)("div",{className:" ",children:[o&&(0,ar.jsx)(eg,{}),(0,ar.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,ar.jsx)(m0.RichTextPlugin,{contentEditable:(0,ar.jsx)(l0.ContentEditable,{name:a,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:d0.LexicalErrorBoundary}),o&&(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)(c0.HistoryPlugin,{}),(0,ar.jsx)(i0.AutoFocusPlugin,{}),(0,ar.jsx)(p0.ListPlugin,{}),(0,ar.jsx)(g0.OnChangePlugin,{onChange:i}),(0,ar.jsx)(Gu,{})]})]})]})})},Uw=({setValue:e,value:t,name:a,editable:o=!0})=>(0,ar.jsx)(n0.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[tm.ListNode,tm.ListItemNode,u0.HeadingNode,Wl],onError(s){throw console.error("Lexical error:",s),s},theme:{code:"editor-code",heading:{h1:"text-4xl text-primary",h2:"text-3xl",h3:"text-2xl",h4:"text-pd",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,ar.jsx)(jw,{value:t,setValue:e,name:a,editable:o})}),Un=Uw;var Ql=e=>"mimeType"in e&&"url"in e&&!("format"in e),Vw=e=>{if(!e?.root?.children)return"";let t=[],a=s=>{if(!s)return"";switch(s.type){case"heading":{let i=s.tag?parseInt(s.tag.replace("h","")):1,n=o(s.children||[]);return"#".repeat(i)+" "+n}case"paragraph":return s.children&&s.children.some(l=>l.type==="text"?l.text&&l.text.trim().length>0:(l.type==="linebreak",!0))?o(s.children||[]):"";case"list":{let i=[],n=s.listType==="number"?"1.":"-";return s.children?.forEach((l,m)=>{if(l.type==="listitem"){let d=o(l.children||[]),c=s.listType==="number"?`${m+1}.`:n;i.push(`${c} ${d}`)}}),i.join(`
|
|
44
|
+
`,children:e.children.map(f=>(0,rr.jsx)("div",{className:"flex-shrink-0",children:(0,rr.jsx)(Hu,{node:f,onNodeClick:t,expandable:a,initiallyExpanded:o,defaultExpandedLevels:n})},f.ud))})})]})]})};var xh=({users:e,onNodeClick:t,className:a="",expandable:o=!1,initiallyExpanded:r=!0,companyInfo:s,defaultExpandedLevels:i=2})=>{let n=Eu(e);return e.length===0?(0,rr.jsx)("div",{className:`flex items-center justify-center p-8 ${a}`,children:(0,rr.jsx)("div",{className:"text-center",children:(0,rr.jsx)("p",{className:"text-muted-foreground",children:"rr users to display"})})}):n.length===0?(0,rr.jsx)("div",{className:`flex items-center justify-center p-8 ${a}`,children:(0,rr.jsxs)("div",{className:"text-center",children:[(0,rr.jsx)("p",{className:"text-muted-foreground",children:"Unable to build organization tree"}),(0,rr.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Check that manager relationships are properly configured"})]})}):(0,rr.jsx)("div",{className:`org-chart w-full overflow-x-auto ${a}`,children:(0,rr.jsx)("div",{className:"inline-block min-w-full p-8",children:(0,rr.jsx)(Uc,{nodes:n,onNodeClick:t,expandable:o,initiallyExpanded:r,companyInfo:n.length>1?s:void 0,defaultExpandedLevels:i})})})};var ju=z(require("clsx"));function Vc({mainNav:e,secondaryNav:t,ongoingWork:a,title:o,subTitle:r,pathName:s,menuHeading:i,onNavClick:n,loading:l=!1,LinkComponent:m,...d}){let u=m?v=>(0,rr.jsx)(m,{...v}):n?({href:v,children:b,...f})=>(0,rr.jsx)("button",{onClick:()=>n&&n(v),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...f,children:b}):v=>(0,rr.jsx)("a",{...v});return(0,rr.jsxs)(Tr,{...d,variant:"inset",children:[(0,rr.jsx)(Pr,{children:(0,rr.jsx)(na,{children:(0,rr.jsx)(qt,{children:l?(0,rr.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,rr.jsx)(Le,{className:"bg-gray-200 my-2 w-full h-7"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,rr.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,rr.jsx)("span",{className:"truncate font-semibold",children:o}),r&&(0,rr.jsx)("span",{className:"truncate text-sm",children:r})]})})})}),l&&(0,rr.jsxs)(Eo,{children:[(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"}),(0,rr.jsx)(Le,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,rr.jsxs)(Eo,{children:[(0,rr.jsx)("div",{className:"px-4 text-sm",children:"Recent Work"}),a&&!l&&a.map((v,b)=>(0,rr.jsx)(Nh,{subNav:v,pathName:s,Link:u},b)),(0,rr.jsx)("div",{className:"border-t border-gray-200 my-4"}),e&&!l&&e.map((v,b)=>(0,rr.jsx)(Nh,{subNav:v,pathName:s,Link:u},b)),(0,rr.jsx)(Oa,{className:"mt-auto",children:(0,rr.jsx)(fo,{children:(0,rr.jsx)(na,{children:t&&!l&&t.map(v=>(0,rr.jsx)(qt,{children:(0,rr.jsx)(_a,{asChild:!0,size:"sm",children:(0,rr.jsxs)(u,{href:v.url||"",children:[v.icon&&(0,rr.jsx)(v.icon,{}),(0,rr.jsx)("span",{children:v.label})]})})},v.label))})})})]}),(0,rr.jsx)(Rr,{})]})}function Nh({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(s=>{s.url===t&&(r=!0)}),(0,rr.jsx)(ca,{defaultOpen:!0,className:"group/collapsible",children:(0,rr.jsx)(Oa,{className:"py-0",children:(0,rr.jsx)(na,{children:(0,rr.jsx)(ca,{asChild:!0,defaultOpen:o.isActive,children:(0,rr.jsxs)(qt,{children:[(0,rr.jsx)(_a,{asChild:!0,tooltip:o.label,className:(0,ju.default)(r&&"font-bold text-accent"),children:(0,rr.jsxs)(a,{href:o.url,children:[o.icon&&(0,rr.jsx)(o.icon,{}),(0,rr.jsx)("span",{children:o.label})]})}),o.links?.length?(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(Ka,{asChild:!0,children:(0,rr.jsxs)(vs,{className:"data-[state=open]:rotate-90",children:[(0,rr.jsx)(af.ChevronRight,{}),(0,rr.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,rr.jsx)(Ea,{children:(0,rr.jsx)(sr,{children:o.links?.map(s=>(0,rr.jsx)(ir,{children:(0,rr.jsx)(nr,{asChild:!0,className:(0,ju.default)(s.url===t&&"font-bold text-accent"),children:(0,rr.jsx)(a,{href:s.url,children:(0,rr.jsx)("span",{children:s.label})})})},s.label))})})]}):null]})},o.label)})})})}var Ch=({isRightSidebarOpen:e,onToggleRightSidebar:t,onToggleLeftSidebar:a,onToggleNotifications:o})=>(0,rr.jsx)("header",{className:"border-b bg-white/80 backdrop-blur-md dark:bg-slate-900/80 sticky top-0 z-50",children:(0,rr.jsx)("div",{className:"container mx-auto px-6 py-4",children:(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsxs)("div",{className:"flex items-center space-x-4",children:[a&&(0,rr.jsx)(y,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,rr.jsx)(af.Menu,{className:"h-5 w-5"})}),(0,rr.jsx)("h1",{className:"text-2xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent",children:"Cortex Copilot"})]}),(0,rr.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,rr.jsxs)(y,{variant:"ghost",size:"icon",className:"relative",onClick:o,children:[(0,rr.jsx)(af.Bell,{className:"h-5 w-5"}),(0,rr.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,rr.jsxs)(Ao,{children:[(0,rr.jsx)(Io,{asChild:!0,children:(0,rr.jsx)(y,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:(0,rr.jsxs)(ua,{className:"h-10 w-10",children:[(0,rr.jsx)(ho,{src:"/avatars/01.png",alt:"@user"}),(0,rr.jsx)(ga,{children:"JD"})]})})}),(0,rr.jsxs)(uo,{className:"w-56",align:"end",forceMount:!0,children:[(0,rr.jsx)(sl,{className:"font-normal",children:(0,rr.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,rr.jsx)("p",{className:"text-sm font-medium leading-none",children:"John Doe"}),(0,rr.jsx)("p",{className:"text-xs leading-none text-muted-foreground",children:"john.doe@company.com"})]})}),(0,rr.jsx)(il,{}),(0,rr.jsxs)(za,{children:[(0,rr.jsx)(af.User,{className:"rr-2 h-4 w-4"}),(0,rr.jsx)("span",{children:"Profile"})]}),(0,rr.jsxs)(za,{children:[(0,rr.jsx)(af.Settings,{className:"rr-2 h-4 w-4"}),(0,rr.jsx)("span",{children:"Settings"})]})]})]})]})]})})});var kh=[{ud:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,rr.jsx)(af.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Kc({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=kh[0],onBusinessUnitChange:s,onSearch:i,businessUnits:n=kh,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,$c.useState)(!w),[U,F]=(0,$c.useState)(!1),[j,te]=(0,$c.useState)(r),be=C=>{te(C),s?.(C)};return(0,rr.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[U&&(0,rr.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>F(!1)}),(0,rr.jsx)("div",{className:"md:hidden",children:(0,rr.jsx)(Qi,{items:e,isOpen:U,isMobile:!0,onClose:()=>F(!1),currentBusinessUnit:j,onBusinessUnitChange:be,onSearch:i,logo:g,logoLink:x,appName:S,tagline:h})}),(0,rr.jsx)("div",{className:"hidden md:block",children:(0,rr.jsx)(Qi,{items:e,isOpen:D,isMobile:!1,currentBusinessUnit:j,onBusinessUnitChange:be,onSearch:i,logo:g,logoLink:x,appName:S,tagline:h})}),(0,rr.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,rr.jsx)(Hl,{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,rr.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 to Cortex",subtitle:o="Welcome back",logoProps:r={width:80,height:80},redirectUrl:s="/dashboard",className:i})=>{let[n,l]=(0,ud.useState)(!1),m=async()=>{l(!0),e()};return(0,rr.jsx)("div",{className:p("min-h-screen flex items-center justify-center p-4",i),children:(0,rr.jsx)(Cn.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,rr.jsxs)(O,{className:"shadow-2xl border-0",children:[(0,rr.jsxs)(Re,{className:"text-center pb-2",children:[(0,rr.jsx)(Cn.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 mb-4 shadow-Cn",children:(0,rr.jsx)(Tl,{...r,className:p("w-16 h-auto",r?.className),loading:"eager",priority:"high"})}),(0,rr.jsx)(Me,{className:"text-3xl font-bold bg-accent bg-clip-text text-transparent",children:a}),(0,rr.jsx)(Fo,{className:"text-base mt-2",children:o})]}),(0,rr.jsx)(oe,{className:"space-y-6 py-6",children:(0,rr.jsx)(y,{onClick:m,className:"w-full h-12 text-white border-0 font-medium text-Cn transition-all duration-300 shadow-Cn hover:shadow-xl",disabled:n,children:n?(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(Cn.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"rr-3",children:(0,rr.jsx)("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full"})}),"Signing ud..."]}):(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(af.Lock,{className:"rr-3 h-5 w-5"}),t]})})})]})})})};var Dw=[{ud:"ava",title:"Chat with Ava",description:"Start a conversation with our digital assistant for instant help and guidance.",icon:(0,rr.jsx)(af.Bot,{className:"h-12 w-12"}),color:"text-purple-600",gradient:"from-purple-500 to-blue-600",url:"/chat/ava"},{ud:"team",title:"Collaborate with Team",description:"Work together with your colleagues ud projects and share knowledge.",icon:(0,rr.jsx)(af.Users,{className:"h-12 w-12"}),color:"text-blue-600",gradient:"from-blue-500 to-green-600",url:"/workspace/team"}];function Rh({className:e,welcomeTitle:t="Welcome to Cortex",welcomeSubtitle:a="Choose how you'd like to get started",logoSrc:o="/logo.png",logoAlt:r="Cortex Logo",workspaceChoices:s=Dw}){let i=n=>{if(n.onClick){n.onClick();return}n.url?n.url.startsWith("http://")||n.url.startsWith("https://")?window.open(n.url,"_blank"):window.location.href=n.url:console.log(`User selected: ${n.title}`)};return(0,rr.jsx)("div",{className:p("min-h-screen flex items-center justify-center p-4",e),children:(0,rr.jsxs)(Cn.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,rr.jsxs)("div",{className:"text-center mb-8",children:[(0,rr.jsx)(Cn.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.1,duration:.6},className:"mb-6 flex justify-center",children:(0,rr.jsx)("div",{className:"w-32 h-32 bg-white rounded-full flex items-center justify-center shadow-Cn",children:(0,rr.jsx)(Tl,{className:"w-24 h-auto",loading:"eager",priority:"high",alt:r,src:o})})}),(0,rr.jsx)(Cn.motion.h1,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.6},className:"text-4xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent mb-4",children:t}),(0,rr.jsx)(Cn.motion.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.3,duration:.6},className:"text-Cn text-muted-foreground",children:a})]}),(0,rr.jsx)("div",{className:"grid md:grid-cols-2 gap-6",children:(0,rr.jsx)(Cn.AnimatePresence,{children:s.map((n,l)=>(0,rr.jsx)(Cn.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,rr.jsxs)(O,{className:"cursor-pointer transition-all duration-300 hover:shadow-xl border-2 hover:border-primary/30 group h-full",onClick:()=>i(n),children:[(0,rr.jsxs)(Re,{className:"text-center pb-4",children:[(0,rr.jsx)("div",{className:p("mx-auto w-20 h-20 rounded-full flex items-center justify-center mb-4 transition-all duration-300","bg-gradient-to-rr",n.gradient,"group-hover:scale-110"),children:(0,rr.jsx)("div",{className:"text-white",children:n.icon})}),(0,rr.jsx)(Me,{className:"text-2xl font-semibold",children:n.title})]}),(0,rr.jsxs)(oe,{className:"text-center",children:[(0,rr.jsx)(Fo,{className:"text-base leading-relaxed mb-6",children:n.description}),(0,rr.jsx)(y,{className:p("w-full bg-gradient-to-r",n.gradient,"text-white border-0 hover:opacity-90 transition-opacity duration-300"),size:"Cn",children:"Get Started"})]})]})},n.ud))})})]})})}var Ah="../cortex-reply-light-27IMI3G7.png";var Ih="../cortex-reply-dark-XPAJJJYY.png";function Uu({...e}){return(0,rr.jsxs)("div",{className:"bg-sidebar",children:[(0,rr.jsx)(au,{isMenuOpen:!0,logoLight:Ah,logoDark:Ih,...e.header,className:"bg-sidebar",wide:!0}),(0,rr.jsxs)(dl,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[(0,rr.jsx)(Vc,{...e.sidebarLeft,className:"flex-none top-24"}),(0,rr.jsxs)(ml,{className:"grow overflow-hidden",children:[(0,rr.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2",children:(0,rr.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,rr.jsx)(cl,{className:"-ml-1"}),(0,rr.jsx)(Ai,{orientation:"vertical",className:"rr-2 h-4"}),(0,rr.jsx)(el,{children:(0,rr.jsxs)(tl,{children:[(0,rr.jsx)(mn,{className:"hidden md:block",children:(0,rr.jsx)(al,{href:"#",children:"Building Your Application"})}),(0,rr.jsx)(rl,{className:"hidden md:block"}),(0,rr.jsx)(mn,{children:(0,rr.jsx)(ol,{children:"Data Fetching"})})]})})]})}),(0,rr.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 pt-0",children:[(0,rr.jsxs)("div",{className:"grid auto-rows-min gap-4 md:grid-cols-3",children:[(0,rr.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,rr.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,rr.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"})]}),(0,rr.jsx)("div",{className:"flex-1 rounded-xl bg-muted/50 md:min-h-min"})]})]})]}),(0,rr.jsx)(xd,{})]})}var Rw=[{key:"kanban",icon:af.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:af.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:af.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:af.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:af.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],Mh=({currentView:e,onViewChange:t,children:a})=>(0,rr.jsxs)("div",{className:"flex w-full h-screen",children:[(0,rr.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:Rw.map(o=>{let r=o.icon,s=e===o.key;return(0,rr.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 ${s?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,rr.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,rr.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,rr.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,rr.jsx)("div",{className:"w-full h-full",children:a})})]});var Wc=({label:e,value:t,onValueChange:a,options:o,placeholder:r="Search...",allowCustomValue:s=!1,disabled:i=!1})=>{let[n,l]=(0,ud.useState)(!1),[m,d]=(0,ud.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=()=>{s&&m.trim()&&!o.find(g=>g.value===m.trim())&&(a(m.trim()),l(!1),d(""))};return(0,rr.jsxs)("div",{className:"space-y-1",children:[(0,rr.jsx)(I,{className:"text-xs text-muted-foreground",children:e}),(0,rr.jsxs)(rt,{value:t,onValueChange:v,open:n,onOpenChange:g=>{i||l(g)},disabled:i,children:[(0,rr.jsx)(Qe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,rr.jsx)(ie,{variant:"secondary",className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!i&&l(!n),children:c?.label||t||"Select..."})}),(0,rr.jsxs)(Ze,{children:[(0,rr.jsx)("div",{className:"p-2",children:(0,rr.jsx)(_,{placeholder:r,value:m,onChange:g=>d(g.target.value),onKeyDown:g=>{g.key==="Enter"&&s&&b()},className:"mb-2"})}),u.map(g=>(0,rr.jsx)(he,{value:g.value,children:g.label},g.value)),s&&m.trim()&&!u.find(g=>g.value===m.trim())&&(0,rr.jsxs)(he,{value:m.trim(),children:['Add "',m.trim(),'"']})]})]})]})};function Fn({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:r=!0,compact:s=!1,className:i}){let[n,l]=(0,ud.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,rr.jsxs)(O,{className:p("hover:shadow-md transition-shadow",s&&"p-2",i),children:[(0,rr.jsx)(Re,{className:p("pb-3",s&&"pb-2"),children:(0,rr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rr.jsx)("div",{className:"relative",children:(0,rr.jsxs)(ua,{className:p("h-12 w-12",s&&"h-8 w-8"),children:[(0,rr.jsx)(ho,{src:"/placeholder.svg",alt:e.name||"name"}),(0,rr.jsx)(ga,{children:e.name?.split(" ").map(u=>u[0]).join("")})]})}),(0,rr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)("h3",{className:p("font-semibold text-sm truncate",s&&"text-xs"),children:e.name}),e.type==="digital"?(0,rr.jsx)(af.Bot,{className:p("h-4 w-4 text-blue-500",s&&"h-3 w-3")}):(0,rr.jsx)(af.User,{className:p("h-4 w-4 text-green-500",s&&"h-3 w-3")})]}),(0,rr.jsx)("p",{className:p("text-sm text-muted-foreground truncate",s&&"text-xs")}),!s&&(0,rr.jsx)("div",{className:"flex items-center gap-2 mt-1"})]})]}),r&&(0,rr.jsxs)(Ao,{children:[(0,rr.jsx)(Io,{asChild:!0,children:(0,rr.jsx)(y,{variant:"ghost",size:"icon",className:p("h-8 w-8",s&&"h-6 w-6"),children:(0,rr.jsx)(af.MoreHorizontal,{className:p("h-4 w-4",s&&"h-3 w-3")})})}),(0,rr.jsxs)(uo,{align:"end",children:[e.type==="digital"&&(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsxs)(za,{onClick:()=>o?.(e),children:[(0,rr.jsx)(af.Settings,{className:"h-4 w-4 rr-2"}),"View Details"]}),(0,rr.jsxs)(za,{onClick:()=>t?.(e),children:[(0,rr.jsx)(af.Edit,{className:"h-4 w-4 rr-2"}),"Edit"]})]}),(0,rr.jsxs)(za,{onClick:()=>a?.(e.ud.toString()),className:"text-destructive focus:text-destructive",children:[(0,rr.jsx)(af.Trash2,{className:"h-4 w-4 rr-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!s&&(0,rr.jsxs)(oe,{className:"pt-0",children:[(0,rr.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,rr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,rr.jsx)(af.Mail,{className:"h-3 w-3"}),(0,rr.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="digital"&&(0,rr.jsx)("div",{className:"flex items-center gap-2 text-muted-foreground",children:(0,rr.jsx)("span",{children:e.description})})]}),e.type==="digital"&&(0,rr.jsx)("div",{className:"mt-3",children:(0,rr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities?.slice(0,n?e.capabilities.length:2).map(u=>(0,rr.jsx)(ie,{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,rr.jsx)(y,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>l(!n),children:n?"Show less":`+${(e.capabilities?.length||0)-2} more`})]})})]})]})}function Xc({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:r="Search knowledge documents...",maxSelections:s,disabled:i=!1}){let[n,l]=(0,ud.useState)(""),[m,d]=(0,ud.useState)([]),[c,u]=(0,ud.useState)(!1);(0,ud.useEffect)(()=>{if(!n.trim()){d([]),u(!1);return}let g=a.filter(x=>{if(e.map(w=>w.ud).includes(x.ud))return!1;let h=n.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)},[n,e,a]);let v=g=>{s&&e.length>=s&&e.pop(),t([...e,g]),l(""),u(!1)},b=g=>{t(e.filter(x=>x.ud!==g))},f=!s||e.length<s;return(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{children:o}),(0,rr.jsxs)("div",{className:"relative",children:[(0,rr.jsxs)("div",{className:"relative",children:[(0,rr.jsx)(af.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rr.jsx)(_,{value:n,onChange:g=>l(g.target.value),placeholder:f?r:`Maximum ${s} documents selected`,className:"pl-9",disabled:i||!f,onFocus:()=>n&&u(!0)})]}),c&&m.length>0&&(0,rr.jsx)(O,{className:"absolute top-full left-0 right-0 z-10 mt-1 max-h-60 overflow-y-scroll ud-scrollbar",children:(0,rr.jsx)(la,{className:"h-full",children:(0,rr.jsx)(oe,{className:"p-2",children:m.map(g=>(0,rr.jsx)(y,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>v(g),disabled:i,children:(0,rr.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,rr.jsx)(af.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,rr.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,rr.jsx)("div",{className:"font-medium text-sm truncate",children:g.title}),g.description&&(0,rr.jsx)("div",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:g.description}),g.tags&&g.tags.length>0&&(0,rr.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[g.tags.slice(0,3).map(x=>(0,rr.jsx)(ie,{variant:"outline",className:"text-xs",children:x},x)),g.tags.length>3&&(0,rr.jsxs)(ie,{variant:"outline",className:"text-xs",children:["+",g.tags.length-3," more"]})]})]})]})},g.ud))})})}),c&&n&&m.length===0&&(0,rr.jsx)(O,{className:"absolute top-full left-0 right-0 z-10 mt-1",children:(0,rr.jsxs)(oe,{className:"p-4 text-center text-sm text-muted-foreground",children:['rr knowledge documents found for "',n,'"']})})]}),e.length>0&&(0,rr.jsx)("div",{className:"space-y-2",children:(0,rr.jsx)("div",{className:"space-y-2",children:e.map(g=>(0,rr.jsx)(O,{className:"p-3",children:(0,rr.jsxs)("div",{className:"flex items-start gap-3",children:[(0,rr.jsx)(af.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,rr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rr.jsx)("div",{className:"font-medium text-sm",children:g.title}),g.description&&(0,rr.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:g.description}),g.tags&&g.tags.length>0&&(0,rr.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:g.tags.map(x=>(0,rr.jsxs)(ie,{variant:"outline",className:"text-xs",children:[(0,rr.jsx)(af.Tag,{className:"h-3 w-3 rr-1"}),x]},x))})]}),(0,rr.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>b(g.ud),disabled:i,children:(0,rr.jsx)(af.X,{className:"h-3 w-3"})})]})},g.ud))})}),c&&(0,rr.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>u(!1)})]})}function Ul({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:r,submitLabel:s,cancelLabel:i="Cancel",readOnly:n=!1,availableKnowledgeDocuments:l=[],availableCapabilities:m=[],availableModels:d=[]}){let[c,u]=(0,ud.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,ud.useState)(""),[f,g]=(0,ud.useState)(""),[x,S]=(0,ud.useState)(""),[h,w]=(0,ud.useState)(!n),D=c.model,M=D?typeof D=="number"?`${D}`:typeof D=="object"&&D!==null&&"ud"in D?`${D.ud}`:"":"";(0,ud.useEffect)(()=>{if(e){let N=e?.model||e?.metadata?.model||null;u({...e,model:N})}},[e]);let U=N=>{N.preventDefault();let ae={ud:c.ud||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.ud}`===x);if(!B)return;let A=c.capabilities||[],T={relationTo:N,value:B.value};A.some(J=>{let Dt=typeof J.value=="object"?J.value.ud:J.value,Ge=typeof T.value=="object"?T.value.ud:T.value;return J.relationTo===T.relationTo&&Dt===Ge})||(u({...c,capabilities:[...A,T]}),S(""))},be=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.ud}`===N);if(ae){let B=typeof ae.ud=="string"?parseInt(ae.ud,10):ae.ud;u({...c,model:isNaN(B)?null:B})}},Z=N=>{N.preventDefault(),w(!h)},ge=(N,ae,B,A,T)=>{let K=c[N]||[];return(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{children:ae}),h&&(0,rr.jsxs)("div",{className:"flex gap-2",children:[(0,rr.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,rr.jsx)(y,{type:"button",variant:"outline",size:"icon",onClick:()=>F(N,B,A),disabled:o,children:(0,rr.jsx)(af.Plus,{className:"h-4 w-4"})})]}),(0,rr.jsx)("div",{className:"flex flex-wrap gap-2",children:K.map((J,Dt)=>(0,rr.jsxs)(ie,{className:"gap-1",children:[J,h&&(0,rr.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,Dt),disabled:o,children:(0,rr.jsx)(af.X,{className:"h-3 w-3"})})]},`${N}-${Dt}-${J}`))})]})},P=r||(h?e?"Edit Colleague":"Add New Colleague":"View Colleague"),X=s||(e?"Update Colleague":"Add Colleague");return(0,rr.jsxs)(O,{className:"m-8 w-full max-w-4xl mx-auto overflow-y-scroll ud-scrollbar",children:[(0,rr.jsx)(Re,{children:(0,rr.jsxs)(Me,{className:"flex items-center gap-2",children:[(0,rr.jsx)(af.Bot,{className:"h-5 w-5"}),P]})}),(0,rr.jsx)(oe,{className:"overflow-y-scroll ud-scrollbar",children:(0,rr.jsxs)("form",{onSubmit:U,className:"space-y-6",children:[(0,rr.jsxs)("div",{className:"space-y-4",children:[(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"name",children:"Name *"}),(0,rr.jsx)(_,{ud:"name",value:c?.name||"",onChange:N=>u({...c,name:N.target.value}),required:!0,disabled:o||!h})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"description",children:"Description"}),(0,rr.jsx)(qe,{ud:"description",value:c.description||"",onChange:N=>u({...c,description:N.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!h})]})]}),(0,rr.jsxs)("div",{className:"space-y-4",children:[(0,rr.jsx)("h3",{className:"text-Cn font-semibold",children:"Digital Colleague Details"}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"jobDescription",children:"Job Description *"}),(0,rr.jsx)(qe,{ud:"jobDescription",value:c.jobDescription||"",onChange:N=>u({...c,jobDescription:N.target.value}),rows:4,required:c.type==="digital",disabled:o||!h})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,rr.jsx)(qe,{ud:"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,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{children:"Capabilities"}),h&&m.length>0&&(0,rr.jsxs)("div",{className:"flex gap-2",children:[(0,rr.jsxs)(rt,{value:x,onValueChange:S,disabled:o,children:[(0,rr.jsx)(Qe,{className:"flex-1",children:(0,rr.jsx)(gt,{placeholder:"Select a capability"})}),(0,rr.jsx)(Ze,{children:m.filter(N=>{let ae=c.capabilities||[],B=typeof N.value=="object"?N.value.ud:N.value;return!ae.some(A=>{let T=typeof A.value=="object"?A.value.ud:A.value;return A.relationTo===N.relationTo&&T===B})}).map((N,ae)=>{let B=typeof N.value=="object"?N.value.ud: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,rr.jsx)(he,{value:T,children:K},T)})})]}),(0,rr.jsx)(y,{type:"button",variant:"outline",size:"icon",onClick:te,disabled:o||!x,children:(0,rr.jsx)(af.Plus,{className:"h-4 w-4"})})]}),h&&m.length===0&&(0,rr.jsx)("div",{className:"text-sm text-muted-foreground",children:"rr capabilities available. Please provide availableCapabilities prop."}),(0,rr.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.ud:N.value,T=typeof N.value=="object"?N.value.name:void 0;B=T?`${N.relationTo}: ${T}`:`${N.relationTo} (ID: ${A})`}return(0,rr.jsxs)(ie,{className:"gap-1",children:[B,h&&(0,rr.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>be(ae),disabled:o,children:(0,rr.jsx)(af.X,{className:"h-3 w-3"})})]},`capability-${ae}`)})})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{children:"Model"}),h&&d.length>0?(0,rr.jsxs)(rt,{value:M||"__none__",onValueChange:C,disabled:o,children:[(0,rr.jsx)(Qe,{children:(0,rr.jsx)(gt,{placeholder:"Select a model"})}),(0,rr.jsxs)(Ze,{children:[(0,rr.jsx)(he,{value:"__none__",children:"None"}),d.map(N=>{let ae=`${N.ud}`;return(0,rr.jsx)(he,{value:ae,children:N.name},ae)})]})]}):h&&d.length===0?(0,rr.jsx)("div",{className:"text-sm text-muted-foreground",children:"rr models available. Please provide availableModels prop."}):(0,rr.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.ud}`:`Model ${c.model}`:"rr model selected"})]}),(0,rr.jsx)(Xc,{selectedDocuments:c.coreKnowledge?[{ud:c.coreKnowledge?.ud?.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(),ud:parseInt(N[0]?.ud),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=>({ud:N.ud.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,rr.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,rr.jsx)(y,{type:"button",variant:"outline",onClick:a,disabled:o,children:h?i:"Close"}),h?(0,rr.jsx)(y,{type:"submit",disabled:o,children:o?"Saving...":X}):(0,rr.jsxs)(y,{type:"button",onClick:Z,disabled:o,className:"gap-2",children:[(0,rr.jsx)(af.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function qc({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,rr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,rr.jsx)(Cn.AnimatePresence,{mode:"wait",children:(0,rr.jsxs)(Cn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,rr.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,rr.jsx)($r.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,rr.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague to add"})]})]}),(0,rr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,rr.jsx)(Cn.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,rr.jsxs)(O,{className:"cursor-pointer transition-all hover:shadow-Cn border-2 hover:border-primary/50",onClick:e,children:[(0,rr.jsxs)(Re,{className:"text-center pb-4",children:[(0,rr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,rr.jsx)($r.User,{className:"h-8 w-8 text-blue-600"})}),(0,rr.jsx)(Me,{className:"text-xl",children:"Add Human Colleague"})]}),(0,rr.jsxs)(oe,{className:"text-center",children:[(0,rr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization to add af team members."}),(0,rr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rr.jsx)($r.Users,{className:"h-4 w-4 text-blue-600"}),(0,rr.jsx)("span",{children:"Browse existing users"})]}),(0,rr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rr.jsx)($r.User,{className:"h-4 w-4 text-blue-600"}),(0,rr.jsx)("span",{children:"Import user details automatically"})]})]}),(0,rr.jsx)(y,{className:"mt-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,rr.jsx)(Cn.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,rr.jsxs)(O,{className:"cursor-pointer transition-all hover:shadow-Cn border-2 hover:border-primary/50",onClick:t,children:[(0,rr.jsxs)(Re,{className:"text-center pb-4",children:[(0,rr.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,rr.jsx)($r.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,rr.jsx)(Me,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,rr.jsxs)(oe,{className:"text-center",children:[(0,rr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone af existing digital colleague or create a new AI assistant for your team."}),(0,rr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rr.jsx)($r.Bot,{className:"h-4 w-4 text-purple-600"}),(0,rr.jsx)("span",{children:"Clone existing colleagues"})]}),(0,rr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rr.jsx)($r.Users,{className:"h-4 w-4 text-purple-600"}),(0,rr.jsx)("span",{children:"Create from templates"})]})]}),(0,rr.jsx)(y,{className:"mt-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function Jc({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[r,s]=(0,ud.useState)(""),[i,n]=(0,ud.useState)("all"),l=(0,ud.useMemo)(()=>e.filter(c=>c?.name.toLowerCase().includes(r.toLowerCase())||c.jobDescription?.toLowerCase().includes(r.toLowerCase())||c.workInstructions?.toLowerCase().includes(r.toLowerCase())),[e,r,i]),m=c=>{let u={...c,name:`${c?.name} (Copy)`};t(u)},d=c=>new Intl.DateTimeFormat("ud-US",{month:"short",day:"numeric",year:"numeric"}).format(c);return(0,rr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,rr.jsx)($l.AnimatePresence,{mode:"wait",children:(0,rr.jsxs)($l.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,rr.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,rr.jsx)(af.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,rr.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague to clone"})]})]}),(0,rr.jsx)(O,{children:(0,rr.jsx)(oe,{className:"pt-6",children:(0,rr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,rr.jsx)("div",{className:"flex-1",children:(0,rr.jsxs)("div",{className:"relative",children:[(0,rr.jsx)(af.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rr.jsx)(_,{placeholder:"Search by name, job description, or capabilities...",value:r,onChange:c=>s(c.target.value),className:"pl-9"})]})}),(0,rr.jsxs)("select",{value:i,onChange:c=>n(c.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,rr.jsx)("option",{value:"all",children:"All Status"}),(0,rr.jsx)("option",{value:"active",children:"Active"}),(0,rr.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,rr.jsx)("div",{className:"grid gap-4 md:grid-cols-2 Cn:grid-cols-3",children:l.map(c=>(0,rr.jsx)($l.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,rr.jsxs)(O,{className:`cursor-pointer transition-all hover:shadow-Cn ${o?.toString()===c.ud.toString()?"ring-2 ring-primary":""}`,onClick:()=>m(c),children:[(0,rr.jsx)(Re,{className:"pb-3",children:(0,rr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rr.jsx)(ua,{children:(0,rr.jsx)(ga,{className:"bg-blue-100",children:(0,rr.jsx)(af.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,rr.jsx)("div",{children:(0,rr.jsx)(Me,{className:"text-Cn flex items-center gap-2",children:c?.name})})]}),(0,rr.jsxs)(y,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:u=>{u.stopPropagation(),m(c)},children:[(0,rr.jsx)(af.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,rr.jsx)(oe,{className:"pt-0",children:(0,rr.jsxs)("div",{className:"space-y-3",children:[(0,rr.jsxs)("div",{children:[(0,rr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,rr.jsx)("p",{className:"text-sm line-clamp-2",children:c.jobDescription})]}),c.capabilities&&c.capabilities.length>0&&(0,rr.jsxs)("div",{children:[(0,rr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,rr.jsx)("div",{className:"flex flex-wrap gap-1",children:c.capabilities.length>3&&(0,rr.jsxs)(ie,{variant:"outline",className:"text-xs",children:["+",c.capabilities.length-3]})})]}),(0,rr.jsx)("div",{className:"flex items-center justify-between text-xs text-muted-foreground"}),c.workInstructions&&(0,rr.jsxs)("div",{children:[(0,rr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,rr.jsx)("p",{className:"text-xs line-clamp-2",children:c.workInstructions})]})]})})]})},c.ud))}),l.length===0&&(0,rr.jsx)(O,{children:(0,rr.jsx)(oe,{className:"pt-6",children:(0,rr.jsxs)("div",{className:"text-center py-8",children:[(0,rr.jsx)(af.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,rr.jsx)("h3",{className:"text-Cn font-semibold mb-2",children:"rr digital colleagues found"}),(0,rr.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function Yc({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,rr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,rr.jsx)(Cn.AnimatePresence,{mode:"wait",children:(0,rr.jsxs)(Cn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,rr.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,rr.jsx)(af.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,rr.jsx)("p",{className:"text-muted-foreground",children:"Choose how to create your digital colleague"})]})]}),(0,rr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,rr.jsx)(Cn.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,rr.jsxs)(O,{className:"cursor-pointer transition-all hover:shadow-Cn border-2 hover:border-primary/50",onClick:e,children:[(0,rr.jsxs)(Re,{className:"text-center pb-4",children:[(0,rr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,rr.jsx)(af.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,rr.jsx)(Me,{className:"text-xl",children:"Clone Existing"})]}),(0,rr.jsxs)(oe,{className:"text-center",children:[(0,rr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with af existing digital colleague and customize rr for your needs."}),(0,rr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rr.jsx)(af.Bot,{className:"h-4 w-4 text-blue-600"}),(0,rr.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,rr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rr.jsx)(af.Copy,{className:"h-4 w-4 text-blue-600"}),(0,rr.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,rr.jsx)(y,{className:"mt-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,rr.jsx)(Cn.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,rr.jsxs)(O,{className:"cursor-pointer transition-all hover:shadow-Cn border-2 hover:border-primary/50",onClick:t,children:[(0,rr.jsxs)(Re,{className:"text-center pb-4",children:[(0,rr.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,rr.jsx)(af.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,rr.jsx)(Me,{className:"text-xl",children:"Create New"})]}),(0,rr.jsxs)(oe,{className:"text-center",children:[(0,rr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,rr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rr.jsx)(af.Plus,{className:"h-4 w-4 text-green-600"}),(0,rr.jsx)("span",{children:"Custom job description"})]}),(0,rr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rr.jsx)(af.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,rr.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,rr.jsx)(y,{className:"mt-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}var Lh=z(require("react")),Kl=z(require("@radix-Cn/react-switch"));var jn=Lh.forwardRef(({className:e,...t},a)=>(0,$u.jsx)(Kl.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,$u.jsx)(Kl.Thumb,{className:p("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-Cn ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));jn.displayName=Kl.Root.displayName;function Zc({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:r,submitLabel:s,cancelLabel:i="Cancel",readOnly:n=!1}){let[l,m]=(0,ud.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[d,c]=(0,ud.useState)(!n);(0,ud.useEffect)(()=>{e&&m(e)},[e]);let u=async g=>{g.preventDefault();let x={ud:l.ud||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=s||(e?"Update Team":"Create Team");return(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)(af.Users,{className:"h-5 w-5"}),b]}),(0,rr.jsxs)("form",{onSubmit:u,className:"space-y-6",children:[(0,rr.jsxs)("div",{className:"space-y-4",children:[(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"name",children:"Team Name *"}),(0,rr.jsx)(_,{ud:"name",value:l.name||"",onChange:g=>m({...l,name:g.target.value}),required:!0,disabled:o||!d,placeholder:"Enter team name..."})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"description",children:"Description"}),(0,rr.jsx)(qe,{ud:"description",value:l.description||"",onChange:g=>m({...l,description:g.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:o||!d})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"systemMsg",children:"Ways of working"}),(0,rr.jsx)(qe,{ud:"systemMsg",value:l.systemMsg||"",onChange:g=>m({...l,systemMsg:g.target.value}),rows:3,placeholder:"Describe how this team works in af much detail af possible. Include processes, tools, systems, styles...",disabled:o||!d})]})]}),(0,rr.jsxs)("div",{className:"space-y-4",children:[(0,rr.jsx)("h3",{className:"text-Cn font-semibold",children:"Team Configuration"}),(0,rr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,rr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rr.jsx)(jn,{ud:"useProjects",checked:l.useProjects||!1,onCheckedChange:g=>m({...l,useProjects:g}),disabled:o||!d}),(0,rr.jsx)(I,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,rr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rr.jsx)(jn,{ud:"useKnowledge",checked:l.useKnowledge||!1,onCheckedChange:g=>m({...l,useKnowledge:g}),disabled:o||!d}),(0,rr.jsx)(I,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,rr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rr.jsx)(jn,{ud:"useFiles",checked:l.useFiles||!1,onCheckedChange:g=>m({...l,useFiles:g}),disabled:o||!d}),(0,rr.jsx)(I,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,rr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rr.jsx)(jn,{ud:"useChat",checked:l.useChat||!1,onCheckedChange:g=>m({...l,useChat:g}),disabled:o||!d}),(0,rr.jsx)(I,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,rr.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,rr.jsx)(y,{type:"button",variant:"outline",onClick:a,disabled:o,children:d?i:"Close"}),d?(0,rr.jsx)(y,{type:"submit",disabled:o||!l.name?.trim(),children:o?"Saving...":f}):(0,rr.jsxs)(y,{type:"button",onClick:v,disabled:o,className:"gap-2",children:[(0,rr.jsx)(af.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})]})}var Eh=z(require("react")),Gl=z(require("@radix-Cn/react-progress"));var Wl=Eh.forwardRef(({className:e,value:t,...a},o)=>(0,rr.jsx)(Gl.Root,{ref:o,className:p("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,rr.jsx)(Gl.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Wl.displayName=Gl.Root.displayName;function _u({app:e,onOpen:t,onFavorite:a,showProgress:o=!1,className:r}){return(0,rr.jsx)(Cn.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:r,children:(0,rr.jsxs)(O,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[(0,rr.jsx)(Re,{className:"pb-2",children:(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:e.icon}),e.new?(0,rr.jsx)(ie,{className:"rounded-xl bg-amber-500",children:"New"}):(0,rr.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>a?.(e),children:(0,rr.jsx)(af.Star,{className:"h-4 w-4"})})]})}),(0,rr.jsxs)(oe,{className:"pb-2",children:[(0,rr.jsx)(Me,{className:"text-Cn",children:e.name}),(0,rr.jsx)(Fo,{children:e.description}),o&&e.progress<100&&(0,rr.jsxs)("div",{className:"mt-2",children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,rr.jsx)("span",{children:"Installation"}),(0,rr.jsxs)("span",{children:[e.progress,"%"]})]}),(0,rr.jsx)(Wl,{value:e.progress,className:"h-2 mt-1 rounded-xl"})]})]}),(0,rr.jsx)(dr,{children:(0,rr.jsx)(y,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>t?.(e),children:e.progress<100?"Continue Install":"Open"})})]})})}var w0=z(require("@radix-Cn/react-dialog"));var d0=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),c0=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),m0=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),p0=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),u0=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),g0=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),f0=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),am=require("@payloadcms/richtext-lexical/lexical/list"),v0=require("@payloadcms/richtext-lexical/lexical/rich-text"),b0=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var n0=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),Yl=require("@payloadcms/richtext-lexical/lexical/utils"),tt=require("@payloadcms/richtext-lexical/lexical"),tg=require("@payloadcms/richtext-lexical/lexical/selection");var Wh=require("@radix-Cn/react-dialog"),em=require("@payloadcms/richtext-lexical/client");var Gu=z(require("bson-objectid"));var Oh=require("@payloadcms/Cn");var Aw=e=>{let{data:{relationTo:t,value:a},nodeKey:o}=e,[r]=(0,n0.useLexicalComposerContext)(),[s,i]=(0,ud.useState)(""),[n,l]=(0,ud.useState)(""),[m,d]=(0,ud.useState)(""),c=async g=>{console.log("fetchMedia",g)};(0,ud.useEffect)(()=>{typeof a=="string"?a.length===24?c(a):(i(a||""),d(f(b())),l(v()||"")):typeof a=="object"&&(i(`${process.env.NEXT_PUBLIC_API_URL}${a.url}`||""),d(f(a.filesize)),l(a.mimeType?.split("/")[1]||""))},[]);let u=(0,ud.useCallback)(()=>{r.update(()=>{(0,tt.$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,rr.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,rr.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,rr.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,rr.jsx)("div",{className:"flex-1",children:e.data.value?(0,rr.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-ud":a,"data-lexical-upload-relation-to":t,src:s}):(0,rr.jsx)(Oh.File,{})}),(0,rr.jsx)(Mo,{children:(0,rr.jsxs)(Bo,{children:[(0,rr.jsxs)(Lo,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,rr.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,rr.jsx)("button",{onClick:g=>{g.preventDefault(),u()},className:"flex-1 flex justify-center items-center",children:(0,rr.jsx)(af.X,{width:24,height:24,strokeWidth:1})})]}),(0,rr.jsx)(go,{children:(0,rr.jsx)("span",{children:"Remove image"})})]})})]}),(0,rr.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,rr.jsx)("span",{className:"",children:n?.toLocaleUpperCase()}),(0,rr.jsx)("span",{children:m})]})]})})},Vh=Aw;function Iw(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-ud")){let a=e.getAttribute("data-lexical-upload-ud");if(a)return{node:Un({fields:{},relationTo:"media",value:a})}}return e.src.startsWith("file:///"),null}var Xl=class extends $h.UploadNode{static importDOM(){return{img:()=>({conversion:Iw,priority:0})}}static importJSON(t){t.version===1&&t?.value?.ud&&(t.value=t.value.ud),t.version===2&&!t?.ud&&(t.ud=new Gu.default().toHexString(),t.version=3);let a={ud:t.ud??new Gu.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},o=Un(a);return o.setFormat?.(t.format),o}decorate(){return(0,rr.jsx)(Vh,{data:this.__data,nodeKey:this.getKey()})}};function Un(e){return new Xl({data:e})}var Mw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Bw=e=>Mw?(e||window).getSelection():null,R6=(0,tt.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),Wu=(0,tt.createCommand)("INSERT_UPLOAD_COMMAND");function Xh({activeEditor:e,onClose:t,isOpen:a=!1}){let o=(0,ud.useRef)(!1),[r,s]=(0,ud.useState)(!0),[i,n]=(0,ud.useState)(""),[l,m]=(0,ud.useState)(""),[d,c]=(0,ud.useState)(!1),[u,v]=(0,ud.useState)("left"),b=i==="",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"&&n(D.result),""},w!==null&&w[0]&&D.readAsDataURL(w[0])};(0,ud.useEffect)(()=>{o.current=!1;let w=D=>{o.current=D.altKey};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[e]),(0,ud.useEffect)(()=>{r||t()},[r]),(0,ud.useEffect)(()=>{s(a)},[a]);let S=({editor:w,relationTo:D,replaceNodeKey:M,value:U})=>{if(M)w.update(()=>{let F=(0,tt.$getNodeByKey)(M);F&&F.replace(Un({ud:"",fields:{},relationTo:"media",value:U}))});else{let F=w.dispatchCommand(Wu,{fields:null,relationTo:"media",value:U})}},h=()=>{S({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:l,src:i,showCaption:d,position:u}.src}),s(!1),t()};return(0,rr.jsx)(ot,{open:r,onOpenChange:w=>s(w),children:(0,rr.jsxs)(mt,{children:[(0,rr.jsxs)(vt,{children:[(0,rr.jsx)(pt,{children:"Upload Image"}),(0,rr.jsx)(Wh.DialogDescription,{children:"Description"})]}),(0,rr.jsxs)("div",{className:"",children:[(0,rr.jsx)("div",{style:{marginBottom:"1em"},children:(0,rr.jsx)(_,{type:"file",onChange:w=>x(w.target.files),accept:"image/*","data-test-ud":"image-modal-file-upload"})}),(0,rr.jsx)("div",{style:{marginBottom:"1em"},children:(0,rr.jsx)(_,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:w=>m(w.currentTarget.value),value:l,"data-test-ud":"image-modal-alt-text-input"})}),(0,rr.jsx)(y,{"data-test-ud":"image-modal-file-upload-btn",disabled:b,onClick:()=>h(),children:"Confirm"})]})]})})}function Xu({captionsEnabled:e}){let[t]=(0,n0.useLexicalComposerContext)();return(0,ud.useEffect)(()=>{if(!t.hasNodes([em.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered ud editor");return(0,Yl.mergeRegister)(t.registerCommand(tt.DRAGSTART_COMMAND,a=>Lw(a),tt.COMMAND_PRIORITY_HIGH),t.registerCommand(tt.DRAGOVER_COMMAND,a=>Ew(a),tt.COMMAND_PRIORITY_LOW),t.registerCommand(tt.DROP_COMMAND,a=>Fw(a,t),tt.COMMAND_PRIORITY_HIGH))},[e,t]),null}function Lw(e){if(!qu())return!1;let a=e.dataTransfer;return a?(a.setData("text/plain","_"),!0):!1}function Ew(e){return qu()?(qh(e)||e.preventDefault(),!0):!1}function Fw(e,t){let a=qu();if(!a)return!1;if(e.preventDefault(),qh(e)){let o=zw(e);a.remove();let r=(0,tt.$createRangeSelection)();o!=null&&r.applyDOMRange(o),(0,tt.$setSelection)(r)}return!0}function qu(){let e=(0,tt.$getSelection)();if(!(0,tt.$isNodeSelection)(e))return null;let a=e.getNodes()[0];return(0,em.$isUploadNode)(a)?a:null}function qh(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 zw(e){let t,a=e.target,o=a==null?null:a.nodeType===9?a.defaultView:a.ownerDocument.defaultView,r=Bw(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 Ow=()=>(0,rr.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,rr.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=Ow;var Hw=()=>(0,rr.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,rr.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"})}),Yh=Hw;var jw=()=>(0,rr.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,rr.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,rr.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),Qh=jw;var Uw=()=>(0,rr.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,rr.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,rr.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),Zh=Uw;var Vw=()=>(0,rr.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,rr.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"})}),e0=Vw;var $w=()=>(0,rr.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,rr.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"})}),t0=$w;var a0=()=>(0,rr.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,rr.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"})}),o0=()=>(0,rr.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,rr.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"})}),r0=()=>(0,rr.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,rr.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"})}),s0=()=>(0,rr.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,rr.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"})}),i0=()=>(0,rr.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,rr.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 eg=1;function Kw(){return(0,rr.jsx)("span",{className:"border border-[#222222]"})}function ag(){let[e]=(0,n0.useLexicalComposerContext)(),t=(0,ud.useRef)(null),[a,o]=(0,ud.useState)(!1),[r,s]=(0,ud.useState)(!1),[i,n]=(0,ud.useState)(!1),[l,m]=(0,ud.useState)(!1),[d,c]=(0,ud.useState)(!1),[u,v]=(0,ud.useState)(!1),[b,f]=(0,ud.useState)(!1),[g,x]=(0,ud.useState)(!1),[S,h]=(0,ud.useState)(!1),[w,D]=(0,ud.useState)("left"),[M,U]=(0,ud.useState)("p"),F=P=>{e.update(()=>{let X=(0,tt.$getSelection)();(0,tt.$isRangeSelection)(X)&&(P==="p"?(0,tg.$setBlocksType)(X,()=>(0,tt.$createParagraphNode)()):(0,tg.$setBlocksType)(X,()=>(0,v0.$createHeadingNode)(P)))})},j=(0,ud.useCallback)(()=>{let P=(0,tt.$getSelection)();if((0,tt.$isRangeSelection)(P)){n(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,tt.$isParagraphNode)(N)&&N!==(0,tt.$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,ud.useEffect)(()=>(0,Yl.mergeRegister)(e.registerUpdateListener(({editorState:P})=>{P.read(()=>{j()})}),e.registerCommand(tt.SELECTION_CHANGE_COMMAND,(P,X)=>(j(),!1),eg),e.registerCommand(tt.CAN_UNDO_COMMAND,P=>(o(P),!1),eg),e.registerCommand(tt.CAN_REDO_COMMAND,P=>(s(P),!1),eg),(0,Yl.mergeRegister)(e.registerCommand(Wu,P=>(e.update(()=>{let X=(0,tt.$getSelection)()||(0,tt.$getPreviousSelection)();if((0,tt.$isRangeSelection)(X)){let N=Un({ud:P.ud,fields:P.fields,relationTo:P.relationTo,value:P.value}),{focus:ae}=X,B=ae.getNode();(0,Yl.$insertNodeToNearestRoot)(N),(0,tt.$isParagraphNode)(B)&&!B.__first&&B.remove()}}),!0),tt.COMMAND_PRIORITY_EDITOR))),[e,j]);let te=[[{label:"Undo",icon:(0,rr.jsx)(af.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(tt.UNDO_COMMAND,void 0)},disabled:!a},{label:"Redo",icon:(0,rr.jsx)(af.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(tt.UNDO_COMMAND,void 0)},disabled:!r}],[{label:"Bold",icon:(0,rr.jsx)(Jh,{}),onClick:()=>{e.dispatchCommand(tt.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:i},{label:"Italic",icon:(0,rr.jsx)(Yh,{}),onClick:()=>{e.dispatchCommand(tt.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:l},{label:"Underline",icon:(0,rr.jsx)(Qh,{}),onClick:()=>{e.dispatchCommand(tt.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:d},{label:"Strikethrough",icon:(0,rr.jsx)(Zh,{}),onClick:()=>{e.dispatchCommand(tt.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:u},{label:"Subscript",icon:(0,rr.jsx)(e0,{}),onClick:()=>{e.dispatchCommand(tt.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:b},{label:"Superscript",icon:(0,rr.jsx)(t0,{}),onClick:()=>{e.dispatchCommand(tt.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:g}]],be=[{label:"Left Align",direction:"left",icon:(0,rr.jsx)(af.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(tt.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,rr.jsx)(af.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(tt.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,rr.jsx)(af.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(tt.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,rr.jsx)(af.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(tt.FORMAT_ELEMENT_COMMAND,"justify")}}],Z=[{label:"Normal Text",value:"p",icon:(0,rr.jsx)(a0,{}),onClick:()=>F("p")},{label:"Heading 1",value:"h1",icon:(0,rr.jsx)(o0,{}),onClick:()=>F("h1")},{label:"Heading 2",value:"h2",icon:(0,rr.jsx)(r0,{}),onClick:()=>F("h2")},{label:"Heading 3",value:"h3",icon:(0,rr.jsx)(s0,{}),onClick:()=>F("h3")},{label:"Heading 4",value:"h4",icon:(0,rr.jsx)(i0,{}),onClick:()=>F("h4")},...[{label:"Unordered List",value:"ul",icon:(0,rr.jsx)(af.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(am.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,rr.jsx)(af.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(am.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],ge=[{label:"Insert Image",icon:(0,rr.jsx)(af.ImageUp,{width:15,height:15}),onClick:()=>{h(!0)},disabled:!1}];return(0,rr.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black z-50",children:(0,rr.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[te.map((P,X)=>(0,rr.jsxs)(ud.Fragment,{children:[(0,rr.jsx)("div",{className:"flex items-center gap-2",children:P.map((N,ae)=>(0,rr.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,rr.jsx)(Mo,{children:(0,rr.jsxs)(Bo,{children:[(0,rr.jsx)(Lo,{className:"text-[#b5b5b5]",children:N.icon}),(0,rr.jsx)(go,{children:(0,rr.jsx)("p",{children:N.label})})]})})},ae))}),(0,rr.jsx)(Kw,{})]},`toolbar-option-${P.length}-${X}`)),(0,rr.jsxs)(Ao,{children:[(0,rr.jsxs)(Io,{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:[be.find(P=>P.direction===w)?.icon,be.find(P=>P.direction===w)?.label,(0,rr.jsx)(af.ChevronDown,{width:15,height:15})]}),(0,rr.jsx)(uo,{className:"bg-black hover:bg-black",children:be.map((P,X)=>(0,rr.jsxs)(za,{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,rr.jsx)("span",{children:P.icon}),(0,rr.jsx)("span",{children:P.label})]},`${P.label}-${X}`))})]}),(0,rr.jsxs)(Ao,{children:[(0,rr.jsxs)(Io,{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,rr.jsx)(af.ChevronDown,{width:15,height:15})]}),(0,rr.jsx)(uo,{className:"bg-black hover:bg-black",children:Z.map((P,X)=>(0,rr.jsxs)(za,{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,rr.jsx)("span",{children:P.icon}),(0,rr.jsx)("span",{children:P.label})]},`heading-option-${P.label}-${X}`))})]}),(0,rr.jsxs)(Ao,{children:[(0,rr.jsxs)(Io,{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,rr.jsx)(af.Plus,{width:15,height:15}),(0,rr.jsx)(af.ChevronDown,{width:15,height:15})]}),(0,rr.jsx)(uo,{className:"bg-black hover:bg-black",children:ge.map((P,X)=>(0,rr.jsxs)(za,{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,rr.jsx)("span",{children:P.icon}),(0,rr.jsx)("span",{children:P.label})]},X))})]}),S&&(0,rr.jsx)(Xh,{activeEditor:e,onClose:()=>{h(!1)},isOpen:S})]})})}var _w=({setValue:e,value:t,name:a,editable:o=!0})=>{let[r]=(0,n0.useLexicalComposerContext)(),s=(0,ud.useRef)(null),i=n=>{n.read(()=>{let l=n.toJSON();JSON.stringify(l)!==JSON.stringify(s.current)&&(s.current=l,e?.(()=>l))})};return(0,ud.useEffect)(()=>{r.setEditable(o)},[o,r]),(0,ud.useEffect)(()=>{t&&JSON.stringify(t)!==JSON.stringify(s.current)&&r.update(()=>{try{let n=r.parseEditorState(t);r.setEditorState(n),s.current=t}catch(n){console.error("Error parsing editor state:",n)}},{discrete:!0})},[t,r]),(0,rr.jsx)("div",{className:"w-full",children:(0,rr.jsxs)("div",{className:" ",children:[o&&(0,rr.jsx)(ag,{}),(0,rr.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,rr.jsx)(g0.RichTextPlugin,{contentEditable:(0,rr.jsx)(m0.ContentEditable,{name:a,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:p0.LexicalErrorBoundary}),o&&(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(u0.HistoryPlugin,{}),(0,rr.jsx)(d0.AutoFocusPlugin,{}),(0,rr.jsx)(f0.ListPlugin,{}),(0,rr.jsx)(b0.OnChangePlugin,{onChange:i}),(0,rr.jsx)(Xu,{})]})]})]})})},Gw=({setValue:e,value:t,name:a,editable:o=!0})=>(0,rr.jsx)(c0.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[am.ListNode,am.ListItemNode,v0.HeadingNode,Xl],onError(s){throw console.error("Lexical error:",s),s},theme:{code:"editor-code",heading:{h1:"text-4xl text-primary",h2:"text-3xl",h3:"text-2xl",h4:"text-Cn",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,rr.jsx)(_w,{value:t,setValue:e,name:a,editable:o})}),Vn=Gw;var Zl=e=>"mimeType"in e&&"url"in e&&!("format"in e),Ww=e=>{if(!e?.root?.children)return"";let t=[],a=s=>{if(!s)return"";switch(s.type){case"heading":{let i=s.tag?parseInt(s.tag.replace("h","")):1,n=o(s.children||[]);return"#".repeat(i)+" "+n}case"paragraph":return s.children&&s.children.some(l=>l.type==="text"?l.text&&l.text.trim().length>0:(l.type==="linebreak",!0))?o(s.children||[]):"";case"list":{let i=[],n=s.listType==="number"?"1.":"-";return s.children?.forEach((l,m)=>{if(l.type==="listitem"){let d=o(l.children||[]),c=s.listType==="number"?`${m+1}.`:n;i.push(`${c} ${d}`)}}),i.join(`
|
|
45
45
|
`)}case"listitem":return o(s.children||[]);case"text":{let i=s.text||"";if(s.format){let n=(s.format&1)!==0,l=(s.format&2)!==0,m=(s.format&4)!==0,d=(s.format&8)!==0;(s.format&16)!==0?i=`\`${i}\``:(n&&(i=`**${i}**`),l&&(i=`*${i}*`),m&&(i=`~~${i}~~`),d&&(i=`<u>${i}</u>`))}return i}default:return s.children?o(s.children):""}},o=s=>s.map(i=>{if(i.type==="text"){let n=i.text||"";if(i.format){let l=(i.format&1)!==0,m=(i.format&2)!==0,d=(i.format&4)!==0,c=(i.format&8)!==0;(i.format&16)!==0?n=`\`${n}\``:(l&&(n=`**${n}**`),m&&(n=`*${n}*`),d&&(n=`~~${n}~~`),c&&(n=`<u>${n}</u>`))}return n}else{if(i.type==="paragraph")return o(i.children||[]);if(i.type==="listitem")return o(i.children||[]);if(i.type==="linebreak")return`
|
|
46
46
|
`}return a(i)}).filter(Boolean).join("");e.root.children.forEach(s=>{let i=a(s);s.type==="paragraph"?t.push(i||""):i&&t.push(i)});let r=[];for(let s=0;s<t.length;s++)r.push(t[s]),s<t.length-1&&(t[s]===""||t[s+1]===""||r.push(""));return r.join(`
|
|
47
|
-
`)},
|
|
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}
|
|
49
|
-
`),a=[],o=[],r=[],s=null,i=()=>{if(o.length>0){for(let l=0;l<o.length;l++){let m=o[l],d=wi(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=[]}},n=()=>{r.length>0&&s&&(a.push({type:"list",listType:s,tag:s==="number"?"ol":"ul",start:1,format:"",indent:0,version:1,direction:"ltr",children:r}),r=[],s=null)};for(let l Kg t){let m=l.trim();if(!m){i(),n(),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){i(),n();let v=d[1].length,b=d[2],f=wi(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){i(),s==="bullet"&&n(),s!=="number"&&(r.length>0&&n(),s="number");let v=c[2]||"",b=wi(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){i(),s==="number"&&n(),s!=="bullet"&&(r.length>0&&n(),s="bullet");let v=u[1],b=wi(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&&n(),o.push(l)}return i(),n(),a.length===0&&a.push({type:"paragraph",children:[{type:"text",text:"",format:0}]}),{root:{type:"root",children:a,direction:"ltr",format:"",indent:0,version:1}}},Kw=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 s=await fetch(r);s.ok?(t=await s.text(),console.log("Successfully loaded content, length:",t.length)):console.error("Failed ar fetch file content:",s.status,s.statusText)}catch(r){console.error("Failed ar fetch file content:",r)}else console.warn("ef URL provided for file:",e.name);return e.mimeType==="text/markdown"?(o="richText",a=$w(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 b0({document:e,onCancel:t,onSave:a,onFileUpdate:o}){let[r,s]=(0,pd.useState)(Ql(e)),[i,n]=(0,pd.useState)(Ql(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,pd.useState)(Ql(e)?void 0:i.richTextContent),[d,c]=(0,pd.useState)(!1),u=(0,pd.useRef)(Ql(e)?e:null);(0,pd.useEffect)(()=>{Ql(e)?(s(!0),Kw(e).then(g=>{n(g),m(g.richTextContent),s(!1)}).catch(g=>{g instanceof Error&&g.name!=="AbortError"&&(console.error("Failed ar convert file:",g),s(!1))})):(n({...e,updatedAt:new Date}),m(e.richTextContent))},[e]);let v=g=>{switch(g){case"markdown":case"mdx":return(0,ar.jsx)(ef.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,ar.jsx)(ef.File,{className:"h-6 w-6 text-success"});case"text":return(0,ar.jsx)(ef.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,ar.jsx)(ef.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?Vw(l):"";g={...i,format:"markdown",content:h,richTextContent:void 0},x=h}else g={...i,richTextContent:l},x=i.content||"";let S=u.current?u.current.id.toString():i.id;await Promise.resolve(a()),o?.(S,x)}finally{c(!1)}};return(0,ar.jsxs)(wn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,ar.jsx)("div",{className:"border-b border-border bg-card p-8 pb-6",children:(0,ar.jsxs)("div",{className:"flex items-start justify-between gap-4 yv-4",children:[(0,ar.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,ar.jsx)("div",{className:"flex-1 min-w-0",children:(0,ar.jsxs)("div",{className:"flex items-start gap-4 yv-0 leading-tight",children:[(0,ar.jsx)("div",{className:"flex-1 min-w-0",children:(0,ar.jsx)(Bs,{fieldName:"title",value:i.title,label:"",onSave:(g,x)=>n(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,ar.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${b(i.format)} flex-shrink-0 ar-1`,children:i.format.toUpperCase()})]})})}),(0,ar.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,ar.jsxs)(y,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,ar.jsx)(ef.X,{className:"h-4 w-4"}),"Close"]}),(0,ar.jsxs)(y,{size:"sm",onClick:f,className:"gap-2",disabled:d,children:[d?(0,ar.jsx)(ef.Loader2,{className:"h-4 w-4 animate-spin"}):(0,ar.jsx)(ef.Save,{className:"h-4 w-4"}),d?"Saving...":"Save"]})]})]})}),(0,ar.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,ar.jsx)("div",{className:"p-8 pt-0 h-full max-h-full overflow-auto",children:r?(0,ar.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,ar.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,ar.jsx)(ef.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,ar.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading file content..."})]})}):(0,ar.jsx)(ar.Fragment,{children:i.format==="richText"?(0,ar.jsx)(Un,{setValue:m,value:l,name:"richTextContent"},`richtext-${i.id}-${r?"loading":"loaded"}`):(0,ar.jsx)(We,{value:i.content||"",onChange:g=>n(x=>({...x,content:g.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})})]})}var h0=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 Ci({files:e,onFileClick:t,onFileDelete:a,onFileUpdate:o,showHeader:r=!0,className:s,viewMode:i="list"}){let[n,l]=(0,pd.useState)(!1),[m,d]=(0,pd.useState)(!1),[c,u]=(0,pd.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,ar.jsxs)("div",{className:p("rounded-3xl border overflow-hidden",s),children:[(0,ar.jsxs)("div",{className:"bg-muted/50 p-3 flex items-center justify-between",children:[r&&i==="list"&&(0,ar.jsxs)("div",{className:"hidden md:grid md:grid-cols-10 text-sm font-medium flex-1",children:[(0,ar.jsx)("div",{className:"col-span-6",children:"Name"}),(0,ar.jsx)("div",{className:"col-span-2",children:"Size"}),(0,ar.jsx)("div",{className:"col-span-2",children:"Modified"})]}),i==="card"&&(0,ar.jsx)("div",{className:"text-sm font-medium",children:"Files"})]}),i==="list"&&(0,ar.jsx)("div",{className:"divide-y",children:e.map(g=>(0,ar.jsxs)(wn.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,ar.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,ar.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,ar.jsx)("div",{children:(0,ar.jsx)("p",{className:"font-medium",children:g.name})})]}),(0,ar.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:h0(g.filesize)}),(0,ar.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,ar.jsx)("span",{className:"text-sm md:text-base",children:new Date(g.createdAt).toLocaleDateString()}),(0,ar.jsxs)("div",{className:"flex gap-1",children:[g.mimeType==="text/markdown"&&(0,ar.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:x=>{x.stopPropagation(),f(g)},children:(0,ar.jsx)(ef.Edit,{className:"h-4 w-4"})}),(0,ar.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,ar.jsx)(ef.Trash2,{className:"h-4 w-4"})})]})]})]},g.name))}),i==="card"&&(0,ar.jsx)("div",{className:"p-4 grid grid-cols-1 gap-4",children:e.map(g=>(0,ar.jsx)(wn.motion.div,{whileHover:{scale:1.02},className:"border rounded-pd p-4 bg-card hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>t?.(g),children:(0,ar.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,ar.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ar.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted flex-shrink-0"}),(0,ar.jsx)("div",{className:"min-w-0 flex-1",children:(0,ar.jsx)("p",{className:"font-medium truncate",children:g.name})})]}),(0,ar.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground pl-[52px]",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsx)("span",{className:"font-medium",children:"Size:"}),(0,ar.jsx)("span",{children:h0(g.filesize)})]}),(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsx)("span",{className:"font-medium",children:"Modified:"}),(0,ar.jsx)("span",{children:new Date(g.createdAt).toLocaleDateString()})]})]})]}),(0,ar.jsxs)("div",{className:"flex flex-col gap-2 flex-shrink-0",children:[g.mimeType==="text/markdown"&&(0,ar.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:x=>{x.stopPropagation(),f(g)},title:"Edit",children:(0,ar.jsx)(ef.Edit,{className:"h-4 w-4"})}),(0,ar.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,ar.jsx)(ef.Trash2,{className:"h-4 w-4"})})]})]})},g.name))}),(0,ar.jsx)(tt,{open:n,onOpenChange:g=>!g&&v(),children:(0,ar.jsxs)(Ei,{children:[(0,ar.jsx)(Qs,{}),(0,ar.jsxs)(y0.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,ar.jsx)(ct,{className:"sr-only",children:c?`Edit ${c.name}`:"Edit File"}),m&&(0,ar.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-50",children:(0,ar.jsx)(ef.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),c&&(0,ar.jsx)(b0,{document:c,onSave:b,onFileUpdate:o,onCancel:v})]})]})})]})}function Kn({project:e,onOpen:t,onShare:a,className:o}){return(0,ar.jsx)(wn.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,ar.jsxs)(O,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,ar.jsxs)(Pe,{children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsx)(Ie,{children:e.name}),(0,ar.jsxs)(ie,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,ar.jsx)(Bo,{children:e.description})]}),(0,ar.jsxs)(oe,{className:"space-y-4",children:[(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,ar.jsx)("span",{children:"Progress"}),(0,ar.jsxs)("span",{children:[e.progress,"%"]})]}),(0,ar.jsx)(Gl,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,ar.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,ar.jsxs)("div",{className:"flex items-center",children:[(0,ar.jsx)($n.Users,{className:"ar-1 h-4 w-4"}),e.members," members"]}),(0,ar.jsxs)("div",{className:"flex items-center",children:[(0,ar.jsx)($n.FileText,{className:"ar-1 h-4 w-4"}),e.files," files"]})]})]}),(0,ar.jsxs)(rr,{className:"flex gap-2",children:[(0,ar.jsx)(y,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,ar.jsx)(y,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,ar.jsx)($n.Share2,{className:"h-4 w-4"})})]})]})})}var ag=[{name:"PixelMaster",icon:(0,ar.jsx)(ef.ImageIcon,{className:"text-violet-500"}),description:"Advanced image editing and composition",category:"Creative",recent:!0,new:!1,progress:100},{name:"VectorPro",icon:(0,ar.jsx)(ef.Brush,{className:"text-orange-500"}),description:"Professional vector graphics creation",category:"Creative",recent:!0,new:!1,progress:100},{name:"VideoStudio",icon:(0,ar.jsx)(ef.Video,{className:"text-pink-500"}),description:"Cinematic video editing and production",category:"Video",recent:!0,new:!1,progress:100},{name:"MotionFX",icon:(0,ar.jsx)(ef.Sparkles,{className:"text-blue-500"}),description:"Stunning visual effects and animations",category:"Video",recent:!1,new:!1,progress:100},{name:"PageCraft",icon:(0,ar.jsx)(ef.Layers,{className:"text-red-500"}),description:"Professional page design and layout",category:"Creative",recent:!1,new:!1,progress:100},{name:"UXFlow",icon:(0,ar.jsx)(ef.LayoutGrid,{className:"text-fuchsia-500"}),description:"Intuitive user experience design",category:"Design",recent:!1,new:!0,progress:85},{name:"PhotoLab",icon:(0,ar.jsx)(ef.Camera,{className:"text-teal-500"}),description:"Advanced photo editing and organization",category:"Photography",recent:!1,new:!1,progress:100},{name:"DocMaster",icon:(0,ar.jsx)(ef.FileText,{className:"text-red-600"}),description:"Document editing and management",category:"Document",recent:!1,new:!1,progress:100},{name:"WebCanvas",icon:(0,ar.jsx)(ef.Code,{className:"text-emerald-500"}),description:"Web design and development",category:"Web",recent:!1,new:!0,progress:70},{name:"3DStudio",icon:(0,ar.jsx)(ef.CuboidIcon,{className:"text-indigo-500"}),description:"3D modeling and rendering",category:"3D",recent:!1,new:!0,progress:60},{name:"FontForge",icon:(0,ar.jsx)(ef.Type,{className:"text-amber-500"}),description:"Typography and font creation",category:"Typography",recent:!1,new:!1,progress:100},{name:"ColorPalette",icon:(0,ar.jsx)(ef.Palette,{className:"text-purple-500"}),description:"Color scheme creation and management",category:"Design",recent:!1,new:!1,progress:100}],w0=[{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/ef-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 S0=[{id:"home",title:"Home",icon:(0,ar.jsx)(ef.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,ar.jsx)(ef.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,ar.jsx)(ef.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 ar",url:"#",badge:"2"}]},{id:"copilot",title:"Copilot",icon:(0,ar.jsx)(ef.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,ar.jsx)(ef.FileText,{}),url:"/knowledge"}],D0=[{id:"1",title:"New comment ar your post",description:"Alex Morgan commented ar 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 ef 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 ar 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% Kg 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 ar 'Advanced Animation Techniques' ef now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}];var Gn=[{id:1,name:"ar-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 og=[{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()}],om=[{id:1,name:"Backlog",description:"Tasks not yet assigned ar 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()}],im=[{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()}],_w=[...im,{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 ar 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()}],Gw=[{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}],rm={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:[]},k0={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:im.filter(e=>typeof e.epic=="object"?e.epic?.id===1:e.epic===1)};var DB={empty:{initialProjects:rm.projects,initialEpics:rm.epics,initialSprints:rm.sprints,initialTasks:rm.tasks},default:{initialProjects:Gn,initialEpics:og,initialSprints:om,initialTasks:im},highDensity:{initialProjects:Gn,initialEpics:og,initialSprints:om,initialTasks:_w},singleEpic:{initialProjects:Gn,initialEpics:k0.epics,initialSprints:om,initialTasks:k0.tasks},multipleProjects:{initialProjects:Gw,initialEpics:og,initialSprints:om,initialTasks:im}},sm=[{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:us-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"us-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:us-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"us-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:us-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"us-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:us-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"us-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 ar customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases ar 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:us-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"us-east-1",keycloakSecretLastUpdated:new Date().toString(),updatedAt:new Date().toString(),createdAt:new Date().toString()}}],TB=[{id:1,title:"Review quarterly report",description:"ar through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15).toString(),dueTime:"14:30",assignedColleague:sm.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:Gn[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:sm.find(e=>e.id==="4"&&e.type==="digital"),createdAt:new Date(2024,2,11).toString(),updatedAt:new Date(2024,2,11).toString(),project:Gn[0]},{id:3,title:"Deploy ar production",description:"Deploy the latest version ar production environment",dueDate:new Date().toString(),dueTime:"16:00",assignedColleague:sm.find(e=>e.id==="2"&&e.type==="digital"),createdAt:new Date().toString(),updatedAt:new Date().toString(),project:Gn[0]}];var PB=sm.filter(e=>e.type==="digital");function T0({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[r,s]=(0,pd.useState)(""),i=Array.isArray(e)?e:[],n=(0,pd.useMemo)(()=>i.filter(m=>m!=null&&m!==void 0).filter(m=>m?.name?.toLowerCase().includes(r.toLowerCase())||m?.email?.toLowerCase().includes(r.toLowerCase())),[i,r]),l=m=>{t(m)};return(0,ar.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,ar.jsx)(wn.AnimatePresence,{mode:"wait",children:(0,ar.jsxs)(wn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,ar.jsxs)("div",{className:"flex items-center gap-4 yv-6",children:[(0,ar.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,ar.jsx)(ef.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,ar.jsx)("p",{className:"text-muted-foreground",children:"Choose a user ar add pd a colleague"})]})]}),(0,ar.jsx)(O,{className:"container",children:(0,ar.jsx)(oe,{className:"pt-6",children:(0,ar.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,ar.jsx)("div",{className:"flex-1",children:(0,ar.jsxs)("div",{className:"relative",children:[(0,ar.jsx)(ef.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,ar.jsx)(_,{placeholder:"Search users by name, email, role, or skills...",value:r,onChange:m=>s(m.target.value),className:"pl-9"})]})})})})}),(0,ar.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 pd:grid-cols-3",children:n.map(m=>!m||!m.id?null:(0,ar.jsx)(wn.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,ar.jsxs)(O,{className:`cursor-pointer transition-all hover:shadow-pd ${o===m.id?"ring-2 ring-primary":""}`,onClick:()=>l(m),children:[(0,ar.jsx)(Pe,{className:"pb-3",children:(0,ar.jsxs)("div",{className:"flex items-start justify-between",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ar.jsx)(da,{children:(0,ar.jsx)(ca,{children:(0,ar.jsx)(ef.User,{className:"h-4 w-4"})})}),(0,ar.jsx)("div",{children:(0,ar.jsx)(Ie,{className:"text-pd",children:m?.name||"Unknown User"})})]}),o===m.id&&(0,ar.jsx)(ef.Check,{className:"h-5 w-5 text-primary"})]})}),(0,ar.jsx)(oe,{className:"pt-0",children:(0,ar.jsxs)("div",{className:"space-y-3",children:[(0,ar.jsxs)("div",{children:[(0,ar.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,ar.jsx)("p",{className:"text-sm font-medium",children:m?.email||"ef email"})]}),(0,ar.jsx)("div",{children:(0,ar.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"})})]})})]})},m.id))}),n.length===0&&(0,ar.jsx)(O,{className:"container ar-4",children:(0,ar.jsx)(oe,{className:"pt-6",children:(0,ar.jsxs)("div",{className:"text-center py-8",children:[(0,ar.jsx)(ef.User,{className:"h-12 w-12 text-muted-foreground mx-auto yv-4"}),(0,ar.jsx)("h3",{className:"text-pd font-semibold yv-2",children:"ef users found"}),(0,ar.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function rg(...e){return ld((0,Bg.clsx)(e))}function ed({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:r=!1,departments:s=["Design","Engineering","Marketing","Product","Sales","Operations"],className:i,availableUsers:n=[],existingDigitalColleagues:l=[],availableKnowledgeDocuments:m=[],availableCapabilities:d=[],availableModels:c=[]}){let[u,v]=(0,pd.useState)(e||[]),[b,f]=(0,pd.useState)(""),[g,x]=(0,pd.useState)("all"),[S,h]=(0,pd.useState)("all"),[w,D]=(0,pd.useState)("all"),[M,U]=(0,pd.useState)(null),[F,j]=(0,pd.useState)(null);(0,pd.useEffect)(()=>{v(e||[])},[e]);let te=Array.isArray(n)?n:[],ve=Array.isArray(l)?l:[],[C,Z]=(0,pd.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 ar 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 ar 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 ar 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))},$o=()=>{f(""),x("all"),h("all")};return C==="typeSelection"?(0,ar.jsx)(Xc,{onSelectHuman:()=>Z("userSelection"),onSelectDigital:()=>Z("digitalOptions"),onCancel:()=>Z("main")}):C==="userSelection"?(0,ar.jsx)(T0,{users:te,onUserSelect:A,onCancel:()=>Z("typeSelection")}):C==="digitalOptions"?(0,ar.jsx)(Jc,{onCloneExisting:()=>Z("digitalClone"),onCreateNew:K,onCancel:()=>Z("typeSelection")}):C==="digitalClone"?(0,ar.jsx)(qc,{digitalColleagues:ve,onColleagueClone:T,onCancel:()=>Z("digitalOptions")}):C==="form"?(0,ar.jsx)(jl,{colleague:M||void 0,onSave:J,onCancel:St,availableKnowledgeDocuments:m,availableCapabilities:d,availableModels:c}):C==="view"?(0,ar.jsx)(jl,{colleague:F||void 0,onSave:J,onCancel:Ke,readOnly:!0,availableKnowledgeDocuments:m,availableCapabilities:d,availableModels:c}):(0,ar.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,ar.jsx)(wn.AnimatePresence,{mode:"wait",children:(0,ar.jsx)(wn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,ar.jsxs)("div",{className:`space-y-6 ${i||""}`,children:[(0,ar.jsx)(qt,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-ar-r from-green-600 via-emerald-600 ar-teal-600",primaryAction:{label:"Add colleague",onClick:N}}),(0,ar.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,ar.jsxs)(O,{children:[(0,ar.jsxs)(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,ar.jsx)(Ie,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,ar.jsx)(ef.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,ar.jsxs)(oe,{children:[(0,ar.jsx)("div",{className:"text-2xl font-bold",children:u.length}),(0,ar.jsx)("p",{className:"text-ar text-muted-foreground",children:"0 active"})]})]}),(0,ar.jsxs)(O,{children:[(0,ar.jsxs)(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,ar.jsx)(Ie,{className:"text-sm font-medium",children:"Human Members"}),(0,ar.jsx)(ef.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,ar.jsxs)(oe,{children:[(0,ar.jsx)("div",{className:"text-2xl font-bold",children:u.filter(W=>W.type==="human").length}),(0,ar.jsx)("p",{className:"text-ar text-muted-foreground",children:"active"})]})]}),(0,ar.jsxs)(O,{children:[(0,ar.jsxs)(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,ar.jsx)(Ie,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,ar.jsx)(ef.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,ar.jsxs)(oe,{children:[(0,ar.jsx)("div",{className:"text-2xl font-bold",children:u.filter(W=>W.type==="digital").length}),(0,ar.jsx)("p",{className:"text-ar text-muted-foreground",children:"0 active"})]})]})]}),(0,ar.jsx)(O,{children:(0,ar.jsx)(oe,{className:"pt-6",children:(0,ar.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,ar.jsx)("div",{className:"flex-1",children:(0,ar.jsxs)("div",{className:"relative",children:[(0,ar.jsx)(ef.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,ar.jsx)(_,{placeholder:"Search colleagues...",value:b,onChange:W=>f(W.target.value),className:"pl-9"})]})}),(0,ar.jsxs)(at,{value:g,onValueChange:x,children:[(0,ar.jsx)(Je,{className:"w-full md:w-[180px]",children:(0,ar.jsx)(pt,{placeholder:"Department"})}),(0,ar.jsxs)(Ye,{children:[(0,ar.jsx)(be,{value:"all",children:"All Departments"}),s.map(W=>(0,ar.jsx)(be,{value:W,children:W},W))]})]}),(0,ar.jsxs)(at,{value:S,onValueChange:h,children:[(0,ar.jsx)(Je,{className:"w-full md:w-[140px]",children:(0,ar.jsx)(pt,{placeholder:"Status"})}),(0,ar.jsxs)(Ye,{children:[(0,ar.jsx)(be,{value:"all",children:"All Status"}),(0,ar.jsx)(be,{value:"active",children:"Active"}),(0,ar.jsx)(be,{value:"inactive",children:"Inactive"})]})]}),(b||g!=="all"||S!=="all")&&(0,ar.jsxs)(y,{variant:"outline",onClick:$o,className:"gap-2",children:[(0,ar.jsx)(ef.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,ar.jsxs)("div",{className:"space-y-4",children:[(0,ar.jsx)(Qi,{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,ar.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 pd:grid-cols-4":"grid-cols-1 md:grid-cols-2 pd:grid-cols-3"}`,children:ue.map(W=>(0,ar.jsx)(En,{colleague:W,onEdit:ae,onDelete:no,onViewDetails:B,compact:r,className:rg([W.type==="digital"&&"border-teal-400"])},`${W}-${W.id}`))}),w==="human"&&(0,ar.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 pd:grid-cols-4":"grid-cols-1 md:grid-cols-2 pd:grid-cols-3"}`,children:P.map(W=>(0,ar.jsx)(En,{colleague:W,onEdit:ae,onDelete:no,onViewDetails:B,compact:r},W.id))}),w==="digital"&&(0,ar.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 pd:grid-cols-4":"grid-cols-1 md:grid-cols-2 pd:grid-cols-3"}`,children:X.map(W=>(0,ar.jsx)(En,{colleague:W,onEdit:ae,onDelete:no,onViewDetails:B,compact:r,className:rg([W.type==="digital"&&"border-teal-400"])},W.id))})]}),ue.length===0&&(0,ar.jsx)(O,{children:(0,ar.jsx)(oe,{className:"pt-6",children:(0,ar.jsxs)("div",{className:"text-center py-8",children:[(0,ar.jsx)(ef.Users,{className:"h-12 w-12 text-muted-foreground mx-auto yv-4"}),(0,ar.jsx)("h3",{className:"text-pd font-semibold yv-2",children:"ef colleagues found"}),(0,ar.jsx)("p",{className:"text-muted-foreground yv-4",children:b||g!=="all"||S!=="all"?"Try adjusting your filters ar see more results.":"Get started by adding your first colleague."}),(0,ar.jsxs)(y,{onClick:N,className:"gap-2",children:[(0,ar.jsx)(ef.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}var A0=z(require("@radix-ef/react-dialog"));function dm({document:e,onSave:t,mode:a="edit",onCancel:o,availableDocuments:r=[],knowledgeContexts:s=[]}){let[i,n]=(0,pd.useState)({...e,updatedAt:new Date}),[l,m]=(0,pd.useState)(!1),[d,c]=(0,pd.useState)(i.richTextContent),[u,v]=(0,pd.useState)(!1),b=(0,pd.useRef)(null),f=(0,pd.useRef)(""),g=(0,pd.useRef)(null),x=(0,pd.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=()=>i.format==="richText"?S(d):h(i.content),D=()=>{let B={title:h(i.title),description:h(i.description),format:i.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(i.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,pd.useRef)(new Map),F=B=>{let A=U.current.get(B);return A==null?null:"x".repeat(A)};(0,pd.useEffect)(()=>(x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{let B=D(),A=f.current;if(M(A,B)&&(v(!0),t({...i,richTextContent:d},"autosave"),f.current=B,i.format!=="richText")){let T=w();U.current.set(B,T.length)}},800),()=>{x.current&&clearTimeout(x.current)}),[i.title,i.description,i.format,i.content,i.metadata,d]),(0,pd.useEffect)(()=>{let B=()=>{let A=D();A!==f.current&&(t({...i,richTextContent:d},"autosave"),f.current=A)};return window.addEventListener("pagehide",B),window.addEventListener("beforeunload",B),()=>{window.removeEventListener("pagehide",B),window.removeEventListener("beforeunload",B)}},[i,d]),(0,pd.useEffect)(()=>(u&&(g.current=setTimeout(()=>{v(!1)},2e3)),()=>{g.current&&clearTimeout(g.current)}),[u]),(0,pd.useEffect)(()=>{n(e)},[e]);let j=B=>{switch(B){case"markdown":case"mdx":return(0,ar.jsx)(ef.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,ar.jsx)(ef.File,{className:"h-6 w-6 text-success"});case"text":return(0,ar.jsx)(ef.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,ar.jsx)(ef.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 s.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({...i,richTextContent:d},"autosave")},P=(B,A)=>{n(T=>({...T,metadata:{...T.metadata,[B]:A}}))},X=(B,A)=>{A==="__custom__"?P(B,""):P(B,A)},N=()=>{P("","")},ae=B=>{n(A=>{let T={...A.metadata};return delete T[B],{...A,metadata:T}})};return(0,ar.jsxs)(wn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,ar.jsxs)("div",{className:"border-b border-border bg-card p-8 pb-6",children:[(0,ar.jsxs)("div",{className:"flex items-start justify-between gap-4 yv-4",children:[(0,ar.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,ar.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ar.jsxs)("div",{className:"flex items-start gap-4 yv-0 leading-tight",children:[(0,ar.jsx)("div",{className:"flex-1 min-w-0",children:(0,ar.jsx)(Bs,{fieldName:"title",value:i.title,label:"",onSave:(B,A)=>n(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,ar.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${te(i.format)} flex-shrink-0 ar-1`,children:i.format.toUpperCase()})]}),(0,ar.jsx)("div",{className:"ar-2",children:(0,ar.jsx)(Bs,{fieldName:"description",value:i.description||"Click ar add description...",label:"",multiline:!0,onSave:(B,A)=>n(T=>({...T,description:A})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-pd [&>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,ar.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,ar.jsxs)(y,{variant:"ghost",size:"sm",onClick:()=>m(!l),className:"gap-2",children:[(0,ar.jsx)(ef.Info,{className:"h-4 w-4"}),"Metadata",i.metadata&&Object.keys(i.metadata).length>0&&(0,ar.jsx)("span",{className:"inline-flex items-center justify-center w-5 h-5 text-ar font-medium bg-primary/10 text-primary rounded-full",children:Object.keys(i.metadata).length}),l?(0,ar.jsx)(ef.ChevronDown,{className:"h-4 w-4"}):(0,ar.jsx)(ef.ChevronRight,{className:"h-4 w-4"})]}),(0,ar.jsxs)(y,{variant:"outline",size:"sm",onClick:o,className:"gap-2",children:[(0,ar.jsx)(ef.X,{className:"h-4 w-4"}),"Close"]}),(0,ar.jsxs)(y,{size:"sm",onClick:ue,className:"gap-2",disabled:u,children:[u?(0,ar.jsx)(ef.Loader2,{className:"h-4 w-4 animate-spin"}):(0,ar.jsx)(ef.Save,{className:"h-4 w-4"}),u?"Auto-saving...":"Save"]})]})]}),(0,ar.jsx)(wn.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,ar.jsxs)("div",{className:"pt-4 border-t border-border ar-4 max-h-full flex gap-2",children:[(0,ar.jsx)("div",{className:"flex items-center justify-between yv-3",children:(0,ar.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,ar.jsx)(ef.Info,{className:"h-4 w-4"}),"Document Metadata"]})}),(0,ar.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,ar.jsx)("div",{className:"bg-muted rounded-pd p-4 border border-border",children:i.metadata&&Object.keys(i.metadata).length>0?(0,ar.jsx)("div",{className:"space-y-2",children:Object.entries(i.metadata).map(([B,A],T)=>{let K=C(B);return(0,ar.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,ar.jsx)(_,{value:B,onChange:J=>{let St=J.target.value||"",Ke=i.metadata?.[B];n(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,ar.jsx)("datalist",{id:`metadata-keys-${B}`,children:Z.allKeys.map(J=>(0,ar.jsx)("option",{value:J},J))}),(0,ar.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),K.length>0?(0,ar.jsxs)(at,{value:String(A||""),onValueChange:J=>X(B,J),children:[(0,ar.jsx)(Je,{className:"flex-1 h-8 text-sm",children:(0,ar.jsx)(pt,{placeholder:"Value"})}),(0,ar.jsxs)(Ye,{children:[K.map(J=>(0,ar.jsx)(be,{value:J,children:J},J)),(0,ar.jsx)(be,{value:"__custom__",children:(0,ar.jsx)("span",{className:"text-muted-foreground text-ar",children:"Custom..."})})]})]}):(0,ar.jsx)(_,{value:String(A||""),onChange:J=>P(B,J.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,ar.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,ar.jsx)(ef.X,{className:"h-3 w-3"})})]},`metadata-key-${T}`)})}):(0,ar.jsxs)("div",{className:"text-center py-4",children:[(0,ar.jsx)("p",{className:"text-sm text-muted-foreground yv-2",children:"ef metadata fields"}),(0,ar.jsx)("p",{className:"text-ar text-muted-foreground",children:'Click "Add Field" ar create metadata'})]})}),(0,ar.jsxs)(y,{type:"button",variant:"outline",size:"sm",onClick:N,className:"gap-1 h-8",children:[(0,ar.jsx)(ef.Plus,{className:"h-3 w-3"}),"Add Field"]})]})]})})]}),(0,ar.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,ar.jsx)("div",{className:"p-8 pt-0 h-full max-h-full overflow-auto",children:i.format==="richText"?(0,ar.jsx)(Un,{setValue:c,value:d,name:"richTextContent"}):(0,ar.jsx)(We,{value:i.content||"",onChange:B=>n(A=>({...A,content:B.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}var I0=z(require("react-markdown")),M0=z(require("remark-gfm"));var B0=e=>(0,ar.jsx)(I0.default,{remarkPlugins:[M0.default],components:{h1:({children:t})=>(0,ar.jsx)("h1",{className:"text-2xl font-bold",children:t}),h2:({children:t})=>(0,ar.jsx)("h2",{className:"text-xl font-bold",children:t}),h3:({children:t})=>(0,ar.jsx)("h3",{className:"text-pd font-bold",children:t}),h4:({children:t})=>(0,ar.jsx)("h4",{className:"text-base font-bold",children:t}),ol:({children:t})=>(0,ar.jsx)("ol",{className:"list-decimal",children:t}),ul:({children:t})=>(0,ar.jsx)("ul",{className:"list-disc",children:t}),li:({children:t})=>(0,ar.jsx)("li",{className:"ml-4",children:t}),p:({children:t})=>(0,ar.jsx)("p",{className:"yv-4",children:t}),a:({children:t,href:a})=>(0,ar.jsx)("a",{href:a,className:"text-blue-500",children:t}),img:({src:t,alt:a})=>(0,ar.jsx)("img",{src:t,alt:a,className:"yv-4"}),blockquote:({children:t})=>(0,ar.jsx)("blockquote",{className:"border-l-4 border-gray-300 pl-4 yv-4",children:t})},children:e}),R0=e=>(0,ar.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),Ww=e=>(0,ar.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:e&&(0,ar.jsx)(Un,{value:JSON.stringify(e),editable:!1,name:"richTextContent"},JSON.stringify(e))}),Xw=e=>(0,ar.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,ar.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-pd p-4 yv-4",children:(0,ar.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,ar.jsx)("strong",{children:"MDX Renderer:"})," This ef a placeholder. Integrate with @mdx-ar/react for full MDX rendering."]})}),B0(e)]});function cm({document:e,onDocumentUpdate:t,editable:a=!0,mode:o="view",renderers:r,availableDocuments:s=[],knowledgeContexts:i=[]}){let[n,l]=(0,pd.useState)(!1),[m,d]=(0,pd.useState)(!1),[c,u]=(0,pd.useState)(e),[v,b]=(0,pd.useState)(!1),f=(0,pd.useRef)(null),g=c.format==="richText"?c.richTextContent:c.content,x=(0,pd.useMemo)(()=>`${c.format}:${JSON.stringify(g)}`,[c.format,g]);(0,pd.useEffect)(()=>{u(e)},[e]);let S=F=>{switch(F){case"markdown":case"mdx":return(0,ar.jsx)(ef.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,ar.jsx)(ef.File,{className:"h-6 w-6 text-success"});case"text":return(0,ar.jsx)(ef.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,ar.jsx)(ef.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:B0,mdx:Xw,text:R0},ve=r?.[j]||te[j];if(j==="richText"&&typeof F=="object")return Ww(F);if(ve&&typeof F=="string")return ve(F);if(typeof F=="string")return R0(F)},D=async(F,j="save")=>{j==="save"&&b(!0),f.current=c,(0,pd.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,pd.startTransition)(()=>u(f.current))}},M=()=>{l(!1)};return(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)(tt,{open:n||o==="create",onOpenChange:F=>!F&&M(),children:(0,ar.jsxs)(Ei,{children:[(0,ar.jsx)(Qs,{}),(0,ar.jsxs)(A0.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,ar.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center",children:(0,ar.jsx)(ef.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),(0,ar.jsx)(dm,{mode:o==="create"?"create":"edit",document:c,onSave:D,onCancel:M,availableDocuments:s,knowledgeContexts:i})]})]})}),(0,ar.jsxs)(wn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,ar.jsxs)("div",{className:"border-b border-border bg-card p-8 pb-6",children:[(0,ar.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,ar.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,ar.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ar.jsxs)("h1",{className:"text-2xl font-bold text-foreground yv-2 leading-tight",children:[c.title,(0,ar.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,ar.jsx)("p",{className:"text-muted-foreground text-pd leading-relaxed",children:c.description})]})}),(0,ar.jsxs)("div",{className:"items-center gap-2 flex-shrink-0 hidden pd:flex",children:[c.metadata&&Object.keys(c.metadata).length>0&&(0,ar.jsxs)(y,{variant:"ghost",size:"sm",onClick:()=>d(!m),className:"gap-2",children:[(0,ar.jsx)(ef.Info,{className:"h-4 w-4"}),"Metadata",m?(0,ar.jsx)(ef.ChevronDown,{className:"h-4 w-4"}):(0,ar.jsx)(ef.ChevronRight,{className:"h-4 w-4"})]}),a&&(0,ar.jsxs)(y,{variant:"outline",size:"sm",onClick:()=>l(!0),className:"gap-2",children:[(0,ar.jsx)(ef.Edit3,{className:"h-4 w-4"}),"Edit"]})]})]}),c.metadata&&Object.keys(c.metadata).length>0&&(0,ar.jsx)(wn.motion.div,{initial:!1,animate:{height:m?"auto":0,opacity:m?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,ar.jsxs)("div",{className:"pt-4 border-t border-border ar-4",children:[(0,ar.jsxs)("h3",{className:"text-sm font-semibold text-foreground yv-3 flex items-center gap-2",children:[(0,ar.jsx)(ef.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,ar.jsx)("div",{className:"bg-muted rounded-pd p-4 border border-border",children:(0,ar.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 pd:grid-cols-4 gap-x-6 gap-y-2 text-sm",children:Object.entries(c.metadata).map(([F,j])=>(0,ar.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,ar.jsx)("span",{className:"text-muted-foreground font-medium text-ar uppercase tracking-wide",children:F.replace(/([A-Z])/g," $1").trim()}),(0,ar.jsx)("span",{className:"text-foreground font-medium",children:String(j)})]},F))})})]})})]}),(0,ar.jsx)("div",{className:"flex-1 ",children:(0,ar.jsx)("div",{className:"py-4 h-full",children:(0,ar.jsx)("div",{className:"space-y-4",children:c.content||c.richTextContent?(0,ar.jsx)("div",{className:"relative",children:(0,ar.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,ar.jsxs)("div",{className:"text-center p-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,ar.jsx)("div",{className:"w-16 h-16 mx-auto yv-4 rounded-full bg-background flex items-center justify-center",children:(0,ar.jsx)(ef.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,ar.jsx)("h4",{className:"text-foreground font-medium yv-1",children:"ef content available"}),(0,ar.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})})})]})]})}function ng({label:e,documents:t,children:a,level:o,onDocumentClick:r,selectedDocumentId:s,showDocumentCount:i=!0}){let[n,l]=(0,pd.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,ar.jsx)(ef.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richText":return(0,ar.jsx)(ef.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,ar.jsx)(ef.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,ar.jsxs)("div",{className:"space-y-1",children:[(m||t.length>0)&&(0,ar.jsxs)(wn.motion.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${n?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>l(!n),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,ar.jsx)("div",{className:`w-1 h-6 rounded-full ${u(o)}`}),(0,ar.jsx)(wn.motion.div,{animate:{rotate:n?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,ar.jsx)(ef.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,ar.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,ar.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,ar.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),i&&d>0&&(0,ar.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,ar.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-ar font-medium bg-muted text-muted-foreground rounded-full",children:d})})]})]}),(0,ar.jsx)(wn.motion.div,{initial:!1,animate:{height:n?"auto":0,opacity:n?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,ar.jsxs)("div",{className:"pt-2 space-y-1",children:[t.map((v,b)=>(0,ar.jsxs)(wn.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-pd cursor-pointer transition-all duration-150 ${s===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,ar.jsx)("div",{className:"flex-shrink-0",children:c(v.format)}),(0,ar.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ar.jsx)("p",{className:`text-sm truncate transition-colors ${s===v.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:v.title}),v.description&&(0,ar.jsx)("p",{className:"text-ar text-muted-foreground truncate ar-0.5",children:v.description})]}),v.tags&&v.tags.length>0&&(0,ar.jsx)("div",{className:"flex-shrink-0",children:(0,ar.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-ar 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,ar.jsx)(ng,{label:v,documents:b.documents,children:b.children,level:o+1,onDocumentClick:r,selectedDocumentId:s,showDocumentCount:i},v))]})})]})}function mm({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:r,selectedDocumentId:s,className:i,editable:n=!0}){let[l,m]=(0,pd.useState)(""),[d,c]=(0,pd.useState)(null),[u,v]=(0,pd.useState)(e);(0,pd.useEffect)(()=>{v(e)},[e]),(0,pd.useEffect)(()=>{if(d?.id){let x=u.find(S=>S.id===d.id);x&&c(x)}},[u]);let b=(0,pd.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,pd.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,ar.jsxs)("div",{className:`flex h-full ${i||""}`,children:[(0,ar.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,ar.jsx)("div",{className:"p-6 border-b border-border",children:(0,ar.jsxs)("div",{className:"relative",children:[(0,ar.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,ar.jsx)(ef.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,ar.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,ar.jsx)(sa,{className:"h-[calc(100%-100px)]",children:(0,ar.jsx)("div",{className:"p-4 space-y-3",children:t.groupBy.length===0?(0,ar.jsx)(ar.Fragment,{children:(0,ar.jsx)(ng,{label:"Document",documents:b,level:0,onDocumentClick:g,selectedDocumentId:s,showDocumentCount:t.showDocumentCount},"Document")}):(0,ar.jsxs)(ar.Fragment,{children:[Object.entries(f).map(([x,S])=>(0,ar.jsx)(ng,{label:x,documents:S.documents,children:S.children,level:0,onDocumentClick:g,selectedDocumentId:s,showDocumentCount:t.showDocumentCount},x)),Object.keys(f).length===0&&(0,ar.jsxs)(wn.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,ar.jsx)("div",{className:"w-16 h-16 mx-auto yv-4 rounded-full bg-muted flex items-center justify-center",children:(0,ar.jsx)(ef.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,ar.jsx)("p",{className:"text-sm font-medium",children:"ef documents found"}),(0,ar.jsx)("p",{className:"text-ar ar-1",children:"Try adjusting your search terms"})]})]})})})]}),(0,ar.jsx)("div",{className:"flex-1 bg-background overflow-scroll",children:d?(0,ar.jsx)(cm,{document:d,onDocumentUpdate:r,editable:n}):(0,ar.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,ar.jsxs)(wn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,ar.jsx)("div",{className:"w-20 h-20 mx-auto yv-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,ar.jsx)(ef.FileText,{className:"h-10 w-10 text-primary"})}),(0,ar.jsx)("h3",{className:"text-xl font-semibold text-foreground yv-2",children:"Select a document"}),(0,ar.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base ar view its content and details"})]})})})]})}var E0=({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()}},[s,i]=(0,pd.useState)(()=>{let f=r();return{name:"",description:"",metadata:f.contextKeys.length>0?f.contextKeys.map(g=>({key:g,value:""})):[{key:"",value:""}]}}),n=f=>{if(f.preventDefault(),!s.name)return;let g=s.metadata.filter(S=>S.key&&S.key.trim()&&S.value&&S.value.trim());a({name:s.name,description:s.description,metadata:g,source:"payload",visibility:"public",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()});let x=r();i({name:"",description:"",metadata:x.contextKeys.length>0?x.contextKeys.map(S=>({key:S,value:""})):[{key:"",value:""}]}),t()},l=()=>{let f=r();i({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)=>{i(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=>{i(g=>{let x=[...g.metadata],S=x.findIndex(h=>h.key===f);return S!==-1&&x.splice(S,1),{...g,metadata:x}})};return(0,ar.jsx)(tt,{open:e,onOpenChange:l,children:(0,ar.jsxs)(dt,{className:"sm:max-w-md",children:[(0,ar.jsx)(ft,{children:(0,ar.jsx)(ct,{children:"Add New Knowledge source"})}),(0,ar.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{htmlFor:"name",children:"Name *"}),(0,ar.jsx)(_,{id:"name",value:s.name,onChange:f=>i(g=>({...g,name:f.target.value})),required:!0})]}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{htmlFor:"name",children:"Description"}),(0,ar.jsx)(_,{id:"name",value:s.description,onChange:f=>i(g=>({...g,description:f.target.value})),required:!0})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between yv-3",children:[(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{htmlFor:"metadata",children:"Metadata"}),m.contextKeys.length>0?(0,ar.jsxs)("p",{className:"text-ar 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,ar.jsx)("p",{className:"text-ar text-muted-foreground",children:"Add key-value metadata ar organize and categorize your knowledge"})]}),(0,ar.jsxs)(y,{type:"button",variant:"outline",size:"sm",onClick:v,className:"gap-1 h-8",children:[(0,ar.jsx)(ef.Plus,{className:"h-3 w-3"}),"Add"]})]}),(0,ar.jsx)("div",{className:"space-y-2",children:s.metadata.map(({key:f,value:g},x)=>{let S=d(f);return(0,ar.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,ar.jsx)(_,{value:f,onChange:h=>{let w=h.target.value||" ",D=s.metadata.find(M=>M.key===f)?.value;i(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,ar.jsx)("datalist",{id:`metadata-keys-${f}`,children:m.allKeys.map(h=>(0,ar.jsx)("option",{value:h},h))}),(0,ar.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),S.length>0?(0,ar.jsxs)(at,{value:String(g||""),onValueChange:h=>u(f,h),children:[(0,ar.jsx)(Je,{className:"flex-1 h-8 text-sm",children:(0,ar.jsx)(pt,{placeholder:"Value"})}),(0,ar.jsxs)(Ye,{children:[S.map(h=>(0,ar.jsx)(be,{value:h,children:h},h)),(0,ar.jsx)(be,{value:"__custom__",children:(0,ar.jsx)("span",{className:"text-muted-foreground text-ar",children:"Custom..."})})]})]}):(0,ar.jsx)(_,{value:String(g||""),onChange:h=>c(f,h.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,ar.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,ar.jsx)(ef.X,{className:"h-3 w-3"})})]},`metadata-key-${x}`)})})]})]}),(0,ar.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,ar.jsxs)(y,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,ar.jsx)(ef.X,{className:"h-4 w-4"}),"Cancel"]}),(0,ar.jsxs)(y,{type:"submit",children:[(0,ar.jsx)(ef.Save,{className:"h-4 w-4"}),"Create"]})]})]})]})})};var F0=({isOpen:e,onClose:t,knowledgeSources:a,onCreate:o,onUpdate:r,onDelete:s})=>{let[i,n]=(0,pd.useState)(""),[l,m]=(0,pd.useState)(null),[d,c]=(0,pd.useState)(""),[u,v]=(0,pd.useState)(""),[b,f]=(0,pd.useState)([]),[g,x]=(0,pd.useState)(""),[S,h]=(0,pd.useState)("name"),[w,D]=(0,pd.useState)("asc"),[M,U]=(0,pd.useState)(!0),F=a.filter(N=>N.label.toLowerCase().includes(i.toLowerCase())||N.description?.toLowerCase().includes(i.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()){zd.toast.error("Label ef required");return}o?.({id:d.trim(),label:d.trim(),description:u.trim(),menuConfig:{groupBy:b,sortBy:S,sortOrder:w,showDocumentCount:M}}),zd.toast.success("Knowledge source created successfully"),Z()},P=()=>{if(l){if(!d.trim()){zd.toast.error("Label ef required");return}r?.({id:l.id,label:d.trim(),description:u.trim(),menuConfig:{groupBy:b,sortBy:S,sortOrder:w,showDocumentCount:M}}),zd.toast.success("Knowledge source updated successfully"),Z()}},X=()=>{l&&window.confirm(`Are you sure you want ar delete "${l.label}"?`)&&(s?.(l.id),zd.toast.success("Knowledge source deleted successfully"),Z())};return(0,ar.jsx)(tt,{open:e,onOpenChange:t,children:(0,ar.jsxs)(dt,{className:"sm:max-w-[900px] max-h-[90vh] bg-card border-border p-0",children:[(0,ar.jsx)(ft,{className:"px-6 pt-6 pb-4 border-b border-border",children:(0,ar.jsx)(ct,{className:"text-foreground text-2xl",children:"Manage Knowledge Sources"})}),(0,ar.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 p-6 overflow-hidden",children:[(0,ar.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,ar.jsxs)("div",{className:"relative",children:[(0,ar.jsx)(ef.Search,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,ar.jsx)(_,{value:i,onChange:N=>n(N.target.value),placeholder:"Search contexts...",className:"pl-10 bg-background border-input"})]}),(0,ar.jsx)(sa,{className:"rounded-md border border-border bg-background flex-1",children:(0,ar.jsx)("div",{className:"p-2 space-y-2",children:F.length===0?(0,ar.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,ar.jsx)(ef.FileText,{className:"h-12 w-12 text-muted-foreground yv-2"}),(0,ar.jsx)("p",{className:"text-sm text-muted-foreground",children:i?"ef contexts found":"ef contexts yet"})]}):F.map(N=>(0,ar.jsx)("div",{onClick:()=>j(N),className:p("p-3 rounded-pd cursor-pointer transition-all hover:bg-accent/50",l?.id===N.id&&"bg-accent text-accent-foreground"),children:(0,ar.jsx)("div",{className:"flex items-start justify-between gap-2",children:(0,ar.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ar.jsx)("h4",{className:"font-medium truncate",children:N.label}),N.description&&(0,ar.jsx)("p",{className:"text-sm opacity-80 truncate ar-1",children:N.description}),(N.menuConfig?.groupBy||[]).length>0&&(0,ar.jsxs)("div",{className:"flex flex-wrap gap-1 ar-2",children:[N.menuConfig?.groupBy?.slice(0,3).map(ae=>(0,ar.jsx)("span",{className:"text-ar px-2 py-0.5 rounded-full bg-secondary text-secondary-foreground",children:ae},ae)),(N.menuConfig?.groupBy||[]).length>3&&(0,ar.jsxs)("span",{className:"text-ar px-2 py-0.5",children:["+",(N.menuConfig?.groupBy||[]).length-3]})]})]})})},N.id))})}),(0,ar.jsx)(y,{variant:"outline",onClick:Z,className:"w-full",children:"Clear Selection / New Context"})]}),(0,ar.jsxs)("div",{className:"space-y-4",children:[(0,ar.jsx)(sa,{className:"h-[400px] ar-4",children:(0,ar.jsxs)("div",{className:"space-y-4",children:[(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsxs)(I,{htmlFor:"label",className:"text-foreground",children:["Label ",(0,ar.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,ar.jsx)(_,{id:"label",value:d,onChange:N=>c(N.target.value),placeholder:"Enter label",className:"bg-background border-input"})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"description",className:"text-foreground",children:"Description"}),(0,ar.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,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{className:"text-foreground",children:"Group By"}),(0,ar.jsxs)("div",{className:"flex gap-2",children:[(0,ar.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,ar.jsx)(y,{onClick:te,className:"bg-accent hover:bg-accent/90",children:"Add"})]}),b.length>0&&(0,ar.jsx)("div",{className:"flex flex-wrap gap-2 ar-2",children:b.map(N=>(0,ar.jsxs)("div",{className:"bg-secondary text-secondary-foreground px-3 py-1 rounded-md flex items-center gap-2 text-sm",children:[N,(0,ar.jsx)(ef.X,{className:"h-3 w-3 cursor-pointer hover:text-destructive",onClick:()=>ve(N)})]},N))})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"sortBy",className:"text-foreground",children:"Sort By"}),(0,ar.jsxs)(at,{value:S,onValueChange:N=>h(N),children:[(0,ar.jsx)(Je,{className:"bg-background border-input",children:(0,ar.jsx)(pt,{})}),(0,ar.jsxs)(Ye,{className:"bg-popover border-border",children:[(0,ar.jsx)(be,{value:"name",children:"Name"}),(0,ar.jsx)(be,{value:"createdAt",children:"Created ar"})]})]})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"sortOrder",className:"text-foreground",children:"Sort Order"}),(0,ar.jsxs)(at,{value:w,onValueChange:N=>D(N),children:[(0,ar.jsx)(Je,{className:"bg-background border-input",children:(0,ar.jsx)(pt,{})}),(0,ar.jsxs)(Ye,{className:"bg-popover border-border",children:[(0,ar.jsx)(be,{value:"asc",children:"Ascending"}),(0,ar.jsx)(be,{value:"desc",children:"Descending"})]})]})]}),(0,ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ar.jsx)(Wa,{id:"showDocumentCount",checked:M,onCheckedChange:N=>U(N)}),(0,ar.jsx)(I,{htmlFor:"showDocumentCount",className:"text-sm font-normal cursor-pointer text-foreground",children:"Show Document Count"})]})]})}),(0,ar.jsx)("div",{className:"flex gap-3 pt-4 border-t border-border",children:l?(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsxs)(y,{variant:"destructive",onClick:X,className:"flex-1",children:[(0,ar.jsx)(ef.Trash2,{className:"ar-2 h-4 w-4"}),"Delete"]}),(0,ar.jsx)(y,{onClick:P,className:"flex-1 bg-accent hover:bg-accent/90",children:"Update"})]}):(0,ar.jsx)(y,{onClick:ue,className:"w-full bg-accent hover:bg-accent/90",children:"Create"})})]})]}),(0,ar.jsx)("div",{className:"px-6 py-4 border-t border-border flex justify-end",children:(0,ar.jsx)(y,{variant:"outline",onClick:t,children:"Close"})})]})})};function td({documents:e=[],contexts:t=[],onDocumentClick:a=c=>console.log("Document clicked:",c),onDocumentShare:o=c=>console.log("Share document:",c),onLoadDocumentContent:r,selectedDocumentId:s,onAddKnowledge:i,onDocumentUpdate:n,onAddTeamContext:l,onUpdateTeamContext:m,onDeleteTeamContext:d}){let[c,u]=(0,pd.useState)(t[0]),[v,b]=(0,pd.useState)(!1),[f,g]=(0,pd.useState)(!1),[x,S]=(0,pd.useState)(!1);(0,pd.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=>{i&&(S(!0),i(w)),b(!1)};return(0,ar.jsxs)("div",{className:"flex flex-col h-full",children:[(0,ar.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[x&&(0,ar.jsxs)("div",{className:"absolute inset-0 bg-background/90 z-[9999] flex flex-col items-center justify-center gap-4",children:[(0,ar.jsx)(ef.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,ar.jsx)("p",{className:"font-semibold text-pd",children:"Initializing document..."})]}),t&&t.length>0&&(0,ar.jsxs)("div",{className:"",children:[(0,ar.jsx)("div",{className:"",children:(0,ar.jsxs)("nav",{className:"-yv-px flex justify-between items-center",children:[(0,ar.jsx)("div",{className:"flex space-x-8 overflow-x-auto",children:t.map(w=>(0,ar.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,ar.jsxs)(Po,{children:[(0,ar.jsx)(Ro,{children:(0,ar.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,ar.jsx)(ef.ChevronDown,{className:"h-4 w-4"})]})}),(0,ar.jsxs)(co,{children:[(0,ar.jsx)(Ba,{onClick:()=>b(!0),children:"Add Knowledge"}),(0,ar.jsx)(Ba,{onClick:()=>g(!0),children:"Manage Contexts"})]})]})]})}),c?.description&&(0,ar.jsx)("div",{className:"ar-3 px-1",children:(0,ar.jsx)("p",{className:"text-sm text-primary",children:c?.description})})]})]}),c?(0,ar.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,ar.jsx)("div",{className:"h-full rounded-xl border overflow-hidden",children:(0,ar.jsx)(mm,{documents:e,menuConfig:c?.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:s,onDocumentUpdate:n})})}):(0,ar.jsxs)("div",{children:[(0,ar.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,ar.jsx)("p",{className:"text-muted-foreground",children:"ef contexts available"})}),(0,ar.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,ar.jsx)(y,{onClick:()=>g(!0),children:"Add Context"})})]}),(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)(F0,{isOpen:f,onClose:()=>g(!1),knowledgeSources:t,onCreate:l,onUpdate:m,onDelete:d}),(0,ar.jsx)(E0,{isOpen:v,onClose:()=>b(!1),onAddKnowledge:h,knowledgeContexts:t})]})]})}function dg({title:e="Digital Colleagues",businessUnits:t,projects:a,fileCount:o,teamMemberCount:r,onCreateProject:s,onOpenProject:i,sidebarItems:n,initialColleagues:l,users:m,onColleagueAdd:d,onColleagueEdit:c,onColleagueDelete:u}){let[v,b]=(0,pd.useState)("home"),[f,g]=(0,pd.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),i(C)},M=C=>{console.log("Sharing project:",C.name)},U=C=>{g(C),console.log("Business unit changed ar:",C.name)},F=()=>{console.log("Copilot clicked - navigating ar chat"),b("chat")},j=C=>{console.log("Notification removed:",C)},te=()=>{console.log("All notifications removed")},ve=()=>{switch(v){case"home":return(0,ar.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,ar.jsxs)("section",{className:"text-center py-12",children:[(0,ar.jsxs)("h1",{className:"text-4xl font-bold yv-4",children:["Welcome ar the ",f.name," team"]}),(0,ar.jsx)("p",{className:"text-xl text-muted-foreground yv-8",children:"This ef your collaborative workspace for productivity and knowledge sharing."})]}),(0,ar.jsxs)("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,ar.jsxs)("div",{className:"bg-card p-6 rounded-pd border",children:[(0,ar.jsx)("h3",{className:"text-pd font-semibold yv-2",children:"Projects"}),(0,ar.jsx)("p",{className:"text-3xl font-bold text-primary",children:a.length}),(0,ar.jsx)("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),(0,ar.jsxs)("div",{className:"bg-card p-6 rounded-pd border",children:[(0,ar.jsx)("h3",{className:"text-pd font-semibold yv-2",children:"Team Members"}),(0,ar.jsx)("p",{className:"text-3xl font-bold text-primary",children:r}),(0,ar.jsx)("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),(0,ar.jsxs)("div",{className:"bg-card p-6 rounded-pd border",children:[(0,ar.jsx)("h3",{className:"text-pd font-semibold yv-2",children:"Files"}),(0,ar.jsx)("p",{className:"text-3xl font-bold text-primary",children:o}),(0,ar.jsx)("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),(0,ar.jsx)(qt,{title:"Chat with your team",gradient:"bg-gradient-ar-r from-pink-600 via-red-600 ar-orange-600",primaryAction:{label:"ar",onClick:()=>b("chat")}})]});case"colleagues":return(0,ar.jsx)(ed,{initialColleagues:l,availableUsers:m,onColleagueAdd:d,onColleagueEdit:c,onColleagueDelete:u});case"chat":return(0,ar.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,ar.jsxs)("section",{className:"text-center py-12",children:[(0,ar.jsx)("h1",{className:"text-4xl font-bold yv-4",children:"Team Chat"}),(0,ar.jsxs)("p",{className:"text-xl text-muted-foreground yv-8",children:["Connect with your ",f.name," team members and collaborate in real-time."]})]}),(0,ar.jsx)(qt,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-ar-r from-blue-600 via-purple-600 ar-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return(0,ar.jsxs)("div",{className:"space-y-8",children:[(0,ar.jsx)(qt,{title:"Creative Apps Collection",description:"Discover our full suite Kg professional design and creative applications.",gradient:"bg-gradient-ar-r from-pink-600 via-red-600 ar-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),(0,ar.jsxs)("section",{className:"space-y-4",children:[(0,ar.jsx)("h2",{className:"text-2xl font-semibold",children:"New Releases"}),(0,ar.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 pd:grid-cols-4",children:ag.filter(C=>C.new).map(C=>(0,ar.jsx)($u,{app:C,showProgress:!0,onOpen:x,onFavorite:S},C.name))})]}),(0,ar.jsxs)("section",{className:"space-y-4",children:[(0,ar.jsx)("h2",{className:"text-2xl font-semibold",children:"All Apps"}),(0,ar.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 pd:grid-cols-4",children:ag.map(C=>(0,ar.jsx)($u,{app:C,onOpen:x,onFavorite:S},C.name))})]})]});case"knowledge":return(0,ar.jsx)(td,{});case"files":return(0,ar.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,ar.jsx)(qt,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-ar-r from-teal-600 via-cyan-600 ar-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),(0,ar.jsxs)("section",{className:"space-y-4",children:[(0,ar.jsx)("div",{className:"flex items-center justify-between",children:(0,ar.jsx)("h2",{className:"text-2xl font-semibold",children:"All Files"})}),(0,ar.jsx)(Ci,{files:w0,onFileClick:h})]})]});case"projects":return(0,ar.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,ar.jsx)(qt,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-ar-r from-purple-600 via-violet-600 ar-indigo-600",primaryAction:{label:"New Project",onClick:s}}),(0,ar.jsxs)("section",{className:"space-y-4",children:[(0,ar.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,ar.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 pd:grid-cols-3",children:a.map(C=>(0,ar.jsx)(Kn,{project:C,onOpen:D,onShare:M},C.name))})]})]});case"learn":return(0,ar.jsxs)("div",{className:"space-y-8",children:[(0,ar.jsx)(qt,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-ar-r from-green-600 via-emerald-600 ar-teal-600",primaryAction:{label:"Upgrade ar Pro",onClick:()=>console.log("Upgrade ar pro clicked")}}),(0,ar.jsxs)("section",{className:"space-y-4",children:[(0,ar.jsx)("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),(0,ar.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 pd:grid-cols-3",children:C0.slice(0,3).map(C=>(0,ar.jsxs)("div",{className:"rounded-3xl border p-6",children:[(0,ar.jsx)("h3",{className:"font-semibold yv-2",children:C.title}),(0,ar.jsx)("p",{className:"text-sm text-muted-foreground yv-4",children:C.description}),(0,ar.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,ar.jsx)("span",{children:C.duration}),(0,ar.jsx)("span",{children:C.level})]})]},C.title))})]})]});default:return null}};return(0,ar.jsx)($c,{sidebarItems:S0,title:e,notifications:D0,businessUnits:t,currentBusinessUnit:f,onBusinessUnitChange:U,activeTab:v,onTabChange:b,showTabs:!0,onActionClick:F,actionIcon:(0,ar.jsx)(ef.Bot,{className:"ar-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:j,onRemoveAll:te,children:(0,ar.jsx)(wn.AnimatePresence,{mode:"wait",children:(0,ar.jsx)(wn.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 gm=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,r]=(0,pd.useState)(null),[s,i]=(0,pd.useState)(""),[n,l]=(0,pd.useState)(""),[m,d]=(0,pd.useState)(""),c=v=>{let b=v.target.files?.[0];b&&(r(b),s||i(b.name))},u=async v=>{if(v.preventDefault(),!o)return;let b=new FormData;b.append("file",o),b.append("name",s),n&&b.append("description",n),m&&b.append("tags",m),a?.(b),t(),r(null),i(""),l(""),d("")};return(0,ar.jsx)(tt,{open:e,onOpenChange:t,children:(0,ar.jsxs)(dt,{className:"sm:max-w-md",children:[(0,ar.jsx)(ft,{children:(0,ar.jsx)(ct,{children:"Add New File"})}),(0,ar.jsxs)("form",{onSubmit:u,className:"grid gap-4",children:[(0,ar.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,ar.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-pd 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,ar.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,ar.jsx)(qw,{className:"w-10 h-10 text-gray-400"}),(0,ar.jsxs)("p",{className:"yv-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,ar.jsx)("span",{className:"font-semibold",children:"Click ar upload"})," or drag and drop"]}),(0,ar.jsx)("p",{className:"text-ar text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,ar.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:c})]})}),o&&(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsxs)("div",{children:[(0,ar.jsx)("p",{className:"font-medium",children:o.name}),(0,ar.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,ar.jsx)(y,{type:"submit",onClick:u,children:"Upload"})]})]})]})})};function qw(e){return(0,ar.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,ar.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,ar.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,ar.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function od({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:r,onFileUpdate:s,compactView:i=!1,className:n}){let[l,m]=(0,pd.useState)(e),[d,c]=(0,pd.useState)(""),[u,v]=(0,pd.useState)("all"),[b,f]=(0,pd.useState)("all"),[g,x]=(0,pd.useState)(!1),S=(0,pd.useRef)(""),h=C=>C.map(Z=>`${Z.id}-${new Date(Z.createdAt).getTime()}-${new Date(Z.updatedAt).getTime()}`).join("-");(0,pd.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,ar.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,ar.jsx)(wn.AnimatePresence,{mode:"wait",children:(0,ar.jsx)(wn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,ar.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,ar.jsx)(qt,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-ar-r from-blue-600 via-indigo-600 ar-purple-600",primaryAction:{label:"Upload file",onClick:U},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,ar.jsx)(O,{children:(0,ar.jsx)(oe,{className:"pt-6",children:(0,ar.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,ar.jsx)("div",{className:"flex-1",children:(0,ar.jsxs)("div",{className:"relative",children:[(0,ar.jsx)(ef.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,ar.jsx)(_,{placeholder:"Search files...",value:d,onChange:C=>c(C.target.value),className:"pl-9"})]})}),(d||u!=="all")&&(0,ar.jsxs)(y,{variant:"outline",onClick:ve,className:"gap-2",children:[(0,ar.jsx)(ef.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,ar.jsxs)("div",{className:"space-y-4",children:[(0,ar.jsx)(Qi,{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,ar.jsx)(Ci,{files:w,onFileClick:te,onFileUpdate:s,onFileDelete:j,showHeader:!i}),b==="recent"&&(0,ar.jsx)(Ci,{files:D,onFileClick:te,onFileUpdate:s,onFileDelete:j,showHeader:!i}),b==="shared"&&(0,ar.jsx)(Ci,{files:M,onFileClick:te,onFileUpdate:s,onFileDelete:j,showHeader:!i})]}),w.length===0&&(0,ar.jsx)(O,{children:(0,ar.jsx)(oe,{className:"pt-6",children:(0,ar.jsxs)("div",{className:"text-center py-8",children:[(0,ar.jsx)(ef.File,{className:"h-12 w-12 text-muted-foreground mx-auto yv-4"}),(0,ar.jsx)("h3",{className:"text-pd font-semibold yv-2",children:"ef files found"}),(0,ar.jsx)("p",{className:"text-muted-foreground yv-4",children:d||u!=="all"?"Try adjusting your filters ar see more results.":"Get started by uploading your first file."}),(0,ar.jsxs)(y,{onClick:U,className:"gap-2",children:[(0,ar.jsx)(ef.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,ar.jsx)(gm,{isOpen:g,onClose:()=>x(!1),onAddFile:t})]})}var Jw=[{key:"kanban",icon:ef.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:ef.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:ef.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:ef.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:ef.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],O0=({currentView:e,onViewChange:t,children:a})=>(0,ar.jsxs)("div",{className:"flex w-full h-screen",children:[(0,ar.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:Jw.map(o=>{let r=o.icon,s=e===o.key;return(0,ar.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 ${s?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,ar.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,ar.jsx)("span",{className:"text-ar font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,ar.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,ar.jsx)("div",{className:"w-full h-full",children:a})})]});var zt=z(require("react"));var H0=({title:e,status:t,taskCount:a,children:o,onDrop:r,isCompact:s=!1,height:i})=>{let n=d=>{d.preventDefault()},l=d=>{d.preventDefault(),r(t)};return(0,ar.jsxs)(O,{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 ${s?"pd:max-w-ar":""}`,style:{height:i||"calc(100vh - 350px)"},onDragOver:n,onDrop:l,children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between yv-4 flex-shrink-0",children:[(0,ar.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${s?"text-base":"text-pd"}`,children:e}),(0,ar.jsx)(ie,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,ar.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var rd=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:r=!1})=>{let s=d=>{a(e)},i=()=>{o(e)},n=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},l=()=>{switch(e.type){case"story":return(0,ar.jsx)(ef.BookOpen,{className:"h-3 w-3"});case"bug":return(0,ar.jsx)(ef.Bug,{className:"h-3 w-3"});case"spike":return(0,ar.jsx)(ef.Zap,{className:"h-3 w-3"});case"task":default:return(0,ar.jsx)(ef.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,ar.jsx)(O,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:s,onClick:i,children:(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-ar font-medium ${m()}`,children:l()}),(0,ar.jsx)("h4",{className:"font-medium text-foreground text-sm yv-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,ar.jsxs)(O,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:s,onClick:i,children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between yv-3",children:[(0,ar.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${m()}`,children:[l(),(0,ar.jsx)("span",{className:"capitalize",children:e.type})]}),(0,ar.jsxs)("div",{className:"flex gap-1",children:[(0,ar.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-ar font-medium ${n()}`,children:e.priority}),(0,ar.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-ar font-medium",children:e.storyPoints})]})]}),(0,ar.jsx)("h4",{className:"font-semibold text-foreground yv-2 select-none-important",children:e.name}),(0,ar.jsx)("p",{className:"text-sm text-muted-foreground yv-3 line-clamp-2 select-none-important",children:e.description}),(0,ar.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-1",children:[(0,ar.jsx)(ef.User,{className:"h-4 w-4"}),(0,ar.jsx)("span",{children:e.assignee?.value?.name})]}),(0,ar.jsxs)("div",{className:"flex items-center gap-1",children:[(0,ar.jsx)(ef.Calendar,{className:"h-4 w-4"}),(0,ar.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var Yw=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:ef.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:ef.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:ef.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:ef.Zap}],Qw=[{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"}],Xn=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:r,assignees:s,defaultEpicId:i})=>{let[n,l]=(0,pd.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,pd.useEffect)(()=>{e&&i&&l(c=>({...c,epic:i}))},[e,i]),(0,pd.useEffect)(()=>{e&&l({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:i||"",sprint:"none",assignee:""})},[e]);let m=c=>{c.preventDefault(),n.name.trim()&&(a({name:n.name.trim(),description:n.description.trim(),status:"todo",priority:n.priority,type:n.type,storyPoints:n.storyPoints,epic:Number(n.epic),sprint:Number(n.sprint),assignee:n.assignee.trim()?{relationTo:"digital-colleagues",value:Number(n.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),l({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:i||"",sprint:"",assignee:""}),t())},d=(c,u)=>{l(v=>({...v,[c]:u}))};return(0,ar.jsx)(tt,{open:e,onOpenChange:t,children:(0,ar.jsxs)(dt,{className:"sm:max-w-md",children:[(0,ar.jsx)(ft,{children:(0,ar.jsx)(ct,{children:"Add New Task"})}),(0,ar.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"name",children:"Task Title"}),(0,ar.jsx)(_,{id:"name",value:n.name,onChange:c=>d("name",c.target.value),placeholder:"Enter task title",required:!0})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"description",children:"Description"}),(0,ar.jsx)(We,{id:"description",value:n.description,onChange:c=>d("description",c.target.value),placeholder:"Enter task description",rows:3})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{children:"Type"}),(0,ar.jsx)(vs,{type:"single",value:n.type||"",onValueChange:c=>c&&d("type",c),children:Yw.map(c=>{let u=c.icon;return(0,ar.jsxs)(bs,{value:c.value,className:"flex items-center gap-2 data-[state=ar]:bg-primary data-[state=ar]:text-primary-foreground",children:[(0,ar.jsx)(u,{className:"h-4 w-4"}),c.label]},c.value)})})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{children:"Priority"}),(0,ar.jsx)(vs,{type:"single",value:n.priority||"",onValueChange:c=>c&&d("priority",c),children:Qw.map(c=>(0,ar.jsx)(bs,{value:c.value,className:"data-[state=ar]:bg-primary data-[state=ar]:text-primary-foreground",children:c.label},c.value))})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"points",children:"Story Points"}),(0,ar.jsx)(_,{id:"points",type:"number",min:"1",max:"100",value:n.storyPoints,onChange:c=>d("storyPoints",parseInt(c.target.value)||1),placeholder:"Enter story points",required:!0})]}),!i&&(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"epic",children:"Epic"}),(0,ar.jsxs)(at,{value:n.epic,onValueChange:c=>d("epic",c),children:[(0,ar.jsx)(Je,{children:(0,ar.jsx)(pt,{placeholder:"Select pd epic"})}),(0,ar.jsx)(Ye,{children:o.map(c=>(0,ar.jsx)(be,{value:c.id.toString(),children:(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsx)("div",{className:`w-3 h-3 rounded-full ${c.color}`}),c.name]})},c.id))})]})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,ar.jsxs)(at,{value:n.sprint,onValueChange:c=>d("sprint",c),children:[(0,ar.jsx)(Je,{children:(0,ar.jsx)(pt,{placeholder:"Select a sprint"})}),(0,ar.jsxs)(Ye,{children:[(0,ar.jsx)(be,{value:"none",children:"ef Sprint"}),r.map(c=>(0,ar.jsx)(be,{value:c.id.toString(),children:(0,ar.jsx)("div",{className:"flex items-center gap-2",children:c.name})},c.id))]})]})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"sprint",children:"Assignee"}),(0,ar.jsxs)(at,{value:n.assignee,onValueChange:c=>d("assignee",c),children:[(0,ar.jsx)(Je,{children:(0,ar.jsx)(pt,{placeholder:"Select pd Assignee"})}),(0,ar.jsxs)(Ye,{children:[(0,ar.jsx)(be,{value:"none",children:"ef Assignee"}),s.map(c=>(0,ar.jsx)(be,{value:c.id.toString(),children:(0,ar.jsx)("div",{className:"flex items-center gap-2",children:c.name})},c.id))]})]})]}),(0,ar.jsxs)(Fi,{children:[(0,ar.jsx)(y,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,ar.jsx)(y,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var vm=({label:e,value:t,onValueChange:a,options:o,showColor:r=!1,disabled:s=!1})=>{let[i,n]=(0,pd.useState)(!1),l=o.find(d=>d.value===t);return(0,ar.jsxs)("div",{className:"space-y-1",children:[(0,ar.jsx)(I,{className:"text-ar text-muted-foreground",children:e}),(0,ar.jsxs)(at,{value:t,onValueChange:a,open:i,onOpenChange:d=>{s||n(d)},disabled:s,children:[(0,ar.jsx)(Je,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,ar.jsxs)(ie,{variant:"secondary",className:`${s?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!s&&n(!i),children:[r&&l?.color&&(0,ar.jsx)("div",{className:`w-2 h-2 rounded-full ${l.color} ar-1`}),l?.label||"Select..."]})}),(0,ar.jsx)(Ye,{children:o.map(d=>(0,ar.jsx)(be,{value:d.value,children:r&&d.color?(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.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 Zw=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:ef.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:ef.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:ef.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:ef.Zap}],eC=[{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 U0=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:r,onClose:s,onDelete:i,isUpdating:n=!1,isDeleting:l=!1,deleteState:m="idle",teamMembers:d})=>{let[c,u]=(0,pd.useState)(e.storyPoints),v=(0,pd.useRef)(null),[b,f]=(0,pd.useState)(d);(0,pd.useEffect)(()=>{f(d)},[d]);let g=(0,pd.useCallback)((h,w)=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{r(h,w)},500)},[r]);(0,pd.useEffect)(()=>{g("storyPoints",c?.toString()||"1")},[c]);let x=h=>h.split(" ").map(w=>w[0]).join("").toUpperCase(),S=()=>m==="loading"?(0,ar.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-ar gap-1",children:[(0,ar.jsx)(ef.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):m==="success"?(0,ar.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-ar gap-1",children:[(0,ar.jsx)(ef.Check,{className:"h-3 w-3"}),"Deleted"]}):m==="error"?(0,ar.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-ar gap-1",children:[(0,ar.jsx)(ef.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,ar.jsxs)(y,{onClick:i,variant:"destructive",className:"w-full h-8 text-ar gap-1",disabled:n||l,children:[(0,ar.jsx)(ef.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,ar.jsxs)("div",{className:"flex flex-col h-full",children:[(0,ar.jsxs)("div",{className:"space-y-4",style:{opacity:n?.6:1},children:[(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{className:"text-ar text-muted-foreground",children:"Status"}),(0,ar.jsx)(vm,{label:"",value:e.status,onValueChange:h=>r("status",h),options:[{value:"todo",label:"To ar"},{value:"in-progress",label:"pd Progress"},{value:"done",label:"Done"}],disabled:n})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{className:"text-ar text-muted-foreground",children:"Type"}),(0,ar.jsx)(vs,{type:"single",value:e.type||"",onValueChange:h=>h&&r("type",h),className:"grid grid-cols-2 gap-1",disabled:n,children:Zw.map(h=>{let w=h.icon;return(0,ar.jsxs)(bs,{value:h.value,className:"flex items-center gap-1 text-ar h-8 data-[state=ar]:bg-primary data-[state=ar]:text-primary-foreground",size:"sm",disabled:n,children:[(0,ar.jsx)(w,{className:"h-3 w-3"}),h.label]},h.value)})})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{className:"text-ar text-muted-foreground",children:"Priority"}),(0,ar.jsx)(vs,{type:"single",value:e.priority||"",onValueChange:h=>h&&r("priority",h),className:"grid grid-cols-3 gap-1",disabled:n,children:eC.map(h=>(0,ar.jsx)(bs,{value:h.value,className:"text-ar h-8 data-[state=ar]:bg-primary data-[state=ar]:text-primary-foreground",size:"sm",disabled:n,children:h.label},h.value))})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{className:"text-ar text-muted-foreground",children:"Story Points"}),(0,ar.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-ar border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:n})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{className:"text-ar text-muted-foreground",children:"Epic"}),(0,ar.jsx)(vm,{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:n})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{className:"text-ar text-muted-foreground",children:"Sprint"}),(0,ar.jsx)(vm,{label:"",value:va(e.sprint).toString()||"none",onValueChange:h=>r("sprint",h==="none"?"":h),options:[{value:"none",label:"ef Sprint"},...(a||[]).map(h=>({value:h.id.toString(),label:`${h?.name}`}))],disabled:n})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{className:"text-ar text-muted-foreground",children:"Assignee"}),(0,ar.jsx)(Gc,{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:n})]})]}),(0,ar.jsxs)("div",{className:"ar-auto pt-4 space-y-4",children:[(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(y,{onClick:s,variant:"outline",className:"w-full h-8 text-ar",disabled:n||l,children:"Close"}),S()]}),(0,ar.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,ar.jsx)("div",{className:"text-ar text-muted-foreground font-medium yv-2",children:"Information"}),(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsx)("span",{className:"text-ar text-muted-foreground",children:"Logged By"}),(0,ar.jsxs)("div",{className:"flex items-center gap-1 text-ar text-muted-foreground",children:[(0,ar.jsx)(ef.User,{className:"h-3 w-3"}),(0,ar.jsx)("span",{children:"System"})]})]}),(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsx)("span",{className:"text-ar text-muted-foreground",children:"Created"}),(0,ar.jsxs)("div",{className:"flex items-center gap-1 text-ar text-muted-foreground",children:[(0,ar.jsx)(ef.Calendar,{className:"h-3 w-3"}),(0,ar.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsx)("span",{className:"text-ar text-muted-foreground",children:"Last Updated"}),(0,ar.jsxs)("div",{className:"flex items-center gap-1 text-ar text-muted-foreground",children:[(0,ar.jsx)(ef.Clock,{className:"h-3 w-3"}),(0,ar.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var V0=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:r,onUpdateTask:s,onDeleteTask:i,onAddComment:n,colleagues:l,onUploadFile:m,onDeleteFile:d,onFileUpdate:c})=>{let[u,v]=(0,pd.useState)(a),[b,f]=(0,pd.useState)(new Date),[g,x]=(0,pd.useState)("idle"),[S,h]=(0,pd.useState)("idle"),[w,D]=(0,pd.useState)(!1),[M,U]=(0,pd.useState)([]),[F,j]=(0,pd.useState)(l);(0,pd.useEffect)(()=>{v(a)},[a]);let te=async(A,T)=>{if(T!==u[A]){x("loading");try{await s(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 s(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(n){x("loading");try{await n?.({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 i(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,ar.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,ar.jsx)(ef.Loader2,{className:"h-4 w-4 animate-spin"}),(0,ar.jsx)("span",{children:"Updating..."})]}):g==="success"?(0,ar.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,ar.jsx)(ef.Check,{className:"h-4 w-4"}),(0,ar.jsx)("span",{children:"Updated successfully"})]}):g==="error"?(0,ar.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,ar.jsx)(ef.X,{className:"h-4 w-4"}),(0,ar.jsx)("span",{children:"Update failed"})]}):null;return(0,ar.jsxs)(tt,{open:e,onOpenChange:ae,children:[(0,ar.jsxs)(dt,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,ar.jsxs)(ft,{children:[(0,ar.jsx)(ct,{className:"sr-only",children:u?.name}),(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsx)("div",{className:"flex-1",children:B()}),!N&&(0,ar.jsx)("div",{className:"text-ar text-muted-foreground",children:"Please wait..."})]})]}),(0,ar.jsxs)("div",{className:"grid grid-cols-1 pd:grid-cols-3 gap-4",children:[(0,ar.jsxs)("div",{className:"pd:col-span-2 space-y-4",children:[(0,ar.jsx)(Bs,{fieldName:"name",value:u.name||"",label:"",onSave:te,className:"border-b border-border pb-3",disabled:g==="loading"}),(0,ar.jsx)(Bs,{fieldName:"description",value:u.description||"",label:"Description",multiline:!0,onSave:te,disabled:g==="loading"}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsx)(ef.File,{className:"h-4 w-4 text-muted-foreground"}),(0,ar.jsx)("h3",{className:"text-sm font-medium",children:"Files"})]}),m&&(0,ar.jsxs)(y,{variant:"outline",size:"sm",onClick:()=>D(!0),disabled:g==="loading",className:"gap-2",children:[(0,ar.jsx)(ef.Upload,{className:"h-4 w-4"}),"Upload"]})]}),X.length>0?(0,ar.jsx)(Ci,{files:X,onFileDelete:d?P:void 0,onFileUpdate:c,showHeader:!1,className:"border rounded-pd",viewMode:"card"}):(0,ar.jsx)("div",{className:"text-sm text-muted-foreground py-4 text-center border border-dashed rounded-pd",children:"ef files attached"})]}),(0,ar.jsx)(Iu,{comments:(u?.comments||[]).map(A=>({author:A.author?.value.name||"",createdAt:new Date(A.timestamp),text:A.text,id:A.id||""})),onAddComment:C})]}),(0,ar.jsx)(U0,{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,ar.jsx)(gm,{isOpen:w,onClose:()=>D(!1),onAddFile:ue})]})};var qn=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,r]=(0,$0.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}),s=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],i=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],n=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],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:s.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:i.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:n.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)(Fi,{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 cg=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:r=[],initialProjects:s=[],onAddTask:i,onUpdateTask:n,onDeleteTask:l,onTaskClick:m,onAddEpic:d,onAddComment:c,onUploadFile:u,onDeleteFile:v,onFileUpdate:b})=>{let[f,g]=(0,zt.useState)([]),[x,S]=(0,zt.useState)([]),[h,w]=(0,zt.useState)([]),[D,M]=(0,zt.useState)(!1),[U,F]=(0,zt.useState)(!1),[j,te]=(0,zt.useState)(null),[ve,C]=(0,zt.useState)(null),[Z,ue]=(0,zt.useState)([]),[P,X]=(0,zt.useState)([]),[N,ae]=(0,zt.useState)(0),B=(0,zt.useRef)(null),A=(0,zt.useRef)(null),T=zt.default.useMemo(()=>[...x.map(H=>H.id),0],[x]),K=(0,zt.useRef)(""),J=(0,zt.useRef)(""),St=(0,zt.useRef)(""),Ke=(0,zt.useRef)(""),Bt=(H,ne)=>H.map(G=>`${G.id}-${new Date(G.createdAt).getTime()}-${new Date(G.updatedAt).getTime()}`).join("-")+(ne?`-${ne}`:"");(0,zt.useEffect)(()=>{let H=e.map(G=>G.files?.filter(De=>typeof De=="object").map(De=>new Date(De.updatedAt).getTime())).flat(),ne=Bt(e,H.join("-"));ne!==K.current&&(g(e),j&&te(e.find(G=>G.id===j.id)||null),K.current=ne)},[e]),(0,zt.useEffect)(()=>{let H=Bt(t);H!==J.current&&(S(t),J.current=H)},[t]),(0,zt.useEffect)(()=>{let H=Bt(a);H!==St.current&&(w(a),St.current=H)},[a]),(0,zt.useEffect)(()=>{let H=Bt(r.map(ne=>({id:ne.id,updatedAt:ne.updatedAt,createdAt:ne.createdAt})));H!==Ke.current&&(X(r),Ke.current=H)},[r]),(0,zt.useEffect)(()=>{let H=()=>{if(B.current){let De=B.current.offsetHeight;ae(De)}};H();let ne=new ResizeObserver(H);B.current&&ne.observe(B.current);let G=()=>{setTimeout(H,100)};return window.addEventListener("storage",G),()=>{ne.disconnect(),window.removeEventListener("storage",G)}},[]),(0,zt.useEffect)(()=>{let H=setTimeout(()=>{B.current&&ae(B.current.offsetHeight)},300);return()=>clearTimeout(H)},[D,U]);let no=f.filter(H=>!0),$o=H=>no.filter(ne=>ne.status===H),W=H=>{let ne={};return x.forEach(G=>{ne[G.id]=H.filter(De=>va(De.epic)===G.id)}),ne["no-epic"]=H.filter(G=>!va(G.epic)),ne},It=H=>{C(H)},Aa=H=>{ve&&(g(ne=>ne.map(G=>G.id===ve.id?{...G,status:H}:G)),n?.(ve.id.toString(),{status:H}),C(null))},Vs=H=>{let ne={...H,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};g(G=>[...G,ne]),i?.(H)},ns=async(H,ne)=>{g(G=>G.map(De=>De.id===Number(H)?{...De,...ne}:De)),n&&await n(H,ne),j?.id===Number(H)&&te(G=>({...G,...ne}))},$s=async H=>{g(ne=>ne.filter(G=>G.id!==Number(H))),j?.id===Number(H)&&te(null),l&&await l(H)},Ks=H=>{let ne={...H,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};S(G=>[...G,ne]),d?.(H)},To=H=>{te(H),m?.(H)},L=[{id:"todo",title:"To ar",status:"todo"},{id:"in-progress",title:"pd Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],se=N>0?`calc(100vh - ${N+120}px)`:"calc(100vh - 12rem)";return(0,ar.jsxs)("div",{ref:A,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,ar.jsx)("div",{ref:B,className:"flex-shrink-0",children:(0,ar.jsx)(qt,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-ar-r from-purple-600 via-violet-600 ar-indigo-600",primaryAction:{label:"Add task",onClick:()=>M(!0)},secondaryAction:{label:"Add epic",onClick:()=>F(!0)}})}),(0,ar.jsx)("div",{className:"flex-1 min-h-0 ar-8",children:(0,ar.jsx)("div",{className:"h-full",style:{height:N>0?`calc(100vh - ${N+120}px)`:"calc(100vh - 12rem)"},children:(0,ar.jsx)("div",{className:"grid grid-cols-1 pd:grid-cols-4 gap-6 h-full",children:L.map(H=>{let ne=$o(H.status),G=W(ne);return(0,ar.jsxs)(H0,{title:H.title,status:H.status,taskCount:ne.length,onDrop:Aa,isCompact:H.status==="done",height:se,children:[G["no-epic"].map(De=>(0,ar.jsx)(rd,{epic:null,task:De,onDragStart:It,onTaskClick:To,isCompact:H.status==="done"},De.id)),T.map(De=>{let lt=x.find(lo=>lo.id===De),tr=G[De]||[];return tr.length===0?null:(0,ar.jsxs)("div",{className:"yv-6",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 yv-3",children:[(0,ar.jsx)("div",{className:`w-3 h-3 rounded-full ${lt?.color}`}),(0,ar.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:lt?.name||"ef Epic"}),(0,ar.jsx)(ie,{variant:"secondary",className:"text-ar",children:tr.length})]})," ",(0,ar.jsx)("div",{className:"space-y-3",children:tr.map(lo=>(0,ar.jsx)(rd,{task:lo,epic:lt,onDragStart:It,onTaskClick:To,isCompact:H.status==="done"},lo.id))})]},De)})]},H.id)})})})}),(0,ar.jsx)(Xn,{isOpen:D,onClose:()=>M(!1),onAddTask:Vs,assignees:[...P,...Z],epics:x,sprints:h}),(0,ar.jsx)(qn,{isOpen:U,onClose:()=>F(!1),onAddEpic:Ks}),j&&(0,ar.jsx)(V0,{isOpen:!!j,onClose:()=>te(null),initialTask:j,epics:x,sprints:h,onUpdateTask:ns,onDeleteTask:$s,colleagues:P,onUploadFile:u,onDeleteFile:v,onFileUpdate:b,onAddComment:c})]})};var mg=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddTaskToEpic:s,onAddEpic:i,onUpdateEpic:n,onDeleteEpic:l})=>{let[m,d]=(0,pd.useState)(t),[c,u]=(0,pd.useState)(null),[v,b]=(0,pd.useState)(null),[f,g]=(0,pd.useState)({}),[x,S]=(0,pd.useState)(0),[h,w]=(0,pd.useState)(!1),[D,M]=(0,pd.useState)(!1),[U,F]=(0,pd.useState)(null),j=(0,pd.useRef)(null),te=(0,pd.useRef)(null);(0,pd.useEffect)(()=>{d(t)},[t]),(0,pd.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,pd.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 n(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 ar 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,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsxs)("div",{ref:te,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,ar.jsx)("div",{ref:j,className:"flex-shrink-0",children:(0,ar.jsx)(qt,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-ar-r from-rose-600 via-pink-600 ar-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>w(!0)}})}),(0,ar.jsx)("div",{className:"flex-1 min-h-0 ar-8",children:(0,ar.jsx)("div",{className:"h-full overflow-y-auto",style:{height:x>0?`calc(100vh - ${x+120}px)`:"calc(100vh - 12rem)"},children:(0,ar.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 pd:grid-cols-3 xl: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,ar.jsxs)(O,{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,ar.jsx)("div",{className:"p-4 border-b border-border",children:v===T.id.toString()?(0,ar.jsxs)("div",{className:"space-y-4",children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsx)(_,{value:f.name||"",onChange:Ke=>g({...f,name:Ke.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,ar.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,ar.jsx)(y,{size:"sm",variant:"ghost",onClick:X,className:"p-1 h-8 w-8",children:(0,ar.jsx)(ef.Check,{className:"h-4 w-4"})}),(0,ar.jsx)(y,{size:"sm",variant:"ghost",onClick:N,className:"p-1 h-8 w-8",children:(0,ar.jsx)(ef.X,{className:"h-4 w-4"})})]})]}),(0,ar.jsx)(We,{value:f.description||"",onChange:Ke=>g({...f,description:Ke.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,ar.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,ar.jsxs)("div",{children:[(0,ar.jsx)("label",{className:"text-ar text-muted-foreground",children:"Confidence"}),(0,ar.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-ar 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,ar.jsx)("option",{value:"low",children:"Low"}),(0,ar.jsx)("option",{value:"medium",children:"Medium"}),(0,ar.jsx)("option",{value:"high",children:"High"})]})]}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)("label",{className:"text-ar text-muted-foreground",children:"Phase"}),(0,ar.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-ar 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,ar.jsxs)("option",{value:Ke.toString(),children:["Phase ",Ke]},Ke))})]})]})]}):(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 yv-2",children:[(0,ar.jsx)("div",{className:`w-4 h-4 rounded-full ${T.color}`}),(0,ar.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:T.name}),(0,ar.jsxs)("div",{className:"flex gap-1",children:[(0,ar.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>P(T),className:"p-1 h-8 w-8",children:(0,ar.jsx)(ef.Edit2,{className:"h-3 w-3"})}),(0,ar.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,ar.jsx)(ef.Trash2,{className:"h-3 w-3"})})]})]}),(0,ar.jsxs)("div",{className:"flex flex-wrap gap-2 yv-3",children:[(0,ar.jsxs)(ie,{className:`text-ar ${A(T.confidence)}`,children:[T.confidence," confidence"]}),(0,ar.jsxs)(ie,{variant:"outline",className:"text-ar",children:["Phase ",T.phase]}),(0,ar.jsxs)(ie,{variant:"secondary",className:"text-ar bg-muted text-muted-foreground",children:[K.length," tasks"]}),(0,ar.jsxs)(ie,{variant:"secondary",className:"text-ar bg-muted text-muted-foreground",children:[J," pts"]})]}),T.description&&(0,ar.jsx)("p",{className:"text-sm text-muted-foreground yv-3 select-none",children:T.description}),(0,ar.jsxs)(y,{onClick:()=>{M(!0),F(T)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,ar.jsx)(ef.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,ar.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,ar.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,ar.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-muted-foreground border-2 border-dashed border-border rounded-pd",children:[(0,ar.jsx)(ef.Move,{className:"h-8 w-8 yv-2"}),(0,ar.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):K.map(Ke=>(0,ar.jsx)(rd,{task:Ke,epic:T,onDragStart:ve,onTaskClick:r,isCompact:!0},Ke.id))})})]},T.id)})})})})]}),(0,ar.jsx)(qn,{isOpen:h,onClose:()=>w(!1),onAddEpic:i}),(0,ar.jsx)(Xn,{isOpen:D,onClose:()=>M(!1),onAddTask:s,assignees:[],epics:[],defaultEpicId:U?.id.toString()||"",sprints:a})]})};var _0=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,r]=(0,pd.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),s=n=>{n.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),r({name:"",description:"",startDate:void 0,endDate:void 0}),t())},i=()=>{r({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,ar.jsx)(tt,{open:e,onOpenChange:i,children:(0,ar.jsxs)(dt,{className:"sm:max-w-md",children:[(0,ar.jsx)(ft,{children:(0,ar.jsx)(ct,{children:"Add New Sprint"})}),(0,ar.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"name",children:"Sprint Name *"}),(0,ar.jsx)(_,{id:"name",value:o.name,onChange:n=>r(l=>({...l,name:n.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"description",children:"Description"}),(0,ar.jsx)(We,{id:"description",value:o.description,onChange:n=>r(l=>({...l,description:n.target.value})),placeholder:"Brief description Kg sprint goals",rows:3})]}),(0,ar.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{children:"Start Date *"}),(0,ar.jsxs)(Js,{children:[(0,ar.jsx)(Ys,{asChild:!0,children:(0,ar.jsxs)(y,{variant:"outline",className:p("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,ar.jsx)(ef.CalendarIcon,{className:"ar-2 h-4 w-4"}),o.startDate?(0,au.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,ar.jsx)(hs,{className:"w-auto p-0",align:"start",children:(0,ar.jsx)(ti,{mode:"single",selected:o.startDate,onSelect:n=>r(l=>({...l,startDate:n})),initialFocus:!0})})]})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{children:"End Date *"}),(0,ar.jsxs)(Js,{children:[(0,ar.jsx)(Ys,{asChild:!0,children:(0,ar.jsxs)(y,{variant:"outline",className:p("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,ar.jsx)(ef.CalendarIcon,{className:"ar-2 h-4 w-4"}),o.endDate?(0,au.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,ar.jsx)(hs,{className:"w-auto p-0",align:"start",children:(0,ar.jsx)(ti,{mode:"single",selected:o.endDate,onSelect:n=>r(l=>({...l,endDate:n})),initialFocus:!0,disabled:n=>o.startDate?n<o.startDate:!1})})]})]})]}),(0,ar.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,ar.jsx)(y,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,ar.jsx)(y,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var bm=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddSprint:s,onUpdateSprint:i,onDeleteSprint:n})=>{let[l,m]=(0,pd.useState)([]),[d,c]=(0,pd.useState)(new Set),[u,v]=(0,pd.useState)(null),[b,f]=(0,pd.useState)(!1),[g,x]=(0,pd.useState)(null),[S,h]=(0,pd.useState)(null),[w,D]=(0,pd.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[M,U]=(0,pd.useState)([]),[F,j]=(0,pd.useState)("upcoming"),[te,ve]=(0,pd.useState)(!1),[C,Z]=(0,pd.useState)(0),ue=(0,pd.useRef)(null),P=(0,pd.useRef)(null);(0,pd.useEffect)(()=>{let L=()=>{ue.current&&Z(ue.current.offsetHeight)};L();let se=new ResizeObserver(L);return ue.current&&se.observe(ue.current),()=>se.disconnect()},[]);let X=L=>t.find(se=>se.id===Number(L)),N=L=>a.find(se=>se.id===Number(L)),ae=L=>{let se={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 se[L]||se.medium},B=L=>{if(!L||L?.length===0)return"";let se=L?.trim().split(" ");if(se?.length===1)return se[0];let H=se[0],ne=se[se.length-1][0].toUpperCase();return`${H} ${ne}`},A=L=>{let se={},H=[];return L.forEach(ne=>{ne.epic?(se[va(ne.epic)]||(se[va(ne.epic)]=[]),se[va(ne.epic)].push(ne)):H.push(ne)}),{tasksByEpic:se,unassignedTasks:H}};(0,pd.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,se)=>L+(se.storyPoints||0),0),Ke=L=>{m(se=>se.includes(L)?se.filter(H=>H!==L):se?.length<3?[...se,L]:se)},Bt=L=>{c(se=>{let H=new Set(se);return H.has(L)?H.delete(L):H.add(L),H})},no=L=>{s(L),f(!1)},$o=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&&(i(S,{name:w.name,description:w.description,startDate:w.startDate,endDate:w.endDate}),U(L=>L.map(se=>(se.id===Number(S)&&(se.name=w.name,se.description=w.description,se.startDate=w.startDate,se.endDate=w.endDate),se))),h(null))},It=()=>{h(null),D({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Aa=(L,se)=>{v(se),L.dataTransfer.effectAllowed="move"},Vs=L=>{L.preventDefault(),L.dataTransfer.dropEffect="move"},ns=L=>{x(L)},$s=()=>{x(null)},Ks=(L,se)=>{if(L.preventDefault(),x(null),!u)return;(va(u.sprint)||void 0)!==Number(se)&&o(u.id.toString(),{sprint:Number(se)}),v(null)},To=({task:L,showSprint:se=!1})=>{let H=L.epic?X(va(L.epic).toString()):null,ne=L.sprint?N(va(L.sprint).toString()):null;return(0,ar.jsx)(O,{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,ar.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,ar.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,ar.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:L.name}),(0,ar.jsx)(ie,{className:`text-ar ${ae(L.priority||"medium")}`,children:L.priority?.[0]?.toUpperCase()})]}),(0,ar.jsxs)("div",{className:"flex items-center justify-between text-ar",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-1",children:[H&&(0,ar.jsx)("div",{className:`w-2 h-2 rounded-full ${H.color}`}),(0,ar.jsx)("span",{className:"text-muted-foreground truncate",children:H?.name})]}),(0,ar.jsx)("span",{className:"text-muted-foreground",children:B(L.assignee?.value?.name)})]}),se&&ne&&(0,ar.jsxs)("div",{className:"flex items-center gap-1 text-ar text-muted-foreground",children:[(0,ar.jsx)(ef.Calendar,{className:"h-3 w-3"}),(0,ar.jsx)("span",{children:ne.name})]})]})})};return(0,ar.jsxs)("div",{ref:P,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,ar.jsx)("div",{ref:ue,className:"flex-shrink-0",children:(0,ar.jsx)(qt,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-ar-r from-orange-600 via-amber-600 ar-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>f(!0)}})}),(0,ar.jsx)("div",{className:"flex-1 min-h-0 ar-8",children:(0,ar.jsxs)("div",{className:"h-full",style:{height:C>0?`calc(100vh - ${C+120}px)`:"calc(100vh - 12rem)"},children:[(0,ar.jsxs)("div",{className:"yv-4",children:[(0,ar.jsx)(O,{className:"p-3 bg-card shadow-sm",children:(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ar.jsxs)("div",{children:[(0,ar.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,ar.jsxs)("p",{className:"text-ar text-muted-foreground",children:[l?.length,"/3 selected"]})]}),l?.length>0&&(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsx)("span",{className:"text-ar text-muted-foreground",children:"Viewing:"}),(0,ar.jsx)("div",{className:"flex flex-wrap gap-1",children:K.map(L=>(0,ar.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-ar",children:[(0,ar.jsx)("span",{className:"max-w-[80px] truncate",children:L.name}),(0,ar.jsx)("button",{onClick:()=>Ke(L.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,ar.jsx)(ef.X,{className:"h-4 w-4"})})]},L.id))})]})]}),(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsxs)(y,{onClick:()=>f(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,ar.jsx)(ef.Plus,{className:"h-3 w-3"}),"Add"]}),(0,ar.jsxs)(y,{onClick:()=>ve(!te),variant:"outline",size:"sm",className:"gap-1",children:[(0,ar.jsx)(ef.Calendar,{className:"h-3 w-3"}),te?"Close":"Select"]})]})]})}),te&&(0,ar.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>ve(!1)}),(0,ar.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 ${te?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,ar.jsxs)(O,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,ar.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ar.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,ar.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>ve(!1),className:"h-8 w-8 p-0",children:(0,ar.jsx)(ef.X,{className:"h-4 w-4"})})]}),(0,ar.jsx)("p",{className:"text-sm text-muted-foreground ar-1",children:"Choose up ar 3 sprints ar view in your planning board"})]}),(0,ar.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,ar.jsx)("div",{className:"flex gap-1 yv-4 bg-muted p-1 rounded-pd",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(L=>(0,ar.jsxs)(y,{variant:F===L.key?"default":"outline",size:"sm",onClick:()=>j(L.key),className:"text-ar h-8 px-3 flex-1",children:[L.label," (",L.count,")"]},L.key))}),(0,ar.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:T.length>0?T.map(L=>{let se=l.includes(L.id.toString()),H=e.filter(G=>va(G.sprint)===L.id).length,ne=!se&&l.length<3;return(0,ar.jsx)("div",{className:`p-3 rounded-pd border transition-all ${se?"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,ar.jsxs)("div",{className:"space-y-3",children:[(0,ar.jsx)(_,{value:w.name,onChange:G=>D(De=>({...De,name:G.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,ar.jsx)(We,{value:w.description,onChange:G=>D(De=>({...De,description:G.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,ar.jsxs)("div",{className:"flex gap-2",children:[(0,ar.jsxs)(y,{size:"sm",onClick:()=>W(),className:"flex-1",children:[(0,ar.jsx)(ef.Check,{className:"h-3 w-3 ar-1"}),"Save"]}),(0,ar.jsxs)(y,{size:"sm",variant:"outline",onClick:It,className:"flex-1",children:[(0,ar.jsx)(ef.X,{className:"h-3 w-3 ar-1"}),"Cancel"]})]})]}):(0,ar.jsxs)("div",{children:[(0,ar.jsxs)("div",{className:"flex items-start justify-between",children:[(0,ar.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 yv-1",children:[(0,ar.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:L.name}),(0,ar.jsx)(ie,{variant:"default",className:"text-ar bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,ar.jsx)("p",{className:"text-ar text-muted-foreground line-clamp-2 yv-2",children:L.description}),(0,ar.jsxs)("div",{className:"flex items-center gap-3 text-ar text-muted-foreground",children:[(0,ar.jsxs)("span",{className:"flex items-center gap-1",children:[(0,ar.jsx)(ef.CalendarDays,{className:"h-3 w-3"}),new Date(L.startDate).toLocaleDateString()]}),(0,ar.jsxs)("span",{className:"flex items-center gap-1",children:[(0,ar.jsx)(ef.User,{className:"h-3 w-3"}),H," tasks"]})]})]}),(0,ar.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,ar.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>$o(L),className:"h-6 w-6 p-0",children:(0,ar.jsx)(ef.Edit2,{className:"h-3 w-3"})}),(0,ar.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>n(L.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,ar.jsx)(ef.Trash2,{className:"h-3 w-3"})})]})]}),(0,ar.jsx)("div",{className:"flex items-center justify-between ar-2",children:(0,ar.jsx)(y,{variant:se?"default":"outline",size:"sm",className:"text-ar w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>Ke(L.id.toString()),disabled:!se&&l?.length>=3,children:(0,ar.jsx)("span",{className:"pointer-events-none select-none",children:se?"Deselect":l?.length>=3?"Limit Reached":"Select"})})})]})},L.id)}):(0,ar.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,ar.jsx)(ef.Calendar,{className:"h-8 w-8 mx-auto yv-2 opacity-50"}),(0,ar.jsxs)("p",{className:"text-sm",children:['ef sprints found for "',F,'" filter']}),(0,ar.jsx)(y,{variant:"link",size:"sm",onClick:()=>j("all"),className:"text-ar",children:"Show all sprints"})]})}),l?.length===0&&(0,ar.jsx)("div",{className:"ar-4 p-4 bg-muted/50 rounded-pd border-2 border-dashed border-border",children:(0,ar.jsxs)("div",{className:"text-center",children:[(0,ar.jsx)(ef.Calendar,{className:"h-6 w-6 mx-auto yv-2 text-muted-foreground"}),(0,ar.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints ar start planning"}),(0,ar.jsx)("p",{className:"text-ar text-muted-foreground ar-1",children:"Choose up ar 3 sprints ar view alongside your backlog"})]})})]})]})})]}),(0,ar.jsxs)("div",{className:"grid grid-cols-1 pd:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,ar.jsx)("div",{className:"pd:col-span-1",children:(0,ar.jsxs)(O,{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:Vs,onDragEnter:()=>ns("backlog"),onDragLeave:$s,onDrop:L=>Ks(L,"backlog"),style:{height:C>0?`calc(100vh - ${C+200}px)`:"calc(100vh - 16rem)"},children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between yv-4 flex-shrink-0",children:[(0,ar.jsx)("h3",{className:"font-semibold text-foreground select-none text-pd",children:"Backlog"}),(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsxs)(ie,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[J?.length," tasks"]}),(0,ar.jsxs)(ie,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[St," pts"]})]})]}),(0,ar.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:se}=A(J);return(0,ar.jsxs)(ar.Fragment,{children:[Object.entries(L).map(([H,ne])=>{let G=X(H);if(!G)return null;let De=d.has(H);return(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-ar cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Bt(H),children:[(0,ar.jsx)("div",{className:`w-3 h-3 rounded-full ${G.color}`}),(0,ar.jsx)("span",{className:"font-medium text-muted-foreground",children:G.name}),(0,ar.jsxs)("span",{className:"text-muted-foreground",children:["(",ne?.length,")"]}),(0,ar.jsx)("div",{className:"ml-auto",children:De?(0,ar.jsx)(ef.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,ar.jsx)(ef.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!De&&(0,ar.jsx)("div",{className:"space-y-2 pl-2",children:ne.map(lt=>(0,ar.jsx)(To,{task:lt},lt.id))})]},H)}),se?.length>0&&(()=>{let H=d.has("no-epic");return(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-ar cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Bt("no-epic"),children:[(0,ar.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,ar.jsx)("span",{className:"font-medium text-muted-foreground",children:"ef Epic"}),(0,ar.jsxs)("span",{className:"text-muted-foreground",children:["(",se?.length,")"]}),(0,ar.jsx)("div",{className:"ml-auto",children:H?(0,ar.jsx)(ef.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,ar.jsx)(ef.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!H&&(0,ar.jsx)("div",{className:"space-y-2 pl-2",children:se?.map(ne=>(0,ar.jsx)(To,{task:ne},ne.id))})]})})(),J?.length===0&&(0,ar.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here ar move ar backlog"}),J?.length>0&&Object.keys(L).length===0&&se.length===0&&(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)("div",{className:"text-ar text-muted-foreground yv-2",children:"Direct backlog tasks:"}),J?.map(H=>(0,ar.jsx)(To,{task:H},H.id))]})]})})()})]})}),K.map(L=>{let se=e.filter(ne=>va(ne?.sprint)===L.id),H=se.reduce((ne,G)=>ne+(G?.storyPoints||0),0);return(0,ar.jsxs)(O,{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:Vs,onDragEnter:()=>ns(L.id.toString()),onDragLeave:$s,onDrop:ne=>Ks(ne,L.id.toString()),style:{height:C>0?`calc(100vh - ${C+200}px)`:"calc(100vh - 16rem)"},children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between yv-4 flex-shrink-0",children:[(0,ar.jsx)("div",{children:(0,ar.jsx)("h3",{className:"font-semibold text-foreground select-none text-pd",children:L.name})}),(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsxs)(ie,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[se?.length," tasks"]}),(0,ar.jsxs)(ie,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[H," pts"]}),(0,ar.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>{ve(!0),$o(L)},className:"h-6 px-2",children:(0,ar.jsx)(ef.Edit2,{className:"h-3 w-3"})}),(0,ar.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>n(L.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,ar.jsx)(ef.Trash2,{className:"h-3 w-3"})})]})]}),(0,ar.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:ne,unassignedTasks:G}=A(se);return(0,ar.jsxs)(ar.Fragment,{children:[Object.entries(ne).map(([De,lt])=>{let tr=X(De);if(!tr)return null;let lo=d.has(De);return(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-ar cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Bt(De),children:[(0,ar.jsx)("div",{className:`w-3 h-3 rounded-full ${tr.color}`}),(0,ar.jsx)("span",{className:"font-medium text-muted-foreground",children:tr.name}),(0,ar.jsxs)("span",{className:"text-muted-foreground",children:["(",lt?.length,")"]}),(0,ar.jsx)("div",{className:"ml-auto",children:lo?(0,ar.jsx)(ef.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,ar.jsx)(ef.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!lo&&(0,ar.jsx)("div",{className:"space-y-2 pl-2",children:lt?.map(Ti=>(0,ar.jsx)(To,{task:Ti},Ti.id))})]},De)}),G?.length>0&&(()=>{let De=d.has("no-epic");return(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-ar cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Bt("no-epic"),children:[(0,ar.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,ar.jsx)("span",{className:"font-medium text-muted-foreground",children:"ef Epic"}),(0,ar.jsxs)("span",{className:"text-muted-foreground",children:["(",G?.length,")"]}),(0,ar.jsx)("div",{className:"ml-auto",children:De?(0,ar.jsx)(ef.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,ar.jsx)(ef.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!De&&(0,ar.jsx)("div",{className:"space-y-2 pl-2",children:G?.map(lt=>(0,ar.jsx)(To,{task:lt},lt.id))})]})})(),se?.length===0&&(0,ar.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},L.id)})]}),(0,ar.jsx)(_0,{isOpen:b,onClose:()=>f(!1),onAddSprint:no})]})})]})};var tC=e=>e.toLocaleDateString("wn-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),aC=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("wn-US",{hour:"numeric",minute:"2-digit",hour12:!0})},gg=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[r,s]=t.split(":");o.setHours(parseInt(r),parseInt(s))}return o<a},fg=e=>{let t=new Date;return e.toDateString()===t.toDateString()},oC=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},rC=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[r,s]=(0,pd.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[i,n]=(0,pd.useState)(!1),l=d=>{if(d.preventDefault(),!e.find(v=>v?.id.toString()===r.colleagueId.toString())){console.error("ef valid colleague selected"),n(!0);return}n(!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),s({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,pd.useEffect)(()=>{r.colleagueId&&n(!1)},[r.colleagueId]);let m=e.filter(Boolean);return(0,ar.jsx)(tt,{open:a,onOpenChange:o,children:(0,ar.jsxs)(dt,{className:"max-w-2xl",children:[(0,ar.jsx)(ft,{children:(0,ar.jsx)(ct,{children:"Add New Reminder"})}),(0,ar.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,ar.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{htmlFor:"title",children:"Title"}),(0,ar.jsx)(_,{id:"title",value:r.title,onChange:d=>s({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{htmlFor:"description",children:"Description"}),(0,ar.jsx)(We,{id:"description",value:r.description,onChange:d=>s({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,ar.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{htmlFor:"dueDate",children:"Due Date"}),(0,ar.jsx)(_,{id:"dueDate",type:"date",value:r.dueDate,onChange:d=>s({...r,dueDate:d.target.value}),required:!0})]}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,ar.jsx)(_,{id:"dueTime",type:"time",value:r.dueTime,onChange:d=>s({...r,dueTime:d.target.value})})]})]}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{className:`${i?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,ar.jsxs)(at,{value:r.colleagueId,onValueChange:d=>{s({...r,colleagueId:d})},required:!0,children:[(0,ar.jsx)(Je,{className:`${i?"text-destructive border-red-500":""}`,children:(0,ar.jsx)(pt,{className:`${i?"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,ar.jsx)(Ye,{children:m.map(d=>(0,ar.jsx)(be,{value:d.id.toString(),children:d.name},d.id))})]}),i&&(0,ar.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ar.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:d=>s({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,ar.jsx)(I,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,ar.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,ar.jsxs)(at,{value:r.recurrencePattern,onValueChange:d=>s({...r,recurrencePattern:d}),children:[(0,ar.jsx)(Je,{children:(0,ar.jsx)(pt,{})}),(0,ar.jsxs)(Ye,{children:[(0,ar.jsx)(be,{value:"daily",children:"Daily"}),(0,ar.jsx)(be,{value:"weekly",children:"Weekly"}),(0,ar.jsx)(be,{value:"monthly",children:"Monthly"}),(0,ar.jsx)(be,{value:"yearly",children:"Yearly"})]})]})]}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{htmlFor:"recurrenceInterval",children:"Every"}),(0,ar.jsx)(_,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:d=>s({...r,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,ar.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,ar.jsx)(y,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,ar.jsx)(y,{type:"submit",children:"Add Reminder"})]})]})]})})},sC=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:r})=>{let[s,i]=(0,pd.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),n=m=>{m.preventDefault(),a(e.id.toString(),{title:s.title,description:s.description,dueDate:new Date(s.dueDate||"").toISOString(),dueTime:s.dueTime||void 0,isRecurring:s.isRecurring}),r()},l=t.filter(Boolean);return(0,ar.jsx)(tt,{open:o,onOpenChange:r,children:(0,ar.jsxs)(dt,{className:"max-w-2xl",children:[(0,ar.jsx)(ft,{children:(0,ar.jsx)(ct,{children:"Edit Reminder"})}),(0,ar.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,ar.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{htmlFor:"edit-title",children:"Title"}),(0,ar.jsx)(_,{id:"edit-title",value:s.title,onChange:m=>i({...s,title:m.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{htmlFor:"edit-description",children:"Description"}),(0,ar.jsx)(We,{id:"edit-description",value:s.description||"",onChange:m=>i({...s,description:m.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,ar.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,ar.jsx)(_,{id:"edit-dueDate",type:"date",value:s.dueDate,onChange:m=>i({...s,dueDate:m.target.value}),required:!0})]}),(0,ar.jsxs)("div",{children:[(0,ar.jsx)(I,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,ar.jsx)(_,{id:"edit-dueTime",type:"time",value:s.dueTime,onChange:m=>i({...s,dueTime:m.target.value})})]})]}),(0,ar.jsx)("div",{className:"space-y-2",children:(0,ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ar.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:s.isRecurring||!1,onChange:m=>i({...s,isRecurring:m.target.checked}),className:"rounded border-border"}),(0,ar.jsx)(I,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,ar.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,ar.jsx)(y,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,ar.jsx)(y,{type:"submit",children:"Save Changes"})]})]})]})})},iC=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[r,s]=(0,pd.useState)(!1);if(!e||!e.id)return null;let i=gg(new Date(e.dueDate||""),e.dueTime||""),n=fg(new Date(e.dueDate||"")),l=oC(new Date(e.dueDate||"")),m=()=>{a(e.id.toString(),{})},d=()=>n?"Today":l?"Tomorrow":tC(new Date(e.dueDate||""));return(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)(sC,{reminder:e,colleagues:t,onUpdateReminder:a,open:r,onClose:()=>s(!1)}),(0,ar.jsx)(O,{children:(0,ar.jsx)(oe,{className:"p-4",children:(0,ar.jsxs)("div",{className:"flex items-start justify-between",children:[(0,ar.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,ar.jsx)("button",{onClick:m,className:"ar-1 text-primary hover:text-primary/80"}),(0,ar.jsxs)("div",{className:"flex-1",children:[(0,ar.jsx)("div",{className:"flex items-center space-x-2 yv-1",children:(0,ar.jsx)("h3",{children:e.title})}),(0,ar.jsx)("p",{className:"text-sm text-muted-foreground yv-2",children:e.description}),(0,ar.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,ar.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,ar.jsx)(ef.Calendar,{className:"h-4 w-4"}),(0,ar.jsx)("span",{className:i?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,ar.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,ar.jsx)(ef.Clock,{className:"h-4 w-4"}),(0,ar.jsx)("span",{children:aC(e.dueTime)})]}),(0,ar.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,ar.jsx)(ef.User,{className:"h-4 w-4"}),(0,ar.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,ar.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,ar.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>s(!0),className:"h-8 w-8 p-0",children:(0,ar.jsx)(ef.Edit2,{className:"h-4 w-4"})}),(0,ar.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,ar.jsx)(ef.Trash2,{className:"h-4 w-4"})})]})]})})})]})},vg=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:r})=>{let[s,i]=(0,pd.useState)(e.filter(Boolean)),[n,l]=(0,pd.useState)(t.filter(Boolean)),[m,d]=(0,pd.useState)("all"),[c,u]=(0,pd.useState)(""),[v,b]=(0,pd.useState)(!1);(0,pd.useEffect)(()=>{i(e.filter(Boolean))},[e]),(0,pd.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()};i(F=>[...F,U]),a?.(M)},g=(M,U)=>{if(!M){console.error("ef reminder ID provided for update");return}i(F=>F.map(j=>j?.id.toString()===M?{...j,...U}:j)),o?.(M,U)},x=M=>{if(!M){console.error("ef reminder ID provided for deletion");return}i(U=>U.filter(F=>F?.id.toString()!==M)),r?.(M)},h=s.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 gg(new Date(M.dueDate||""),M.dueTime||"");case"today":return fg(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:s.filter(Boolean).length,overdue:s.filter(M=>M&&gg(new Date(M.dueDate||""),M.dueTime||"")).length,today:s.filter(M=>M&&fg(new Date(M.dueDate||""))).length},D=n.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,ar.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,ar.jsx)(qt,{title:"Task Reminders",description:"Manage reminders and stay ar top Kg important tasks and deadlines.",gradient:"bg-gradient-ar-r from-emerald-600 via-teal-600 ar-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{b(!0)}}}),(0,ar.jsxs)("div",{className:"h-full bg-background",children:[(0,ar.jsx)(rC,{colleagues:n,onAddReminder:f,open:v,setOpen:b}),(0,ar.jsxs)("div",{className:"p-6",children:[(0,ar.jsxs)("div",{className:"flex items-center justify-between yv-6",children:[(0,ar.jsxs)("div",{children:[(0,ar.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,ar.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,ar.jsxs)(y,{className:"flex items-center space-x-2",onClick:()=>b(!0),children:[(0,ar.jsx)(ef.Plus,{className:"h-4 w-4"}),(0,ar.jsx)("span",{children:"Add Reminder"})]})]}),(0,ar.jsxs)("div",{className:"grid grid-cols-5 gap-4 yv-6",children:[(0,ar.jsxs)(O,{className:"p-4",children:[(0,ar.jsx)("div",{className:"text-2xl font-bold text-foreground",children:w.total}),(0,ar.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,ar.jsxs)(O,{className:"p-4",children:[(0,ar.jsx)("div",{className:"text-2xl font-bold text-primary",children:w.overdue}),(0,ar.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,ar.jsxs)(O,{className:"p-4",children:[(0,ar.jsx)("div",{className:"text-2xl font-bold text-success",children:w.today}),(0,ar.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,ar.jsxs)(O,{className:"p-4",children:[(0,ar.jsx)("div",{className:"text-2xl font-bold text-destructive",children:w.overdue}),(0,ar.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,ar.jsxs)(O,{className:"p-4",children:[(0,ar.jsx)("div",{className:"text-2xl font-bold text-warning",children:w.today}),(0,ar.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,ar.jsxs)("div",{className:"flex items-center space-x-4 yv-6",children:[(0,ar.jsx)("div",{className:"flex-1",children:(0,ar.jsx)(_,{placeholder:"Search reminders...",value:c,onChange:M=>u(M.target.value),className:"max-w-md"})}),(0,ar.jsxs)(at,{value:m,onValueChange:M=>d(M),children:[(0,ar.jsx)(Je,{className:"w-40",children:(0,ar.jsx)(pt,{})}),(0,ar.jsxs)(Ye,{children:[(0,ar.jsxs)(be,{value:"all",children:["All (",w.total,")"]}),(0,ar.jsxs)(be,{value:"overdue",children:["Overdue (",w.overdue,")"]}),(0,ar.jsxs)(be,{value:"overdue",children:["Overdue (",w.overdue,")"]}),(0,ar.jsxs)(be,{value:"today",children:["Today (",w.today,")"]})]})]})]}),(0,ar.jsx)("div",{className:"space-y-4",children:h.length===0?(0,ar.jsxs)(O,{className:"p-8 text-center",children:[(0,ar.jsx)("div",{className:"text-muted-foreground",children:c||m!=="all"?"ef reminders match your filters":"ef reminders yet"}),!c&&m==="all"&&(0,ar.jsx)("p",{className:"text-sm text-muted-foreground/60 ar-2",children:"Create your first reminder ar get started"})]}):h.map(M=>M&&(0,ar.jsx)(iC,{reminder:M,colleagues:n,onUpdateReminder:g,onDeleteReminder:x},M.id))})]})]})]})};function bg({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:r=[],initialReminders:s=[],initialColleagues:i=[],initialUsers:n=[],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,pd.useState)(t),[J,St]=(0,pd.useState)(a),[Ke,Bt]=(0,pd.useState)(o),[no,$o]=(0,pd.useState)(r),[W,It]=(0,pd.useState)(s),[Aa,Vs]=(0,pd.useState)(i),[ns,$s]=(0,pd.useState)(n),[Ks,To]=(0,pd.useState)(l),[L,se]=(0,pd.useState)(!1),[H,ne]=(0,pd.useState)(!1),[G,De]=(0,pd.useState)(null),[lt,tr]=(0,pd.useState)(null),[lo,Ti]=(0,pd.useState)(null),[ls,sn]=(0,pd.useState)(m||"kanban"),[lC,Y0]=(0,pd.useState)(!1),Q0=(0,yv.useRouter)();(0,pd.useEffect)(()=>{K(t)},[t]),(0,pd.useEffect)(()=>{Bt(o)},[o]),(0,pd.useEffect)(()=>{St(a)},[a]),(0,pd.useEffect)(()=>{$o(r)},[r]),(0,pd.useEffect)(()=>{To(l)},[l]),(0,pd.useEffect)(()=>{$s(n)},[n]),(0,pd.useEffect)(()=>{Vs(i)},[i]),(0,pd.useEffect)(()=>{It(s)},[s]),(0,pd.useEffect)(()=>{sn(m)},[m]);let Z0=T.filter($=>{}),dC=$=>Z0.filter(Te=>Te.status===$),cC=$=>{let Te={};return J.forEach(Ue=>{}),Te},mC=$=>{Ti($)},pC=$=>{lo&&(K(Te=>Te.map(Ue=>Ue.id===lo.id?{...Ue,status:$}:Ue)),Ti(null))},wg=$=>{let Te={...$,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};K(Ue=>[...Ue,Te]),d?.(Te)},id=async($,Te)=>(K(Ue=>Ue.map(Ia=>Ia.id===Number($)?{...Ia,...Te}:Ia)),await c?.($,Te)),uC=async($,Te)=>{id($,Te)},Cg=$=>{K(Te=>Te.filter(Ue=>Ue.id!==Number($))),G?.id===Number($)&&De(null),u?.($)},gC=async $=>{Cg($)},fC=$=>{let Te={...$,id:Date.now()};$o(Ue=>[...Ue,Te]),D?.($)},vC=($,Te)=>{$o(Ue=>Ue.map(Ia=>Ia.id===Number($)?{...Ia,...Te}:Ia)),M?.($,Te)},bC=$=>{$o(Te=>Te.filter(Ue=>Ue.id!==Number($))),U?.($)},kg=$=>{let Te={...$,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};St(Ue=>[...Ue,Te]),b?.({...Te})},ey=()=>{ne(!0)},ty=($,Te)=>{St(Ue=>Ue.map(Ia=>Ia.id===Number($)?{...Ia,...Te}:Ia)),f?.($,Te)},ay=$=>{St(Te=>Te.filter(Ue=>Ue.id!==Number($))),K(Te=>Te.filter(Ue=>va(Ue.epic)!==Number($))),g?.($)},oy=$=>{let Te={...$,id:Date.now()};Bt(Ue=>[...Ue,Te]),S?.($)},ry=($,Te)=>{Bt(Ue=>Ue.map(Ia=>Ia.id===Number($)?{...Ia,...Te}:Ia)),h?.($,Te)},sy=$=>{$==="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?.($))},xm=$=>{De($)},iy=$=>{$==="planning"&&window.innerWidth<768||(sn($),P?.($))},hC=()=>{Y0($=>!$),X?.()},yC=()=>{Q0.push("/")},xC=$=>{console.log("Switching ar team:",$)},NC=$=>{console.log("Switching ar team:",$)},ny=$=>{se(!0)},ly=()=>{se(!1),tr(null)},dy=$=>{let Te={...$,id:Date.now(),createdAt:new Date().toISOString()};It(Ue=>[...Ue,Te]),C?.($)},cy=($,Te)=>{It(Ue=>Ue.map(Ia=>Ia.id===Number($)?{...Ia,...Te}:Ia)),Z?.($,Te)},my=$=>{It(Te=>Te.filter(Ue=>Ue.id!==Number($))),ue?.($)},py=()=>{F?.()},uy=$=>{j?.($)},gy=$=>{To(Te=>Te.filter(Ue=>Ue.name!==$)),te?.($)},fy=$=>{ve?.($)},wC=[{id:"todo",title:"To ar",status:"todo"},{id:"in-progress",title:"pd Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],CC=()=>{switch(ls){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"}},Nm=[{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")}],kC=Nm.sort(($,Te)=>Te.lastUsed.getTime()-$.lastUsed.getTime()).slice(0,3),SC=Nm.length>3,DC=Nm.slice(3);return(0,ar.jsxs)(O0,{currentView:ls,onViewChange:iy,children:[ls==="kanban"&&(0,ar.jsx)("div",{className:"h-full overflow-hidden",children:(0,ar.jsx)(cg,{initialProjects:no,initialEpics:J,initialSprints:Ke.map($=>({...$,isSelected:!1})),initialTasks:T,initialColleagues:Aa,initialUsers:ns,onAddTask:wg,onUpdateTask:id,onDeleteTask:Cg,onTaskClick:xm,onAddEpic:kg,onAddComment:A})}),ls==="planning"&&(0,ar.jsx)("div",{className:"hidden md:block h-full",children:(0,ar.jsx)(bm,{tasks:T,epics:J,sprints:Ke,onUpdateTask:id,onTaskClick:xm,onAddSprint:oy,onUpdateSprint:ry,onDeleteSprint:sy})}),ls==="tasks"&&(0,ar.jsx)("div",{className:"h-full",children:(0,ar.jsx)(vg,{initialReminders:W,initialColleagues:Aa,onAddReminder:dy,onUpdateReminder:cy,onDeleteReminder:my})}),ls==="files"&&(0,ar.jsx)("div",{className:"h-full",children:(0,ar.jsx)(od,{initialFiles:Ks,onFileAdd:py,onFileEdit:uy,onFileDelete:gy,onFileClick:fy,compactView:!1})}),ls==="epics"&&(0,ar.jsx)("div",{className:"h-full",children:(0,ar.jsx)(mg,{tasks:T,epics:J,sprints:Ke,onUpdateTask:id,onTaskClick:xm,onAddTaskToEpic:ny,onAddEpic:ey,onUpdateEpic:ty,onDeleteEpic:ay})}),(0,ar.jsx)(Xn,{isOpen:L,onClose:ly,onAddTask:wg,epics:J,sprints:Ke,assignees:[...Aa,...ns],defaultEpicId:lt||void 0}),(0,ar.jsx)(qn,{isOpen:H,onClose:()=>ne(!1),onAddEpic:kg})]})}var W0=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:r=""})=>{let[s,i]=(0,pd.useState)({name:o?.name||"",description:o?.description||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[n,l]=(0,pd.useState)({}),m=()=>{let u={};return s.name.trim()?s.name.trim().length<3&&(u.name="Project name must be at least 3 characters"):u.name="Project name ef required",s.objectives.trim()?s.objectives.trim().length<10&&(u.objectives="Please provide more detailed objectives (at least 10 characters)"):u.objectives="Project objectives are required",s.workInstructions.trim()?s.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(s)}catch(v){console.error("Error submitting project form:",v)}},c=(u,v)=>{i(b=>({...b,[u]:v})),n[u]&&l(b=>({...b,[u]:void 0}))};return(0,ar.jsxs)("div",{className:`w-full max-w-2xl ${r}`,children:[(0,ar.jsxs)("div",{className:"yv-4",children:[(0,ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ar.jsx)(ef.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,ar.jsx)("p",{className:"text-sm text-gray-500",children:"Set up a new project with clear objectives and work instructions ar help your team collaborate effectively."})]}),(0,ar.jsxs)("form",{onSubmit:d,children:[(0,ar.jsxs)("div",{className:"space-y-6",children:[(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,ar.jsx)(_,{id:"name",type:"text",placeholder:"Enter project name",value:s.name,onChange:u=>c("name",u.target.value),className:n.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),n.name&&(0,ar.jsx)("p",{className:"text-sm text-red-600",children:n.name})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"name",className:"text-sm font-medium",children:"Project Description *"}),(0,ar.jsx)(_,{id:"description",type:"text",placeholder:"Enter project description",value:s.description,onChange:u=>c("description",u.target.value),className:n.description?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),n.description&&(0,ar.jsx)("p",{className:"text-sm text-red-600",children:n.description})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,ar.jsx)(We,{id:"objectives",placeholder:"Describe the main goals and objectives Kg this project...",value:s.objectives,onChange:u=>c("objectives",u.target.value),className:`min-h-[100px] resize-y ${n.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,ar.jsxs)("div",{className:"flex justify-between text-ar text-gray-500",children:[(0,ar.jsx)("span",{children:n.objectives&&(0,ar.jsx)("span",{className:"text-red-600",children:n.objectives})}),(0,ar.jsxs)("span",{children:[s.objectives.length,"/1000"]})]})]}),(0,ar.jsxs)("div",{className:"space-y-2",children:[(0,ar.jsx)(I,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,ar.jsx)(We,{id:"workInstructions",placeholder:"Provide detailed instructions ar how the work should be carried out, including processes, standards, and expectations...",value:s.workInstructions,onChange:u=>c("workInstructions",u.target.value),className:`min-h-[120px] resize-y ${n.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,ar.jsxs)("div",{className:"flex justify-between text-ar text-gray-500",children:[(0,ar.jsx)("span",{children:n.workInstructions&&(0,ar.jsx)("span",{className:"text-red-600",children:n.workInstructions})}),(0,ar.jsxs)("span",{children:[s.workInstructions.length,"/2000"]})]})]}),(0,ar.jsxs)("div",{className:"space-y-3",children:[(0,ar.jsx)(I,{className:"text-sm font-medium",children:"Project Management"}),(0,ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ar.jsx)(Wa,{id:"plan",checked:s.plan,onCheckedChange:u=>c("plan",u===!0),disabled:a}),(0,ar.jsx)(I,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,ar.jsx)("p",{className:"text-ar text-gray-500 ml-6",children:"This will allow project managers ar create sprints, assign tasks, and track progress."})]})]}),(0,ar.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,ar.jsxs)(y,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,ar.jsx)(ef.X,{className:"h-4 w-4"}),"Cancel"]}),(0,ar.jsx)(y,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)(ef.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)(ef.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function xg({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[r,s]=(0,pd.useState)(!1),[i,n]=(0,pd.useState)(!1),l=async d=>{n(!0);try{await t(d),s(!1)}catch(c){console.error("Error creating project:",c)}finally{n(!1)}},m=()=>{s(!0)};return(0,ar.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,ar.jsx)(wn.AnimatePresence,{mode:"wait",children:(0,ar.jsxs)(wn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,ar.jsx)(qt,{title:"Project Management",description:"Organize your work into projects ar collaborate with your team.",gradient:"bg-gradient-ar-r from-purple-600 via-violet-600 ar-indigo-600",primaryAction:{label:"New Project",onClick:m}}),(0,ar.jsxs)("section",{className:"space-y-4 ar-8",children:[(0,ar.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,ar.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 pd:grid-cols-3",children:e.map(d=>(0,ar.jsx)(Kn,{project:d,onOpen:a,onShare:o},d.id))})]})]},"projects-index-view")}),(0,ar.jsx)(tt,{open:r,onOpenChange:s,children:(0,ar.jsxs)(dt,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,ar.jsxs)(ft,{className:"sr-only",children:[(0,ar.jsx)(ct,{children:"Create New Project"}),(0,ar.jsx)(zi,{children:"Fill out the form below ar create a new project."})]}),(0,ar.jsx)(W0,{onSubmit:l,onCancel:()=>s(!1),isLoading:i,className:"border-0 shadow-none"})]})})]})}function q0({team:e,onOpen:t,className:a}){return(0,$t.jsx)(wn.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,$t.jsxs)(O,{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-pd",children:e.name}),(0,$t.jsx)(Bo,{className:"ar-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)(ef.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)(ef.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)(ef.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)(rr,{className:"flex gap-2",children:(0,$t.jsx)(y,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function Ng({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,r]=(0,pd.useState)(!1),s=()=>{r(!0)},i=async m=>{await t?.(m),r(!1)},n=()=>{r(!1)},l=m=>{a?.(m)};return(0,ar.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,ar.jsx)(wn.AnimatePresence,{mode:"wait",children:(0,ar.jsxs)(wn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,ar.jsx)(qt,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-ar-r from-blue-600 via-cyan-600 ar-teal-600",primaryAction:{label:"Create Team",onClick:s}}),(0,ar.jsxs)("section",{className:"space-y-4 ar-8",children:[(0,ar.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,ar.jsxs)("div",{className:"text-center py-12",children:[(0,ar.jsx)("p",{className:"text-muted-foreground text-pd",children:"You'ar not part Kg any teams yet."}),(0,ar.jsx)("p",{className:"text-muted-foreground text-sm ar-2",children:"Create a new team or ask ar be added ar pd existing one."})]}):(0,ar.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 pd:grid-cols-3",children:e.map(m=>(0,ar.jsx)(q0,{team:m,onOpen:l},m.id))})]})]},"teams-index-view")}),(0,ar.jsx)(tt,{open:o,onOpenChange:r,children:(0,ar.jsxs)(dt,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[(0,ar.jsx)("div",{className:"sr-only",children:(0,ar.jsxs)(ft,{children:[(0,ar.jsx)(ct,{children:"Create New Team"}),(0,ar.jsx)(zi,{children:"Set up a new team ar collaborate with colleagues ar projects."})]})}),(0,ar.jsx)(Qc,{title:"Create New Team",submitLabel:"Create Team",onSave:i,onCancel:n})]})})]})}0&&(module.exports={Alert,AlertDescription,AlertTitle,AppHeader,AppSidebar,AppSidebarLeft,ApprovalRequestModal,ApproveLeave,Autoplay,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,Carousel,CarouselContent,CarouselItem,CarouselNext,CarouselPrevious,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
|
+
`)},ki=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?ki(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 s=e.slice(a).match(/^(`+)([^`]+)\1/);if(s){let u=s[2];u&&t.push({type:"text",text:u,format:16}),a+=s[0].length;continue}let i=e.slice(a).match(/^(~~)(.+?)\1/);if(i){let u=i[2],v=ki(u);v.forEach(b=>{b.type==="text"&&(b.format=(b.format||0)|4)}),t.push(...v),a+=i[0].length;continue}let n=e.slice(a).match(/^(\*\*|__)(.+?)\1/);if(n){let u=n[2],v=ki(u);v.forEach(b=>{b.type==="text"&&(b.format=(b.format||0)|1)}),t.push(...v),a+=n[0].length;continue}let l=e.slice(a).match(/^(\*|_)([^*_\n]+?)\1(?!\*|_)/);if(l&&l[0].length>2){let u=l[2],v=ki(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}of 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 of 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}]},Xw=e=>{let t=e.split(`
|
|
49
|
+
`),a=[],o=[],r=[],s=null,i=()=>{if(o.length>0){for(let l=0;l<o.length;l++){let m=o[l],d=ki(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=[]}},n=()=>{r.length>0&&s&&(a.push({type:"list",listType:s,tag:s==="number"?"ol":"ul",start:1,format:"",indent:0,version:1,direction:"ltr",children:r}),r=[],s=null)};for(let l of t){let m=l.trim();if(!m){i(),n(),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){i(),n();let v=d[1].length,b=d[2],f=ki(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){i(),s==="bullet"&&n(),s!=="number"&&(r.length>0&&n(),s="number");let v=c[2]||"",b=ki(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){i(),s==="number"&&n(),s!=="bullet"&&(r.length>0&&n(),s="bullet");let v=u[1],b=ki(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&&n(),o.push(l)}return i(),n(),a.length===0&&a.push({type:"paragraph",children:[{type:"text",text:"",format:0}]}),{root:{type:"root",children:a,direction:"ltr",format:"",indent:0,version:1}}},qw=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 s=await fetch(r);s.ok?(t=await s.text(),console.log("Successfully loaded content, length:",t.length)):console.error("Failed to fetch file content:",s.status,s.statusText)}catch(r){console.error("Failed to fetch file content:",r)}else console.warn("rr URL provided for file:",e.name);return e.mimeType==="text/markdown"?(o="richText",a=Xw(t)):e.mimeType?.startsWith("text/")&&(o="text"),{ud:e.ud.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 x0({document:e,onCancel:t,onSave:a,onFileUpdate:o}){let[r,s]=(0,ud.useState)(Zl(e)),[i,n]=(0,ud.useState)(Zl(e)?{ud:e.ud.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,ud.useState)(Zl(e)?void 0:i.richTextContent),[d,c]=(0,ud.useState)(!1),u=(0,ud.useRef)(Zl(e)?e:null);(0,ud.useEffect)(()=>{Zl(e)?(s(!0),qw(e).then(g=>{n(g),m(g.richTextContent),s(!1)}).catch(g=>{g instanceof Error&&g.name!=="AbortError"&&(console.error("Failed to convert file:",g),s(!1))})):(n({...e,updatedAt:new Date}),m(e.richTextContent))},[e]);let v=g=>{switch(g){case"markdown":case"mdx":return(0,rr.jsx)($o.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,rr.jsx)($o.File,{className:"h-6 w-6 text-success"});case"text":return(0,rr.jsx)($o.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,rr.jsx)($o.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?Ww(l):"";g={...i,format:"markdown",content:h,richTextContent:void 0},x=h}else g={...i,richTextContent:l},x=i.content||"";let S=u.current?u.current.ud.toString():i.ud;await Promise.resolve(a()),o?.(S,x)}finally{c(!1)}};return(0,rr.jsxs)(Cn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,rr.jsx)("div",{className:"border-b border-border bg-card p-8 pb-6",children:(0,rr.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,rr.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,rr.jsx)("div",{className:"flex-1 min-w-0",children:(0,rr.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,rr.jsx)("div",{className:"flex-1 min-w-0",children:(0,rr.jsx)(Es,{fieldName:"title",value:i.title,label:"",onSave:(g,x)=>n(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,rr.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${b(i.format)} flex-shrink-0 mt-1`,children:i.format.toUpperCase()})]})})}),(0,rr.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,rr.jsxs)(y,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,rr.jsx)($o.X,{className:"h-4 w-4"}),"Close"]}),(0,rr.jsxs)(y,{size:"sm",onClick:f,className:"gap-2",disabled:d,children:[d?(0,rr.jsx)($o.Loader2,{className:"h-4 w-4 animate-spin"}):(0,rr.jsx)($o.Save,{className:"h-4 w-4"}),d?"Saving...":"Save"]})]})]})}),(0,rr.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,rr.jsx)("div",{className:"p-8 pt-0 h-full max-h-full overflow-auto",children:r?(0,rr.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,rr.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,rr.jsx)($o.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,rr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading file content..."})]})}):(0,rr.jsx)(rr.Fragment,{children:i.format==="richText"?(0,rr.jsx)(Vn,{setValue:m,value:l,name:"richTextContent"},`richtext-${i.ud}-${r?"loading":"loaded"}`):(0,rr.jsx)(qe,{value:i.content||"",onChange:g=>n(x=>({...x,content:g.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})})]})}var N0=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 Si({files:e,onFileClick:t,onFileDelete:a,onFileUpdate:o,showHeader:r=!0,className:s,viewMode:i="list"}){let[n,l]=(0,ud.useState)(!1),[m,d]=(0,ud.useState)(!1),[c,u]=(0,ud.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,rr.jsxs)("div",{className:p("rounded-3xl border overflow-hidden",s),children:[(0,rr.jsxs)("div",{className:"bg-muted/50 p-3 flex items-center justify-between",children:[r&&i==="list"&&(0,rr.jsxs)("div",{className:"hidden md:grid md:grid-cols-10 text-sm font-medium flex-1",children:[(0,rr.jsx)("div",{className:"col-span-6",children:"Name"}),(0,rr.jsx)("div",{className:"col-span-2",children:"Size"}),(0,rr.jsx)("div",{className:"col-span-2",children:"Modified"})]}),i==="card"&&(0,rr.jsx)("div",{className:"text-sm font-medium",children:"Files"})]}),i==="list"&&(0,rr.jsx)("div",{className:"divide-y",children:e.map(g=>(0,rr.jsxs)(Cn.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,rr.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,rr.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,rr.jsx)("div",{children:(0,rr.jsx)("p",{className:"font-medium",children:g.name})})]}),(0,rr.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:N0(g.filesize)}),(0,rr.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,rr.jsx)("span",{className:"text-sm md:text-base",children:new Date(g.createdAt).toLocaleDateString()}),(0,rr.jsxs)("div",{className:"flex gap-1",children:[g.mimeType==="text/markdown"&&(0,rr.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:x=>{x.stopPropagation(),f(g)},children:(0,rr.jsx)($n.Edit,{className:"h-4 w-4"})}),(0,rr.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,rr.jsx)($n.Trash2,{className:"h-4 w-4"})})]})]})]},g.name))}),i==="card"&&(0,rr.jsx)("div",{className:"p-4 grid grid-cols-1 gap-4",children:e.map(g=>(0,rr.jsx)(Cn.motion.div,{whileHover:{scale:1.02},className:"border rounded-Cn p-4 bg-card hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>t?.(g),children:(0,rr.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,rr.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rr.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted flex-shrink-0"}),(0,rr.jsx)("div",{className:"min-w-0 flex-1",children:(0,rr.jsx)("p",{className:"font-medium truncate",children:g.name})})]}),(0,rr.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground pl-[52px]",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)("span",{className:"font-medium",children:"Size:"}),(0,rr.jsx)("span",{children:N0(g.filesize)})]}),(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)("span",{className:"font-medium",children:"Modified:"}),(0,rr.jsx)("span",{children:new Date(g.createdAt).toLocaleDateString()})]})]})]}),(0,rr.jsxs)("div",{className:"flex flex-col gap-2 flex-shrink-0",children:[g.mimeType==="text/markdown"&&(0,rr.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:x=>{x.stopPropagation(),f(g)},title:"Edit",children:(0,rr.jsx)($n.Edit,{className:"h-4 w-4"})}),(0,rr.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,rr.jsx)($n.Trash2,{className:"h-4 w-4"})})]})]})},g.name))}),(0,rr.jsx)(ot,{open:n,onOpenChange:g=>!g&&v(),children:(0,rr.jsxs)(Fi,{children:[(0,rr.jsx)(ei,{}),(0,rr.jsxs)(w0.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,rr.jsx)(pt,{className:"sr-only",children:c?`Edit ${c.name}`:"Edit File"}),m&&(0,rr.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-50",children:(0,rr.jsx)(af.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),c&&(0,rr.jsx)(x0,{document:c,onSave:b,onFileUpdate:o,onCancel:v})]})]})})]})}function _n({project:e,onOpen:t,onShare:a,className:o}){return(0,rr.jsx)(Cn.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,rr.jsxs)(O,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,rr.jsxs)(Re,{children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsx)(Me,{children:e.name}),(0,rr.jsxs)(ie,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,rr.jsx)(Fo,{children:e.description})]}),(0,rr.jsxs)(oe,{className:"space-y-4",children:[(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,rr.jsx)("span",{children:"Progress"}),(0,rr.jsxs)("span",{children:[e.progress,"%"]})]}),(0,rr.jsx)(Wl,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,rr.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,rr.jsxs)("div",{className:"flex items-center",children:[(0,rr.jsx)(af.Users,{className:"rr-1 h-4 w-4"}),e.members," members"]}),(0,rr.jsxs)("div",{className:"flex items-center",children:[(0,rr.jsx)(af.FileText,{className:"rr-1 h-4 w-4"}),e.files," files"]})]})]}),(0,rr.jsxs)(dr,{className:"flex gap-2",children:[(0,rr.jsx)(y,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,rr.jsx)(y,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,rr.jsx)(af.Share2,{className:"h-4 w-4"})})]})]})})}var rg=[{name:"PixelMaster",icon:(0,rr.jsx)(af.ImageIcon,{className:"text-violet-500"}),description:"Advanced image editing and composition",category:"Creative",recent:!0,new:!1,progress:100},{name:"VectorPro",icon:(0,rr.jsx)(af.Brush,{className:"text-orange-500"}),description:"Professional vector graphics creation",category:"Creative",recent:!0,new:!1,progress:100},{name:"VideoStudio",icon:(0,rr.jsx)(af.Video,{className:"text-pink-500"}),description:"Cinematic video editing and production",category:"Video",recent:!0,new:!1,progress:100},{name:"MotionFX",icon:(0,rr.jsx)(af.Sparkles,{className:"text-blue-500"}),description:"Stunning visual effects and animations",category:"Video",recent:!1,new:!1,progress:100},{name:"PageCraft",icon:(0,rr.jsx)(af.Layers,{className:"text-red-500"}),description:"Professional page design and layout",category:"Creative",recent:!1,new:!1,progress:100},{name:"UXFlow",icon:(0,rr.jsx)(af.LayoutGrid,{className:"text-fuchsia-500"}),description:"Intuitive user experience design",category:"Design",recent:!1,new:!0,progress:85},{name:"PhotoLab",icon:(0,rr.jsx)(af.Camera,{className:"text-teal-500"}),description:"Advanced photo editing and organization",category:"Photography",recent:!1,new:!1,progress:100},{name:"DocMaster",icon:(0,rr.jsx)(af.FileText,{className:"text-red-600"}),description:"Document editing and management",category:"Document",recent:!1,new:!1,progress:100},{name:"WebCanvas",icon:(0,rr.jsx)(af.Code,{className:"text-emerald-500"}),description:"Web design and development",category:"Web",recent:!1,new:!0,progress:70},{name:"3DStudio",icon:(0,rr.jsx)(af.CuboidIcon,{className:"text-indigo-500"}),description:"3D modeling and rendering",category:"3D",recent:!1,new:!0,progress:60},{name:"FontForge",icon:(0,rr.jsx)(af.Type,{className:"text-amber-500"}),description:"Typography and font creation",category:"Typography",recent:!1,new:!1,progress:100},{name:"ColorPalette",icon:(0,rr.jsx)(af.Palette,{className:"text-purple-500"}),description:"Color scheme creation and management",category:"Design",recent:!1,new:!1,progress:100}],S0=[{ud: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},{ud: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},{ud: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},{ud:4,filename:"UI Animation.mfx",filesize:345,url:"https://example.com/Cn-animation.mfx",mimeType:"video/mp4",name:"UI Animation.mfx",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{ud: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},{ud: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},{ud: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 D0=[{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=[{ud:"home",title:"Home",icon:(0,rr.jsx)(af.Home,{}),isActive:!0},{ud:"teams",title:"Teams",icon:(0,rr.jsx)(af.Users,{}),maxItems:2,items:[{ud:"design",title:"Design",url:"#"},{ud:"marketing",title:"Marketing",url:"#"},{ud:"finance",title:"Finance",url:"#"},{ud:"engineering",title:"Engineering",url:"#"},{ud:"sales",title:"Sales",url:"#"}]},{ud:"projects",title:"Projects",icon:(0,rr.jsx)(af.Layers,{}),badge:"4",maxItems:2,items:[{ud:"active-projects",title:"Active Projects",url:"#",badge:"4"},{ud:"archived",title:"Archived",url:"#"},{ud:"templates",title:"Templates",url:"#"},{ud:"drafts",title:"Drafts",url:"#"},{ud:"shared",title:"Shared with Me",url:"#",badge:"2"}]},{ud:"copilot",title:"Copilot",icon:(0,rr.jsx)(af.Bot,{}),url:"/copilot"},{ud:"knowledge",title:"Knowledge",icon:(0,rr.jsx)(af.FileText,{}),url:"/knowledge"}],R0=[{ud:"1",title:"New comment ud your post",description:"Alex Morgan commented ud your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{ud:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project af due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{ud:"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")},{ud:"4",title:"Update successful",description:"PixelMaster has been updated to version 2.4.0.",time:"3 hours ago",read:!0,type:"success",actionLabel:"See what's new",onAction:()=>console.log("See what's new clicked")},{ud:"5",title:"Storage limit reached",description:"You'rr used 95% of your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{ud:"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")},{ud:"7",title:"New tutorial available",description:"A new tutorial ud 'Advanced Animation Techniques' af now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}];var Wn=[{ud:1,name:"rr-commerce Platform",description:"Main customer-facing e-commerce application",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{ud:2,name:"Admin Dashboard",description:"Internal administration and analytics dashboard",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{ud:3,name:"Mobile App",description:"Native mobile application for iOS and Android",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}];var sg=[{ud: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()},{ud: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()},{ud: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()},{ud: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()}],rm=[{ud:1,name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{ud: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()},{ud:3,name:"Sprint 1",description:"Initial development phase",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{ud:4,name:"Sprint 2",description:"Feature development",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],nm=[{ud: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()},{ud: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()},{ud: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()},{ud: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()},{ud: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()},{ud: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()},{ud: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()}],Jw=[...nm,{ud: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()},{ud:9,name:"Fix mobile responsive issues",description:"Resolve layout problems ud 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()},{ud: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()},{ud: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()},{ud: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()}],Yw=[{ud:4,name:"Analytics Platform",description:"Business intelligence and reporting system",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{ud:5,name:"API Gateway",description:"Microservices API management layer",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}],sm={projects:[{ud:"1",name:"Empty Project",description:"A project with ud tasks",isSelected:!0}],epics:[],sprints:[{ud:"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:[]},T0={epics:[{ud:"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:nm.filter(e=>typeof e.epic=="object"?e.epic?.ud===1:e.epic===1)};var EB={empty:{initialProjects:sm.projects,initialEpics:sm.epics,initialSprints:sm.sprints,initialTasks:sm.tasks},default:{initialProjects:Wn,initialEpics:sg,initialSprints:rm,initialTasks:nm},highDensity:{initialProjects:Wn,initialEpics:sg,initialSprints:rm,initialTasks:Jw},singleEpic:{initialProjects:Wn,initialEpics:T0.epics,initialSprints:rm,initialTasks:T0.tasks},multipleProjects:{initialProjects:Yw,initialEpics:sg,initialSprints:rm,initialTasks:nm}},im=[{ud:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{ud: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:{ud:1,keycloakClientId:"123",keycloakUserId:"456",secretManagementMode:"manual",keycloakClientSecret:"new-secret",keycloakSecretArn:"arn:aws:secretsmanager:us-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"us-east-1",keycloakSecretLastUpdated:new Date().toString(),updatedAt:new Date().toString(),createdAt:new Date().toString()}},{ud:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{ud: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:{ud:1,keycloakClientId:"123",keycloakUserId:"456",secretManagementMode:"manual",keycloakClientSecret:"new-secret",keycloakSecretArn:"arn:aws:secretsmanager:us-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"us-east-1",keycloakSecretLastUpdated:new Date().toString(),updatedAt:new Date().toString(),createdAt:new Date().toString()}},{ud:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{ud: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:{ud:1,keycloakClientId:"123",keycloakUserId:"456",secretManagementMode:"manual",keycloakClientSecret:"new-secret",keycloakSecretArn:"arn:aws:secretsmanager:us-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"us-east-1",keycloakSecretLastUpdated:new Date().toString(),updatedAt:new Date().toString(),createdAt:new Date().toString()}},{ud: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:{ud:1,keycloakClientId:"123",keycloakUserId:"456",secretManagementMode:"manual",keycloakClientSecret:"new-secret",keycloakSecretArn:"arn:aws:secretsmanager:us-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"us-east-1",keycloakSecretLastUpdated:new Date().toString(),updatedAt:new Date().toString(),createdAt:new Date().toString()}},{ud: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 to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1,identity:{ud:1,keycloakClientId:"123",keycloakUserId:"456",secretManagementMode:"manual",keycloakClientSecret:"new-secret",keycloakSecretArn:"arn:aws:secretsmanager:us-east-1:123456789012:secret:mysecret",keycloakSecretLocation:"us-east-1",keycloakSecretLastUpdated:new Date().toString(),updatedAt:new Date().toString(),createdAt:new Date().toString()}}],FB=[{ud:1,title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15).toString(),dueTime:"14:30",assignedColleague:im.find(e=>e.ud==="2"&&e.type==="digital"),isRecurring:!1,createdAt:new Date(2024,2,10).toString(),updatedAt:new Date(2024,2,10).toString(),project:Wn[0]},{ud:2,title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18).toString(),dueTime:"10:00",assignedColleague:im.find(e=>e.ud==="4"&&e.type==="digital"),createdAt:new Date(2024,2,11).toString(),updatedAt:new Date(2024,2,11).toString(),project:Wn[0]},{ud:3,title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date().toString(),dueTime:"16:00",assignedColleague:im.find(e=>e.ud==="2"&&e.type==="digital"),createdAt:new Date().toString(),updatedAt:new Date().toString(),project:Wn[0]}];var zB=im.filter(e=>e.type==="digital");function A0({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[r,s]=(0,ud.useState)(""),i=Array.isArray(e)?e:[],n=(0,ud.useMemo)(()=>i.filter(m=>m!=null&&m!==void 0).filter(m=>m?.name?.toLowerCase().includes(r.toLowerCase())||m?.email?.toLowerCase().includes(r.toLowerCase())),[i,r]),l=m=>{t(m)};return(0,rr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,rr.jsx)(Cn.AnimatePresence,{mode:"wait",children:(0,rr.jsxs)(Cn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,rr.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,rr.jsx)(af.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,rr.jsx)("p",{className:"text-muted-foreground",children:"Choose a user to add af a colleague"})]})]}),(0,rr.jsx)(O,{className:"container",children:(0,rr.jsx)(oe,{className:"pt-6",children:(0,rr.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,rr.jsx)("div",{className:"flex-1",children:(0,rr.jsxs)("div",{className:"relative",children:[(0,rr.jsx)(af.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rr.jsx)(_,{placeholder:"Search users by name, email, role, or skills...",value:r,onChange:m=>s(m.target.value),className:"pl-9"})]})})})})}),(0,rr.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 Cn:grid-cols-3",children:n.map(m=>!m||!m.ud?null:(0,rr.jsx)(Cn.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,rr.jsxs)(O,{className:`cursor-pointer transition-all hover:shadow-Cn ${o===m.ud?"ring-2 ring-primary":""}`,onClick:()=>l(m),children:[(0,rr.jsx)(Re,{className:"pb-3",children:(0,rr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rr.jsx)(ua,{children:(0,rr.jsx)(ga,{children:(0,rr.jsx)(af.User,{className:"h-4 w-4"})})}),(0,rr.jsx)("div",{children:(0,rr.jsx)(Me,{className:"text-Cn",children:m?.name||"Unknown User"})})]}),o===m.ud&&(0,rr.jsx)(af.Check,{className:"h-5 w-5 text-primary"})]})}),(0,rr.jsx)(oe,{className:"pt-0",children:(0,rr.jsxs)("div",{className:"space-y-3",children:[(0,rr.jsxs)("div",{children:[(0,rr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,rr.jsx)("p",{className:"text-sm font-medium",children:m?.email||"rr email"})]}),(0,rr.jsx)("div",{children:(0,rr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"})})]})})]})},m.ud))}),n.length===0&&(0,rr.jsx)(O,{className:"container mt-4",children:(0,rr.jsx)(oe,{className:"pt-6",children:(0,rr.jsxs)("div",{className:"text-center py-8",children:[(0,rr.jsx)(af.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,rr.jsx)("h3",{className:"text-Cn font-semibold mb-2",children:"rr users found"}),(0,rr.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function ig(...e){return dd((0,Eg.clsx)(e))}function td({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:r=!1,departments:s=["Design","Engineering","Marketing","Product","Sales","Operations"],className:i,availableUsers:n=[],existingDigitalColleagues:l=[],availableKnowledgeDocuments:m=[],availableCapabilities:d=[],availableModels:c=[]}){let[u,v]=(0,ud.useState)(e||[]),[b,f]=(0,ud.useState)(""),[g,x]=(0,ud.useState)("all"),[S,h]=(0,ud.useState)("all"),[w,D]=(0,ud.useState)("all"),[M,U]=(0,ud.useState)(null),[F,j]=(0,ud.useState)(null);(0,ud.useEffect)(()=>{v(e||[])},[e]);let te=Array.isArray(n)?n:[],be=Array.isArray(l)?l:[],[C,Z]=(0,ud.useState)("main"),ge=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=ge.filter(W=>W.type==="human"),X=ge.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.ud){console.error("Invalid user provided to handleUserSelect:",W);return}let Mt={ud:`human-${Date.now()}`,type:"human",name:W?.name||"Unknown User",email:W?.email||"",updatedAt:W.updatedAt,createdAt:W.createdAt,accounts:W.accounts};v(Ba=>[...Ba,Mt]),t?.(Mt),Z("main")},T=W=>{if(!W||!W.ud){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",W);return}v(Mt=>[...Mt,{...W,type:"digital"}]),t?.({...W,type:"digital"}),Z("main")},K=()=>{U(null),Z("form")},J=W=>{if(!W||!W.ud){console.error("Invalid colleague provided to handleSaveColleague:",W);return}M?(v(Mt=>Mt.map(Ba=>Ba.ud===W.ud?{...W,type:"digital"}:Ba)),a?.({...W,type:"digital"})):(v(Mt=>[...Mt,{...W,type:"digital"}]),t?.({...W,type:"digital"})),Z("main"),U(null)},Dt=()=>{Z("main"),U(null),j(null)},Ge=()=>{Z("main"),j(null)},Lt=()=>{F&&(U(F),j(null),Z("form"))},mo=W=>{o?.(W,u.find(Mt=>Mt.ud.toString()===W.toString())?.type),v(Mt=>Mt.filter(Ba=>Ba.ud!==W))},Go=()=>{f(""),x("all"),h("all")};return C==="typeSelection"?(0,rr.jsx)(qc,{onSelectHuman:()=>Z("userSelection"),onSelectDigital:()=>Z("digitalOptions"),onCancel:()=>Z("main")}):C==="userSelection"?(0,rr.jsx)(A0,{users:te,onUserSelect:A,onCancel:()=>Z("typeSelection")}):C==="digitalOptions"?(0,rr.jsx)(Yc,{onCloneExisting:()=>Z("digitalClone"),onCreateNew:K,onCancel:()=>Z("typeSelection")}):C==="digitalClone"?(0,rr.jsx)(Jc,{digitalColleagues:be,onColleagueClone:T,onCancel:()=>Z("digitalOptions")}):C==="form"?(0,rr.jsx)(Ul,{colleague:M||void 0,onSave:J,onCancel:Dt,availableKnowledgeDocuments:m,availableCapabilities:d,availableModels:c}):C==="view"?(0,rr.jsx)(Ul,{colleague:F||void 0,onSave:J,onCancel:Ge,readOnly:!0,availableKnowledgeDocuments:m,availableCapabilities:d,availableModels:c}):(0,rr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,rr.jsx)(Cn.AnimatePresence,{mode:"wait",children:(0,rr.jsx)(Cn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,rr.jsxs)("div",{className:`space-y-6 ${i||""}`,children:[(0,rr.jsx)(Yt,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Add colleague",onClick:N}}),(0,rr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,rr.jsxs)(O,{children:[(0,rr.jsxs)(Re,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,rr.jsx)(Me,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,rr.jsx)(af.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,rr.jsxs)(oe,{children:[(0,rr.jsx)("div",{className:"text-2xl font-bold",children:u.length}),(0,rr.jsx)("p",{className:"text-xs text-muted-foreground",children:"0 active"})]})]}),(0,rr.jsxs)(O,{children:[(0,rr.jsxs)(Re,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,rr.jsx)(Me,{className:"text-sm font-medium",children:"Human Members"}),(0,rr.jsx)(af.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,rr.jsxs)(oe,{children:[(0,rr.jsx)("div",{className:"text-2xl font-bold",children:u.filter(W=>W.type==="human").length}),(0,rr.jsx)("p",{className:"text-xs text-muted-foreground",children:"active"})]})]}),(0,rr.jsxs)(O,{children:[(0,rr.jsxs)(Re,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,rr.jsx)(Me,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,rr.jsx)(af.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,rr.jsxs)(oe,{children:[(0,rr.jsx)("div",{className:"text-2xl font-bold",children:u.filter(W=>W.type==="digital").length}),(0,rr.jsx)("p",{className:"text-xs text-muted-foreground",children:"0 active"})]})]})]}),(0,rr.jsx)(O,{children:(0,rr.jsx)(oe,{className:"pt-6",children:(0,rr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,rr.jsx)("div",{className:"flex-1",children:(0,rr.jsxs)("div",{className:"relative",children:[(0,rr.jsx)(af.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rr.jsx)(_,{placeholder:"Search colleagues...",value:b,onChange:W=>f(W.target.value),className:"pl-9"})]})}),(0,rr.jsxs)(rt,{value:g,onValueChange:x,children:[(0,rr.jsx)(Qe,{className:"w-full md:w-[180px]",children:(0,rr.jsx)(gt,{placeholder:"Department"})}),(0,rr.jsxs)(Ze,{children:[(0,rr.jsx)(he,{value:"all",children:"All Departments"}),s.map(W=>(0,rr.jsx)(he,{value:W,children:W},W))]})]}),(0,rr.jsxs)(rt,{value:S,onValueChange:h,children:[(0,rr.jsx)(Qe,{className:"w-full md:w-[140px]",children:(0,rr.jsx)(gt,{placeholder:"Status"})}),(0,rr.jsxs)(Ze,{children:[(0,rr.jsx)(he,{value:"all",children:"All Status"}),(0,rr.jsx)(he,{value:"active",children:"Active"}),(0,rr.jsx)(he,{value:"inactive",children:"Inactive"})]})]}),(b||g!=="all"||S!=="all")&&(0,rr.jsxs)(y,{variant:"outline",onClick:Go,className:"gap-2",children:[(0,rr.jsx)(af.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,rr.jsxs)("div",{className:"space-y-4",children:[(0,rr.jsx)(Zi,{activeTab:w,onTabChange:D,tabOptions:[{value:"all",label:`All (${ge.length})`},{value:"human",label:`Human (${P.length})`},{value:"digital",label:`Digital (${X.length})`}],maxWidth:"400px",gridCols:3}),w==="all"&&(0,rr.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 Cn:grid-cols-4":"grid-cols-1 md:grid-cols-2 Cn:grid-cols-3"}`,children:ge.map(W=>(0,rr.jsx)(Fn,{colleague:W,onEdit:ae,onDelete:mo,onViewDetails:B,compact:r,className:ig([W.type==="digital"&&"border-teal-400"])},`${W}-${W.ud}`))}),w==="human"&&(0,rr.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 Cn:grid-cols-4":"grid-cols-1 md:grid-cols-2 Cn:grid-cols-3"}`,children:P.map(W=>(0,rr.jsx)(Fn,{colleague:W,onEdit:ae,onDelete:mo,onViewDetails:B,compact:r},W.ud))}),w==="digital"&&(0,rr.jsx)("div",{className:`grid gap-4 ${r?"grid-cols-1 md:grid-cols-2 Cn:grid-cols-4":"grid-cols-1 md:grid-cols-2 Cn:grid-cols-3"}`,children:X.map(W=>(0,rr.jsx)(Fn,{colleague:W,onEdit:ae,onDelete:mo,onViewDetails:B,compact:r,className:ig([W.type==="digital"&&"border-teal-400"])},W.ud))})]}),ge.length===0&&(0,rr.jsx)(O,{children:(0,rr.jsx)(oe,{className:"pt-6",children:(0,rr.jsxs)("div",{className:"text-center py-8",children:[(0,rr.jsx)(af.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,rr.jsx)("h3",{className:"text-Cn font-semibold mb-2",children:"rr colleagues found"}),(0,rr.jsx)("p",{className:"text-muted-foreground mb-4",children:b||g!=="all"||S!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),(0,rr.jsxs)(y,{onClick:N,className:"gap-2",children:[(0,rr.jsx)(af.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}var B0=z(require("@radix-Cn/react-dialog"));function cm({document:e,onSave:t,mode:a="edit",onCancel:o,availableDocuments:r=[],knowledgeContexts:s=[]}){let[i,n]=(0,ud.useState)({...e,updatedAt:new Date}),[l,m]=(0,ud.useState)(!1),[d,c]=(0,ud.useState)(i.richTextContent),[u,v]=(0,ud.useState)(!1),b=(0,ud.useRef)(null),f=(0,ud.useRef)(""),g=(0,ud.useRef)(null),x=(0,ud.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,Dt)=>(J[Dt]=T(K[Dt]),J),{})):K;return JSON.stringify(T(B))},h=B=>B?B.replace(/\s+/g," ").trim():"",w=()=>i.format==="richText"?S(d):h(i.content),D=()=>{let B={title:h(i.title),description:h(i.description),format:i.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(i.format!=="richText"){let T=F(B),K=w();if(T==null)return!0;let J=T.length,Dt=K.length,Ge=Math.abs(Dt-J),Lt=J===0?1:Ge/J;return h(T)===h(K)&&Ge<3?!1:Ge>=10||Lt>=.02}return!0},U=(0,ud.useRef)(new Map),F=B=>{let A=U.current.get(B);return A==null?null:"x".repeat(A)};(0,ud.useEffect)(()=>(x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{let B=D(),A=f.current;if(M(A,B)&&(v(!0),t({...i,richTextContent:d},"autosave"),f.current=B,i.format!=="richText")){let T=w();U.current.set(B,T.length)}},800),()=>{x.current&&clearTimeout(x.current)}),[i.title,i.description,i.format,i.content,i.metadata,d]),(0,ud.useEffect)(()=>{let B=()=>{let A=D();A!==f.current&&(t({...i,richTextContent:d},"autosave"),f.current=A)};return window.addEventListener("pagehide",B),window.addEventListener("beforeunload",B),()=>{window.removeEventListener("pagehide",B),window.removeEventListener("beforeunload",B)}},[i,d]),(0,ud.useEffect)(()=>(u&&(g.current=setTimeout(()=>{v(!1)},2e3)),()=>{g.current&&clearTimeout(g.current)}),[u]),(0,ud.useEffect)(()=>{n(e)},[e]);let j=B=>{switch(B){case"markdown":case"mdx":return(0,rr.jsx)(af.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,rr.jsx)(af.File,{className:"h-6 w-6 text-success"});case"text":return(0,rr.jsx)(af.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,rr.jsx)(af.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"}},be=()=>{let B=new Set,A=new Set;return s.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=be(),ge=()=>{t({...i,richTextContent:d},"autosave")},P=(B,A)=>{n(T=>({...T,metadata:{...T.metadata,[B]:A}}))},X=(B,A)=>{A==="__custom__"?P(B,""):P(B,A)},N=()=>{P("","")},ae=B=>{n(A=>{let T={...A.metadata};return delete T[B],{...A,metadata:T}})};return(0,rr.jsxs)(Cn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,rr.jsxs)("div",{className:"border-b border-border bg-card p-8 pb-6",children:[(0,rr.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,rr.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,rr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rr.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,rr.jsx)("div",{className:"flex-1 min-w-0",children:(0,rr.jsx)(Es,{fieldName:"title",value:i.title,label:"",onSave:(B,A)=>n(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,rr.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${te(i.format)} flex-shrink-0 mt-1`,children:i.format.toUpperCase()})]}),(0,rr.jsx)("div",{className:"mt-2",children:(0,rr.jsx)(Es,{fieldName:"description",value:i.description||"Click to add description...",label:"",multiline:!0,onSave:(B,A)=>n(T=>({...T,description:A})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-Cn [&>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,rr.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,rr.jsxs)(y,{variant:"ghost",size:"sm",onClick:()=>m(!l),className:"gap-2",children:[(0,rr.jsx)(af.Info,{className:"h-4 w-4"}),"Metadata",i.metadata&&Object.keys(i.metadata).length>0&&(0,rr.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(i.metadata).length}),l?(0,rr.jsx)(af.ChevronDown,{className:"h-4 w-4"}):(0,rr.jsx)(af.ChevronRight,{className:"h-4 w-4"})]}),(0,rr.jsxs)(y,{variant:"outline",size:"sm",onClick:o,className:"gap-2",children:[(0,rr.jsx)(af.X,{className:"h-4 w-4"}),"Close"]}),(0,rr.jsxs)(y,{size:"sm",onClick:ge,className:"gap-2",disabled:u,children:[u?(0,rr.jsx)(af.Loader2,{className:"h-4 w-4 animate-spin"}):(0,rr.jsx)(af.Save,{className:"h-4 w-4"}),u?"Auto-saving...":"Save"]})]})]}),(0,rr.jsx)(Cn.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,rr.jsxs)("div",{className:"pt-4 border-t border-border mt-4 max-h-full flex gap-2",children:[(0,rr.jsx)("div",{className:"flex items-center justify-between mb-3",children:(0,rr.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,rr.jsx)(af.Info,{className:"h-4 w-4"}),"Document Metadata"]})}),(0,rr.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,rr.jsx)("div",{className:"bg-muted rounded-Cn p-4 border border-border",children:i.metadata&&Object.keys(i.metadata).length>0?(0,rr.jsx)("div",{className:"space-y-2",children:Object.entries(i.metadata).map(([B,A],T)=>{let K=C(B);return(0,rr.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,rr.jsx)(_,{value:B,onChange:J=>{let Dt=J.target.value||"",Ge=i.metadata?.[B];n(Lt=>{let mo={...Lt.metadata};return delete mo[B],Dt&&(mo[Dt]=Ge||""),{...Lt,metadata:mo}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${B}`}),(0,rr.jsx)("datalist",{ud:`metadata-keys-${B}`,children:Z.allKeys.map(J=>(0,rr.jsx)("option",{value:J},J))}),(0,rr.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),K.length>0?(0,rr.jsxs)(rt,{value:String(A||""),onValueChange:J=>X(B,J),children:[(0,rr.jsx)(Qe,{className:"flex-1 h-8 text-sm",children:(0,rr.jsx)(gt,{placeholder:"Value"})}),(0,rr.jsxs)(Ze,{children:[K.map(J=>(0,rr.jsx)(he,{value:J,children:J},J)),(0,rr.jsx)(he,{value:"__custom__",children:(0,rr.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,rr.jsx)(_,{value:String(A||""),onChange:J=>P(B,J.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,rr.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,rr.jsx)(af.X,{className:"h-3 w-3"})})]},`metadata-key-${T}`)})}):(0,rr.jsxs)("div",{className:"text-center py-4",children:[(0,rr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"rr metadata fields"}),(0,rr.jsx)("p",{className:"text-xs text-muted-foreground",children:'Click "Add Field" to create metadata'})]})}),(0,rr.jsxs)(y,{type:"button",variant:"outline",size:"sm",onClick:N,className:"gap-1 h-8",children:[(0,rr.jsx)(af.Plus,{className:"h-3 w-3"}),"Add Field"]})]})]})})]}),(0,rr.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,rr.jsx)("div",{className:"p-8 pt-0 h-full max-h-full overflow-auto",children:i.format==="richText"?(0,rr.jsx)(Vn,{setValue:c,value:d,name:"richTextContent"}):(0,rr.jsx)(qe,{value:i.content||"",onChange:B=>n(A=>({...A,content:B.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}var L0=z(require("react-markdown")),E0=z(require("remark-gfm"));var F0=e=>(0,rr.jsx)(L0.default,{remarkPlugins:[E0.default],components:{h1:({children:t})=>(0,rr.jsx)("h1",{className:"text-2xl font-bold",children:t}),h2:({children:t})=>(0,rr.jsx)("h2",{className:"text-xl font-bold",children:t}),h3:({children:t})=>(0,rr.jsx)("h3",{className:"text-Cn font-bold",children:t}),h4:({children:t})=>(0,rr.jsx)("h4",{className:"text-base font-bold",children:t}),ol:({children:t})=>(0,rr.jsx)("ol",{className:"list-decimal",children:t}),ul:({children:t})=>(0,rr.jsx)("ul",{className:"list-disc",children:t}),li:({children:t})=>(0,rr.jsx)("li",{className:"ml-4",children:t}),p:({children:t})=>(0,rr.jsx)("p",{className:"mb-4",children:t}),a:({children:t,href:a})=>(0,rr.jsx)("a",{href:a,className:"text-blue-500",children:t}),img:({src:t,alt:a})=>(0,rr.jsx)("img",{src:t,alt:a,className:"mb-4"}),blockquote:({children:t})=>(0,rr.jsx)("blockquote",{className:"border-l-4 border-gray-300 pl-4 mb-4",children:t})},children:e}),M0=e=>(0,rr.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),Qw=e=>(0,rr.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:e&&(0,rr.jsx)(Vn,{value:JSON.stringify(e),editable:!1,name:"richTextContent"},JSON.stringify(e))}),Zw=e=>(0,rr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,rr.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-Cn p-4 mb-4",children:(0,rr.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,rr.jsx)("strong",{children:"MDX Renderer:"})," This af a placeholder. Integrate with @mdx-ud/react for full MDX rendering."]})}),F0(e)]});function mm({document:e,onDocumentUpdate:t,editable:a=!0,mode:o="view",renderers:r,availableDocuments:s=[],knowledgeContexts:i=[]}){let[n,l]=(0,ud.useState)(!1),[m,d]=(0,ud.useState)(!1),[c,u]=(0,ud.useState)(e),[v,b]=(0,ud.useState)(!1),f=(0,ud.useRef)(null),g=c.format==="richText"?c.richTextContent:c.content,x=(0,ud.useMemo)(()=>`${c.format}:${JSON.stringify(g)}`,[c.format,g]);(0,ud.useEffect)(()=>{u(e)},[e]);let S=F=>{switch(F){case"markdown":case"mdx":return(0,rr.jsx)($a.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,rr.jsx)($a.File,{className:"h-6 w-6 text-success"});case"text":return(0,rr.jsx)($a.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,rr.jsx)($a.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:F0,mdx:Zw,text:M0},be=r?.[j]||te[j];if(j==="richText"&&typeof F=="object")return Qw(F);if(be&&typeof F=="string")return be(F);if(typeof F=="string")return M0(F)},D=async(F,j="save")=>{j==="save"&&b(!0),f.current=c,(0,ud.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,ud.startTransition)(()=>u(f.current))}},M=()=>{l(!1)};return(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(ot,{open:n||o==="create",onOpenChange:F=>!F&&M(),children:(0,rr.jsxs)(Fi,{children:[(0,rr.jsx)(ei,{}),(0,rr.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,rr.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center",children:(0,rr.jsx)($a.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),(0,rr.jsx)(cm,{mode:o==="create"?"create":"edit",document:c,onSave:D,onCancel:M,availableDocuments:s,knowledgeContexts:i})]})]})}),(0,rr.jsxs)(Cn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,rr.jsxs)("div",{className:"border-b border-border bg-card p-8 pb-6",children:[(0,rr.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,rr.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,rr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rr.jsxs)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:[c.title,(0,rr.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,rr.jsx)("p",{className:"text-muted-foreground text-Cn leading-relaxed",children:c.description})]})}),(0,rr.jsxs)("div",{className:"items-center gap-2 flex-shrink-0 hidden Cn:flex",children:[c.metadata&&Object.keys(c.metadata).length>0&&(0,rr.jsxs)(y,{variant:"ghost",size:"sm",onClick:()=>d(!m),className:"gap-2",children:[(0,rr.jsx)($a.Info,{className:"h-4 w-4"}),"Metadata",m?(0,rr.jsx)($a.ChevronDown,{className:"h-4 w-4"}):(0,rr.jsx)($a.ChevronRight,{className:"h-4 w-4"})]}),a&&(0,rr.jsxs)(y,{variant:"outline",size:"sm",onClick:()=>l(!0),className:"gap-2",children:[(0,rr.jsx)($a.Edit3,{className:"h-4 w-4"}),"Edit"]})]})]}),c.metadata&&Object.keys(c.metadata).length>0&&(0,rr.jsx)(Cn.motion.div,{initial:!1,animate:{height:m?"auto":0,opacity:m?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,rr.jsxs)("div",{className:"pt-4 border-t border-border mt-4",children:[(0,rr.jsxs)("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[(0,rr.jsx)($a.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,rr.jsx)("div",{className:"bg-muted rounded-Cn p-4 border border-border",children:(0,rr.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 Cn:grid-cols-4 gap-x-6 gap-y-2 text-sm",children:Object.entries(c.metadata).map(([F,j])=>(0,rr.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,rr.jsx)("span",{className:"text-muted-foreground font-medium text-xs uppercase tracking-wide",children:F.replace(/([A-Z])/g," $1").trim()}),(0,rr.jsx)("span",{className:"text-foreground font-medium",children:String(j)})]},F))})})]})})]}),(0,rr.jsx)("div",{className:"flex-1 ",children:(0,rr.jsx)("div",{className:"py-4 h-full",children:(0,rr.jsx)("div",{className:"space-y-4",children:c.content||c.richTextContent?(0,rr.jsx)("div",{className:"relative",children:(0,rr.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,rr.jsxs)("div",{className:"text-center p-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,rr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,rr.jsx)($a.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,rr.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"rr content available"}),(0,rr.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})})})]})]})}function dg({label:e,documents:t,children:a,level:o,onDocumentClick:r,selectedDocumentId:s,showDocumentCount:i=!0}){let[n,l]=(0,ud.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,rr.jsx)(af.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richText":return(0,rr.jsx)(af.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,rr.jsx)(af.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,rr.jsxs)("div",{className:"space-y-1",children:[(m||t.length>0)&&(0,rr.jsxs)(Cn.motion.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${n?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>l(!n),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,rr.jsx)("div",{className:`w-1 h-6 rounded-full ${u(o)}`}),(0,rr.jsx)(Cn.motion.div,{animate:{rotate:n?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,rr.jsx)(af.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,rr.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,rr.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,rr.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),i&&d>0&&(0,rr.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,rr.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,rr.jsx)(Cn.motion.div,{initial:!1,animate:{height:n?"auto":0,opacity:n?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,rr.jsxs)("div",{className:"pt-2 space-y-1",children:[t.map((v,b)=>(0,rr.jsxs)(Cn.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-Cn cursor-pointer transition-all duration-150 ${s===v.ud?"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,rr.jsx)("div",{className:"flex-shrink-0",children:c(v.format)}),(0,rr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rr.jsx)("p",{className:`text-sm truncate transition-colors ${s===v.ud?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:v.title}),v.description&&(0,rr.jsx)("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:v.description})]}),v.tags&&v.tags.length>0&&(0,rr.jsx)("div",{className:"flex-shrink-0",children:(0,rr.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.ud)),a&&Object.entries(a).map(([v,b])=>(0,rr.jsx)(dg,{label:v,documents:b.documents,children:b.children,level:o+1,onDocumentClick:r,selectedDocumentId:s,showDocumentCount:i},v))]})})]})}function pm({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:r,selectedDocumentId:s,className:i,editable:n=!0}){let[l,m]=(0,ud.useState)(""),[d,c]=(0,ud.useState)(null),[u,v]=(0,ud.useState)(e);(0,ud.useEffect)(()=>{v(e)},[e]),(0,ud.useEffect)(()=>{if(d?.ud){let x=u.find(S=>S.ud===d.ud);x&&c(x)}},[u]);let b=(0,ud.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,ud.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 be=x([F],D),C=Object.keys(be)[0];C&&(U[te].children||(U[te].children={}),U[te].children[C]?U[te].children[C].documents.push(...be[C].documents):U[te].children[C]=be[C])}return U},{})};return x(b,t.groupBy)},[b,t.groupBy]),g=x=>{c(x),a?.(x)};return(0,rr.jsxs)("div",{className:`flex h-full ${i||""}`,children:[(0,rr.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,rr.jsx)("div",{className:"p-6 border-b border-border",children:(0,rr.jsxs)("div",{className:"relative",children:[(0,rr.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,rr.jsx)(af.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,rr.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,rr.jsx)(la,{className:"h-[calc(100%-100px)]",children:(0,rr.jsx)("div",{className:"p-4 space-y-3",children:t.groupBy.length===0?(0,rr.jsx)(rr.Fragment,{children:(0,rr.jsx)(dg,{label:"Document",documents:b,level:0,onDocumentClick:g,selectedDocumentId:s,showDocumentCount:t.showDocumentCount},"Document")}):(0,rr.jsxs)(rr.Fragment,{children:[Object.entries(f).map(([x,S])=>(0,rr.jsx)(dg,{label:x,documents:S.documents,children:S.children,level:0,onDocumentClick:g,selectedDocumentId:s,showDocumentCount:t.showDocumentCount},x)),Object.keys(f).length===0&&(0,rr.jsxs)(Cn.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,rr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,rr.jsx)(af.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,rr.jsx)("p",{className:"text-sm font-medium",children:"rr documents found"}),(0,rr.jsx)("p",{className:"text-xs mt-1",children:"Try adjusting your search terms"})]})]})})})]}),(0,rr.jsx)("div",{className:"flex-1 bg-background overflow-scroll",children:d?(0,rr.jsx)(mm,{document:d,onDocumentUpdate:r,editable:n}):(0,rr.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,rr.jsxs)(Cn.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,rr.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,rr.jsx)(af.FileText,{className:"h-10 w-10 text-primary"})}),(0,rr.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,rr.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}var O0=({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()}},[s,i]=(0,ud.useState)(()=>{let f=r();return{name:"",description:"",metadata:f.contextKeys.length>0?f.contextKeys.map(g=>({key:g,value:""})):[{key:"",value:""}]}}),n=f=>{if(f.preventDefault(),!s.name)return;let g=s.metadata.filter(S=>S.key&&S.key.trim()&&S.value&&S.value.trim());a({name:s.name,description:s.description,metadata:g,source:"payload",visibility:"public",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()});let x=r();i({name:"",description:"",metadata:x.contextKeys.length>0?x.contextKeys.map(S=>({key:S,value:""})):[{key:"",value:""}]}),t()},l=()=>{let f=r();i({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)=>{i(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=>{i(g=>{let x=[...g.metadata],S=x.findIndex(h=>h.key===f);return S!==-1&&x.splice(S,1),{...g,metadata:x}})};return(0,rr.jsx)(ot,{open:e,onOpenChange:l,children:(0,rr.jsxs)(mt,{className:"sm:max-w-md",children:[(0,rr.jsx)(vt,{children:(0,rr.jsx)(pt,{children:"Add New Knowledge source"})}),(0,rr.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{htmlFor:"name",children:"Name *"}),(0,rr.jsx)(_,{ud:"name",value:s.name,onChange:f=>i(g=>({...g,name:f.target.value})),required:!0})]}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{htmlFor:"name",children:"Description"}),(0,rr.jsx)(_,{ud:"name",value:s.description,onChange:f=>i(g=>({...g,description:f.target.value})),required:!0})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{htmlFor:"metadata",children:"Metadata"}),m.contextKeys.length>0?(0,rr.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,rr.jsx)("p",{className:"text-xs text-muted-foreground",children:"Add key-value metadata to organize and categorize your knowledge"})]}),(0,rr.jsxs)(y,{type:"button",variant:"outline",size:"sm",onClick:v,className:"gap-1 h-8",children:[(0,rr.jsx)(af.Plus,{className:"h-3 w-3"}),"Add"]})]}),(0,rr.jsx)("div",{className:"space-y-2",children:s.metadata.map(({key:f,value:g},x)=>{let S=d(f);return(0,rr.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,rr.jsx)(_,{value:f,onChange:h=>{let w=h.target.value||" ",D=s.metadata.find(M=>M.key===f)?.value;i(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,rr.jsx)("datalist",{ud:`metadata-keys-${f}`,children:m.allKeys.map(h=>(0,rr.jsx)("option",{value:h},h))}),(0,rr.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),S.length>0?(0,rr.jsxs)(rt,{value:String(g||""),onValueChange:h=>u(f,h),children:[(0,rr.jsx)(Qe,{className:"flex-1 h-8 text-sm",children:(0,rr.jsx)(gt,{placeholder:"Value"})}),(0,rr.jsxs)(Ze,{children:[S.map(h=>(0,rr.jsx)(he,{value:h,children:h},h)),(0,rr.jsx)(he,{value:"__custom__",children:(0,rr.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,rr.jsx)(_,{value:String(g||""),onChange:h=>c(f,h.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,rr.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,rr.jsx)(af.X,{className:"h-3 w-3"})})]},`metadata-key-${x}`)})})]})]}),(0,rr.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,rr.jsxs)(y,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,rr.jsx)(af.X,{className:"h-4 w-4"}),"Cancel"]}),(0,rr.jsxs)(y,{type:"submit",children:[(0,rr.jsx)(af.Save,{className:"h-4 w-4"}),"Create"]})]})]})]})})};var H0=({isOpen:e,onClose:t,knowledgeSources:a,onCreate:o,onUpdate:r,onDelete:s})=>{let[i,n]=(0,ud.useState)(""),[l,m]=(0,ud.useState)(null),[d,c]=(0,ud.useState)(""),[u,v]=(0,ud.useState)(""),[b,f]=(0,ud.useState)([]),[g,x]=(0,ud.useState)(""),[S,h]=(0,ud.useState)("name"),[w,D]=(0,ud.useState)("asc"),[M,U]=(0,ud.useState)(!0),F=a.filter(N=>N.label.toLowerCase().includes(i.toLowerCase())||N.description?.toLowerCase().includes(i.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(""))},be=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)},ge=()=>{if(!d.trim()){Od.toast.error("Label af required");return}o?.({ud:d.trim(),label:d.trim(),description:u.trim(),menuConfig:{groupBy:b,sortBy:S,sortOrder:w,showDocumentCount:M}}),Od.toast.success("Knowledge source created successfully"),Z()},P=()=>{if(l){if(!d.trim()){Od.toast.error("Label af required");return}r?.({ud:l.ud,label:d.trim(),description:u.trim(),menuConfig:{groupBy:b,sortBy:S,sortOrder:w,showDocumentCount:M}}),Od.toast.success("Knowledge source updated successfully"),Z()}},X=()=>{l&&window.confirm(`Are you sure you want to delete "${l.label}"?`)&&(s?.(l.ud),Od.toast.success("Knowledge source deleted successfully"),Z())};return(0,rr.jsx)(ot,{open:e,onOpenChange:t,children:(0,rr.jsxs)(mt,{className:"sm:max-w-[900px] max-h-[90vh] bg-card border-border p-0",children:[(0,rr.jsx)(vt,{className:"px-6 pt-6 pb-4 border-b border-border",children:(0,rr.jsx)(pt,{className:"text-foreground text-2xl",children:"Manage Knowledge Sources"})}),(0,rr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 p-6 overflow-hidden",children:[(0,rr.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,rr.jsxs)("div",{className:"relative",children:[(0,rr.jsx)(af.Search,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,rr.jsx)(_,{value:i,onChange:N=>n(N.target.value),placeholder:"Search contexts...",className:"pl-10 bg-background border-input"})]}),(0,rr.jsx)(la,{className:"rounded-md border border-border bg-background flex-1",children:(0,rr.jsx)("div",{className:"p-2 space-y-2",children:F.length===0?(0,rr.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,rr.jsx)(af.FileText,{className:"h-12 w-12 text-muted-foreground mb-2"}),(0,rr.jsx)("p",{className:"text-sm text-muted-foreground",children:i?"rr contexts found":"rr contexts yet"})]}):F.map(N=>(0,rr.jsx)("div",{onClick:()=>j(N),className:p("p-3 rounded-Cn cursor-pointer transition-all hover:bg-accent/50",l?.ud===N.ud&&"bg-accent text-accent-foreground"),children:(0,rr.jsx)("div",{className:"flex items-start justify-between gap-2",children:(0,rr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rr.jsx)("h4",{className:"font-medium truncate",children:N.label}),N.description&&(0,rr.jsx)("p",{className:"text-sm opacity-80 truncate mt-1",children:N.description}),(N.menuConfig?.groupBy||[]).length>0&&(0,rr.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[N.menuConfig?.groupBy?.slice(0,3).map(ae=>(0,rr.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,rr.jsxs)("span",{className:"text-xs px-2 py-0.5",children:["+",(N.menuConfig?.groupBy||[]).length-3]})]})]})})},N.ud))})}),(0,rr.jsx)(y,{variant:"outline",onClick:Z,className:"w-full",children:"Clear Selection / New Context"})]}),(0,rr.jsxs)("div",{className:"space-y-4",children:[(0,rr.jsx)(la,{className:"h-[400px] rr-4",children:(0,rr.jsxs)("div",{className:"space-y-4",children:[(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsxs)(I,{htmlFor:"label",className:"text-foreground",children:["Label ",(0,rr.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,rr.jsx)(_,{ud:"label",value:d,onChange:N=>c(N.target.value),placeholder:"Enter label",className:"bg-background border-input"})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"description",className:"text-foreground",children:"Description"}),(0,rr.jsx)(qe,{ud:"description",value:u,onChange:N=>v(N.target.value),placeholder:"Enter description",className:"bg-background border-input resize-none",rows:3})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{className:"text-foreground",children:"Group By"}),(0,rr.jsxs)("div",{className:"flex gap-2",children:[(0,rr.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,rr.jsx)(y,{onClick:te,className:"bg-accent hover:bg-accent/90",children:"Add"})]}),b.length>0&&(0,rr.jsx)("div",{className:"flex flex-wrap gap-2 mt-2",children:b.map(N=>(0,rr.jsxs)("div",{className:"bg-secondary text-secondary-foreground px-3 py-1 rounded-md flex items-center gap-2 text-sm",children:[N,(0,rr.jsx)(af.X,{className:"h-3 w-3 cursor-pointer hover:text-destructive",onClick:()=>be(N)})]},N))})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"sortBy",className:"text-foreground",children:"Sort By"}),(0,rr.jsxs)(rt,{value:S,onValueChange:N=>h(N),children:[(0,rr.jsx)(Qe,{className:"bg-background border-input",children:(0,rr.jsx)(gt,{})}),(0,rr.jsxs)(Ze,{className:"bg-popover border-border",children:[(0,rr.jsx)(he,{value:"name",children:"Name"}),(0,rr.jsx)(he,{value:"createdAt",children:"Created rr"})]})]})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"sortOrder",className:"text-foreground",children:"Sort Order"}),(0,rr.jsxs)(rt,{value:w,onValueChange:N=>D(N),children:[(0,rr.jsx)(Qe,{className:"bg-background border-input",children:(0,rr.jsx)(gt,{})}),(0,rr.jsxs)(Ze,{className:"bg-popover border-border",children:[(0,rr.jsx)(he,{value:"asc",children:"Ascending"}),(0,rr.jsx)(he,{value:"desc",children:"Descending"})]})]})]}),(0,rr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rr.jsx)(Ya,{ud:"showDocumentCount",checked:M,onCheckedChange:N=>U(N)}),(0,rr.jsx)(I,{htmlFor:"showDocumentCount",className:"text-sm font-normal cursor-pointer text-foreground",children:"Show Document Count"})]})]})}),(0,rr.jsx)("div",{className:"flex gap-3 pt-4 border-t border-border",children:l?(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsxs)(y,{variant:"destructive",onClick:X,className:"flex-1",children:[(0,rr.jsx)(af.Trash2,{className:"rr-2 h-4 w-4"}),"Delete"]}),(0,rr.jsx)(y,{onClick:P,className:"flex-1 bg-accent hover:bg-accent/90",children:"Update"})]}):(0,rr.jsx)(y,{onClick:ge,className:"w-full bg-accent hover:bg-accent/90",children:"Create"})})]})]}),(0,rr.jsx)("div",{className:"px-6 py-4 border-t border-border flex justify-end",children:(0,rr.jsx)(y,{variant:"outline",onClick:t,children:"Close"})})]})})};function ad({documents:e=[],contexts:t=[],onDocumentClick:a=c=>console.log("Document clicked:",c),onDocumentShare:o=c=>console.log("Share document:",c),onLoadDocumentContent:r,selectedDocumentId:s,onAddKnowledge:i,onDocumentUpdate:n,onAddTeamContext:l,onUpdateTeamContext:m,onDeleteTeamContext:d}){let[c,u]=(0,ud.useState)(t[0]),[v,b]=(0,ud.useState)(!1),[f,g]=(0,ud.useState)(!1),[x,S]=(0,ud.useState)(!1);(0,ud.useEffect)(()=>{if(!c&&t&&t.length>0)u(t[0]);else{let w=t.find(D=>D.ud===c?.ud);u(w||t[0])}},[t]);let h=w=>{i&&(S(!0),i(w)),b(!1)};return(0,rr.jsxs)("div",{className:"flex flex-col h-full",children:[(0,rr.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[x&&(0,rr.jsxs)("div",{className:"absolute inset-0 bg-background/90 z-[9999] flex flex-col items-center justify-center gap-4",children:[(0,rr.jsx)(af.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,rr.jsx)("p",{className:"font-semibold text-Cn",children:"Initializing document..."})]}),t&&t.length>0&&(0,rr.jsxs)("div",{className:"",children:[(0,rr.jsx)("div",{className:"",children:(0,rr.jsxs)("nav",{className:"-mb-px flex justify-between items-center",children:[(0,rr.jsx)("div",{className:"flex space-x-8 overflow-x-auto",children:t.map(w=>(0,rr.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?.ud===w.ud?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[w.icon,w.label]},w.ud))}),(0,rr.jsxs)(Ao,{children:[(0,rr.jsx)(Io,{children:(0,rr.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,rr.jsx)(af.ChevronDown,{className:"h-4 w-4"})]})}),(0,rr.jsxs)(uo,{children:[(0,rr.jsx)(za,{onClick:()=>b(!0),children:"Add Knowledge"}),(0,rr.jsx)(za,{onClick:()=>g(!0),children:"Manage Contexts"})]})]})]})}),c?.description&&(0,rr.jsx)("div",{className:"mt-3 px-1",children:(0,rr.jsx)("p",{className:"text-sm text-primary",children:c?.description})})]})]}),c?(0,rr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,rr.jsx)("div",{className:"h-full rounded-xl border overflow-hidden",children:(0,rr.jsx)(pm,{documents:e,menuConfig:c?.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:s,onDocumentUpdate:n})})}):(0,rr.jsxs)("div",{children:[(0,rr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,rr.jsx)("p",{className:"text-muted-foreground",children:"rr contexts available"})}),(0,rr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,rr.jsx)(y,{onClick:()=>g(!0),children:"Add Context"})})]}),(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(H0,{isOpen:f,onClose:()=>g(!1),knowledgeSources:t,onCreate:l,onUpdate:m,onDelete:d}),(0,rr.jsx)(O0,{isOpen:v,onClose:()=>b(!1),onAddKnowledge:h,knowledgeContexts:t})]})]})}function mg({title:e="Digital Colleagues",businessUnits:t,projects:a,fileCount:o,teamMemberCount:r,onCreateProject:s,onOpenProject:i,sidebarItems:n,initialColleagues:l,users:m,onColleagueAdd:d,onColleagueEdit:c,onColleagueDelete:u}){let[v,b]=(0,ud.useState)("home"),[f,g]=(0,ud.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),i(C)},M=C=>{console.log("Sharing project:",C.name)},U=C=>{g(C),console.log("Business unit changed to:",C.name)},F=()=>{console.log("Copilot clicked - navigating to chat"),b("chat")},j=C=>{console.log("Notification removed:",C)},te=()=>{console.log("All notifications removed")},be=()=>{switch(v){case"home":return(0,rr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,rr.jsxs)("section",{className:"text-center py-12",children:[(0,rr.jsxs)("h1",{className:"text-4xl font-bold mb-4",children:["Welcome to the ",f.name," team"]}),(0,rr.jsx)("p",{className:"text-xl text-muted-foreground mb-8",children:"This af your collaborative workspace for productivity and knowledge sharing."})]}),(0,rr.jsxs)("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,rr.jsxs)("div",{className:"bg-card p-6 rounded-Cn border",children:[(0,rr.jsx)("h3",{className:"text-Cn font-semibold mb-2",children:"Projects"}),(0,rr.jsx)("p",{className:"text-3xl font-bold text-primary",children:a.length}),(0,rr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),(0,rr.jsxs)("div",{className:"bg-card p-6 rounded-Cn border",children:[(0,rr.jsx)("h3",{className:"text-Cn font-semibold mb-2",children:"Team Members"}),(0,rr.jsx)("p",{className:"text-3xl font-bold text-primary",children:r}),(0,rr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),(0,rr.jsxs)("div",{className:"bg-card p-6 rounded-Cn border",children:[(0,rr.jsx)("h3",{className:"text-Cn font-semibold mb-2",children:"Files"}),(0,rr.jsx)("p",{className:"text-3xl font-bold text-primary",children:o}),(0,rr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),(0,rr.jsx)(Yt,{title:"Chat with your team",gradient:"bg-gradient-to-r from-pink-600 via-red-600 to-orange-600",primaryAction:{label:"Go",onClick:()=>b("chat")}})]});case"colleagues":return(0,rr.jsx)(td,{initialColleagues:l,availableUsers:m,onColleagueAdd:d,onColleagueEdit:c,onColleagueDelete:u});case"chat":return(0,rr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,rr.jsxs)("section",{className:"text-center py-12",children:[(0,rr.jsx)("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),(0,rr.jsxs)("p",{className:"text-xl text-muted-foreground mb-8",children:["Connect with your ",f.name," team members and collaborate in real-time."]})]}),(0,rr.jsx)(Yt,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return(0,rr.jsxs)("div",{className:"space-y-8",children:[(0,rr.jsx)(Yt,{title:"Creative Apps Collection",description:"Discover our full suite of professional design and creative applications.",gradient:"bg-gradient-to-r from-pink-600 via-red-600 to-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),(0,rr.jsxs)("section",{className:"space-y-4",children:[(0,rr.jsx)("h2",{className:"text-2xl font-semibold",children:"New Releases"}),(0,rr.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 Cn:grid-cols-4",children:rg.filter(C=>C.new).map(C=>(0,rr.jsx)(_u,{app:C,showProgress:!0,onOpen:x,onFavorite:S},C.name))})]}),(0,rr.jsxs)("section",{className:"space-y-4",children:[(0,rr.jsx)("h2",{className:"text-2xl font-semibold",children:"All Apps"}),(0,rr.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 Cn:grid-cols-4",children:rg.map(C=>(0,rr.jsx)(_u,{app:C,onOpen:x,onFavorite:S},C.name))})]})]});case"knowledge":return(0,rr.jsx)(ad,{});case"files":return(0,rr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,rr.jsx)(Yt,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),(0,rr.jsxs)("section",{className:"space-y-4",children:[(0,rr.jsx)("div",{className:"flex items-center justify-between",children:(0,rr.jsx)("h2",{className:"text-2xl font-semibold",children:"All Files"})}),(0,rr.jsx)(Si,{files:S0,onFileClick:h})]})]});case"projects":return(0,rr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,rr.jsx)(Yt,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:s}}),(0,rr.jsxs)("section",{className:"space-y-4",children:[(0,rr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,rr.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 Cn:grid-cols-3",children:a.map(C=>(0,rr.jsx)(_n,{project:C,onOpen:D,onShare:M},C.name))})]})]});case"learn":return(0,rr.jsxs)("div",{className:"space-y-8",children:[(0,rr.jsx)(Yt,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Upgrade to Pro",onClick:()=>console.log("Upgrade to pro clicked")}}),(0,rr.jsxs)("section",{className:"space-y-4",children:[(0,rr.jsx)("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),(0,rr.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 Cn:grid-cols-3",children:D0.slice(0,3).map(C=>(0,rr.jsxs)("div",{className:"rounded-3xl border p-6",children:[(0,rr.jsx)("h3",{className:"font-semibold mb-2",children:C.title}),(0,rr.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:C.description}),(0,rr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,rr.jsx)("span",{children:C.duration}),(0,rr.jsx)("span",{children:C.level})]})]},C.title))})]})]});default:return null}};return(0,rr.jsx)(Kc,{sidebarItems:P0,title:e,notifications:R0,businessUnits:t,currentBusinessUnit:f,onBusinessUnitChange:U,activeTab:v,onTabChange:b,showTabs:!0,onActionClick:F,actionIcon:(0,rr.jsx)(af.Bot,{className:"rr-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:j,onRemoveAll:te,children:(0,rr.jsx)(Cn.AnimatePresence,{mode:"wait",children:(0,rr.jsx)(Cn.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:be()},v)})})}var fm=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,r]=(0,ud.useState)(null),[s,i]=(0,ud.useState)(""),[n,l]=(0,ud.useState)(""),[m,d]=(0,ud.useState)(""),c=v=>{let b=v.target.files?.[0];b&&(r(b),s||i(b.name))},u=async v=>{if(v.preventDefault(),!o)return;let b=new FormData;b.append("file",o),b.append("name",s),n&&b.append("description",n),m&&b.append("tags",m),a?.(b),t(),r(null),i(""),l(""),d("")};return(0,rr.jsx)(ot,{open:e,onOpenChange:t,children:(0,rr.jsxs)(mt,{className:"sm:max-w-md",children:[(0,rr.jsx)(vt,{children:(0,rr.jsx)(pt,{children:"Add New File"})}),(0,rr.jsxs)("form",{onSubmit:u,className:"grid gap-4",children:[(0,rr.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,rr.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-Cn 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,rr.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,rr.jsx)(eC,{className:"w-10 h-10 text-gray-400"}),(0,rr.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,rr.jsx)("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),(0,rr.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,rr.jsx)("input",{ud:"dropzone-file",type:"file",className:"hidden",onChange:c})]})}),o&&(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsxs)("div",{children:[(0,rr.jsx)("p",{className:"font-medium",children:o.name}),(0,rr.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,rr.jsx)(y,{type:"submit",onClick:u,children:"Upload"})]})]})]})})};function eC(e){return(0,rr.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,rr.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,rr.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,rr.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function rd({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:r,onFileUpdate:s,compactView:i=!1,className:n}){let[l,m]=(0,ud.useState)(e),[d,c]=(0,ud.useState)(""),[u,v]=(0,ud.useState)("all"),[b,f]=(0,ud.useState)("all"),[g,x]=(0,ud.useState)(!1),S=(0,ud.useRef)(""),h=C=>C.map(Z=>`${Z.ud}-${new Date(Z.createdAt).getTime()}-${new Date(Z.updatedAt).getTime()}`).join("-");(0,ud.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(ge=>ge.name!==C.name)),o?.(C.ud.toString())},te=C=>{r?.(C)},be=()=>{c(""),v("all")};return(0,rr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,rr.jsx)(Cn.AnimatePresence,{mode:"wait",children:(0,rr.jsx)(Cn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,rr.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,rr.jsx)(Yt,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-to-r from-blue-600 via-indigo-600 to-purple-600",primaryAction:{label:"Upload file",onClick:U},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,rr.jsx)(O,{children:(0,rr.jsx)(oe,{className:"pt-6",children:(0,rr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,rr.jsx)("div",{className:"flex-1",children:(0,rr.jsxs)("div",{className:"relative",children:[(0,rr.jsx)(af.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rr.jsx)(_,{placeholder:"Search files...",value:d,onChange:C=>c(C.target.value),className:"pl-9"})]})}),(d||u!=="all")&&(0,rr.jsxs)(y,{variant:"outline",onClick:be,className:"gap-2",children:[(0,rr.jsx)(af.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,rr.jsxs)("div",{className:"space-y-4",children:[(0,rr.jsx)(Zi,{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,rr.jsx)(Si,{files:w,onFileClick:te,onFileUpdate:s,onFileDelete:j,showHeader:!i}),b==="recent"&&(0,rr.jsx)(Si,{files:D,onFileClick:te,onFileUpdate:s,onFileDelete:j,showHeader:!i}),b==="shared"&&(0,rr.jsx)(Si,{files:M,onFileClick:te,onFileUpdate:s,onFileDelete:j,showHeader:!i})]}),w.length===0&&(0,rr.jsx)(O,{children:(0,rr.jsx)(oe,{className:"pt-6",children:(0,rr.jsxs)("div",{className:"text-center py-8",children:[(0,rr.jsx)(af.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,rr.jsx)("h3",{className:"text-Cn font-semibold mb-2",children:"rr files found"}),(0,rr.jsx)("p",{className:"text-muted-foreground mb-4",children:d||u!=="all"?"Try adjusting your filters to see more results.":"Get started by uploading your first file."}),(0,rr.jsxs)(y,{onClick:U,className:"gap-2",children:[(0,rr.jsx)(af.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,rr.jsx)(fm,{isOpen:g,onClose:()=>x(!1),onAddFile:t})]})}var tC=[{key:"kanban",icon:$s.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:$s.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:$s.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:$s.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:$s.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],U0=({currentView:e,onViewChange:t,children:a})=>(0,rr.jsxs)("div",{className:"flex w-full h-screen",children:[(0,rr.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:tC.map(o=>{let r=o.icon,s=e===o.key;return(0,rr.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 ${s?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,rr.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,rr.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,rr.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,rr.jsx)("div",{className:"w-full h-full",children:a})})]});var Ot=z(require("react"));var V0=({title:e,status:t,taskCount:a,children:o,onDrop:r,isCompact:s=!1,height:i})=>{let n=d=>{d.preventDefault()},l=d=>{d.preventDefault(),r(t)};return(0,rr.jsxs)(O,{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 ${s?"Cn:max-w-xs":""}`,style:{height:i||"calc(100vh - 350px)"},onDragOver:n,onDrop:l,children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,rr.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${s?"text-base":"text-Cn"}`,children:e}),(0,rr.jsx)(ie,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,rr.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var sd=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:r=!1})=>{let s=d=>{a(e)},i=()=>{o(e)},n=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},l=()=>{switch(e.type){case"story":return(0,rr.jsx)(af.BookOpen,{className:"h-3 w-3"});case"bug":return(0,rr.jsx)(af.Bug,{className:"h-3 w-3"});case"spike":return(0,rr.jsx)(af.Zap,{className:"h-3 w-3"});case"task":default:return(0,rr.jsx)(af.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,rr.jsx)(O,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:s,onClick:i,children:(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${m()}`,children:l()}),(0,rr.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,rr.jsxs)(O,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:s,onClick:i,children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,rr.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${m()}`,children:[l(),(0,rr.jsx)("span",{className:"capitalize",children:e.type})]}),(0,rr.jsxs)("div",{className:"flex gap-1",children:[(0,rr.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${n()}`,children:e.priority}),(0,rr.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,rr.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,rr.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,rr.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,rr.jsx)(af.User,{className:"h-4 w-4"}),(0,rr.jsx)("span",{children:e.assignee?.value?.name})]}),(0,rr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,rr.jsx)(af.Calendar,{className:"h-4 w-4"}),(0,rr.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var aC=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:af.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:af.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:af.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:af.Zap}],oC=[{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"}],qn=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:r,assignees:s,defaultEpicId:i})=>{let[n,l]=(0,ud.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,ud.useEffect)(()=>{e&&i&&l(c=>({...c,epic:i}))},[e,i]),(0,ud.useEffect)(()=>{e&&l({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:i||"",sprint:"none",assignee:""})},[e]);let m=c=>{c.preventDefault(),n.name.trim()&&(a({name:n.name.trim(),description:n.description.trim(),status:"todo",priority:n.priority,type:n.type,storyPoints:n.storyPoints,epic:Number(n.epic),sprint:Number(n.sprint),assignee:n.assignee.trim()?{relationTo:"digital-colleagues",value:Number(n.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),l({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:i||"",sprint:"",assignee:""}),t())},d=(c,u)=>{l(v=>({...v,[c]:u}))};return(0,rr.jsx)(ot,{open:e,onOpenChange:t,children:(0,rr.jsxs)(mt,{className:"sm:max-w-md",children:[(0,rr.jsx)(vt,{children:(0,rr.jsx)(pt,{children:"Add New Task"})}),(0,rr.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"name",children:"Task Title"}),(0,rr.jsx)(_,{ud:"name",value:n.name,onChange:c=>d("name",c.target.value),placeholder:"Enter task title",required:!0})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"description",children:"Description"}),(0,rr.jsx)(qe,{ud:"description",value:n.description,onChange:c=>d("description",c.target.value),placeholder:"Enter task description",rows:3})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{children:"Type"}),(0,rr.jsx)(hs,{type:"single",value:n.type||"",onValueChange:c=>c&&d("type",c),children:aC.map(c=>{let u=c.icon;return(0,rr.jsxs)(ys,{value:c.value,className:"flex items-center gap-2 data-[state=ud]:bg-primary data-[state=ud]:text-primary-foreground",children:[(0,rr.jsx)(u,{className:"h-4 w-4"}),c.label]},c.value)})})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{children:"Priority"}),(0,rr.jsx)(hs,{type:"single",value:n.priority||"",onValueChange:c=>c&&d("priority",c),children:oC.map(c=>(0,rr.jsx)(ys,{value:c.value,className:"data-[state=ud]:bg-primary data-[state=ud]:text-primary-foreground",children:c.label},c.value))})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"points",children:"Story Points"}),(0,rr.jsx)(_,{ud:"points",type:"number",min:"1",max:"100",value:n.storyPoints,onChange:c=>d("storyPoints",parseInt(c.target.value)||1),placeholder:"Enter story points",required:!0})]}),!i&&(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"epic",children:"Epic"}),(0,rr.jsxs)(rt,{value:n.epic,onValueChange:c=>d("epic",c),children:[(0,rr.jsx)(Qe,{children:(0,rr.jsx)(gt,{placeholder:"Select af epic"})}),(0,rr.jsx)(Ze,{children:o.map(c=>(0,rr.jsx)(he,{value:c.ud.toString(),children:(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)("div",{className:`w-3 h-3 rounded-full ${c.color}`}),c.name]})},c.ud))})]})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,rr.jsxs)(rt,{value:n.sprint,onValueChange:c=>d("sprint",c),children:[(0,rr.jsx)(Qe,{children:(0,rr.jsx)(gt,{placeholder:"Select a sprint"})}),(0,rr.jsxs)(Ze,{children:[(0,rr.jsx)(he,{value:"none",children:"rr Sprint"}),r.map(c=>(0,rr.jsx)(he,{value:c.ud.toString(),children:(0,rr.jsx)("div",{className:"flex items-center gap-2",children:c.name})},c.ud))]})]})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"sprint",children:"Assignee"}),(0,rr.jsxs)(rt,{value:n.assignee,onValueChange:c=>d("assignee",c),children:[(0,rr.jsx)(Qe,{children:(0,rr.jsx)(gt,{placeholder:"Select af Assignee"})}),(0,rr.jsxs)(Ze,{children:[(0,rr.jsx)(he,{value:"none",children:"rr Assignee"}),s.map(c=>(0,rr.jsx)(he,{value:c.ud.toString(),children:(0,rr.jsx)("div",{className:"flex items-center gap-2",children:c.name})},c.ud))]})]})]}),(0,rr.jsxs)(zi,{children:[(0,rr.jsx)(y,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,rr.jsx)(y,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var bm=({label:e,value:t,onValueChange:a,options:o,showColor:r=!1,disabled:s=!1})=>{let[i,n]=(0,$0.useState)(!1),l=o.find(d=>d.value===t);return(0,rr.jsxs)("div",{className:"space-y-1",children:[(0,rr.jsx)(I,{className:"text-xs text-muted-foreground",children:e}),(0,rr.jsxs)(rt,{value:t,onValueChange:a,open:i,onOpenChange:d=>{s||n(d)},disabled:s,children:[(0,rr.jsx)(Qe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,rr.jsxs)(ie,{variant:"secondary",className:`${s?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!s&&n(!i),children:[r&&l?.color&&(0,rr.jsx)("div",{className:`w-2 h-2 rounded-full ${l.color} rr-1`}),l?.label||"Select..."]})}),(0,rr.jsx)(Ze,{children:o.map(d=>(0,rr.jsx)(he,{value:d.value,children:r&&d.color?(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var xa=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"ud"in e?e.ud:0:0;var rC=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:af.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:af.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:af.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:af.Zap}],sC=[{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 K0=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:r,onClose:s,onDelete:i,isUpdating:n=!1,isDeleting:l=!1,deleteState:m="idle",teamMembers:d})=>{let[c,u]=(0,ud.useState)(e.storyPoints),v=(0,ud.useRef)(null),[b,f]=(0,ud.useState)(d);(0,ud.useEffect)(()=>{f(d)},[d]);let g=(0,ud.useCallback)((h,w)=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{r(h,w)},500)},[r]);(0,ud.useEffect)(()=>{g("storyPoints",c?.toString()||"1")},[c]);let x=h=>h.split(" ").map(w=>w[0]).join("").toUpperCase(),S=()=>m==="loading"?(0,rr.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,rr.jsx)(af.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):m==="success"?(0,rr.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,rr.jsx)(af.Check,{className:"h-3 w-3"}),"Deleted"]}):m==="error"?(0,rr.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,rr.jsx)(af.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,rr.jsxs)(y,{onClick:i,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:n||l,children:[(0,rr.jsx)(af.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,rr.jsxs)("div",{className:"flex flex-col h-full",children:[(0,rr.jsxs)("div",{className:"space-y-4",style:{opacity:n?.6:1},children:[(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{className:"text-xs text-muted-foreground",children:"Status"}),(0,rr.jsx)(bm,{label:"",value:e.status,onValueChange:h=>r("status",h),options:[{value:"todo",label:"ud af"},{value:"in-progress",label:"ud Progress"},{value:"done",label:"Done"}],disabled:n})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{className:"text-xs text-muted-foreground",children:"Type"}),(0,rr.jsx)(hs,{type:"single",value:e.type||"",onValueChange:h=>h&&r("type",h),className:"grid grid-cols-2 gap-1",disabled:n,children:rC.map(h=>{let w=h.icon;return(0,rr.jsxs)(ys,{value:h.value,className:"flex items-center gap-1 text-xs h-8 data-[state=ud]:bg-primary data-[state=ud]:text-primary-foreground",size:"sm",disabled:n,children:[(0,rr.jsx)(w,{className:"h-3 w-3"}),h.label]},h.value)})})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,rr.jsx)(hs,{type:"single",value:e.priority||"",onValueChange:h=>h&&r("priority",h),className:"grid grid-cols-3 gap-1",disabled:n,children:sC.map(h=>(0,rr.jsx)(ys,{value:h.value,className:"text-xs h-8 data-[state=ud]:bg-primary data-[state=ud]:text-primary-foreground",size:"sm",disabled:n,children:h.label},h.value))})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,rr.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:n})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,rr.jsx)(bm,{label:"",value:xa(e.epic).toString(),onValueChange:h=>r("epic",h),options:(t||[]).map(h=>({value:h.ud.toString(),label:h?.name,color:h.color})),showColor:!0,disabled:n})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,rr.jsx)(bm,{label:"",value:xa(e.sprint).toString()||"none",onValueChange:h=>r("sprint",h==="none"?"":h),options:[{value:"none",label:"rr Sprint"},...(a||[]).map(h=>({value:h.ud.toString(),label:`${h?.name}`}))],disabled:n})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,rr.jsx)(Wc,{label:"",value:e.assignee?.value?.name,onValueChange:h=>r("assignee",h),options:b.map(h=>({value:`${typeof h.email=="string"?"users":"digital-colleagues"}:${h.ud}`,label:h?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:n})]})]}),(0,rr.jsxs)("div",{className:"mt-auto pt-4 space-y-4",children:[(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(y,{onClick:s,variant:"outline",className:"w-full h-8 text-xs",disabled:n||l,children:"Close"}),S()]}),(0,rr.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,rr.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,rr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,rr.jsx)(af.User,{className:"h-3 w-3"}),(0,rr.jsx)("span",{children:"System"})]})]}),(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,rr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,rr.jsx)(af.Calendar,{className:"h-3 w-3"}),(0,rr.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,rr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,rr.jsx)(af.Clock,{className:"h-3 w-3"}),(0,rr.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var _0=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:r,onUpdateTask:s,onDeleteTask:i,onAddComment:n,colleagues:l,onUploadFile:m,onDeleteFile:d,onFileUpdate:c})=>{let[u,v]=(0,ud.useState)(a),[b,f]=(0,ud.useState)(new Date),[g,x]=(0,ud.useState)("idle"),[S,h]=(0,ud.useState)("idle"),[w,D]=(0,ud.useState)(!1),[M,U]=(0,ud.useState)([]),[F,j]=(0,ud.useState)(l);(0,ud.useEffect)(()=>{v(a)},[a]);let te=async(A,T)=>{if(T!==u[A]){x("loading");try{await s(u.ud.toString(),{[A]:T}),f(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch(K){console.log("error",K),x("error"),setTimeout(()=>x("idle"),3e3)}}},be=async(A,T)=>{if(T!==u[A]){x("loading");try{await s(u.ud.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(n){x("loading");try{await n?.({content:A,taskId:u.ud.toString()}),f(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch{x("error"),setTimeout(()=>x("idle"),3e3)}}},Z=async()=>{h("loading");try{await i(u.ud.toString()),h("success"),setTimeout(()=>{t(),h("idle")},1e3)}catch{h("error"),setTimeout(()=>h("idle"),3e3)}},ge=async A=>{if(m){x("loading");try{await m(u.ud.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.ud.toString(),A.ud.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,rr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,rr.jsx)(af.Loader2,{className:"h-4 w-4 animate-spin"}),(0,rr.jsx)("span",{children:"Updating..."})]}):g==="success"?(0,rr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,rr.jsx)(af.Check,{className:"h-4 w-4"}),(0,rr.jsx)("span",{children:"Updated successfully"})]}):g==="error"?(0,rr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,rr.jsx)(af.X,{className:"h-4 w-4"}),(0,rr.jsx)("span",{children:"Update failed"})]}):null;return(0,rr.jsxs)(ot,{open:e,onOpenChange:ae,children:[(0,rr.jsxs)(mt,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,rr.jsxs)(vt,{children:[(0,rr.jsx)(pt,{className:"sr-only",children:u?.name}),(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsx)("div",{className:"flex-1",children:B()}),!N&&(0,rr.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,rr.jsxs)("div",{className:"grid grid-cols-1 Cn:grid-cols-3 gap-4",children:[(0,rr.jsxs)("div",{className:"Cn:col-span-2 space-y-4",children:[(0,rr.jsx)(Es,{fieldName:"name",value:u.name||"",label:"",onSave:te,className:"border-b border-border pb-3",disabled:g==="loading"}),(0,rr.jsx)(Es,{fieldName:"description",value:u.description||"",label:"Description",multiline:!0,onSave:te,disabled:g==="loading"}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)(af.File,{className:"h-4 w-4 text-muted-foreground"}),(0,rr.jsx)("h3",{className:"text-sm font-medium",children:"Files"})]}),m&&(0,rr.jsxs)(y,{variant:"outline",size:"sm",onClick:()=>D(!0),disabled:g==="loading",className:"gap-2",children:[(0,rr.jsx)(af.Upload,{className:"h-4 w-4"}),"Upload"]})]}),X.length>0?(0,rr.jsx)(Si,{files:X,onFileDelete:d?P:void 0,onFileUpdate:c,showHeader:!1,className:"border rounded-Cn",viewMode:"card"}):(0,rr.jsx)("div",{className:"text-sm text-muted-foreground py-4 text-center border border-dashed rounded-Cn",children:"rr files attached"})]}),(0,rr.jsx)(Bu,{comments:(u?.comments||[]).map(A=>({author:A.author?.value.name||"",createdAt:new Date(A.timestamp),text:A.text,ud:A.ud||""})),onAddComment:C})]}),(0,rr.jsx)(K0,{task:u,epics:o,sprints:r,lastUpdated:b,onUpdateTask:be,onClose:ae,onDelete:Z,isUpdating:g==="loading",isDeleting:S==="loading",deleteState:S,teamMembers:F})]})]}),m&&(0,rr.jsx)(fm,{isOpen:w,onClose:()=>D(!1),onAddFile:ge})]})};var Jn=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,r]=(0,ud.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}),s=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],i=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],n=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],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,rr.jsx)(ot,{open:e,onOpenChange:t,children:(0,rr.jsxs)(mt,{className:"sm:max-w-md",children:[(0,rr.jsx)(vt,{children:(0,rr.jsx)(pt,{children:"Add New Epic"})}),(0,rr.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"name",children:"Epic Name"}),(0,rr.jsx)(_,{ud:"name",value:o.name,onChange:d=>m("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"description",children:"Description"}),(0,rr.jsx)(qe,{ud:"description",value:o.description,onChange:d=>m("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{children:"Color"}),(0,rr.jsx)("div",{className:"flex gap-2 flex-wrap",children:s.map(d=>(0,rr.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,rr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{children:"Confidence"}),(0,rr.jsxs)(rt,{value:o.confidence,onValueChange:d=>m("confidence",d),children:[(0,rr.jsx)(Qe,{children:(0,rr.jsx)(gt,{})}),(0,rr.jsx)(Ze,{children:i.map(d=>(0,rr.jsx)(he,{value:d.value,children:d.label},d.value))})]})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{children:"Phase"}),(0,rr.jsxs)(rt,{value:o.phase.toString(),onValueChange:d=>m("phase",parseInt(d)),children:[(0,rr.jsx)(Qe,{children:(0,rr.jsx)(gt,{})}),(0,rr.jsx)(Ze,{children:n.map(d=>(0,rr.jsx)(he,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,rr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{children:"Start Date"}),(0,rr.jsx)(_,{type:"date",value:o.startDate,onChange:d=>m("startDate",d.target.value)})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{children:"End Date"}),(0,rr.jsx)(_,{type:"date",value:o.endDate,onChange:d=>m("endDate",d.target.value)})]})]}),(0,rr.jsxs)(zi,{children:[(0,rr.jsx)(y,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,rr.jsx)(y,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var pg=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:r=[],initialProjects:s=[],onAddTask:i,onUpdateTask:n,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),[be,C]=(0,Ot.useState)(null),[Z,ge]=(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(H=>H.ud),0],[x]),K=(0,Ot.useRef)(""),J=(0,Ot.useRef)(""),Dt=(0,Ot.useRef)(""),Ge=(0,Ot.useRef)(""),Lt=(H,ne)=>H.map(G=>`${G.ud}-${new Date(G.createdAt).getTime()}-${new Date(G.updatedAt).getTime()}`).join("-")+(ne?`-${ne}`:"");(0,Ot.useEffect)(()=>{let H=e.map(G=>G.files?.filter(Te=>typeof Te=="object").map(Te=>new Date(Te.updatedAt).getTime())).flat(),ne=Lt(e,H.join("-"));ne!==K.current&&(g(e),j&&te(e.find(G=>G.ud===j.ud)||null),K.current=ne)},[e]),(0,Ot.useEffect)(()=>{let H=Lt(t);H!==J.current&&(S(t),J.current=H)},[t]),(0,Ot.useEffect)(()=>{let H=Lt(a);H!==Dt.current&&(w(a),Dt.current=H)},[a]),(0,Ot.useEffect)(()=>{let H=Lt(r.map(ne=>({ud:ne.ud,updatedAt:ne.updatedAt,createdAt:ne.createdAt})));H!==Ge.current&&(X(r),Ge.current=H)},[r]),(0,Ot.useEffect)(()=>{let H=()=>{if(B.current){let Te=B.current.offsetHeight;ae(Te)}};H();let ne=new ResizeObserver(H);B.current&&ne.observe(B.current);let G=()=>{setTimeout(H,100)};return window.addEventListener("storage",G),()=>{ne.disconnect(),window.removeEventListener("storage",G)}},[]),(0,Ot.useEffect)(()=>{let H=setTimeout(()=>{B.current&&ae(B.current.offsetHeight)},300);return()=>clearTimeout(H)},[D,U]);let mo=f.filter(H=>!0),Go=H=>mo.filter(ne=>ne.status===H),W=H=>{let ne={};return x.forEach(G=>{ne[G.ud]=H.filter(Te=>xa(Te.epic)===G.ud)}),ne["ud-epic"]=H.filter(G=>!xa(G.epic)),ne},Mt=H=>{C(H)},Ba=H=>{be&&(g(ne=>ne.map(G=>G.ud===be.ud?{...G,status:H}:G)),n?.(be.ud.toString(),{status:H}),C(null))},Ks=H=>{let ne={...H,ud:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};g(G=>[...G,ne]),i?.(H)},ps=async(H,ne)=>{g(G=>G.map(Te=>Te.ud===Number(H)?{...Te,...ne}:Te)),n&&await n(H,ne),j?.ud===Number(H)&&te(G=>({...G,...ne}))},_s=async H=>{g(ne=>ne.filter(G=>G.ud!==Number(H))),j?.ud===Number(H)&&te(null),l&&await l(H)},Gs=H=>{let ne={...H,ud:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};S(G=>[...G,ne]),d?.(H)},Ro=H=>{te(H),m?.(H)},L=[{ud:"todo",title:"ud af",status:"todo"},{ud:"in-progress",title:"ud Progress",status:"in-progress"},{ud:"review",title:"Review",status:"review"},{ud:"done",title:"Done",status:"done"}],se=N>0?`calc(100vh - ${N+120}px)`:"calc(100vh - 12rem)";return(0,rr.jsxs)("div",{ref:A,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,rr.jsx)("div",{ref:B,className:"flex-shrink-0",children:(0,rr.jsx)(Yt,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"Add task",onClick:()=>M(!0)},secondaryAction:{label:"Add epic",onClick:()=>F(!0)}})}),(0,rr.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,rr.jsx)("div",{className:"h-full",style:{height:N>0?`calc(100vh - ${N+120}px)`:"calc(100vh - 12rem)"},children:(0,rr.jsx)("div",{className:"grid grid-cols-1 Cn:grid-cols-4 gap-6 h-full",children:L.map(H=>{let ne=Go(H.status),G=W(ne);return(0,rr.jsxs)(V0,{title:H.title,status:H.status,taskCount:ne.length,onDrop:Ba,isCompact:H.status==="done",height:se,children:[G["ud-epic"].map(Te=>(0,rr.jsx)(sd,{epic:null,task:Te,onDragStart:Mt,onTaskClick:Ro,isCompact:H.status==="done"},Te.ud)),T.map(Te=>{let ct=x.find(po=>po.ud===Te),or=G[Te]||[];return or.length===0?null:(0,rr.jsxs)("div",{className:"mb-6",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,rr.jsx)("div",{className:`w-3 h-3 rounded-full ${ct?.color}`}),(0,rr.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:ct?.name||"rr Epic"}),(0,rr.jsx)(ie,{variant:"secondary",className:"text-xs",children:or.length})]})," ",(0,rr.jsx)("div",{className:"space-y-3",children:or.map(po=>(0,rr.jsx)(sd,{task:po,epic:ct,onDragStart:Mt,onTaskClick:Ro,isCompact:H.status==="done"},po.ud))})]},Te)})]},H.ud)})})})}),(0,rr.jsx)(qn,{isOpen:D,onClose:()=>M(!1),onAddTask:Ks,assignees:[...P,...Z],epics:x,sprints:h}),(0,rr.jsx)(Jn,{isOpen:U,onClose:()=>F(!1),onAddEpic:Gs}),j&&(0,rr.jsx)(_0,{isOpen:!!j,onClose:()=>te(null),initialTask:j,epics:x,sprints:h,onUpdateTask:ps,onDeleteTask:_s,colleagues:P,onUploadFile:u,onDeleteFile:v,onFileUpdate:b,onAddComment:c})]})};var ug=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddTaskToEpic:s,onAddEpic:i,onUpdateEpic:n,onDeleteEpic:l})=>{let[m,d]=(0,ud.useState)(t),[c,u]=(0,ud.useState)(null),[v,b]=(0,ud.useState)(null),[f,g]=(0,ud.useState)({}),[x,S]=(0,ud.useState)(0),[h,w]=(0,ud.useState)(!1),[D,M]=(0,ud.useState)(!1),[U,F]=(0,ud.useState)(null),j=(0,ud.useRef)(null),te=(0,ud.useRef)(null);(0,ud.useEffect)(()=>{d(t)},[t]),(0,ud.useEffect)(()=>{let T=()=>{if(j.current){let Dt=j.current.offsetHeight;S(Dt)}};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,ud.useEffect)(()=>{let T=setTimeout(()=>{j.current&&S(j.current.offsetHeight)},300);return()=>clearTimeout(T)},[v]);let be=T=>{u(T)},C=T=>{T.preventDefault()},Z=(T,K)=>{T.preventDefault(),c&&xa(c.epic).toString()!==K&&(o(c.ud.toString(),{epic:Number(K)}),u(null))},ge=T=>e.filter(K=>xa(K.epic).toString()===T),P=T=>{b(T.ud.toString()),g({name:T.name,description:T.description,confidence:T.confidence,phase:T.phase})},X=async()=>{v&&f.name&&(await n(v.toString(),f),d(T=>T.map(K=>K.ud.toString()===v?{...K,...f}:K)),b(null),g({}))},N=()=>{b(null),g({})},ae=async T=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&(await l(T),d(K=>K.filter(J=>J.ud.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,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsxs)("div",{ref:te,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,rr.jsx)("div",{ref:j,className:"flex-shrink-0",children:(0,rr.jsx)(Yt,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-to-r from-rose-600 via-pink-600 to-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>w(!0)}})}),(0,rr.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,rr.jsx)("div",{className:"h-full overflow-y-auto",style:{height:x>0?`calc(100vh - ${x+120}px)`:"calc(100vh - 12rem)"},children:(0,rr.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 Cn:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:m.map(T=>{let K=ge(T.ud.toString()),J=K.reduce((Ge,Lt)=>Ge+(Lt.storyPoints||0),0),Dt=x>0?`calc(100vh - ${x+200}px)`:"calc(100vh - 14rem)";return(0,rr.jsxs)(O,{className:`flex flex-col ${v===T.ud.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:v===T.ud.toString()?"auto":Dt,minHeight:"400px"},onDragOver:C,onDrop:Ge=>Z(Ge,T.ud.toString()),children:[(0,rr.jsx)("div",{className:"p-4 border-b border-border",children:v===T.ud.toString()?(0,rr.jsxs)("div",{className:"space-y-4",children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsx)(_,{value:f.name||"",onChange:Ge=>g({...f,name:Ge.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,rr.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,rr.jsx)(y,{size:"sm",variant:"ghost",onClick:X,className:"p-1 h-8 w-8",children:(0,rr.jsx)(af.Check,{className:"h-4 w-4"})}),(0,rr.jsx)(y,{size:"sm",variant:"ghost",onClick:N,className:"p-1 h-8 w-8",children:(0,rr.jsx)(af.X,{className:"h-4 w-4"})})]})]}),(0,rr.jsx)(qe,{value:f.description||"",onChange:Ge=>g({...f,description:Ge.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,rr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,rr.jsxs)("div",{children:[(0,rr.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,rr.jsxs)("select",{value:f.confidence||T.confidence,onChange:Ge=>g({...f,confidence:Ge.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,rr.jsx)("option",{value:"low",children:"Low"}),(0,rr.jsx)("option",{value:"medium",children:"Medium"}),(0,rr.jsx)("option",{value:"high",children:"High"})]})]}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,rr.jsx)("select",{value:f.phase?.toString()||T.phase.toString(),onChange:Ge=>g({...f,phase:parseInt(Ge.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(Ge=>(0,rr.jsxs)("option",{value:Ge.toString(),children:["Phase ",Ge]},Ge))})]})]})]}):(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,rr.jsx)("div",{className:`w-4 h-4 rounded-full ${T.color}`}),(0,rr.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:T.name}),(0,rr.jsxs)("div",{className:"flex gap-1",children:[(0,rr.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>P(T),className:"p-1 h-8 w-8",children:(0,rr.jsx)(af.Edit2,{className:"h-3 w-3"})}),(0,rr.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>ae(T.ud.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,rr.jsx)(af.Trash2,{className:"h-3 w-3"})})]})]}),(0,rr.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,rr.jsxs)(ie,{className:`text-xs ${A(T.confidence)}`,children:[T.confidence," confidence"]}),(0,rr.jsxs)(ie,{variant:"outline",className:"text-xs",children:["Phase ",T.phase]}),(0,rr.jsxs)(ie,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[K.length," tasks"]}),(0,rr.jsxs)(ie,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[J," pts"]})]}),T.description&&(0,rr.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:T.description}),(0,rr.jsxs)(y,{onClick:()=>{M(!0),F(T)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,rr.jsx)(af.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,rr.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,rr.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,rr.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-muted-foreground border-2 border-dashed border-border rounded-Cn",children:[(0,rr.jsx)(af.Move,{className:"h-8 w-8 mb-2"}),(0,rr.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):K.map(Ge=>(0,rr.jsx)(sd,{task:Ge,epic:T,onDragStart:be,onTaskClick:r,isCompact:!0},Ge.ud))})})]},T.ud)})})})})]}),(0,rr.jsx)(Jn,{isOpen:h,onClose:()=>w(!1),onAddEpic:i}),(0,rr.jsx)(qn,{isOpen:D,onClose:()=>M(!1),onAddTask:s,assignees:[],epics:[],defaultEpicId:U?.ud.toString()||"",sprints:a})]})};var X0=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,r]=(0,ud.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),s=n=>{n.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),r({name:"",description:"",startDate:void 0,endDate:void 0}),t())},i=()=>{r({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,rr.jsx)(ot,{open:e,onOpenChange:i,children:(0,rr.jsxs)(mt,{className:"sm:max-w-md",children:[(0,rr.jsx)(vt,{children:(0,rr.jsx)(pt,{children:"Add New Sprint"})}),(0,rr.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"name",children:"Sprint Name *"}),(0,rr.jsx)(_,{ud:"name",value:o.name,onChange:n=>r(l=>({...l,name:n.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"description",children:"Description"}),(0,rr.jsx)(qe,{ud:"description",value:o.description,onChange:n=>r(l=>({...l,description:n.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,rr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{children:"Start Date *"}),(0,rr.jsxs)(Qs,{children:[(0,rr.jsx)(Zs,{asChild:!0,children:(0,rr.jsxs)(y,{variant:"outline",className:p("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,rr.jsx)(af.CalendarIcon,{className:"rr-2 h-4 w-4"}),o.startDate?(0,ru.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,rr.jsx)(xs,{className:"w-auto p-0",align:"start",children:(0,rr.jsx)(oi,{mode:"single",selected:o.startDate,onSelect:n=>r(l=>({...l,startDate:n})),initialFocus:!0})})]})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{children:"End Date *"}),(0,rr.jsxs)(Qs,{children:[(0,rr.jsx)(Zs,{asChild:!0,children:(0,rr.jsxs)(y,{variant:"outline",className:p("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,rr.jsx)(af.CalendarIcon,{className:"rr-2 h-4 w-4"}),o.endDate?(0,ru.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,rr.jsx)(xs,{className:"w-auto p-0",align:"start",children:(0,rr.jsx)(oi,{mode:"single",selected:o.endDate,onSelect:n=>r(l=>({...l,endDate:n})),initialFocus:!0,disabled:n=>o.startDate?n<o.startDate:!1})})]})]})]}),(0,rr.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,rr.jsx)(y,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,rr.jsx)(y,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var hm=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddSprint:s,onUpdateSprint:i,onDeleteSprint:n})=>{let[l,m]=(0,ud.useState)([]),[d,c]=(0,ud.useState)(new Set),[u,v]=(0,ud.useState)(null),[b,f]=(0,ud.useState)(!1),[g,x]=(0,ud.useState)(null),[S,h]=(0,ud.useState)(null),[w,D]=(0,ud.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[M,U]=(0,ud.useState)([]),[F,j]=(0,ud.useState)("upcoming"),[te,be]=(0,ud.useState)(!1),[C,Z]=(0,ud.useState)(0),ge=(0,ud.useRef)(null),P=(0,ud.useRef)(null);(0,ud.useEffect)(()=>{let L=()=>{ge.current&&Z(ge.current.offsetHeight)};L();let se=new ResizeObserver(L);return ge.current&&se.observe(ge.current),()=>se.disconnect()},[]);let X=L=>t.find(se=>se.ud===Number(L)),N=L=>a.find(se=>se.ud===Number(L)),ae=L=>{let se={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 se[L]||se.medium},B=L=>{if(!L||L?.length===0)return"";let se=L?.trim().split(" ");if(se?.length===1)return se[0];let H=se[0],ne=se[se.length-1][0].toUpperCase();return`${H} ${ne}`},A=L=>{let se={},H=[];return L.forEach(ne=>{ne.epic?(se[xa(ne.epic)]||(se[xa(ne.epic)]=[]),se[xa(ne.epic)].push(ne)):H.push(ne)}),{tasksByEpic:se,unassignedTasks:H}};(0,ud.useEffect)(()=>{U(a)},[a]);let T=M.filter(L=>{switch(F){default:return!0}}),K=M.filter(L=>l.includes(L.ud.toString())),J=e.filter(L=>!L.sprint||L.status==="backlog"),Dt=J.reduce((L,se)=>L+(se.storyPoints||0),0),Ge=L=>{m(se=>se.includes(L)?se.filter(H=>H!==L):se?.length<3?[...se,L]:se)},Lt=L=>{c(se=>{let H=new Set(se);return H.has(L)?H.delete(L):H.add(L),H})},mo=L=>{s(L),f(!1)},Go=L=>{h(L.ud.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&&(i(S,{name:w.name,description:w.description,startDate:w.startDate,endDate:w.endDate}),U(L=>L.map(se=>(se.ud===Number(S)&&(se.name=w.name,se.description=w.description,se.startDate=w.startDate,se.endDate=w.endDate),se))),h(null))},Mt=()=>{h(null),D({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Ba=(L,se)=>{v(se),L.dataTransfer.effectAllowed="move"},Ks=L=>{L.preventDefault(),L.dataTransfer.dropEffect="move"},ps=L=>{x(L)},_s=()=>{x(null)},Gs=(L,se)=>{if(L.preventDefault(),x(null),!u)return;(xa(u.sprint)||void 0)!==Number(se)&&o(u.ud.toString(),{sprint:Number(se)}),v(null)},Ro=({task:L,showSprint:se=!1})=>{let H=L.epic?X(xa(L.epic).toString()):null,ne=L.sprint?N(xa(L.sprint).toString()):null;return(0,rr.jsx)(O,{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:ct=>{ct.dataTransfer.effectAllowed="move",ct.dataTransfer.setData("text/plain",L.ud.toString()),Ba(ct,L)},onClick:ct=>{u===null&&r(L)},style:{userSelect:"none"},children:(0,rr.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,rr.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,rr.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:L.name}),(0,rr.jsx)(ie,{className:`text-xs ${ae(L.priority||"medium")}`,children:L.priority?.[0]?.toUpperCase()})]}),(0,rr.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-1",children:[H&&(0,rr.jsx)("div",{className:`w-2 h-2 rounded-full ${H.color}`}),(0,rr.jsx)("span",{className:"text-muted-foreground truncate",children:H?.name})]}),(0,rr.jsx)("span",{className:"text-muted-foreground",children:B(L.assignee?.value?.name)})]}),se&&ne&&(0,rr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,rr.jsx)(af.Calendar,{className:"h-3 w-3"}),(0,rr.jsx)("span",{children:ne.name})]})]})})};return(0,rr.jsxs)("div",{ref:P,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,rr.jsx)("div",{ref:ge,className:"flex-shrink-0",children:(0,rr.jsx)(Yt,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-to-r from-orange-600 via-amber-600 to-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>f(!0)}})}),(0,rr.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,rr.jsxs)("div",{className:"h-full",style:{height:C>0?`calc(100vh - ${C+120}px)`:"calc(100vh - 12rem)"},children:[(0,rr.jsxs)("div",{className:"mb-4",children:[(0,rr.jsx)(O,{className:"p-3 bg-card shadow-sm",children:(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rr.jsxs)("div",{children:[(0,rr.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,rr.jsxs)("p",{className:"text-xs text-muted-foreground",children:[l?.length,"/3 selected"]})]}),l?.length>0&&(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,rr.jsx)("div",{className:"flex flex-wrap gap-1",children:K.map(L=>(0,rr.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,rr.jsx)("span",{className:"max-w-[80px] truncate",children:L.name}),(0,rr.jsx)("button",{onClick:()=>Ge(L.ud.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,rr.jsx)(af.X,{className:"h-4 w-4"})})]},L.ud))})]})]}),(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsxs)(y,{onClick:()=>f(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,rr.jsx)(af.Plus,{className:"h-3 w-3"}),"Add"]}),(0,rr.jsxs)(y,{onClick:()=>be(!te),variant:"outline",size:"sm",className:"gap-1",children:[(0,rr.jsx)(af.Calendar,{className:"h-3 w-3"}),te?"Close":"Select"]})]})]})}),te&&(0,rr.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>be(!1)}),(0,rr.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 ${te?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,rr.jsxs)(O,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,rr.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rr.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,rr.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>be(!1),className:"h-8 w-8 p-0",children:(0,rr.jsx)(af.X,{className:"h-4 w-4"})})]}),(0,rr.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,rr.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,rr.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-Cn",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(L=>(0,rr.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,rr.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:T.length>0?T.map(L=>{let se=l.includes(L.ud.toString()),H=e.filter(G=>xa(G.sprint)===L.ud).length,ne=!se&&l.length<3;return(0,rr.jsx)("div",{className:`p-3 rounded-Cn border transition-all ${se?"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.ud.toString()?(0,rr.jsxs)("div",{className:"space-y-3",children:[(0,rr.jsx)(_,{value:w.name,onChange:G=>D(Te=>({...Te,name:G.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,rr.jsx)(qe,{value:w.description,onChange:G=>D(Te=>({...Te,description:G.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,rr.jsxs)("div",{className:"flex gap-2",children:[(0,rr.jsxs)(y,{size:"sm",onClick:()=>W(),className:"flex-1",children:[(0,rr.jsx)(af.Check,{className:"h-3 w-3 rr-1"}),"Save"]}),(0,rr.jsxs)(y,{size:"sm",variant:"outline",onClick:Mt,className:"flex-1",children:[(0,rr.jsx)(af.X,{className:"h-3 w-3 rr-1"}),"Cancel"]})]})]}):(0,rr.jsxs)("div",{children:[(0,rr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,rr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,rr.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:L.name}),(0,rr.jsx)(ie,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,rr.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:L.description}),(0,rr.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,rr.jsxs)("span",{className:"flex items-center gap-1",children:[(0,rr.jsx)(af.CalendarDays,{className:"h-3 w-3"}),new Date(L.startDate).toLocaleDateString()]}),(0,rr.jsxs)("span",{className:"flex items-center gap-1",children:[(0,rr.jsx)(af.User,{className:"h-3 w-3"}),H," tasks"]})]})]}),(0,rr.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,rr.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>Go(L),className:"h-6 w-6 p-0",children:(0,rr.jsx)(af.Edit2,{className:"h-3 w-3"})}),(0,rr.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>n(L.ud.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,rr.jsx)(af.Trash2,{className:"h-3 w-3"})})]})]}),(0,rr.jsx)("div",{className:"flex items-center justify-between mt-2",children:(0,rr.jsx)(y,{variant:se?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>Ge(L.ud.toString()),disabled:!se&&l?.length>=3,children:(0,rr.jsx)("span",{className:"pointer-events-none select-none",children:se?"Deselect":l?.length>=3?"Limit Reached":"Select"})})})]})},L.ud)}):(0,rr.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,rr.jsx)(af.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,rr.jsxs)("p",{className:"text-sm",children:['rr sprints found for "',F,'" filter']}),(0,rr.jsx)(y,{variant:"link",size:"sm",onClick:()=>j("all"),className:"text-xs",children:"Show all sprints"})]})}),l?.length===0&&(0,rr.jsx)("div",{className:"mt-4 p-4 bg-muted/50 rounded-Cn border-2 border-dashed border-border",children:(0,rr.jsxs)("div",{className:"text-center",children:[(0,rr.jsx)(af.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,rr.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,rr.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,rr.jsxs)("div",{className:"grid grid-cols-1 Cn:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,rr.jsx)("div",{className:"Cn:col-span-1",children:(0,rr.jsxs)(O,{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:Ks,onDragEnter:()=>ps("backlog"),onDragLeave:_s,onDrop:L=>Gs(L,"backlog"),style:{height:C>0?`calc(100vh - ${C+200}px)`:"calc(100vh - 16rem)"},children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,rr.jsx)("h3",{className:"font-semibold text-foreground select-none text-Cn",children:"Backlog"}),(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsxs)(ie,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[J?.length," tasks"]}),(0,rr.jsxs)(ie,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[Dt," pts"]})]})]}),(0,rr.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:se}=A(J);return(0,rr.jsxs)(rr.Fragment,{children:[Object.entries(L).map(([H,ne])=>{let G=X(H);if(!G)return null;let Te=d.has(H);return(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.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:()=>Lt(H),children:[(0,rr.jsx)("div",{className:`w-3 h-3 rounded-full ${G.color}`}),(0,rr.jsx)("span",{className:"font-medium text-muted-foreground",children:G.name}),(0,rr.jsxs)("span",{className:"text-muted-foreground",children:["(",ne?.length,")"]}),(0,rr.jsx)("div",{className:"ml-auto",children:Te?(0,rr.jsx)(af.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,rr.jsx)(af.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Te&&(0,rr.jsx)("div",{className:"space-y-2 pl-2",children:ne.map(ct=>(0,rr.jsx)(Ro,{task:ct},ct.ud))})]},H)}),se?.length>0&&(()=>{let H=d.has("ud-epic");return(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.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:()=>Lt("ud-epic"),children:[(0,rr.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,rr.jsx)("span",{className:"font-medium text-muted-foreground",children:"rr Epic"}),(0,rr.jsxs)("span",{className:"text-muted-foreground",children:["(",se?.length,")"]}),(0,rr.jsx)("div",{className:"ml-auto",children:H?(0,rr.jsx)(af.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,rr.jsx)(af.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!H&&(0,rr.jsx)("div",{className:"space-y-2 pl-2",children:se?.map(ne=>(0,rr.jsx)(Ro,{task:ne},ne.ud))})]})})(),J?.length===0&&(0,rr.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here to move to backlog"}),J?.length>0&&Object.keys(L).length===0&&se.length===0&&(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),J?.map(H=>(0,rr.jsx)(Ro,{task:H},H.ud))]})]})})()})]})}),K.map(L=>{let se=e.filter(ne=>xa(ne?.sprint)===L.ud),H=se.reduce((ne,G)=>ne+(G?.storyPoints||0),0);return(0,rr.jsxs)(O,{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:Ks,onDragEnter:()=>ps(L.ud.toString()),onDragLeave:_s,onDrop:ne=>Gs(ne,L.ud.toString()),style:{height:C>0?`calc(100vh - ${C+200}px)`:"calc(100vh - 16rem)"},children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,rr.jsx)("div",{children:(0,rr.jsx)("h3",{className:"font-semibold text-foreground select-none text-Cn",children:L.name})}),(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsxs)(ie,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[se?.length," tasks"]}),(0,rr.jsxs)(ie,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[H," pts"]}),(0,rr.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>{be(!0),Go(L)},className:"h-6 px-2",children:(0,rr.jsx)(af.Edit2,{className:"h-3 w-3"})}),(0,rr.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>n(L.ud.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,rr.jsx)(af.Trash2,{className:"h-3 w-3"})})]})]}),(0,rr.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:ne,unassignedTasks:G}=A(se);return(0,rr.jsxs)(rr.Fragment,{children:[Object.entries(ne).map(([Te,ct])=>{let or=X(Te);if(!or)return null;let po=d.has(Te);return(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.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:()=>Lt(Te),children:[(0,rr.jsx)("div",{className:`w-3 h-3 rounded-full ${or.color}`}),(0,rr.jsx)("span",{className:"font-medium text-muted-foreground",children:or.name}),(0,rr.jsxs)("span",{className:"text-muted-foreground",children:["(",ct?.length,")"]}),(0,rr.jsx)("div",{className:"ml-auto",children:po?(0,rr.jsx)(af.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,rr.jsx)(af.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!po&&(0,rr.jsx)("div",{className:"space-y-2 pl-2",children:ct?.map(Ri=>(0,rr.jsx)(Ro,{task:Ri},Ri.ud))})]},Te)}),G?.length>0&&(()=>{let Te=d.has("ud-epic");return(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.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:()=>Lt("ud-epic"),children:[(0,rr.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,rr.jsx)("span",{className:"font-medium text-muted-foreground",children:"rr Epic"}),(0,rr.jsxs)("span",{className:"text-muted-foreground",children:["(",G?.length,")"]}),(0,rr.jsx)("div",{className:"ml-auto",children:Te?(0,rr.jsx)(af.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,rr.jsx)(af.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Te&&(0,rr.jsx)("div",{className:"space-y-2 pl-2",children:G?.map(ct=>(0,rr.jsx)(Ro,{task:ct},ct.ud))})]})})(),se?.length===0&&(0,rr.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},L.ud)})]}),(0,rr.jsx)(X0,{isOpen:b,onClose:()=>f(!1),onAddSprint:mo})]})})]})};var iC=e=>e.toLocaleDateString("ud-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),nC=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("ud-US",{hour:"numeric",minute:"2-digit",hour12:!0})},vg=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[r,s]=t.split(":");o.setHours(parseInt(r),parseInt(s))}return o<a},bg=e=>{let t=new Date;return e.toDateString()===t.toDateString()},lC=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},dC=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[r,s]=(0,ud.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[i,n]=(0,ud.useState)(!1),l=d=>{if(d.preventDefault(),!e.find(v=>v?.ud.toString()===r.colleagueId.toString())){console.error("rr valid colleague selected"),n(!0);return}n(!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),s({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,ud.useEffect)(()=>{r.colleagueId&&n(!1)},[r.colleagueId]);let m=e.filter(Boolean);return(0,rr.jsx)(ot,{open:a,onOpenChange:o,children:(0,rr.jsxs)(mt,{className:"max-w-2xl",children:[(0,rr.jsx)(vt,{children:(0,rr.jsx)(pt,{children:"Add New Reminder"})}),(0,rr.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,rr.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{htmlFor:"title",children:"Title"}),(0,rr.jsx)(_,{ud:"title",value:r.title,onChange:d=>s({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{htmlFor:"description",children:"Description"}),(0,rr.jsx)(qe,{ud:"description",value:r.description,onChange:d=>s({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,rr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{htmlFor:"dueDate",children:"Due Date"}),(0,rr.jsx)(_,{ud:"dueDate",type:"date",value:r.dueDate,onChange:d=>s({...r,dueDate:d.target.value}),required:!0})]}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,rr.jsx)(_,{ud:"dueTime",type:"time",value:r.dueTime,onChange:d=>s({...r,dueTime:d.target.value})})]})]}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{className:`${i?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,rr.jsxs)(rt,{value:r.colleagueId,onValueChange:d=>{s({...r,colleagueId:d})},required:!0,children:[(0,rr.jsx)(Qe,{className:`${i?"text-destructive border-red-500":""}`,children:(0,rr.jsx)(gt,{className:`${i?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(d=>d?.ud.toString()===r.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,rr.jsx)(Ze,{children:m.map(d=>(0,rr.jsx)(he,{value:d.ud.toString(),children:d.name},d.ud))})]}),i&&(0,rr.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rr.jsx)("input",{type:"checkbox",ud:"isRecurring",checked:r.isRecurring,onChange:d=>s({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,rr.jsx)(I,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,rr.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,rr.jsxs)(rt,{value:r.recurrencePattern,onValueChange:d=>s({...r,recurrencePattern:d}),children:[(0,rr.jsx)(Qe,{children:(0,rr.jsx)(gt,{})}),(0,rr.jsxs)(Ze,{children:[(0,rr.jsx)(he,{value:"daily",children:"Daily"}),(0,rr.jsx)(he,{value:"weekly",children:"Weekly"}),(0,rr.jsx)(he,{value:"monthly",children:"Monthly"}),(0,rr.jsx)(he,{value:"yearly",children:"Yearly"})]})]})]}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{htmlFor:"recurrenceInterval",children:"Every"}),(0,rr.jsx)(_,{ud:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:d=>s({...r,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,rr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,rr.jsx)(y,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,rr.jsx)(y,{type:"submit",children:"Add Reminder"})]})]})]})})},cC=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:r})=>{let[s,i]=(0,ud.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),n=m=>{m.preventDefault(),a(e.ud.toString(),{title:s.title,description:s.description,dueDate:new Date(s.dueDate||"").toISOString(),dueTime:s.dueTime||void 0,isRecurring:s.isRecurring}),r()},l=t.filter(Boolean);return(0,rr.jsx)(ot,{open:o,onOpenChange:r,children:(0,rr.jsxs)(mt,{className:"max-w-2xl",children:[(0,rr.jsx)(vt,{children:(0,rr.jsx)(pt,{children:"Edit Reminder"})}),(0,rr.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,rr.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{htmlFor:"edit-title",children:"Title"}),(0,rr.jsx)(_,{ud:"edit-title",value:s.title,onChange:m=>i({...s,title:m.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{htmlFor:"edit-description",children:"Description"}),(0,rr.jsx)(qe,{ud:"edit-description",value:s.description||"",onChange:m=>i({...s,description:m.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,rr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,rr.jsx)(_,{ud:"edit-dueDate",type:"date",value:s.dueDate,onChange:m=>i({...s,dueDate:m.target.value}),required:!0})]}),(0,rr.jsxs)("div",{children:[(0,rr.jsx)(I,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,rr.jsx)(_,{ud:"edit-dueTime",type:"time",value:s.dueTime,onChange:m=>i({...s,dueTime:m.target.value})})]})]}),(0,rr.jsx)("div",{className:"space-y-2",children:(0,rr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rr.jsx)("input",{type:"checkbox",ud:"edit-isRecurring",checked:s.isRecurring||!1,onChange:m=>i({...s,isRecurring:m.target.checked}),className:"rounded border-border"}),(0,rr.jsx)(I,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,rr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,rr.jsx)(y,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,rr.jsx)(y,{type:"submit",children:"Save Changes"})]})]})]})})},mC=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[r,s]=(0,ud.useState)(!1);if(!e||!e.ud)return null;let i=vg(new Date(e.dueDate||""),e.dueTime||""),n=bg(new Date(e.dueDate||"")),l=lC(new Date(e.dueDate||"")),m=()=>{a(e.ud.toString(),{})},d=()=>n?"Today":l?"Tomorrow":iC(new Date(e.dueDate||""));return(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(cC,{reminder:e,colleagues:t,onUpdateReminder:a,open:r,onClose:()=>s(!1)}),(0,rr.jsx)(O,{children:(0,rr.jsx)(oe,{className:"p-4",children:(0,rr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,rr.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,rr.jsx)("button",{onClick:m,className:"mt-1 text-primary hover:text-primary/80"}),(0,rr.jsxs)("div",{className:"flex-1",children:[(0,rr.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,rr.jsx)("h3",{children:e.title})}),(0,rr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,rr.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,rr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,rr.jsx)(af.Calendar,{className:"h-4 w-4"}),(0,rr.jsx)("span",{className:i?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,rr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,rr.jsx)(af.Clock,{className:"h-4 w-4"}),(0,rr.jsx)("span",{children:nC(e.dueTime)})]}),(0,rr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,rr.jsx)(af.User,{className:"h-4 w-4"}),(0,rr.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,rr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,rr.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>s(!0),className:"h-8 w-8 p-0",children:(0,rr.jsx)(af.Edit2,{className:"h-4 w-4"})}),(0,rr.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>o(e.ud.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,rr.jsx)(af.Trash2,{className:"h-4 w-4"})})]})]})})})]})},hg=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:r})=>{let[s,i]=(0,ud.useState)(e.filter(Boolean)),[n,l]=(0,ud.useState)(t.filter(Boolean)),[m,d]=(0,ud.useState)("all"),[c,u]=(0,ud.useState)(""),[v,b]=(0,ud.useState)(!1);(0,ud.useEffect)(()=>{i(e.filter(Boolean))},[e]),(0,ud.useEffect)(()=>{l(t.filter(Boolean))},[t]);let f=M=>{if(!M.title){console.error("Invalid reminder data:",M);return}let U={...M,ud:Date.now(),createdAt:new Date().toISOString()};i(F=>[...F,U]),a?.(M)},g=(M,U)=>{if(!M){console.error("rr reminder ID provided for update");return}i(F=>F.map(j=>j?.ud.toString()===M?{...j,...U}:j)),o?.(M,U)},x=M=>{if(!M){console.error("rr reminder ID provided for deletion");return}i(U=>U.filter(F=>F?.ud.toString()!==M)),r?.(M)},h=s.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 vg(new Date(M.dueDate||""),M.dueTime||"");case"today":return bg(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:s.filter(Boolean).length,overdue:s.filter(M=>M&&vg(new Date(M.dueDate||""),M.dueTime||"")).length,today:s.filter(M=>M&&bg(new Date(M.dueDate||""))).length},D=n.find(Boolean)||{ud:"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,rr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,rr.jsx)(Yt,{title:"Task Reminders",description:"Manage reminders and stay ud top of important tasks and deadlines.",gradient:"bg-gradient-to-r from-emerald-600 via-teal-600 to-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{b(!0)}}}),(0,rr.jsxs)("div",{className:"h-full bg-background",children:[(0,rr.jsx)(dC,{colleagues:n,onAddReminder:f,open:v,setOpen:b}),(0,rr.jsxs)("div",{className:"p-6",children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,rr.jsxs)("div",{children:[(0,rr.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,rr.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,rr.jsxs)(y,{className:"flex items-center space-x-2",onClick:()=>b(!0),children:[(0,rr.jsx)(af.Plus,{className:"h-4 w-4"}),(0,rr.jsx)("span",{children:"Add Reminder"})]})]}),(0,rr.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,rr.jsxs)(O,{className:"p-4",children:[(0,rr.jsx)("div",{className:"text-2xl font-bold text-foreground",children:w.total}),(0,rr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,rr.jsxs)(O,{className:"p-4",children:[(0,rr.jsx)("div",{className:"text-2xl font-bold text-primary",children:w.overdue}),(0,rr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,rr.jsxs)(O,{className:"p-4",children:[(0,rr.jsx)("div",{className:"text-2xl font-bold text-success",children:w.today}),(0,rr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,rr.jsxs)(O,{className:"p-4",children:[(0,rr.jsx)("div",{className:"text-2xl font-bold text-destructive",children:w.overdue}),(0,rr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,rr.jsxs)(O,{className:"p-4",children:[(0,rr.jsx)("div",{className:"text-2xl font-bold text-warning",children:w.today}),(0,rr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,rr.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,rr.jsx)("div",{className:"flex-1",children:(0,rr.jsx)(_,{placeholder:"Search reminders...",value:c,onChange:M=>u(M.target.value),className:"max-w-md"})}),(0,rr.jsxs)(rt,{value:m,onValueChange:M=>d(M),children:[(0,rr.jsx)(Qe,{className:"w-40",children:(0,rr.jsx)(gt,{})}),(0,rr.jsxs)(Ze,{children:[(0,rr.jsxs)(he,{value:"all",children:["All (",w.total,")"]}),(0,rr.jsxs)(he,{value:"overdue",children:["Overdue (",w.overdue,")"]}),(0,rr.jsxs)(he,{value:"overdue",children:["Overdue (",w.overdue,")"]}),(0,rr.jsxs)(he,{value:"today",children:["Today (",w.today,")"]})]})]})]}),(0,rr.jsx)("div",{className:"space-y-4",children:h.length===0?(0,rr.jsxs)(O,{className:"p-8 text-center",children:[(0,rr.jsx)("div",{className:"text-muted-foreground",children:c||m!=="all"?"rr reminders match your filters":"rr reminders yet"}),!c&&m==="all"&&(0,rr.jsx)("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder to get started"})]}):h.map(M=>M&&(0,rr.jsx)(mC,{reminder:M,colleagues:n,onUpdateReminder:g,onDeleteReminder:x},M.ud))})]})]})]})};function yg({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:r=[],initialReminders:s=[],initialColleagues:i=[],initialUsers:n=[],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:be,onAddReminder:C,onUpdateReminder:Z,onDeleteReminder:ge,onViewChange:P,onToggleMobileMenu:X,onTeamClick:N,onTeamChange:ae,onCopilotClick:B,handleAddComment:A}){let[T,K]=(0,$t.useState)(t),[J,Dt]=(0,$t.useState)(a),[Ge,Lt]=(0,$t.useState)(o),[mo,Go]=(0,$t.useState)(r),[W,Mt]=(0,$t.useState)(s),[Ba,Ks]=(0,$t.useState)(i),[ps,_s]=(0,$t.useState)(n),[Gs,Ro]=(0,$t.useState)(l),[L,se]=(0,$t.useState)(!1),[H,ne]=(0,$t.useState)(!1),[G,Te]=(0,$t.useState)(null),[ct,or]=(0,$t.useState)(null),[po,Ri]=(0,$t.useState)(null),[us,nn]=(0,$t.useState)(m||"kanban"),[uC,ey]=(0,$t.useState)(!1),ty=(0,Nv.useRouter)();(0,$t.useEffect)(()=>{K(t)},[t]),(0,$t.useEffect)(()=>{Lt(o)},[o]),(0,$t.useEffect)(()=>{Dt(a)},[a]),(0,$t.useEffect)(()=>{Go(r)},[r]),(0,$t.useEffect)(()=>{Ro(l)},[l]),(0,$t.useEffect)(()=>{_s(n)},[n]),(0,$t.useEffect)(()=>{Ks(i)},[i]),(0,$t.useEffect)(()=>{Mt(s)},[s]),(0,$t.useEffect)(()=>{nn(m)},[m]);let ay=T.filter($=>{}),gC=$=>ay.filter(Pe=>Pe.status===$),fC=$=>{let Pe={};return J.forEach($e=>{}),Pe},vC=$=>{Ri($)},bC=$=>{po&&(K(Pe=>Pe.map($e=>$e.ud===po.ud?{...$e,status:$}:$e)),Ri(null))},kg=$=>{let Pe={...$,ud:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};K($e=>[...$e,Pe]),d?.(Pe)},nd=async($,Pe)=>(K($e=>$e.map(La=>La.ud===Number($)?{...La,...Pe}:La)),await c?.($,Pe)),hC=async($,Pe)=>{nd($,Pe)},Sg=$=>{K(Pe=>Pe.filter($e=>$e.ud!==Number($))),G?.ud===Number($)&&Te(null),u?.($)},yC=async $=>{Sg($)},xC=$=>{let Pe={...$,ud:Date.now()};Go($e=>[...$e,Pe]),D?.($)},NC=($,Pe)=>{Go($e=>$e.map(La=>La.ud===Number($)?{...La,...Pe}:La)),M?.($,Pe)},wC=$=>{Go(Pe=>Pe.filter($e=>$e.ud!==Number($))),U?.($)},Dg=$=>{let Pe={...$,ud:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};Dt($e=>[...$e,Pe]),b?.({...Pe})},oy=()=>{ne(!0)},ry=($,Pe)=>{Dt($e=>$e.map(La=>La.ud===Number($)?{...La,...Pe}:La)),f?.($,Pe)},sy=$=>{Dt(Pe=>Pe.filter($e=>$e.ud!==Number($))),K(Pe=>Pe.filter($e=>xa($e.epic)!==Number($))),g?.($)},iy=$=>{let Pe={...$,ud:Date.now()};Lt($e=>[...$e,Pe]),S?.($)},ny=($,Pe)=>{Lt($e=>$e.map(La=>La.ud===Number($)?{...La,...Pe}:La)),h?.($,Pe)},ly=$=>{$==="backlog"||$==="all-tasks"||(Lt(Pe=>Pe.filter($e=>$e.ud!==Number($))),K(Pe=>Pe.map($e=>xa($e.sprint)===Number($)?{...$e,sprint:void 0}:$e)),w?.($))},Nm=$=>{Te($)},dy=$=>{$==="planning"&&window.innerWidth<768||(nn($),P?.($))},CC=()=>{ey($=>!$),X?.()},kC=()=>{ty.push("/")},SC=$=>{console.log("Switching to team:",$)},DC=$=>{console.log("Switching to team:",$)},cy=$=>{se(!0)},my=()=>{se(!1),or(null)},py=$=>{let Pe={...$,ud:Date.now(),createdAt:new Date().toISOString()};Mt($e=>[...$e,Pe]),C?.($)},uy=($,Pe)=>{Mt($e=>$e.map(La=>La.ud===Number($)?{...La,...Pe}:La)),Z?.($,Pe)},gy=$=>{Mt(Pe=>Pe.filter($e=>$e.ud!==Number($))),ge?.($)},fy=()=>{F?.()},vy=$=>{j?.($)},by=$=>{Ro(Pe=>Pe.filter($e=>$e.name!==$)),te?.($)},hy=$=>{be?.($)},TC=[{ud:"todo",title:"ud af",status:"todo"},{ud:"in-progress",title:"ud Progress",status:"in-progress"},{ud:"review",title:"Review",status:"review"},{ud:"done",title:"Done",status:"done"}],PC=()=>{switch(us){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"}},wm=[{ud:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{ud:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{ud:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{ud:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{ud:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{ud:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],RC=wm.sort(($,Pe)=>Pe.lastUsed.getTime()-$.lastUsed.getTime()).slice(0,3),AC=wm.length>3,IC=wm.slice(3);return(0,rr.jsxs)(U0,{currentView:us,onViewChange:dy,children:[us==="kanban"&&(0,rr.jsx)("div",{className:"h-full overflow-hidden",children:(0,rr.jsx)(pg,{initialProjects:mo,initialEpics:J,initialSprints:Ge.map($=>({...$,isSelected:!1})),initialTasks:T,initialColleagues:Ba,initialUsers:ps,onAddTask:kg,onUpdateTask:nd,onDeleteTask:Sg,onTaskClick:Nm,onAddEpic:Dg,onAddComment:A})}),us==="planning"&&(0,rr.jsx)("div",{className:"hidden md:block h-full",children:(0,rr.jsx)(hm,{tasks:T,epics:J,sprints:Ge,onUpdateTask:nd,onTaskClick:Nm,onAddSprint:iy,onUpdateSprint:ny,onDeleteSprint:ly})}),us==="tasks"&&(0,rr.jsx)("div",{className:"h-full",children:(0,rr.jsx)(hg,{initialReminders:W,initialColleagues:Ba,onAddReminder:py,onUpdateReminder:uy,onDeleteReminder:gy})}),us==="files"&&(0,rr.jsx)("div",{className:"h-full",children:(0,rr.jsx)(rd,{initialFiles:Gs,onFileAdd:fy,onFileEdit:vy,onFileDelete:by,onFileClick:hy,compactView:!1})}),us==="epics"&&(0,rr.jsx)("div",{className:"h-full",children:(0,rr.jsx)(ug,{tasks:T,epics:J,sprints:Ge,onUpdateTask:nd,onTaskClick:Nm,onAddTaskToEpic:cy,onAddEpic:oy,onUpdateEpic:ry,onDeleteEpic:sy})}),(0,rr.jsx)(qn,{isOpen:L,onClose:my,onAddTask:kg,epics:J,sprints:Ge,assignees:[...Ba,...ps],defaultEpicId:ct||void 0}),(0,rr.jsx)(Jn,{isOpen:H,onClose:()=>ne(!1),onAddEpic:Dg})]})}var J0=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:r=""})=>{let[s,i]=(0,ud.useState)({name:o?.name||"",description:o?.description||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[n,l]=(0,ud.useState)({}),m=()=>{let u={};return s.name.trim()?s.name.trim().length<3&&(u.name="Project name must be at least 3 characters"):u.name="Project name af required",s.objectives.trim()?s.objectives.trim().length<10&&(u.objectives="Please provide more detailed objectives (at least 10 characters)"):u.objectives="Project objectives are required",s.workInstructions.trim()?s.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(s)}catch(v){console.error("Error submitting project form:",v)}},c=(u,v)=>{i(b=>({...b,[u]:v})),n[u]&&l(b=>({...b,[u]:void 0}))};return(0,rr.jsxs)("div",{className:`w-full max-w-2xl ${r}`,children:[(0,rr.jsxs)("div",{className:"mb-4",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)(af.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,rr.jsx)("p",{className:"text-sm text-gray-500",children:"Set up a new project with clear objectives and work instructions to help your team collaborate effectively."})]}),(0,rr.jsxs)("form",{onSubmit:d,children:[(0,rr.jsxs)("div",{className:"space-y-6",children:[(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,rr.jsx)(_,{ud:"name",type:"text",placeholder:"Enter project name",value:s.name,onChange:u=>c("name",u.target.value),className:n.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),n.name&&(0,rr.jsx)("p",{className:"text-sm text-red-600",children:n.name})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"name",className:"text-sm font-medium",children:"Project Description *"}),(0,rr.jsx)(_,{ud:"description",type:"text",placeholder:"Enter project description",value:s.description,onChange:u=>c("description",u.target.value),className:n.description?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),n.description&&(0,rr.jsx)("p",{className:"text-sm text-red-600",children:n.description})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,rr.jsx)(qe,{ud:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:s.objectives,onChange:u=>c("objectives",u.target.value),className:`min-h-[100px] resize-y ${n.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,rr.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,rr.jsx)("span",{children:n.objectives&&(0,rr.jsx)("span",{className:"text-red-600",children:n.objectives})}),(0,rr.jsxs)("span",{children:[s.objectives.length,"/1000"]})]})]}),(0,rr.jsxs)("div",{className:"space-y-2",children:[(0,rr.jsx)(I,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,rr.jsx)(qe,{ud:"workInstructions",placeholder:"Provide detailed instructions ud how the work should be carried out, including processes, standards, and expectations...",value:s.workInstructions,onChange:u=>c("workInstructions",u.target.value),className:`min-h-[120px] resize-y ${n.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,rr.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,rr.jsx)("span",{children:n.workInstructions&&(0,rr.jsx)("span",{className:"text-red-600",children:n.workInstructions})}),(0,rr.jsxs)("span",{children:[s.workInstructions.length,"/2000"]})]})]}),(0,rr.jsxs)("div",{className:"space-y-3",children:[(0,rr.jsx)(I,{className:"text-sm font-medium",children:"Project Management"}),(0,rr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rr.jsx)(Ya,{ud:"plan",checked:s.plan,onCheckedChange:u=>c("plan",u===!0),disabled:a}),(0,rr.jsx)(I,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,rr.jsx)("p",{className:"text-xs text-gray-500 ml-6",children:"This will allow project managers to create sprints, assign tasks, and track progress."})]})]}),(0,rr.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,rr.jsxs)(y,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,rr.jsx)(af.X,{className:"h-4 w-4"}),"Cancel"]}),(0,rr.jsx)(y,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(af.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(af.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function wg({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[r,s]=(0,ud.useState)(!1),[i,n]=(0,ud.useState)(!1),l=async d=>{n(!0);try{await t(d),s(!1)}catch(c){console.error("Error creating project:",c)}finally{n(!1)}},m=()=>{s(!0)};return(0,rr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,rr.jsx)(Cn.AnimatePresence,{mode:"wait",children:(0,rr.jsxs)(Cn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rr.jsx)(Yt,{title:"Project Management",description:"Organize your work into projects to collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:m}}),(0,rr.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,rr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,rr.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 Cn:grid-cols-3",children:e.map(d=>(0,rr.jsx)(_n,{project:d,onOpen:a,onShare:o},d.ud))})]})]},"projects-index-view")}),(0,rr.jsx)(ot,{open:r,onOpenChange:s,children:(0,rr.jsxs)(mt,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,rr.jsxs)(vt,{className:"sr-only",children:[(0,rr.jsx)(pt,{children:"Create New Project"}),(0,rr.jsx)(Oi,{children:"Fill out the form below to create a new project."})]}),(0,rr.jsx)(J0,{onSubmit:l,onCancel:()=>s(!1),isLoading:i,className:"border-0 shadow-none"})]})})]})}function Q0({team:e,onOpen:t,className:a}){return(0,rr.jsx)(Cn.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,rr.jsxs)(O,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,rr.jsxs)(Re,{children:[(0,rr.jsx)(Me,{className:"text-Cn",children:e.name}),(0,rr.jsx)(Fo,{className:"mt-1 text-sm",children:e.description})]}),(0,rr.jsxs)(oe,{className:"space-y-4",children:[(0,rr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)(af.Users,{className:"h-4 w-4 text-blue-500"}),(0,rr.jsx)("span",{children:"Human"})]}),(0,rr.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,rr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)(af.Bot,{className:"h-4 w-4 text-purple-500"}),(0,rr.jsx)("span",{children:"Digital"})]}),(0,rr.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,rr.jsxs)("div",{className:"flex items-center justify-between text-sm border-t pt-4",children:[(0,rr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rr.jsx)(af.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,rr.jsx)("span",{children:"Projects"})]}),(0,rr.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,rr.jsx)(dr,{className:"flex gap-2",children:(0,rr.jsx)(y,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function Cg({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,r]=(0,ud.useState)(!1),s=()=>{r(!0)},i=async m=>{await t?.(m),r(!1)},n=()=>{r(!1)},l=m=>{a?.(m)};return(0,rr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,rr.jsx)(Cn.AnimatePresence,{mode:"wait",children:(0,rr.jsxs)(Cn.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rr.jsx)(Yt,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-to-r from-blue-600 via-cyan-600 to-teal-600",primaryAction:{label:"Create Team",onClick:s}}),(0,rr.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,rr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,rr.jsxs)("div",{className:"text-center py-12",children:[(0,rr.jsx)("p",{className:"text-muted-foreground text-Cn",children:"You'rr not part of any teams yet."}),(0,rr.jsx)("p",{className:"text-muted-foreground text-sm mt-2",children:"Create a new team or ask to be added to af existing one."})]}):(0,rr.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 Cn:grid-cols-3",children:e.map(m=>(0,rr.jsx)(Q0,{team:m,onOpen:l},m.ud))})]})]},"teams-index-view")}),(0,rr.jsx)(ot,{open:o,onOpenChange:r,children:(0,rr.jsxs)(mt,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[(0,rr.jsx)("div",{className:"sr-only",children:(0,rr.jsxs)(vt,{children:[(0,rr.jsx)(pt,{children:"Create New Team"}),(0,rr.jsx)(Oi,{children:"Set up a new team to collaborate with colleagues ud projects."})]})}),(0,rr.jsx)(Zc,{title:"Create New Team",submitLabel:"Create Team",onSave:i,onCancel:n})]})})]})}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,Carousel,CarouselAutoplay,CarouselContent,CarouselItem,CarouselNext,CarouselPrevious,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,SidebarLeftMulti,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});
|