@rafal.lemieszewski/tide-ui 0.87.5 → 0.87.7

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),E=require("react"),i=require("../fundamental/sidebar.cjs"),R=require("../fundamental/button.cjs"),p=require("../fundamental/icon.cjs"),d=require("lucide-react"),u=require("../fundamental/avatar.cjs"),F=require("../fundamental/separator.cjs"),V=require("../fundamental/kbd.cjs"),a=require("../fundamental/dropdown-menu.cjs"),c=require("../fundamental/tooltip.cjs"),h=require("../fundamental/command.cjs");function U(o){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const x in o)if(x!=="default"){const n=Object.getOwnPropertyDescriptor(o,x);Object.defineProperty(l,x,n.get?n:{enumerable:!0,get:()=>o[x]})}}return l.default=o,Object.freeze(l)}const g=U(E),G={name:"John Doe",email:"john@example.com",avatarUrl:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=32&h=32&fit=crop&crop=face"},P=[{name:"Acme Corp",role:"Admin",plan:"Enterprise",avatarUrl:"https://useful-toucan-91.convex.cloud/api/storage/5e36a31d-3f0a-4bb0-95db-f5b1c8e8af93"},{name:"Startup Inc",role:"Member",plan:"Pro",avatarUrl:"https://useful-toucan-91.convex.cloud/api/storage/5e36a31d-3f0a-4bb0-95db-f5b1c8e8af93"}],q={main:[{title:"Home",icon:d.House,url:"/home",isActive:!1},{title:"Boards",icon:d.LayoutDashboard,url:"/boards",isActive:!1}],operations:[{title:"Voyage economics",icon:d.Ship,url:"/freight-planner",isActive:!1,items:[]},{title:"Trade desk",icon:d.TrendingUp,url:"/trade-desk",isActive:!1,items:[]},{title:"Agreements",icon:d.ScrollText,url:"/agreements",isActive:!0,items:[{title:"Recaps",url:"/agreements/recaps",isActive:!0},{title:"Contracts",url:"/agreements/contracts",isActive:!1},{title:"Clause library",url:"/agreements/clause-library",isActive:!1}]},{title:"Compliance",icon:d.ShieldCheck,url:"/compliance",isActive:!1,items:[]}],intelligence:[{title:"Global market",icon:d.Globe,url:"/global-market",isActive:!1,items:[{title:"Supply",url:"/global-market/supply",isActive:!1},{title:"Commodities",url:"/global-market/commodities",isActive:!1},{title:"Freight",url:"/global-market/freight",isActive:!1}]},{title:"Assets",icon:d.Container,url:"/assets",isActive:!1,items:[{title:"Vessels",url:"/assets/vessels",isActive:!1},{title:"Fleets",url:"/assets/fleets",isActive:!1},{title:"Ports",url:"/assets/ports",isActive:!1},{title:"Canals",url:"/assets/canals",isActive:!1}]},{title:"Fixtures",icon:d.Anchor,url:"/fixtures",isActive:!1}],support:[{title:"Notifications",icon:d.Bell,url:"/notifications",isActive:!1},{title:"Help & support",icon:d.CircleHelp,url:"/help-support",isActive:!1}]},H=o=>o.split(" ").filter(Boolean).map(l=>l[0]).join("").slice(0,2).toUpperCase(),L=o=>o.split(" ").filter(Boolean).map(l=>l[0]).join("").slice(0,2).toUpperCase(),D=()=>typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.userAgent);function K(o,l){return o.reduce((x,n)=>{const b=l(n);return(x[b]??=[]).push(n),x},{})}function B(o){const l={};return[...o.main||[],...o.operations||[],...o.intelligence||[],...o.support||[]].forEach(n=>{if(n.items&&n.items.length>0){const b=n.items.some(v=>v.isActive);l[n.title]=b}}),l}function Z({navigationData:o,user:l,teams:x,onNavigate:n,navigationMode:b,onNavigationModeChange:v,onSearchChange:y,searchItems:f,searchLoading:k}){const[A,j]=g.useState(!1),[I,M]=g.useState(""),[C,N]=g.useState(()=>B(o)),[s,m]=g.useState(x[0]),S=r=>{N(t=>({...t,[r]:!t[r]}))},O=r=>r.items&&r.items.some(t=>t.isActive),z=r=>{if(r.items&&r.items.length>0){const t=r.items.find(w=>w.isActive);if(t)return`${r.title} → ${t.title}`}return r.title};return g.useEffect(()=>{const r=t=>{t.key==="k"&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),j(w=>!w))};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[]),g.useEffect(()=>{N(B(o))},[o]),e.jsxs(c.TooltipProvider,{delayDuration:100,children:[e.jsxs(i.Sidebar,{variant:"sidebar",collapsible:"icon",className:"flex h-full flex-col",children:[e.jsx(i.SidebarHeader,{className:"sticky top-0 z-10 h-12 border-b border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] group-data-[collapsible=icon]:flex group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-2 box-border",children:e.jsx("div",{className:"flex h-[22px] w-7 items-center justify-center",children:e.jsx("svg",{width:"28",height:"22",viewBox:"0 0 28 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4.39355 0.688477C6.89528 0.688477 8.12094 1.67409 8.12109 3.74609V7.69043H5.5332V2.87695H3.28711V8.03125L8.12109 11.458V18.2705C8.12109 20.3262 6.92916 21.3125 4.39355 21.3125C1.85827 21.3124 0.701172 20.3261 0.701172 18.2705L0.700195 13.7412H3.28711V19.1396H5.5332V12.6777L0.701172 9.23438V3.74609C0.701322 1.67422 1.89214 0.688597 4.39355 0.688477ZM13.8379 0.6875C16.4752 0.687615 17.6152 1.67395 17.6152 3.74609V10.5312L12.6113 13.7236V19.123H15.0273V14.3096H17.6143V18.2705C17.6143 20.3262 16.4235 21.3125 13.8027 21.3125C11.1821 21.3125 10.0244 20.3262 10.0244 18.2705V3.74609H10.0254C10.0254 1.67382 11.2003 0.6875 13.8379 0.6875ZM23.333 0.6875C25.9537 0.6875 27.1113 1.67378 27.1113 3.72949V18.2539H27.1104C27.1104 20.3261 25.9363 21.3125 23.2988 21.3125C20.6612 21.3125 19.5205 20.3262 19.5205 18.2539V11.4688L24.5254 8.27637V2.87695H22.1084V7.69043H19.5215V3.72949C19.5215 1.67384 20.7124 0.687556 23.333 0.6875ZM22.1084 12.2197V19.1396H24.5254V10.5986L22.1084 12.2197ZM12.6113 11.4014L15.0273 9.78027V2.86035H12.6113V11.4014Z",fill:"#005F85"})})})}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto group-data-[collapsible=icon]:overflow-hidden","data-sidebar":"content",children:[e.jsx("div",{className:"p-[var(--space-m)] pt-[var(--space-s)] group-data-[collapsible=icon]:px-2",children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute top-1/2 left-2 -translate-y-1/2 group-data-[collapsible=icon]:hidden",children:e.jsx(p.Icon,{name:d.Search,size:"m",color:"tertiary"})}),e.jsxs("div",{className:"group-data-[collapsible=icon]:hidden",children:[e.jsx("button",{onClick:()=>j(!0),className:"text-body-md flex h-8 w-full cursor-pointer items-center rounded-m border border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] px-3 py-1 pr-20 pl-8 text-left text-[var(--color-text-tertiary)] transition-colors hover:border-[var(--color-border-primary-medium)] hover:!bg-[var(--color-background-neutral-subtlest-hovered)] focus:border-[var(--color-border-brand-bold)] focus:ring-2 focus:ring-[var(--color-border-brand-bold)]/20 focus:ring-offset-0 focus:outline-none active:border-[var(--color-border-primary-medium)]",children:"Search"}),e.jsxs("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 gap-1",children:[e.jsx(V.Kbd,{size:"s",children:D()?"⌘":"Ctrl"}),e.jsx(V.Kbd,{size:"s",children:"K"})]})]}),e.jsxs(c.Tooltip,{delayDuration:500,children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx("button",{onClick:()=>j(!0),className:"hidden h-8 w-8 cursor-pointer items-center justify-center rounded border border-[var(--color-border-primary-subtle)] bg-transparent transition-all duration-200 group-data-[collapsible=icon]:flex hover:border-[var(--color-border-primary-medium)] hover:!bg-[var(--color-background-neutral-subtlest-hovered)] focus:border-[var(--color-border-brand-bold)] focus:ring-2 focus:ring-[var(--color-border-brand-bold)]/20 focus:ring-offset-0 focus:outline-none active:border-[var(--color-border-primary-medium)]","aria-label":"Search",children:e.jsx(p.Icon,{name:d.Search,size:"m",color:"tertiary"})})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:"Search"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(V.Kbd,{size:"s",variant:"dark",children:D()?"⌘":"Ctrl"}),e.jsx(V.Kbd,{size:"s",variant:"dark",children:"K"})]})]})})]})]})}),e.jsx(i.SidebarGroup,{className:"pb-1 mt-1 p-[var(--space-s)]",children:e.jsx(i.SidebarGroupContent,{children:e.jsx(i.SidebarMenu,{children:o.main.map(r=>e.jsx(i.SidebarMenuItem,{children:e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsxs(i.SidebarMenuButton,{isActive:r.isActive,onClick:t=>{n&&(t.preventDefault(),n(r.url))},children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title})]})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]})},r.title))})})}),e.jsx("div",{className:"my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex",children:e.jsx(F.Separator,{layout:"vertical"})}),e.jsxs(i.SidebarGroup,{className:"mt-1 p-[var(--space-s)]",children:[e.jsx(i.SidebarGroupLabel,{className:"py-1 pb-1.5 group-data-[collapsible=icon]:hidden",children:"Operations"}),e.jsx(i.SidebarGroupContent,{children:e.jsx(i.SidebarMenu,{children:o.operations.map(r=>e.jsx(i.SidebarMenuItem,{children:r.items&&r.items.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"group-data-[collapsible=icon]:hidden",children:e.jsxs(i.SidebarMenuButton,{isActive:r.isActive&&!r.items?.length,onClick:()=>S(r.title),children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title}),e.jsx(p.Icon,{name:d.ChevronRight,size:"s",className:`ml-auto transition-transform ${C[r.title]?"rotate-90":""}`})]})}),r.items&&r.items.length>0&&C[r.title]&&e.jsx(i.SidebarMenuSub,{children:r.items.map(t=>e.jsx(i.SidebarMenuSubItem,{children:e.jsx(i.SidebarMenuSubButton,{isActive:t.isActive,onClick:w=>{n&&(w.preventDefault(),n(t.url))},children:e.jsx("span",{children:t.title})})},t.title))}),e.jsx("div",{className:"hidden group-data-[collapsible=icon]:block",children:e.jsxs(a.DropdownMenu,{children:[e.jsxs(c.Tooltip,{children:[e.jsx(a.DropdownMenuTrigger,{asChild:!0,children:e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(i.SidebarMenuButton,{isActive:O(r),className:"w-full justify-center",children:e.jsx(p.Icon,{name:r.icon,size:"s"})})})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]}),e.jsxs(a.DropdownMenuContent,{side:"right",sideOffset:8,align:"start",children:[e.jsx(a.DropdownMenuLabel,{className:"text-body-medium-sm font-medium",children:r.title}),e.jsx(a.DropdownMenuSeparator,{}),r.items.map(t=>e.jsx(a.DropdownMenuItem,{className:t.isActive?"bg-[var(--color-background-blue-subtle-selected)] text-[var(--color-text-brand-bold)]":"",onSelect:()=>{n&&n(t.url)},children:t.title},t.title))]})]})})]}):e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsxs(i.SidebarMenuButton,{isActive:r.isActive,onClick:t=>{n&&(t.preventDefault(),n(r.url))},children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title})]})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]})},r.title))})})]}),e.jsx("div",{className:"my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex",children:e.jsx(F.Separator,{layout:"vertical"})}),e.jsxs(i.SidebarGroup,{className:"mt-1 p-[var(--space-s)]",children:[e.jsx(i.SidebarGroupLabel,{className:"py-1 pb-1.5 group-data-[collapsible=icon]:hidden",children:"Intelligence"}),e.jsx(i.SidebarGroupContent,{children:e.jsx(i.SidebarMenu,{children:o.intelligence.map(r=>e.jsx(i.SidebarMenuItem,{children:r.items&&r.items.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"group-data-[collapsible=icon]:hidden",children:e.jsxs(i.SidebarMenuButton,{isActive:r.isActive&&!r.items?.length,onClick:()=>S(r.title),children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title}),e.jsx(p.Icon,{name:d.ChevronRight,size:"s",className:`ml-auto transition-transform ${C[r.title]?"rotate-90":""}`})]})}),r.items&&r.items.length>0&&C[r.title]&&e.jsx(i.SidebarMenuSub,{children:r.items.map(t=>e.jsx(i.SidebarMenuSubItem,{children:e.jsx(i.SidebarMenuSubButton,{isActive:t.isActive,onClick:w=>{n&&(w.preventDefault(),n(t.url))},children:e.jsx("span",{children:t.title})})},t.title))}),e.jsx("div",{className:"hidden group-data-[collapsible=icon]:block",children:e.jsxs(a.DropdownMenu,{children:[e.jsxs(c.Tooltip,{children:[e.jsx(a.DropdownMenuTrigger,{asChild:!0,children:e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(i.SidebarMenuButton,{isActive:O(r),className:"w-full justify-center",children:e.jsx(p.Icon,{name:r.icon,size:"s"})})})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]}),e.jsxs(a.DropdownMenuContent,{side:"right",sideOffset:8,align:"start",children:[e.jsx(a.DropdownMenuLabel,{className:"text-body-medium-sm font-medium",children:r.title}),e.jsx(a.DropdownMenuSeparator,{}),r.items.map(t=>e.jsx(a.DropdownMenuItem,{className:t.isActive?"bg-[var(--color-background-blue-subtle-selected)] text-[var(--color-text-brand-bold)]":"",onSelect:()=>{n&&n(t.url)},children:t.title},t.title))]})]})})]}):e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsxs(i.SidebarMenuButton,{isActive:r.isActive,onClick:t=>{n&&(t.preventDefault(),n(r.url))},children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title})]})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]})},r.title))})})]}),e.jsx(i.SidebarGroup,{className:"pb-2 p-[var(--space-s)] mt-auto",children:e.jsx(i.SidebarGroupContent,{children:e.jsx(i.SidebarMenu,{children:o.support.map(r=>e.jsx(i.SidebarMenuItem,{children:e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsxs(i.SidebarMenuButton,{isActive:r.isActive,onClick:t=>{n&&(t.preventDefault(),n(r.url))},children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title})]})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]})},r.title))})})})]}),e.jsx(i.SidebarFooter,{className:"sticky bottom-0 z-10 border-t border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] group-data-[collapsible=icon]:px-2 group-data-[collapsible=icon]:py-2",children:e.jsx("div",{className:"group/user-menu rounded-m border border-[var(--color-border-primary-subtle)] transition-colors hover:border-[var(--color-border-primary-medium)] group-data-[collapsible=icon]:rounded-none group-data-[collapsible=icon]:border-none",children:e.jsxs(a.DropdownMenu,{children:[e.jsx(a.DropdownMenuTrigger,{asChild:!0,children:e.jsxs(R.Button,{variant:"ghost",className:"h-auto min-h-[56px] w-full justify-start rounded-m px-3 py-2 hover:!bg-[var(--color-background-neutral-subtlest-hovered)] group-data-[collapsible=icon]:h-8 group-data-[collapsible=icon]:min-h-0 group-data-[collapsible=icon]:w-8 group-data-[collapsible=icon]:p-0",children:[e.jsxs("div",{className:"flex w-full items-center gap-3 group-data-[collapsible=icon]:hidden",children:[e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsxs(u.Avatar,{size:"m",type:"user",children:[e.jsx(u.AvatarImage,{src:l.avatarUrl,alt:l.name}),e.jsx(u.AvatarFallback,{size:"m",type:"user",children:H(l.name)})]}),e.jsx("div",{className:"absolute -right-1 -bottom-1 rounded-[4px] border-2 border-white p-0",children:e.jsxs(u.Avatar,{size:"xxs",type:"organization",children:[e.jsx(u.AvatarImage,{src:s.avatarUrl,alt:s.name}),e.jsx(u.AvatarFallback,{size:"xxs",type:"organization",children:L(s.name)})]})})]}),e.jsxs("div",{className:"min-w-0 flex-1 text-left",children:[e.jsx("div",{className:"text-body-medium-sm truncate font-medium text-[var(--color-text-primary)]",children:l.name}),e.jsxs("div",{className:"text-body-xsm text-[var(--color-text-secondary)]",children:[s.role," at ",s.name]})]}),e.jsx(p.Icon,{name:d.ChevronDown,size:"m",className:"opacity-50"})]}),e.jsxs("div",{className:"relative hidden group-data-[collapsible=icon]:block",children:[e.jsxs(u.Avatar,{size:"s",type:"user",children:[e.jsx(u.AvatarImage,{src:l.avatarUrl,alt:l.name}),e.jsx(u.AvatarFallback,{size:"s",type:"user",children:H(l.name)})]}),e.jsx("div",{className:"absolute -right-1 -bottom-1 rounded-[2px] border-2 border-white bg-[var(--color-surface-primary)]",children:e.jsxs(u.Avatar,{size:"xxs",type:"organization",children:[e.jsx(u.AvatarImage,{src:s.avatarUrl,alt:s.name}),e.jsx(u.AvatarFallback,{size:"xxs",type:"organization",children:L(s.name)})]})})]})]})}),e.jsxs(a.DropdownMenuContent,{className:"w-[--radix-dropdown-menu-trigger-width]",align:"start",side:"top",sideOffset:4,children:[e.jsx(a.DropdownMenuLabel,{className:"p-0 font-normal",children:e.jsxs("div",{className:"flex items-center gap-3 px-2 py-2",children:[e.jsxs(u.Avatar,{size:"s",type:"user",children:[e.jsx(u.AvatarImage,{src:l.avatarUrl,alt:l.name}),e.jsx(u.AvatarFallback,{size:"s",type:"user",children:H(l.name)})]}),e.jsxs("div",{className:"grid flex-1 text-left",children:[e.jsx("span",{className:"text-body-medium-sm truncate font-semibold text-[var(--color-text-primary)]",children:l.name}),e.jsx("span",{className:"text-caption-xsm truncate text-[var(--color-text-secondary)]",children:l.email})]})]})}),e.jsx(a.DropdownMenuSeparator,{}),e.jsx(a.DropdownMenuLabel,{className:"px-2 py-1 text-[12px] font-medium text-[var(--color-text-tertiary)]",children:"Organizations"}),x.map(r=>e.jsxs(a.DropdownMenuItem,{onSelect:()=>m(r),className:"mx-1 mb-1 h-10 cursor-pointer gap-2 px-1 pr-2 pl-1",children:[e.jsxs(u.Avatar,{size:"s",type:"organization",children:[e.jsx(u.AvatarImage,{src:r.avatarUrl,alt:r.name}),e.jsx(u.AvatarFallback,{size:"s",type:"organization",children:L(r.name)})]}),e.jsxs("div",{className:"flex flex-1 flex-col text-left",children:[e.jsx("span",{className:"text-body-medium-sm truncate font-semibold text-[var(--color-text-primary)]",children:r.name}),e.jsxs("span",{className:"text-caption-xsm truncate text-[var(--color-text-secondary)]",children:[r.role," • ",r.plan," plan"]})]}),s.name===r.name&&e.jsx(p.Icon,{name:d.Check,size:"m",className:"text-[var(--color-icon-brand-bold)]"})]},r.name)),e.jsx(a.DropdownMenuSeparator,{}),e.jsx(a.DropdownMenuLabel,{className:"px-2 py-1 text-[12px] font-medium text-[var(--color-text-tertiary)]",children:"Navigation"}),e.jsxs(a.DropdownMenuItem,{className:"mx-1 mb-0.5 cursor-pointer gap-2 px-2",onSelect:()=>v("sidebar"),children:[e.jsx("span",{className:"flex-1",children:"New sidebar navigation"}),b==="sidebar"&&e.jsx(p.Icon,{name:d.Check,size:"m",className:"text-[var(--color-icon-brand-bold)]"})]}),e.jsxs(a.DropdownMenuItem,{className:"mx-1 mb-1 cursor-pointer gap-2 px-2",onSelect:()=>v("horizontal"),children:[e.jsx("span",{className:"flex-1",children:"Old horizontal menu"}),b==="horizontal"&&e.jsx(p.Icon,{name:d.Check,size:"m",className:"text-[var(--color-icon-brand-bold)]"})]}),e.jsx(a.DropdownMenuSeparator,{}),e.jsx(a.DropdownMenuItem,{icon:d.User,className:"cursor-pointer",onSelect:()=>{n&&n("/user/profile")},children:"User profile"}),e.jsx(a.DropdownMenuItem,{icon:d.Settings,className:"cursor-pointer",onSelect:()=>{n&&n("/organization/settings")},children:"Organization settings"}),e.jsx(a.DropdownMenuSeparator,{}),e.jsx(a.DropdownMenuItem,{icon:d.LogOut,destructive:!0,className:"cursor-pointer",onSelect:()=>{n&&n("/auth/sign-out")},children:"Sign out"})]})]})})}),e.jsx(i.SidebarRail,{})]}),e.jsxs(h.CommandDialog,{open:A,onOpenChange:j,commandProps:f?{shouldFilter:!1}:void 0,children:[e.jsx(h.CommandInput,{placeholder:"Type a command or search...",value:I,onValueChange:r=>{M(r),y?.(r)},clearable:!1}),e.jsxs(h.CommandList,{children:[e.jsx(h.CommandEmpty,{children:"No results found."}),k&&e.jsx("div",{className:"py-[var(--space-m)] text-center text-body-sm text-[var(--color-text-tertiary)]",children:"Searching…"}),f&&f.length>0&&(()=>{const r=K(f,t=>t.group??"Results");return Object.entries(r).map(([t,w])=>e.jsx(h.CommandGroup,{heading:t,children:w.map(T=>e.jsxs(h.CommandItem,{value:T.id,onSelect:()=>{T.onSelect?.(),j(!1)},children:[T.icon&&e.jsx(p.Icon,{name:T.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:T.label})]},T.id))},t))})(),e.jsxs(h.CommandGroup,{heading:"Quick actions",children:[e.jsxs(h.CommandItem,{onSelect:()=>console.log("Reload"),children:[e.jsx(p.Icon,{name:d.RotateCcw,size:"s",className:"mr-2"}),e.jsx("span",{children:"Reload Page"}),e.jsxs("span",{className:"text-caption-sm ml-auto text-[var(--color-text-tertiary)]",children:[D()?"⌘":"Ctrl","R"]})]}),e.jsxs(h.CommandItem,{onSelect:()=>j(!1),children:[e.jsx(p.Icon,{name:d.Search,size:"s",className:"mr-2"}),e.jsx("span",{children:"Search"}),e.jsxs("span",{className:"text-caption-sm ml-auto text-[var(--color-text-tertiary)]",children:[D()?"⌘":"Ctrl","K"]})]})]}),e.jsxs(h.CommandGroup,{heading:"Navigation",children:[o.main.map(r=>e.jsxs(h.CommandItem,{onSelect:()=>j(!1),children:[e.jsx(p.Icon,{name:r.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:r.title})]},r.title)),o.operations.map(r=>e.jsxs(h.CommandItem,{onSelect:()=>j(!1),children:[e.jsx(p.Icon,{name:r.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:r.title})]},r.title)),o.intelligence.map(r=>e.jsxs(h.CommandItem,{onSelect:()=>j(!1),children:[e.jsx(p.Icon,{name:r.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:r.title})]},r.title))]}),e.jsx(h.CommandGroup,{heading:"Settings",children:o.support.map(r=>e.jsxs(h.CommandItem,{onSelect:()=>j(!1),children:[e.jsx(p.Icon,{name:r.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:r.title})]},r.title))}),e.jsx(h.CommandGroup,{heading:"Switch team",children:x.map(r=>e.jsxs(h.CommandItem,{onSelect:()=>j(!1),children:[e.jsxs(u.Avatar,{size:"s",className:"mr-2",type:"organization",children:[e.jsx(u.AvatarImage,{src:r.avatarUrl,alt:r.name}),e.jsx(u.AvatarFallback,{size:"s",type:"organization",children:L(r.name)})]}),e.jsx("span",{children:r.name})]},r.name))})]})]})]})}function W({navigationData:o,user:l,activeTeam:x,onNavigate:n,navigationMode:b,onNavigationModeChange:v}){const[y,f]=g.useState(!1),k=g.useRef(null);g.useEffect(()=>{if(!y)return;const s=m=>{k.current&&!k.current.contains(m.target)&&f(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[y]);const A=[...o.main,...o.operations,...o.intelligence],j=A.find(s=>s.isActive||s.items?.some(m=>m.isActive))?.title??null,[I,M]=g.useState(j),C=A.find(s=>s.title===I)?.items??[],N=H(l.name);return e.jsxs("div",{style:{width:"100%"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",height:48,backgroundColor:"#162736",padding:"0 16px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[e.jsx("rect",{width:"20",height:"20",rx:"4",fill:"#005F85"}),e.jsx("rect",{x:"4",y:"4",width:"5",height:"5",rx:"1",fill:"white"}),e.jsx("rect",{x:"11",y:"4",width:"5",height:"5",rx:"1",fill:"white",opacity:"0.6"}),e.jsx("rect",{x:"4",y:"11",width:"5",height:"5",rx:"1",fill:"white",opacity:"0.6"}),e.jsx("rect",{x:"11",y:"11",width:"5",height:"5",rx:"1",fill:"white",opacity:"0.4"})]}),e.jsx("svg",{width:"28",height:"22",viewBox:"0 0 28 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4.39355 0.688477C6.89528 0.688477 8.12094 1.67409 8.12109 3.74609V7.69043H5.5332V2.87695H3.28711V8.03125L8.12109 11.458V18.2705C8.12109 20.3262 6.92916 21.3125 4.39355 21.3125C1.85827 21.3124 0.701172 20.3261 0.701172 18.2705L0.700195 13.7412H3.28711V19.1396H5.5332V12.6777L0.701172 9.23438V3.74609C0.701322 1.67422 1.89214 0.688597 4.39355 0.688477ZM13.8379 0.6875C16.4752 0.687615 17.6152 1.67395 17.6152 3.74609V10.5312L12.6113 13.7236V19.123H15.0273V14.3096H17.6143V18.2705C17.6143 20.3262 16.4235 21.3125 13.8027 21.3125C11.1821 21.3125 10.0244 20.3262 10.0244 18.2705V3.74609H10.0254C10.0254 1.67382 11.2003 0.6875 13.8379 0.6875ZM23.333 0.6875C25.9537 0.6875 27.1113 1.67378 27.1113 3.72949V18.2539H27.1104C27.1104 20.3261 25.9363 21.3125 23.2988 21.3125C20.6612 21.3125 19.5205 20.3262 19.5205 18.2539V11.4688L24.5254 8.27637V2.87695H22.1084V7.69043H19.5215V3.72949C19.5215 1.67384 20.7124 0.687556 23.333 0.6875ZM22.1084 12.2197V19.1396H24.5254V10.5986L22.1084 12.2197ZM12.6113 11.4014L15.0273 9.78027V2.86035H12.6113V11.4014Z",fill:"white"})})]}),e.jsx("div",{style:{flex:1}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("button",{onClick:()=>n?.("/notifications"),style:{background:"none",border:"none",cursor:"pointer",padding:6,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="rgba(255,255,255,0.1)"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"}),e.jsx("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"})]})}),e.jsxs("div",{ref:k,style:{position:"relative"},children:[e.jsx("button",{onClick:()=>f(s=>!s),style:{width:32,height:32,borderRadius:"50%",backgroundColor:"#005F85",color:"white",border:"2px solid rgba(255,255,255,0.3)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:600,padding:0},children:l.avatarUrl?e.jsx("img",{src:l.avatarUrl,alt:l.name,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):N}),y&&e.jsxs("div",{style:{position:"absolute",top:40,right:0,width:220,backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 24px rgba(0,0,0,0.15)",zIndex:9999,padding:"4px 0",fontSize:14},children:[e.jsxs("div",{style:{padding:"8px 12px",borderBottom:"1px solid #e5e7eb"},children:[e.jsx("div",{style:{fontWeight:600,color:"#111827"},children:l.name}),e.jsx("div",{style:{fontSize:12,color:"#6b7280"},children:l.email})]}),e.jsxs("div",{style:{padding:"4px 0",borderBottom:"1px solid #e5e7eb"},children:[e.jsx("div",{style:{padding:"4px 12px",fontSize:11,fontWeight:500,color:"#9ca3af",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Navigation"}),e.jsxs("button",{onClick:()=>{v("sidebar"),f(!1)},style:{display:"flex",alignItems:"center",width:"100%",padding:"6px 12px",background:"none",border:"none",cursor:"pointer",fontSize:14,color:"#374151",textAlign:"left"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="#f3f4f6"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:[e.jsx("span",{style:{flex:1},children:"New sidebar navigation"}),b==="sidebar"&&e.jsx("span",{style:{color:"#005F85",fontWeight:700},children:"✓"})]}),e.jsxs("button",{onClick:()=>{v("horizontal"),f(!1)},style:{display:"flex",alignItems:"center",width:"100%",padding:"6px 12px",background:"none",border:"none",cursor:"pointer",fontSize:14,color:"#374151",textAlign:"left"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="#f3f4f6"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:[e.jsx("span",{style:{flex:1},children:"Old horizontal menu"}),b==="horizontal"&&e.jsx("span",{style:{color:"#005F85",fontWeight:700},children:"✓"})]})]}),e.jsx("div",{style:{padding:"4px 0"},children:e.jsx("button",{onClick:()=>{n?.("/auth/sign-out"),f(!1)},style:{display:"flex",alignItems:"center",width:"100%",padding:"6px 12px",background:"none",border:"none",cursor:"pointer",fontSize:14,color:"#dc2626",textAlign:"left"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="#fef2f2"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:"Sign out"})})]})]})]})]}),e.jsx("div",{style:{display:"flex",alignItems:"center",height:40,backgroundColor:"#1e3a4f",padding:"0 16px",gap:2,overflowX:"auto"},children:A.map(s=>{const m=s.isActive||(s.items?.some(S=>S.isActive)??!1);return e.jsx("button",{onClick:S=>{S.preventDefault(),M(s.title),n?.(s.url)},style:{padding:"6px 14px",borderRadius:4,border:"none",cursor:"pointer",fontSize:13,fontWeight:m?600:400,color:"white",backgroundColor:m?"#005F85":"transparent",whiteSpace:"nowrap",transition:"background-color 0.15s"},onMouseEnter:S=>{m||(S.currentTarget.style.backgroundColor="rgba(255,255,255,0.1)")},onMouseLeave:S=>{m||(S.currentTarget.style.backgroundColor="transparent")},children:s.title},s.title)})}),C.length>0&&e.jsx("div",{style:{display:"flex",alignItems:"center",height:36,backgroundColor:"#f0f5f8",padding:"0 16px",gap:2,borderBottom:"1px solid #d1dde6",overflowX:"auto"},children:C.map(s=>e.jsx("button",{onClick:m=>{m.preventDefault(),n?.(s.url)},style:{padding:"4px 12px",borderRadius:4,border:"none",cursor:"pointer",fontSize:13,fontWeight:s.isActive?600:400,color:s.isActive?"#005F85":"#374151",backgroundColor:s.isActive?"#dbeeff":"transparent",whiteSpace:"nowrap",transition:"background-color 0.15s"},onMouseEnter:m=>{s.isActive||(m.currentTarget.style.backgroundColor="#e5eef4")},onMouseLeave:m=>{s.isActive||(m.currentTarget.style.backgroundColor="transparent")},children:s.title},s.title))})]})}function $(){const{state:o,toggleSidebar:l}=i.useSidebar(),x=o==="collapsed";return g.useEffect(()=>{const n=b=>{b.key==="["&&(b.preventDefault(),l())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[l]),e.jsxs(c.Tooltip,{delayDuration:500,children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(i.SidebarTrigger,{className:"-ml-1"})}),e.jsx(c.TooltipContent,{side:"bottom",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:x?"Expand sidebar":"Collapse sidebar"}),e.jsx(V.Kbd,{size:"s",variant:"dark",children:"["})]})})]})}function _({navigationData:o=q,user:l=G,teams:x=P,defaultSidebarOpen:n=!0,headerContent:b,headerTabs:v,headerActions:y,children:f,onNavigate:k,onSearchChange:A,searchItems:j,searchLoading:I}){const[M,C]=g.useState("sidebar"),[N]=g.useState(x[0]);return M==="horizontal"?e.jsxs("div",{className:"h-screen overflow-hidden",style:{display:"flex",flexDirection:"column"},children:[e.jsx(W,{navigationData:o,user:l,activeTeam:N,onNavigate:k,navigationMode:M,onNavigationModeChange:C}),e.jsx("div",{style:{flex:1,overflow:"auto",minHeight:0,backgroundColor:"var(--color-surface-base)"},children:f})]}):e.jsx("div",{className:"h-screen overflow-hidden",children:e.jsxs(i.SidebarProvider,{defaultOpen:n,children:[e.jsx(Z,{navigationData:o,user:l,teams:x,onNavigate:k,navigationMode:M,onNavigationModeChange:C,onSearchChange:A,searchItems:j,searchLoading:I}),e.jsxs(i.SidebarInset,{children:[(b||y||v)&&e.jsxs("header",{className:"flex h-12 shrink-0 items-center gap-2 border-b border-[var(--color-border-primary-subtle)] transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 box-border px-[var(--space-m)]",children:[e.jsx($,{}),e.jsx(F.Separator,{layout:"horizontal",className:"mr-2 h-4"}),e.jsx("div",{className:"flex-1 min-w-0",children:b}),e.jsxs("div",{className:"flex items-center gap-2 ml-auto shrink-0",children:[v&&e.jsx("div",{className:"flex items-center gap-2",children:v}),v&&y&&e.jsx("span",{className:"text-[var(--color-text-tertiary)] select-none","aria-hidden":!0,children:"•"}),y&&e.jsx("div",{className:"flex items-center gap-2",children:y})]})]}),e.jsx("div",{className:"flex flex-1 flex-col overflow-auto min-h-0 min-w-0",children:f})]})]})})}exports.AppFrame=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),E=require("react"),l=require("../fundamental/sidebar.cjs"),U=require("../fundamental/button.cjs"),p=require("../fundamental/icon.cjs"),d=require("lucide-react"),u=require("../fundamental/avatar.cjs"),H=require("../fundamental/separator.cjs"),V=require("../fundamental/kbd.cjs"),a=require("../fundamental/dropdown-menu.cjs"),c=require("../fundamental/tooltip.cjs"),j=require("../fundamental/command.cjs");function R(o){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const x in o)if(x!=="default"){const t=Object.getOwnPropertyDescriptor(o,x);Object.defineProperty(n,x,t.get?t:{enumerable:!0,get:()=>o[x]})}}return n.default=o,Object.freeze(n)}const g=R(E),G={name:"John Doe",email:"john@example.com",avatarUrl:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=32&h=32&fit=crop&crop=face"},P=[{name:"Acme Corp",role:"Admin",plan:"Enterprise",avatarUrl:"https://useful-toucan-91.convex.cloud/api/storage/5e36a31d-3f0a-4bb0-95db-f5b1c8e8af93"},{name:"Startup Inc",role:"Member",plan:"Pro",avatarUrl:"https://useful-toucan-91.convex.cloud/api/storage/5e36a31d-3f0a-4bb0-95db-f5b1c8e8af93"}],q={main:[{title:"Home",icon:d.House,url:"/home",isActive:!1},{title:"News",icon:d.Newspaper,url:"/news",isActive:!1},{title:"Boards",icon:d.LayoutDashboard,url:"/boards",isActive:!1}],operations:[{title:"Voyage economics",icon:d.Ship,url:"/freight-planner",isActive:!1,items:[]},{title:"Trade desk",icon:d.TrendingUp,url:"/trade-desk",isActive:!1,items:[]},{title:"Agreements",icon:d.ScrollText,url:"/agreements",isActive:!0,items:[{title:"Recaps",url:"/agreements/recaps",isActive:!0},{title:"Contracts",url:"/agreements/contracts",isActive:!1},{title:"Clause library",url:"/agreements/clause-library",isActive:!1}]},{title:"Compliance",icon:d.ShieldCheck,url:"/compliance",isActive:!1,items:[]}],intelligence:[{title:"Global market",icon:d.Globe,url:"/global-market",isActive:!1,items:[{title:"Supply",url:"/global-market/supply",isActive:!1},{title:"Commodities",url:"/global-market/commodities",isActive:!1},{title:"Freight",url:"/global-market/freight",isActive:!1}]},{title:"Assets",icon:d.Container,url:"/assets",isActive:!1,items:[{title:"Vessels",url:"/assets/vessels",isActive:!1},{title:"Fleets",url:"/assets/fleets",isActive:!1},{title:"Ports",url:"/assets/ports",isActive:!1},{title:"Chokepoints",url:"/assets/chokepoints",isActive:!1}]},{title:"Fixtures",icon:d.Anchor,url:"/fixtures",isActive:!1}],support:[{title:"Notifications",icon:d.Bell,url:"/notifications",isActive:!1},{title:"Help & support",icon:d.CircleHelp,url:"/help-support",isActive:!1}]},D=o=>o.split(" ").filter(Boolean).map(n=>n[0]).join("").slice(0,2).toUpperCase(),L=o=>o.split(" ").filter(Boolean).map(n=>n[0]).join("").slice(0,2).toUpperCase(),O=()=>typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.userAgent);function K(o,n){return o.reduce((x,t)=>{const m=n(t);return(x[m]??=[]).push(t),x},{})}function B(o){const n={};return[...o.main||[],...o.operations||[],...o.intelligence||[],...o.support||[]].forEach(t=>{if(t.items&&t.items.length>0){const m=t.items.some(v=>v.isActive);n[t.title]=m}}),n}function Z({navigationData:o,user:n,teams:x,onNavigate:t,navigationMode:m,onNavigationModeChange:v,onSearchChange:y,searchItems:b,searchLoading:k}){const[A,f]=g.useState(!1),[I,M]=g.useState(""),[C,N]=g.useState(()=>B(o)),[s,h]=g.useState(x[0]),S=r=>{N(i=>({...i,[r]:!i[r]}))},F=r=>r.items&&r.items.some(i=>i.isActive),z=r=>{if(r.items&&r.items.length>0){const i=r.items.find(w=>w.isActive);if(i)return`${r.title} → ${i.title}`}return r.title};return g.useEffect(()=>{const r=i=>{i.key==="k"&&(i.metaKey||i.ctrlKey)&&(i.preventDefault(),f(w=>!w))};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[]),g.useEffect(()=>{N(B(o))},[o]),e.jsxs(c.TooltipProvider,{delayDuration:100,children:[e.jsxs(l.Sidebar,{variant:"sidebar",collapsible:"icon",className:"flex h-full flex-col",children:[e.jsx(l.SidebarHeader,{className:"sticky top-0 z-10 h-12 border-b border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] group-data-[collapsible=icon]:flex group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-2 box-border",children:e.jsx("div",{className:"flex h-[22px] w-7 items-center justify-center",children:e.jsx("svg",{width:"28",height:"22",viewBox:"0 0 28 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4.39355 0.688477C6.89528 0.688477 8.12094 1.67409 8.12109 3.74609V7.69043H5.5332V2.87695H3.28711V8.03125L8.12109 11.458V18.2705C8.12109 20.3262 6.92916 21.3125 4.39355 21.3125C1.85827 21.3124 0.701172 20.3261 0.701172 18.2705L0.700195 13.7412H3.28711V19.1396H5.5332V12.6777L0.701172 9.23438V3.74609C0.701322 1.67422 1.89214 0.688597 4.39355 0.688477ZM13.8379 0.6875C16.4752 0.687615 17.6152 1.67395 17.6152 3.74609V10.5312L12.6113 13.7236V19.123H15.0273V14.3096H17.6143V18.2705C17.6143 20.3262 16.4235 21.3125 13.8027 21.3125C11.1821 21.3125 10.0244 20.3262 10.0244 18.2705V3.74609H10.0254C10.0254 1.67382 11.2003 0.6875 13.8379 0.6875ZM23.333 0.6875C25.9537 0.6875 27.1113 1.67378 27.1113 3.72949V18.2539H27.1104C27.1104 20.3261 25.9363 21.3125 23.2988 21.3125C20.6612 21.3125 19.5205 20.3262 19.5205 18.2539V11.4688L24.5254 8.27637V2.87695H22.1084V7.69043H19.5215V3.72949C19.5215 1.67384 20.7124 0.687556 23.333 0.6875ZM22.1084 12.2197V19.1396H24.5254V10.5986L22.1084 12.2197ZM12.6113 11.4014L15.0273 9.78027V2.86035H12.6113V11.4014Z",fill:"#005F85"})})})}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto group-data-[collapsible=icon]:overflow-hidden","data-sidebar":"content",children:[e.jsx("div",{className:"p-[var(--space-m)] pt-[var(--space-s)] group-data-[collapsible=icon]:px-2",children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute top-1/2 left-2 -translate-y-1/2 group-data-[collapsible=icon]:hidden",children:e.jsx(p.Icon,{name:d.Search,size:"m",color:"tertiary"})}),e.jsxs("div",{className:"group-data-[collapsible=icon]:hidden",children:[e.jsx("button",{onClick:()=>f(!0),className:"text-body-md flex h-8 w-full cursor-pointer items-center rounded-m border border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] px-3 py-1 pr-20 pl-8 text-left text-[var(--color-text-tertiary)] transition-colors hover:border-[var(--color-border-primary-medium)] hover:!bg-[var(--color-background-neutral-subtlest-hovered)] focus:border-[var(--color-border-brand-bold)] focus:ring-2 focus:ring-[var(--color-border-brand-bold)]/20 focus:ring-offset-0 focus:outline-none active:border-[var(--color-border-primary-medium)]",children:"Search"}),e.jsxs("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 gap-1",children:[e.jsx(V.Kbd,{size:"s",children:O()?"⌘":"Ctrl"}),e.jsx(V.Kbd,{size:"s",children:"K"})]})]}),e.jsxs(c.Tooltip,{delayDuration:500,children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx("button",{onClick:()=>f(!0),className:"hidden h-8 w-8 cursor-pointer items-center justify-center rounded border border-[var(--color-border-primary-subtle)] bg-transparent transition-all duration-200 group-data-[collapsible=icon]:flex hover:border-[var(--color-border-primary-medium)] hover:!bg-[var(--color-background-neutral-subtlest-hovered)] focus:border-[var(--color-border-brand-bold)] focus:ring-2 focus:ring-[var(--color-border-brand-bold)]/20 focus:ring-offset-0 focus:outline-none active:border-[var(--color-border-primary-medium)]","aria-label":"Search",children:e.jsx(p.Icon,{name:d.Search,size:"m",color:"tertiary"})})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:"Search"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(V.Kbd,{size:"s",variant:"dark",children:O()?"⌘":"Ctrl"}),e.jsx(V.Kbd,{size:"s",variant:"dark",children:"K"})]})]})})]})]})}),e.jsx(l.SidebarGroup,{className:"pb-1 mt-1 p-[var(--space-s)]",children:e.jsx(l.SidebarGroupContent,{children:e.jsx(l.SidebarMenu,{children:o.main.map(r=>e.jsx(l.SidebarMenuItem,{children:e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsxs(l.SidebarMenuButton,{isActive:r.isActive,onClick:i=>{t&&(i.preventDefault(),t(r.url))},children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title})]})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]})},r.title))})})}),e.jsx("div",{className:"my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex",children:e.jsx(H.Separator,{layout:"vertical"})}),e.jsxs(l.SidebarGroup,{className:"mt-1 p-[var(--space-s)]",children:[e.jsx(l.SidebarGroupLabel,{className:"py-1 pb-1.5 group-data-[collapsible=icon]:hidden",children:"Operations"}),e.jsx(l.SidebarGroupContent,{children:e.jsx(l.SidebarMenu,{children:o.operations.map(r=>e.jsx(l.SidebarMenuItem,{children:r.items&&r.items.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"group-data-[collapsible=icon]:hidden",children:e.jsxs(l.SidebarMenuButton,{isActive:r.isActive&&!r.items?.length,onClick:()=>S(r.title),children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title}),e.jsx(p.Icon,{name:d.ChevronRight,size:"s",className:`ml-auto transition-transform ${C[r.title]?"rotate-90":""}`})]})}),r.items&&r.items.length>0&&C[r.title]&&e.jsx(l.SidebarMenuSub,{children:r.items.map(i=>e.jsx(l.SidebarMenuSubItem,{children:e.jsx(l.SidebarMenuSubButton,{isActive:i.isActive,onClick:w=>{t&&(w.preventDefault(),t(i.url))},children:e.jsx("span",{children:i.title})})},i.title))}),e.jsx("div",{className:"hidden group-data-[collapsible=icon]:block",children:e.jsxs(a.DropdownMenu,{children:[e.jsxs(c.Tooltip,{children:[e.jsx(a.DropdownMenuTrigger,{asChild:!0,children:e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(l.SidebarMenuButton,{isActive:F(r),className:"w-full justify-center",children:e.jsx(p.Icon,{name:r.icon,size:"s"})})})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]}),e.jsxs(a.DropdownMenuContent,{side:"right",sideOffset:8,align:"start",children:[e.jsx(a.DropdownMenuLabel,{className:"text-body-medium-sm font-medium",children:r.title}),e.jsx(a.DropdownMenuSeparator,{}),r.items.map(i=>e.jsx(a.DropdownMenuItem,{className:i.isActive?"bg-[var(--color-background-blue-subtle-selected)] text-[var(--color-text-brand-bold)]":"",onSelect:()=>{t&&t(i.url)},children:i.title},i.title))]})]})})]}):e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsxs(l.SidebarMenuButton,{isActive:r.isActive,onClick:i=>{t&&(i.preventDefault(),t(r.url))},children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title})]})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]})},r.title))})})]}),e.jsx("div",{className:"my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex",children:e.jsx(H.Separator,{layout:"vertical"})}),e.jsxs(l.SidebarGroup,{className:"mt-1 p-[var(--space-s)]",children:[e.jsx(l.SidebarGroupLabel,{className:"py-1 pb-1.5 group-data-[collapsible=icon]:hidden",children:"Intelligence"}),e.jsx(l.SidebarGroupContent,{children:e.jsx(l.SidebarMenu,{children:o.intelligence.map(r=>e.jsx(l.SidebarMenuItem,{children:r.items&&r.items.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"group-data-[collapsible=icon]:hidden",children:e.jsxs(l.SidebarMenuButton,{isActive:r.isActive&&!r.items?.length,onClick:()=>S(r.title),children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title}),e.jsx(p.Icon,{name:d.ChevronRight,size:"s",className:`ml-auto transition-transform ${C[r.title]?"rotate-90":""}`})]})}),r.items&&r.items.length>0&&C[r.title]&&e.jsx(l.SidebarMenuSub,{children:r.items.map(i=>e.jsx(l.SidebarMenuSubItem,{children:e.jsx(l.SidebarMenuSubButton,{isActive:i.isActive,onClick:w=>{t&&(w.preventDefault(),t(i.url))},children:e.jsx("span",{children:i.title})})},i.title))}),e.jsx("div",{className:"hidden group-data-[collapsible=icon]:block",children:e.jsxs(a.DropdownMenu,{children:[e.jsxs(c.Tooltip,{children:[e.jsx(a.DropdownMenuTrigger,{asChild:!0,children:e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(l.SidebarMenuButton,{isActive:F(r),className:"w-full justify-center",children:e.jsx(p.Icon,{name:r.icon,size:"s"})})})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]}),e.jsxs(a.DropdownMenuContent,{side:"right",sideOffset:8,align:"start",children:[e.jsx(a.DropdownMenuLabel,{className:"text-body-medium-sm font-medium",children:r.title}),e.jsx(a.DropdownMenuSeparator,{}),r.items.map(i=>e.jsx(a.DropdownMenuItem,{className:i.isActive?"bg-[var(--color-background-blue-subtle-selected)] text-[var(--color-text-brand-bold)]":"",onSelect:()=>{t&&t(i.url)},children:i.title},i.title))]})]})})]}):e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsxs(l.SidebarMenuButton,{isActive:r.isActive,onClick:i=>{t&&(i.preventDefault(),t(r.url))},children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title})]})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]})},r.title))})})]}),e.jsx(l.SidebarGroup,{className:"pb-2 p-[var(--space-s)] pt-[var(--space-l)] mt-auto",children:e.jsx(l.SidebarGroupContent,{children:e.jsx(l.SidebarMenu,{children:o.support.map(r=>e.jsx(l.SidebarMenuItem,{children:e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsxs(l.SidebarMenuButton,{isActive:r.isActive,onClick:i=>{t&&(i.preventDefault(),t(r.url))},children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title})]})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]})},r.title))})})})]}),e.jsx(l.SidebarFooter,{className:"sticky bottom-0 z-10 border-t border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] group-data-[collapsible=icon]:px-2 group-data-[collapsible=icon]:py-2",children:e.jsx("div",{className:"group/user-menu rounded-m border border-[var(--color-border-primary-subtle)] transition-colors hover:border-[var(--color-border-primary-medium)] group-data-[collapsible=icon]:rounded-none group-data-[collapsible=icon]:border-none",children:e.jsxs(a.DropdownMenu,{children:[e.jsx(a.DropdownMenuTrigger,{asChild:!0,children:e.jsxs(U.Button,{variant:"ghost",className:"h-auto min-h-[56px] w-full justify-start rounded-m px-3 py-2 hover:!bg-[var(--color-background-neutral-subtlest-hovered)] group-data-[collapsible=icon]:h-8 group-data-[collapsible=icon]:min-h-0 group-data-[collapsible=icon]:w-8 group-data-[collapsible=icon]:p-0",children:[e.jsxs("div",{className:"flex w-full items-center gap-3 group-data-[collapsible=icon]:hidden",children:[e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsxs(u.Avatar,{size:"m",type:"user",children:[e.jsx(u.AvatarImage,{src:n.avatarUrl,alt:n.name}),e.jsx(u.AvatarFallback,{size:"m",type:"user",children:D(n.name)})]}),e.jsx("div",{className:"absolute -right-1 -bottom-1 rounded-[4px] border-2 border-white p-0",children:e.jsxs(u.Avatar,{size:"xxs",type:"organization",children:[e.jsx(u.AvatarImage,{src:s.avatarUrl,alt:s.name}),e.jsx(u.AvatarFallback,{size:"xxs",type:"organization",children:L(s.name)})]})})]}),e.jsxs("div",{className:"min-w-0 flex-1 text-left",children:[e.jsx("div",{className:"text-body-medium-sm truncate font-medium text-[var(--color-text-primary)]",children:n.name}),e.jsxs("div",{className:"text-body-xsm text-[var(--color-text-secondary)]",children:[s.role," at ",s.name]})]}),e.jsx(p.Icon,{name:d.ChevronDown,size:"m",className:"opacity-50"})]}),e.jsxs("div",{className:"relative hidden group-data-[collapsible=icon]:block",children:[e.jsxs(u.Avatar,{size:"s",type:"user",children:[e.jsx(u.AvatarImage,{src:n.avatarUrl,alt:n.name}),e.jsx(u.AvatarFallback,{size:"s",type:"user",children:D(n.name)})]}),e.jsx("div",{className:"absolute -right-1 -bottom-1 rounded-[2px] border-2 border-white bg-[var(--color-surface-primary)]",children:e.jsxs(u.Avatar,{size:"xxs",type:"organization",children:[e.jsx(u.AvatarImage,{src:s.avatarUrl,alt:s.name}),e.jsx(u.AvatarFallback,{size:"xxs",type:"organization",children:L(s.name)})]})})]})]})}),e.jsxs(a.DropdownMenuContent,{className:"w-[--radix-dropdown-menu-trigger-width]",align:"start",side:"top",sideOffset:4,children:[e.jsx(a.DropdownMenuLabel,{className:"p-0 font-normal",children:e.jsxs("div",{className:"flex items-center gap-3 px-2 py-2",children:[e.jsxs(u.Avatar,{size:"s",type:"user",children:[e.jsx(u.AvatarImage,{src:n.avatarUrl,alt:n.name}),e.jsx(u.AvatarFallback,{size:"s",type:"user",children:D(n.name)})]}),e.jsxs("div",{className:"grid flex-1 text-left",children:[e.jsx("span",{className:"text-body-medium-sm truncate font-semibold text-[var(--color-text-primary)]",children:n.name}),e.jsx("span",{className:"text-caption-xsm truncate text-[var(--color-text-secondary)]",children:n.email})]})]})}),e.jsx(a.DropdownMenuSeparator,{}),e.jsx(a.DropdownMenuLabel,{className:"px-2 py-1 text-[12px] font-medium text-[var(--color-text-tertiary)]",children:"Organizations"}),x.map(r=>e.jsxs(a.DropdownMenuItem,{onSelect:()=>h(r),className:"mx-1 mb-1 h-10 cursor-pointer gap-2 px-1 pr-2 pl-1",children:[e.jsxs(u.Avatar,{size:"s",type:"organization",children:[e.jsx(u.AvatarImage,{src:r.avatarUrl,alt:r.name}),e.jsx(u.AvatarFallback,{size:"s",type:"organization",children:L(r.name)})]}),e.jsxs("div",{className:"flex flex-1 flex-col text-left",children:[e.jsx("span",{className:"text-body-medium-sm truncate font-semibold text-[var(--color-text-primary)]",children:r.name}),e.jsxs("span",{className:"text-caption-xsm truncate text-[var(--color-text-secondary)]",children:[r.role," • ",r.plan," plan"]})]}),s.name===r.name&&e.jsx(p.Icon,{name:d.Check,size:"m",className:"text-[var(--color-icon-brand-bold)]"})]},r.name)),e.jsx(a.DropdownMenuSeparator,{}),e.jsx(a.DropdownMenuLabel,{className:"px-2 py-1 text-[12px] font-medium text-[var(--color-text-tertiary)]",children:"Navigation"}),e.jsxs(a.DropdownMenuItem,{className:"mx-1 mb-0.5 cursor-pointer gap-2 px-2",onSelect:()=>v("sidebar"),children:[e.jsx("span",{className:"flex-1",children:"New sidebar navigation"}),m==="sidebar"&&e.jsx(p.Icon,{name:d.Check,size:"m",className:"text-[var(--color-icon-brand-bold)]"})]}),e.jsxs(a.DropdownMenuItem,{className:"mx-1 mb-1 cursor-pointer gap-2 px-2",onSelect:()=>v("horizontal"),children:[e.jsx("span",{className:"flex-1",children:"Old horizontal menu"}),m==="horizontal"&&e.jsx(p.Icon,{name:d.Check,size:"m",className:"text-[var(--color-icon-brand-bold)]"})]}),e.jsx(a.DropdownMenuSeparator,{}),e.jsx(a.DropdownMenuItem,{icon:d.User,className:"cursor-pointer",onSelect:()=>{t&&t("/user/profile")},children:"User profile"}),e.jsx(a.DropdownMenuItem,{icon:d.Settings,className:"cursor-pointer",onSelect:()=>{t&&t("/organization/settings")},children:"Organization settings"}),e.jsx(a.DropdownMenuSeparator,{}),e.jsx(a.DropdownMenuItem,{icon:d.LogOut,destructive:!0,className:"cursor-pointer",onSelect:()=>{t&&t("/auth/sign-out")},children:"Sign out"})]})]})})}),e.jsx(l.SidebarRail,{})]}),e.jsxs(j.CommandDialog,{open:A,onOpenChange:f,commandProps:b&&b.length>0?{shouldFilter:!1}:void 0,children:[e.jsx(j.CommandInput,{placeholder:"Type a command or search...",value:I,onValueChange:r=>{M(r),y?.(r)},clearable:!1}),e.jsxs(j.CommandList,{children:[e.jsx(j.CommandEmpty,{children:"No results found."}),k&&e.jsx("div",{className:"py-[var(--space-m)] text-center text-body-sm text-[var(--color-text-tertiary)]",children:"Searching…"}),b&&b.length>0&&(()=>{const r=K(b,i=>i.group??"Results");return Object.entries(r).map(([i,w])=>e.jsx(j.CommandGroup,{heading:i,children:w.map(T=>e.jsxs(j.CommandItem,{value:T.id,onSelect:()=>{T.onSelect?.(),f(!1)},children:[T.icon&&e.jsx(p.Icon,{name:T.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:T.label})]},T.id))},i))})(),!b?.length&&e.jsxs(e.Fragment,{children:[e.jsxs(j.CommandGroup,{heading:"Navigation",children:[o.main.map(r=>e.jsxs(j.CommandItem,{onSelect:()=>{t?.(r.url),f(!1)},children:[e.jsx(p.Icon,{name:r.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:r.title})]},r.title)),o.operations.map(r=>e.jsxs(j.CommandItem,{onSelect:()=>{t?.(r.url),f(!1)},children:[e.jsx(p.Icon,{name:r.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:r.title})]},r.title)),o.intelligence.map(r=>e.jsxs(j.CommandItem,{onSelect:()=>{t?.(r.url),f(!1)},children:[e.jsx(p.Icon,{name:r.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:r.title})]},r.title))]}),e.jsx(j.CommandGroup,{heading:"Settings",children:o.support.map(r=>e.jsxs(j.CommandItem,{onSelect:()=>{t?.(r.url),f(!1)},children:[e.jsx(p.Icon,{name:r.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:r.title})]},r.title))}),e.jsx(j.CommandGroup,{heading:"Switch team",children:x.map(r=>e.jsxs(j.CommandItem,{onSelect:()=>f(!1),children:[e.jsxs(u.Avatar,{size:"s",className:"mr-2",type:"organization",children:[e.jsx(u.AvatarImage,{src:r.avatarUrl,alt:r.name}),e.jsx(u.AvatarFallback,{size:"s",type:"organization",children:L(r.name)})]}),e.jsx("span",{children:r.name})]},r.name))})]})]})]})]})}function W({navigationData:o,user:n,activeTeam:x,onNavigate:t,navigationMode:m,onNavigationModeChange:v}){const[y,b]=g.useState(!1),k=g.useRef(null);g.useEffect(()=>{if(!y)return;const s=h=>{k.current&&!k.current.contains(h.target)&&b(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[y]);const A=[...o.main,...o.operations,...o.intelligence],f=A.find(s=>s.isActive||s.items?.some(h=>h.isActive))?.title??null,[I,M]=g.useState(f),C=A.find(s=>s.title===I)?.items??[],N=D(n.name);return e.jsxs("div",{style:{width:"100%"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",height:48,backgroundColor:"#162736",padding:"0 16px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[e.jsx("rect",{width:"20",height:"20",rx:"4",fill:"#005F85"}),e.jsx("rect",{x:"4",y:"4",width:"5",height:"5",rx:"1",fill:"white"}),e.jsx("rect",{x:"11",y:"4",width:"5",height:"5",rx:"1",fill:"white",opacity:"0.6"}),e.jsx("rect",{x:"4",y:"11",width:"5",height:"5",rx:"1",fill:"white",opacity:"0.6"}),e.jsx("rect",{x:"11",y:"11",width:"5",height:"5",rx:"1",fill:"white",opacity:"0.4"})]}),e.jsx("svg",{width:"28",height:"22",viewBox:"0 0 28 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4.39355 0.688477C6.89528 0.688477 8.12094 1.67409 8.12109 3.74609V7.69043H5.5332V2.87695H3.28711V8.03125L8.12109 11.458V18.2705C8.12109 20.3262 6.92916 21.3125 4.39355 21.3125C1.85827 21.3124 0.701172 20.3261 0.701172 18.2705L0.700195 13.7412H3.28711V19.1396H5.5332V12.6777L0.701172 9.23438V3.74609C0.701322 1.67422 1.89214 0.688597 4.39355 0.688477ZM13.8379 0.6875C16.4752 0.687615 17.6152 1.67395 17.6152 3.74609V10.5312L12.6113 13.7236V19.123H15.0273V14.3096H17.6143V18.2705C17.6143 20.3262 16.4235 21.3125 13.8027 21.3125C11.1821 21.3125 10.0244 20.3262 10.0244 18.2705V3.74609H10.0254C10.0254 1.67382 11.2003 0.6875 13.8379 0.6875ZM23.333 0.6875C25.9537 0.6875 27.1113 1.67378 27.1113 3.72949V18.2539H27.1104C27.1104 20.3261 25.9363 21.3125 23.2988 21.3125C20.6612 21.3125 19.5205 20.3262 19.5205 18.2539V11.4688L24.5254 8.27637V2.87695H22.1084V7.69043H19.5215V3.72949C19.5215 1.67384 20.7124 0.687556 23.333 0.6875ZM22.1084 12.2197V19.1396H24.5254V10.5986L22.1084 12.2197ZM12.6113 11.4014L15.0273 9.78027V2.86035H12.6113V11.4014Z",fill:"white"})})]}),e.jsx("div",{style:{flex:1}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("button",{onClick:()=>t?.("/notifications"),style:{background:"none",border:"none",cursor:"pointer",padding:6,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="rgba(255,255,255,0.1)"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"}),e.jsx("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"})]})}),e.jsxs("div",{ref:k,style:{position:"relative"},children:[e.jsx("button",{onClick:()=>b(s=>!s),style:{width:32,height:32,borderRadius:"50%",backgroundColor:"#005F85",color:"white",border:"2px solid rgba(255,255,255,0.3)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:600,padding:0},children:n.avatarUrl?e.jsx("img",{src:n.avatarUrl,alt:n.name,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):N}),y&&e.jsxs("div",{style:{position:"absolute",top:40,right:0,width:220,backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 24px rgba(0,0,0,0.15)",zIndex:9999,padding:"4px 0",fontSize:14},children:[e.jsxs("div",{style:{padding:"8px 12px",borderBottom:"1px solid #e5e7eb"},children:[e.jsx("div",{style:{fontWeight:600,color:"#111827"},children:n.name}),e.jsx("div",{style:{fontSize:12,color:"#6b7280"},children:n.email})]}),e.jsxs("div",{style:{padding:"4px 0",borderBottom:"1px solid #e5e7eb"},children:[e.jsx("div",{style:{padding:"4px 12px",fontSize:11,fontWeight:500,color:"#9ca3af",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Navigation"}),e.jsxs("button",{onClick:()=>{v("sidebar"),b(!1)},style:{display:"flex",alignItems:"center",width:"100%",padding:"6px 12px",background:"none",border:"none",cursor:"pointer",fontSize:14,color:"#374151",textAlign:"left"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="#f3f4f6"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:[e.jsx("span",{style:{flex:1},children:"New sidebar navigation"}),m==="sidebar"&&e.jsx("span",{style:{color:"#005F85",fontWeight:700},children:"✓"})]}),e.jsxs("button",{onClick:()=>{v("horizontal"),b(!1)},style:{display:"flex",alignItems:"center",width:"100%",padding:"6px 12px",background:"none",border:"none",cursor:"pointer",fontSize:14,color:"#374151",textAlign:"left"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="#f3f4f6"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:[e.jsx("span",{style:{flex:1},children:"Old horizontal menu"}),m==="horizontal"&&e.jsx("span",{style:{color:"#005F85",fontWeight:700},children:"✓"})]})]}),e.jsx("div",{style:{padding:"4px 0"},children:e.jsx("button",{onClick:()=>{t?.("/auth/sign-out"),b(!1)},style:{display:"flex",alignItems:"center",width:"100%",padding:"6px 12px",background:"none",border:"none",cursor:"pointer",fontSize:14,color:"#dc2626",textAlign:"left"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="#fef2f2"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:"Sign out"})})]})]})]})]}),e.jsx("div",{style:{display:"flex",alignItems:"center",height:40,backgroundColor:"#1e3a4f",padding:"0 16px",gap:2,overflowX:"auto"},children:A.map(s=>{const h=s.isActive||(s.items?.some(S=>S.isActive)??!1);return e.jsx("button",{onClick:S=>{S.preventDefault(),M(s.title),t?.(s.url)},style:{padding:"6px 14px",borderRadius:4,border:"none",cursor:"pointer",fontSize:13,fontWeight:h?600:400,color:"white",backgroundColor:h?"#005F85":"transparent",whiteSpace:"nowrap",transition:"background-color 0.15s"},onMouseEnter:S=>{h||(S.currentTarget.style.backgroundColor="rgba(255,255,255,0.1)")},onMouseLeave:S=>{h||(S.currentTarget.style.backgroundColor="transparent")},children:s.title},s.title)})}),C.length>0&&e.jsx("div",{style:{display:"flex",alignItems:"center",height:36,backgroundColor:"#f0f5f8",padding:"0 16px",gap:2,borderBottom:"1px solid #d1dde6",overflowX:"auto"},children:C.map(s=>e.jsx("button",{onClick:h=>{h.preventDefault(),t?.(s.url)},style:{padding:"4px 12px",borderRadius:4,border:"none",cursor:"pointer",fontSize:13,fontWeight:s.isActive?600:400,color:s.isActive?"#005F85":"#374151",backgroundColor:s.isActive?"#dbeeff":"transparent",whiteSpace:"nowrap",transition:"background-color 0.15s"},onMouseEnter:h=>{s.isActive||(h.currentTarget.style.backgroundColor="#e5eef4")},onMouseLeave:h=>{s.isActive||(h.currentTarget.style.backgroundColor="transparent")},children:s.title},s.title))})]})}function $(){const{state:o,toggleSidebar:n}=l.useSidebar(),x=o==="collapsed";return g.useEffect(()=>{const t=m=>{m.key==="["&&(m.preventDefault(),n())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[n]),e.jsxs(c.Tooltip,{delayDuration:500,children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(l.SidebarTrigger,{className:"-ml-1"})}),e.jsx(c.TooltipContent,{side:"bottom",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:x?"Expand sidebar":"Collapse sidebar"}),e.jsx(V.Kbd,{size:"s",variant:"dark",children:"["})]})})]})}function _({navigationData:o=q,user:n=G,teams:x=P,defaultSidebarOpen:t=!0,headerContent:m,headerTabs:v,headerActions:y,children:b,onNavigate:k,onSearchChange:A,searchItems:f,searchLoading:I}){const[M,C]=g.useState("sidebar"),[N]=g.useState(x[0]);return M==="horizontal"?e.jsxs("div",{className:"h-screen overflow-hidden",style:{display:"flex",flexDirection:"column"},children:[e.jsx(W,{navigationData:o,user:n,activeTeam:N,onNavigate:k,navigationMode:M,onNavigationModeChange:C}),e.jsx("div",{style:{flex:1,overflow:"auto",minHeight:0,backgroundColor:"var(--color-surface-base)"},children:b})]}):e.jsx("div",{className:"h-screen overflow-hidden",children:e.jsxs(l.SidebarProvider,{defaultOpen:t,children:[e.jsx(Z,{navigationData:o,user:n,teams:x,onNavigate:k,navigationMode:M,onNavigationModeChange:C,onSearchChange:A,searchItems:f,searchLoading:I}),e.jsxs(l.SidebarInset,{children:[(m||y||v)&&e.jsxs("header",{className:"flex h-12 shrink-0 items-center gap-2 border-b border-[var(--color-border-primary-subtle)] transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 box-border px-[var(--space-m)]",children:[e.jsx($,{}),e.jsx(H.Separator,{layout:"horizontal",className:"mr-2 h-4"}),e.jsx("div",{className:"flex-1 min-w-0",children:m}),e.jsxs("div",{className:"flex items-center gap-2 ml-auto shrink-0",children:[v&&e.jsx("div",{className:"flex items-center gap-2",children:v}),v&&y&&e.jsx("span",{className:"text-[var(--color-text-tertiary)] select-none","aria-hidden":!0,children:"•"}),y&&e.jsx("div",{className:"flex items-center gap-2",children:y})]})]}),e.jsx("div",{className:"flex flex-1 flex-col overflow-auto min-h-0 min-w-0",children:b})]})]})})}exports.AppFrame=_;
@@ -1,15 +1,15 @@
1
- import { jsxs as l, jsx as e, Fragment as ee } from "react/jsx-runtime";
1
+ import { jsxs as l, jsx as e, Fragment as G } from "react/jsx-runtime";
2
2
  import * as m from "react";
3
- import { SidebarProvider as oe, SidebarInset as se, Sidebar as ce, SidebarHeader as de, SidebarGroup as B, SidebarGroupContent as I, SidebarMenu as P, SidebarMenuItem as Z, SidebarMenuButton as C, SidebarGroupLabel as re, SidebarMenuSub as le, SidebarMenuSubItem as ie, SidebarMenuSubButton as te, SidebarFooter as pe, SidebarRail as he, useSidebar as ue, SidebarTrigger as me } from "../fundamental/sidebar.js";
3
+ import { SidebarProvider as ae, SidebarInset as se, Sidebar as ce, SidebarHeader as de, SidebarGroup as F, SidebarGroupContent as B, SidebarMenu as I, SidebarMenuItem as P, SidebarMenuButton as C, SidebarGroupLabel as _, SidebarMenuSub as ee, SidebarMenuSubItem as re, SidebarMenuSubButton as le, SidebarFooter as pe, SidebarRail as he, useSidebar as ue, SidebarTrigger as me } from "../fundamental/sidebar.js";
4
4
  import { Button as fe } from "../fundamental/button.js";
5
5
  import { Icon as s } from "../fundamental/icon.js";
6
- import { Bell as be, CircleHelp as ge, Globe as ve, Container as xe, Anchor as ye, Ship as Ce, TrendingUp as we, ScrollText as ke, ShieldCheck as Se, House as Ne, LayoutDashboard as ze, Search as $, ChevronRight as ne, ChevronDown as Ae, Check as X, User as Me, Settings as Ve, LogOut as Le, RotateCcw as Te } from "lucide-react";
7
- import { Avatar as V, AvatarImage as L, AvatarFallback as T } from "../fundamental/avatar.js";
8
- import { Separator as Y } from "../fundamental/separator.js";
9
- import { Kbd as F } from "../fundamental/kbd.js";
10
- import { DropdownMenu as J, DropdownMenuTrigger as Q, DropdownMenuContent as q, DropdownMenuLabel as O, DropdownMenuSeparator as U, DropdownMenuItem as w } from "../fundamental/dropdown-menu.js";
11
- import { TooltipProvider as He, Tooltip as S, TooltipTrigger as N, TooltipContent as z } from "../fundamental/tooltip.js";
12
- import { CommandDialog as Ee, CommandInput as Re, CommandList as Ue, CommandEmpty as je, CommandGroup as D, CommandItem as k } from "../fundamental/command.js";
6
+ import { Bell as be, CircleHelp as ge, Globe as ve, Container as xe, Anchor as ye, Ship as Ce, TrendingUp as we, ScrollText as ke, ShieldCheck as Se, House as Ne, Newspaper as ze, LayoutDashboard as Ae, Search as ie, ChevronRight as te, ChevronDown as Me, Check as $, User as Ve, Settings as Le, LogOut as Te } from "lucide-react";
7
+ import { Avatar as M, AvatarImage as V, AvatarFallback as L } from "../fundamental/avatar.js";
8
+ import { Separator as Q } from "../fundamental/separator.js";
9
+ import { Kbd as D } from "../fundamental/kbd.js";
10
+ import { DropdownMenu as X, DropdownMenuTrigger as J, DropdownMenuContent as q, DropdownMenuLabel as O, DropdownMenuSeparator as U, DropdownMenuItem as w } from "../fundamental/dropdown-menu.js";
11
+ import { TooltipProvider as He, Tooltip as k, TooltipTrigger as S, TooltipContent as N } from "../fundamental/tooltip.js";
12
+ import { CommandDialog as Ee, CommandInput as Ue, CommandList as Re, CommandEmpty as je, CommandGroup as Z, CommandItem as R } from "../fundamental/command.js";
13
13
  const Oe = {
14
14
  name: "John Doe",
15
15
  email: "john@example.com",
@@ -36,8 +36,14 @@ const Oe = {
36
36
  isActive: !1
37
37
  },
38
38
  {
39
- title: "Boards",
39
+ title: "News",
40
40
  icon: ze,
41
+ url: "/news",
42
+ isActive: !1
43
+ },
44
+ {
45
+ title: "Boards",
46
+ icon: Ae,
41
47
  url: "/boards",
42
48
  isActive: !1
43
49
  }
@@ -109,7 +115,7 @@ const Oe = {
109
115
  { title: "Vessels", url: "/assets/vessels", isActive: !1 },
110
116
  { title: "Fleets", url: "/assets/fleets", isActive: !1 },
111
117
  { title: "Ports", url: "/assets/ports", isActive: !1 },
112
- { title: "Canals", url: "/assets/canals", isActive: !1 }
118
+ { title: "Chokepoints", url: "/assets/chokepoints", isActive: !1 }
113
119
  ]
114
120
  },
115
121
  {
@@ -133,36 +139,36 @@ const Oe = {
133
139
  isActive: !1
134
140
  }
135
141
  ]
136
- }, G = (o) => o.split(" ").filter(Boolean).map((a) => a[0]).join("").slice(0, 2).toUpperCase(), W = (o) => o.split(" ").filter(Boolean).map((a) => a[0]).join("").slice(0, 2).toUpperCase(), K = () => typeof navigator < "u" && /Mac|iPod|iPhone|iPad/.test(navigator.userAgent);
137
- function Be(o, a) {
138
- return o.reduce((h, n) => {
139
- const d = a(n);
140
- return (h[d] ??= []).push(n), h;
142
+ }, K = (a) => a.split(" ").filter(Boolean).map((o) => o[0]).join("").slice(0, 2).toUpperCase(), W = (a) => a.split(" ").filter(Boolean).map((o) => o[0]).join("").slice(0, 2).toUpperCase(), ne = () => typeof navigator < "u" && /Mac|iPod|iPhone|iPad/.test(navigator.userAgent);
143
+ function Be(a, o) {
144
+ return a.reduce((u, n) => {
145
+ const d = o(n);
146
+ return (u[d] ??= []).push(n), u;
141
147
  }, {});
142
148
  }
143
- function ae(o) {
144
- const a = {};
149
+ function oe(a) {
150
+ const o = {};
145
151
  return [
146
- ...o.main || [],
147
- ...o.operations || [],
148
- ...o.intelligence || [],
149
- ...o.support || []
152
+ ...a.main || [],
153
+ ...a.operations || [],
154
+ ...a.intelligence || [],
155
+ ...a.support || []
150
156
  ].forEach((n) => {
151
157
  if (n.items && n.items.length > 0) {
152
158
  const d = n.items.some((f) => f.isActive);
153
- a[n.title] = d;
159
+ o[n.title] = d;
154
160
  }
155
- }), a;
161
+ }), o;
156
162
  }
157
- function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMode: d, onNavigationModeChange: f, onSearchChange: b, searchItems: u, searchLoading: y }) {
158
- const [A, p] = m.useState(!1), [j, M] = m.useState(""), [g, H] = m.useState(
159
- () => ae(o)
160
- ), [i, c] = m.useState(h[0]), v = (r) => {
161
- H((t) => ({
163
+ function Ie({ navigationData: a, user: o, teams: u, onNavigate: n, navigationMode: d, onNavigationModeChange: f, onSearchChange: b, searchItems: p, searchLoading: y }) {
164
+ const [z, h] = m.useState(!1), [j, A] = m.useState(""), [g, T] = m.useState(
165
+ () => oe(a)
166
+ ), [i, c] = m.useState(u[0]), v = (r) => {
167
+ T((t) => ({
162
168
  ...t,
163
169
  [r]: !t[r]
164
170
  }));
165
- }, _ = (r) => r.items && r.items.some((t) => t.isActive), E = (r) => {
171
+ }, Y = (r) => r.items && r.items.some((t) => t.isActive), H = (r) => {
166
172
  if (r.items && r.items.length > 0) {
167
173
  const t = r.items.find((x) => x.isActive);
168
174
  if (t)
@@ -172,12 +178,12 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
172
178
  };
173
179
  return m.useEffect(() => {
174
180
  const r = (t) => {
175
- t.key === "k" && (t.metaKey || t.ctrlKey) && (t.preventDefault(), p((x) => !x));
181
+ t.key === "k" && (t.metaKey || t.ctrlKey) && (t.preventDefault(), h((x) => !x));
176
182
  };
177
183
  return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
178
184
  }, []), m.useEffect(() => {
179
- H(ae(o));
180
- }, [o]), /* @__PURE__ */ l(He, { delayDuration: 100, children: [
185
+ T(oe(a));
186
+ }, [a]), /* @__PURE__ */ l(He, { delayDuration: 100, children: [
181
187
  /* @__PURE__ */ l(ce, { variant: "sidebar", collapsible: "icon", className: "flex h-full flex-col", children: [
182
188
  /* @__PURE__ */ e(de, { className: "sticky top-0 z-10 h-12 border-b border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] group-data-[collapsible=icon]:flex group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-2 box-border", children: /* @__PURE__ */ e("div", { className: "flex h-[22px] w-7 items-center justify-center", children: /* @__PURE__ */ e(
183
189
  "svg",
@@ -203,42 +209,42 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
203
209
  "data-sidebar": "content",
204
210
  children: [
205
211
  /* @__PURE__ */ e("div", { className: "p-[var(--space-m)] pt-[var(--space-s)] group-data-[collapsible=icon]:px-2", children: /* @__PURE__ */ l("div", { className: "relative", children: [
206
- /* @__PURE__ */ e("div", { className: "absolute top-1/2 left-2 -translate-y-1/2 group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ e(s, { name: $, size: "m", color: "tertiary" }) }),
212
+ /* @__PURE__ */ e("div", { className: "absolute top-1/2 left-2 -translate-y-1/2 group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ e(s, { name: ie, size: "m", color: "tertiary" }) }),
207
213
  /* @__PURE__ */ l("div", { className: "group-data-[collapsible=icon]:hidden", children: [
208
214
  /* @__PURE__ */ e(
209
215
  "button",
210
216
  {
211
- onClick: () => p(!0),
217
+ onClick: () => h(!0),
212
218
  className: "text-body-md flex h-8 w-full cursor-pointer items-center rounded-m border border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] px-3 py-1 pr-20 pl-8 text-left text-[var(--color-text-tertiary)] transition-colors hover:border-[var(--color-border-primary-medium)] hover:!bg-[var(--color-background-neutral-subtlest-hovered)] focus:border-[var(--color-border-brand-bold)] focus:ring-2 focus:ring-[var(--color-border-brand-bold)]/20 focus:ring-offset-0 focus:outline-none active:border-[var(--color-border-primary-medium)]",
213
219
  children: "Search"
214
220
  }
215
221
  ),
216
222
  /* @__PURE__ */ l("div", { className: "absolute top-1/2 right-2 flex -translate-y-1/2 gap-1", children: [
217
- /* @__PURE__ */ e(F, { size: "s", children: K() ? "⌘" : "Ctrl" }),
218
- /* @__PURE__ */ e(F, { size: "s", children: "K" })
223
+ /* @__PURE__ */ e(D, { size: "s", children: ne() ? "⌘" : "Ctrl" }),
224
+ /* @__PURE__ */ e(D, { size: "s", children: "K" })
219
225
  ] })
220
226
  ] }),
221
- /* @__PURE__ */ l(S, { delayDuration: 500, children: [
222
- /* @__PURE__ */ e(N, { asChild: !0, children: /* @__PURE__ */ e(
227
+ /* @__PURE__ */ l(k, { delayDuration: 500, children: [
228
+ /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(
223
229
  "button",
224
230
  {
225
- onClick: () => p(!0),
231
+ onClick: () => h(!0),
226
232
  className: "hidden h-8 w-8 cursor-pointer items-center justify-center rounded border border-[var(--color-border-primary-subtle)] bg-transparent transition-all duration-200 group-data-[collapsible=icon]:flex hover:border-[var(--color-border-primary-medium)] hover:!bg-[var(--color-background-neutral-subtlest-hovered)] focus:border-[var(--color-border-brand-bold)] focus:ring-2 focus:ring-[var(--color-border-brand-bold)]/20 focus:ring-offset-0 focus:outline-none active:border-[var(--color-border-primary-medium)]",
227
233
  "aria-label": "Search",
228
- children: /* @__PURE__ */ e(s, { name: $, size: "m", color: "tertiary" })
234
+ children: /* @__PURE__ */ e(s, { name: ie, size: "m", color: "tertiary" })
229
235
  }
230
236
  ) }),
231
- /* @__PURE__ */ e(z, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
237
+ /* @__PURE__ */ e(N, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
232
238
  /* @__PURE__ */ e("span", { children: "Search" }),
233
239
  /* @__PURE__ */ l("div", { className: "flex gap-1", children: [
234
- /* @__PURE__ */ e(F, { size: "s", variant: "dark", children: K() ? "⌘" : "Ctrl" }),
235
- /* @__PURE__ */ e(F, { size: "s", variant: "dark", children: "K" })
240
+ /* @__PURE__ */ e(D, { size: "s", variant: "dark", children: ne() ? "⌘" : "Ctrl" }),
241
+ /* @__PURE__ */ e(D, { size: "s", variant: "dark", children: "K" })
236
242
  ] })
237
243
  ] }) })
238
244
  ] })
239
245
  ] }) }),
240
- /* @__PURE__ */ e(B, { className: "pb-1 mt-1 p-[var(--space-s)]", children: /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(P, { children: o.main.map((r) => /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ l(S, { children: [
241
- /* @__PURE__ */ e(N, { asChild: !0, children: /* @__PURE__ */ l(
246
+ /* @__PURE__ */ e(F, { className: "pb-1 mt-1 p-[var(--space-s)]", children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(I, { children: a.main.map((r) => /* @__PURE__ */ e(P, { children: /* @__PURE__ */ l(k, { children: [
247
+ /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ l(
242
248
  C,
243
249
  {
244
250
  isActive: r.isActive,
@@ -251,12 +257,12 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
251
257
  ]
252
258
  }
253
259
  ) }),
254
- /* @__PURE__ */ e(z, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: E(r) })
260
+ /* @__PURE__ */ e(N, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: H(r) })
255
261
  ] }) }, r.title)) }) }) }),
256
- /* @__PURE__ */ e("div", { className: "my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex", children: /* @__PURE__ */ e(Y, { layout: "vertical" }) }),
257
- /* @__PURE__ */ l(B, { className: "mt-1 p-[var(--space-s)]", children: [
258
- /* @__PURE__ */ e(re, { className: "py-1 pb-1.5 group-data-[collapsible=icon]:hidden", children: "Operations" }),
259
- /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(P, { children: o.operations.map((r) => /* @__PURE__ */ e(Z, { children: r.items && r.items.length > 0 ? /* @__PURE__ */ l(ee, { children: [
262
+ /* @__PURE__ */ e("div", { className: "my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex", children: /* @__PURE__ */ e(Q, { layout: "vertical" }) }),
263
+ /* @__PURE__ */ l(F, { className: "mt-1 p-[var(--space-s)]", children: [
264
+ /* @__PURE__ */ e(_, { className: "py-1 pb-1.5 group-data-[collapsible=icon]:hidden", children: "Operations" }),
265
+ /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(I, { children: a.operations.map((r) => /* @__PURE__ */ e(P, { children: r.items && r.items.length > 0 ? /* @__PURE__ */ l(G, { children: [
260
266
  /* @__PURE__ */ e("div", { className: "group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ l(
261
267
  C,
262
268
  {
@@ -268,7 +274,7 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
268
274
  /* @__PURE__ */ e(
269
275
  s,
270
276
  {
271
- name: ne,
277
+ name: te,
272
278
  size: "s",
273
279
  className: `ml-auto transition-transform ${g[r.title] ? "rotate-90" : ""}`
274
280
  }
@@ -276,8 +282,8 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
276
282
  ]
277
283
  }
278
284
  ) }),
279
- r.items && r.items.length > 0 && g[r.title] && /* @__PURE__ */ e(le, { children: r.items.map((t) => /* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e(
280
- te,
285
+ r.items && r.items.length > 0 && g[r.title] && /* @__PURE__ */ e(ee, { children: r.items.map((t) => /* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(
286
+ le,
281
287
  {
282
288
  isActive: t.isActive,
283
289
  onClick: (x) => {
@@ -286,17 +292,17 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
286
292
  children: /* @__PURE__ */ e("span", { children: t.title })
287
293
  }
288
294
  ) }, t.title)) }),
289
- /* @__PURE__ */ e("div", { className: "hidden group-data-[collapsible=icon]:block", children: /* @__PURE__ */ l(J, { children: [
290
- /* @__PURE__ */ l(S, { children: [
291
- /* @__PURE__ */ e(Q, { asChild: !0, children: /* @__PURE__ */ e(N, { asChild: !0, children: /* @__PURE__ */ e(
295
+ /* @__PURE__ */ e("div", { className: "hidden group-data-[collapsible=icon]:block", children: /* @__PURE__ */ l(X, { children: [
296
+ /* @__PURE__ */ l(k, { children: [
297
+ /* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(
292
298
  C,
293
299
  {
294
- isActive: _(r),
300
+ isActive: Y(r),
295
301
  className: "w-full justify-center",
296
302
  children: /* @__PURE__ */ e(s, { name: r.icon, size: "s" })
297
303
  }
298
304
  ) }) }),
299
- /* @__PURE__ */ e(z, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: E(r) })
305
+ /* @__PURE__ */ e(N, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: H(r) })
300
306
  ] }),
301
307
  /* @__PURE__ */ l(q, { side: "right", sideOffset: 8, align: "start", children: [
302
308
  /* @__PURE__ */ e(O, { className: "text-body-medium-sm font-medium", children: r.title }),
@@ -314,8 +320,8 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
314
320
  ))
315
321
  ] })
316
322
  ] }) })
317
- ] }) : /* @__PURE__ */ l(S, { children: [
318
- /* @__PURE__ */ e(N, { asChild: !0, children: /* @__PURE__ */ l(
323
+ ] }) : /* @__PURE__ */ l(k, { children: [
324
+ /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ l(
319
325
  C,
320
326
  {
321
327
  isActive: r.isActive,
@@ -328,13 +334,13 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
328
334
  ]
329
335
  }
330
336
  ) }),
331
- /* @__PURE__ */ e(z, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: E(r) })
337
+ /* @__PURE__ */ e(N, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: H(r) })
332
338
  ] }) }, r.title)) }) })
333
339
  ] }),
334
- /* @__PURE__ */ e("div", { className: "my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex", children: /* @__PURE__ */ e(Y, { layout: "vertical" }) }),
335
- /* @__PURE__ */ l(B, { className: "mt-1 p-[var(--space-s)]", children: [
336
- /* @__PURE__ */ e(re, { className: "py-1 pb-1.5 group-data-[collapsible=icon]:hidden", children: "Intelligence" }),
337
- /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(P, { children: o.intelligence.map((r) => /* @__PURE__ */ e(Z, { children: r.items && r.items.length > 0 ? /* @__PURE__ */ l(ee, { children: [
340
+ /* @__PURE__ */ e("div", { className: "my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex", children: /* @__PURE__ */ e(Q, { layout: "vertical" }) }),
341
+ /* @__PURE__ */ l(F, { className: "mt-1 p-[var(--space-s)]", children: [
342
+ /* @__PURE__ */ e(_, { className: "py-1 pb-1.5 group-data-[collapsible=icon]:hidden", children: "Intelligence" }),
343
+ /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(I, { children: a.intelligence.map((r) => /* @__PURE__ */ e(P, { children: r.items && r.items.length > 0 ? /* @__PURE__ */ l(G, { children: [
338
344
  /* @__PURE__ */ e("div", { className: "group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ l(
339
345
  C,
340
346
  {
@@ -346,7 +352,7 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
346
352
  /* @__PURE__ */ e(
347
353
  s,
348
354
  {
349
- name: ne,
355
+ name: te,
350
356
  size: "s",
351
357
  className: `ml-auto transition-transform ${g[r.title] ? "rotate-90" : ""}`
352
358
  }
@@ -354,8 +360,8 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
354
360
  ]
355
361
  }
356
362
  ) }),
357
- r.items && r.items.length > 0 && g[r.title] && /* @__PURE__ */ e(le, { children: r.items.map((t) => /* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e(
358
- te,
363
+ r.items && r.items.length > 0 && g[r.title] && /* @__PURE__ */ e(ee, { children: r.items.map((t) => /* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(
364
+ le,
359
365
  {
360
366
  isActive: t.isActive,
361
367
  onClick: (x) => {
@@ -364,17 +370,17 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
364
370
  children: /* @__PURE__ */ e("span", { children: t.title })
365
371
  }
366
372
  ) }, t.title)) }),
367
- /* @__PURE__ */ e("div", { className: "hidden group-data-[collapsible=icon]:block", children: /* @__PURE__ */ l(J, { children: [
368
- /* @__PURE__ */ l(S, { children: [
369
- /* @__PURE__ */ e(Q, { asChild: !0, children: /* @__PURE__ */ e(N, { asChild: !0, children: /* @__PURE__ */ e(
373
+ /* @__PURE__ */ e("div", { className: "hidden group-data-[collapsible=icon]:block", children: /* @__PURE__ */ l(X, { children: [
374
+ /* @__PURE__ */ l(k, { children: [
375
+ /* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(
370
376
  C,
371
377
  {
372
- isActive: _(r),
378
+ isActive: Y(r),
373
379
  className: "w-full justify-center",
374
380
  children: /* @__PURE__ */ e(s, { name: r.icon, size: "s" })
375
381
  }
376
382
  ) }) }),
377
- /* @__PURE__ */ e(z, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: E(r) })
383
+ /* @__PURE__ */ e(N, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: H(r) })
378
384
  ] }),
379
385
  /* @__PURE__ */ l(q, { side: "right", sideOffset: 8, align: "start", children: [
380
386
  /* @__PURE__ */ e(O, { className: "text-body-medium-sm font-medium", children: r.title }),
@@ -392,8 +398,8 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
392
398
  ))
393
399
  ] })
394
400
  ] }) })
395
- ] }) : /* @__PURE__ */ l(S, { children: [
396
- /* @__PURE__ */ e(N, { asChild: !0, children: /* @__PURE__ */ l(
401
+ ] }) : /* @__PURE__ */ l(k, { children: [
402
+ /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ l(
397
403
  C,
398
404
  {
399
405
  isActive: r.isActive,
@@ -406,11 +412,11 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
406
412
  ]
407
413
  }
408
414
  ) }),
409
- /* @__PURE__ */ e(z, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: E(r) })
415
+ /* @__PURE__ */ e(N, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: H(r) })
410
416
  ] }) }, r.title)) }) })
411
417
  ] }),
412
- /* @__PURE__ */ e(B, { className: "pb-2 p-[var(--space-s)] mt-auto", children: /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(P, { children: o.support.map((r) => /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ l(S, { children: [
413
- /* @__PURE__ */ e(N, { asChild: !0, children: /* @__PURE__ */ l(
418
+ /* @__PURE__ */ e(F, { className: "pb-2 p-[var(--space-s)] pt-[var(--space-l)] mt-auto", children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(I, { children: a.support.map((r) => /* @__PURE__ */ e(P, { children: /* @__PURE__ */ l(k, { children: [
419
+ /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ l(
414
420
  C,
415
421
  {
416
422
  isActive: r.isActive,
@@ -423,13 +429,13 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
423
429
  ]
424
430
  }
425
431
  ) }),
426
- /* @__PURE__ */ e(z, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: E(r) })
432
+ /* @__PURE__ */ e(N, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: H(r) })
427
433
  ] }) }, r.title)) }) }) })
428
434
  ]
429
435
  }
430
436
  ),
431
- /* @__PURE__ */ e(pe, { className: "sticky bottom-0 z-10 border-t border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] group-data-[collapsible=icon]:px-2 group-data-[collapsible=icon]:py-2", children: /* @__PURE__ */ e("div", { className: "group/user-menu rounded-m border border-[var(--color-border-primary-subtle)] transition-colors hover:border-[var(--color-border-primary-medium)] group-data-[collapsible=icon]:rounded-none group-data-[collapsible=icon]:border-none", children: /* @__PURE__ */ l(J, { children: [
432
- /* @__PURE__ */ e(Q, { asChild: !0, children: /* @__PURE__ */ l(
437
+ /* @__PURE__ */ e(pe, { className: "sticky bottom-0 z-10 border-t border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] group-data-[collapsible=icon]:px-2 group-data-[collapsible=icon]:py-2", children: /* @__PURE__ */ e("div", { className: "group/user-menu rounded-m border border-[var(--color-border-primary-subtle)] transition-colors hover:border-[var(--color-border-primary-medium)] group-data-[collapsible=icon]:rounded-none group-data-[collapsible=icon]:border-none", children: /* @__PURE__ */ l(X, { children: [
438
+ /* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ l(
433
439
  fe,
434
440
  {
435
441
  variant: "ghost",
@@ -437,33 +443,33 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
437
443
  children: [
438
444
  /* @__PURE__ */ l("div", { className: "flex w-full items-center gap-3 group-data-[collapsible=icon]:hidden", children: [
439
445
  /* @__PURE__ */ l("div", { className: "relative flex-shrink-0", children: [
440
- /* @__PURE__ */ l(V, { size: "m", type: "user", children: [
441
- /* @__PURE__ */ e(L, { src: a.avatarUrl, alt: a.name }),
442
- /* @__PURE__ */ e(T, { size: "m", type: "user", children: G(a.name) })
446
+ /* @__PURE__ */ l(M, { size: "m", type: "user", children: [
447
+ /* @__PURE__ */ e(V, { src: o.avatarUrl, alt: o.name }),
448
+ /* @__PURE__ */ e(L, { size: "m", type: "user", children: K(o.name) })
443
449
  ] }),
444
- /* @__PURE__ */ e("div", { className: "absolute -right-1 -bottom-1 rounded-[4px] border-2 border-white p-0", children: /* @__PURE__ */ l(V, { size: "xxs", type: "organization", children: [
445
- /* @__PURE__ */ e(L, { src: i.avatarUrl, alt: i.name }),
446
- /* @__PURE__ */ e(T, { size: "xxs", type: "organization", children: W(i.name) })
450
+ /* @__PURE__ */ e("div", { className: "absolute -right-1 -bottom-1 rounded-[4px] border-2 border-white p-0", children: /* @__PURE__ */ l(M, { size: "xxs", type: "organization", children: [
451
+ /* @__PURE__ */ e(V, { src: i.avatarUrl, alt: i.name }),
452
+ /* @__PURE__ */ e(L, { size: "xxs", type: "organization", children: W(i.name) })
447
453
  ] }) })
448
454
  ] }),
449
455
  /* @__PURE__ */ l("div", { className: "min-w-0 flex-1 text-left", children: [
450
- /* @__PURE__ */ e("div", { className: "text-body-medium-sm truncate font-medium text-[var(--color-text-primary)]", children: a.name }),
456
+ /* @__PURE__ */ e("div", { className: "text-body-medium-sm truncate font-medium text-[var(--color-text-primary)]", children: o.name }),
451
457
  /* @__PURE__ */ l("div", { className: "text-body-xsm text-[var(--color-text-secondary)]", children: [
452
458
  i.role,
453
459
  " at ",
454
460
  i.name
455
461
  ] })
456
462
  ] }),
457
- /* @__PURE__ */ e(s, { name: Ae, size: "m", className: "opacity-50" })
463
+ /* @__PURE__ */ e(s, { name: Me, size: "m", className: "opacity-50" })
458
464
  ] }),
459
465
  /* @__PURE__ */ l("div", { className: "relative hidden group-data-[collapsible=icon]:block", children: [
460
- /* @__PURE__ */ l(V, { size: "s", type: "user", children: [
461
- /* @__PURE__ */ e(L, { src: a.avatarUrl, alt: a.name }),
462
- /* @__PURE__ */ e(T, { size: "s", type: "user", children: G(a.name) })
466
+ /* @__PURE__ */ l(M, { size: "s", type: "user", children: [
467
+ /* @__PURE__ */ e(V, { src: o.avatarUrl, alt: o.name }),
468
+ /* @__PURE__ */ e(L, { size: "s", type: "user", children: K(o.name) })
463
469
  ] }),
464
- /* @__PURE__ */ e("div", { className: "absolute -right-1 -bottom-1 rounded-[2px] border-2 border-white bg-[var(--color-surface-primary)]", children: /* @__PURE__ */ l(V, { size: "xxs", type: "organization", children: [
465
- /* @__PURE__ */ e(L, { src: i.avatarUrl, alt: i.name }),
466
- /* @__PURE__ */ e(T, { size: "xxs", type: "organization", children: W(i.name) })
470
+ /* @__PURE__ */ e("div", { className: "absolute -right-1 -bottom-1 rounded-[2px] border-2 border-white bg-[var(--color-surface-primary)]", children: /* @__PURE__ */ l(M, { size: "xxs", type: "organization", children: [
471
+ /* @__PURE__ */ e(V, { src: i.avatarUrl, alt: i.name }),
472
+ /* @__PURE__ */ e(L, { size: "xxs", type: "organization", children: W(i.name) })
467
473
  ] }) })
468
474
  ] })
469
475
  ]
@@ -478,26 +484,26 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
478
484
  sideOffset: 4,
479
485
  children: [
480
486
  /* @__PURE__ */ e(O, { className: "p-0 font-normal", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-3 px-2 py-2", children: [
481
- /* @__PURE__ */ l(V, { size: "s", type: "user", children: [
482
- /* @__PURE__ */ e(L, { src: a.avatarUrl, alt: a.name }),
483
- /* @__PURE__ */ e(T, { size: "s", type: "user", children: G(a.name) })
487
+ /* @__PURE__ */ l(M, { size: "s", type: "user", children: [
488
+ /* @__PURE__ */ e(V, { src: o.avatarUrl, alt: o.name }),
489
+ /* @__PURE__ */ e(L, { size: "s", type: "user", children: K(o.name) })
484
490
  ] }),
485
491
  /* @__PURE__ */ l("div", { className: "grid flex-1 text-left", children: [
486
- /* @__PURE__ */ e("span", { className: "text-body-medium-sm truncate font-semibold text-[var(--color-text-primary)]", children: a.name }),
487
- /* @__PURE__ */ e("span", { className: "text-caption-xsm truncate text-[var(--color-text-secondary)]", children: a.email })
492
+ /* @__PURE__ */ e("span", { className: "text-body-medium-sm truncate font-semibold text-[var(--color-text-primary)]", children: o.name }),
493
+ /* @__PURE__ */ e("span", { className: "text-caption-xsm truncate text-[var(--color-text-secondary)]", children: o.email })
488
494
  ] })
489
495
  ] }) }),
490
496
  /* @__PURE__ */ e(U, {}),
491
497
  /* @__PURE__ */ e(O, { className: "px-2 py-1 text-[12px] font-medium text-[var(--color-text-tertiary)]", children: "Organizations" }),
492
- h.map((r) => /* @__PURE__ */ l(
498
+ u.map((r) => /* @__PURE__ */ l(
493
499
  w,
494
500
  {
495
501
  onSelect: () => c(r),
496
502
  className: "mx-1 mb-1 h-10 cursor-pointer gap-2 px-1 pr-2 pl-1",
497
503
  children: [
498
- /* @__PURE__ */ l(V, { size: "s", type: "organization", children: [
499
- /* @__PURE__ */ e(L, { src: r.avatarUrl, alt: r.name }),
500
- /* @__PURE__ */ e(T, { size: "s", type: "organization", children: W(r.name) })
504
+ /* @__PURE__ */ l(M, { size: "s", type: "organization", children: [
505
+ /* @__PURE__ */ e(V, { src: r.avatarUrl, alt: r.name }),
506
+ /* @__PURE__ */ e(L, { size: "s", type: "organization", children: W(r.name) })
501
507
  ] }),
502
508
  /* @__PURE__ */ l("div", { className: "flex flex-1 flex-col text-left", children: [
503
509
  /* @__PURE__ */ e("span", { className: "text-body-medium-sm truncate font-semibold text-[var(--color-text-primary)]", children: r.name }),
@@ -508,7 +514,7 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
508
514
  " plan"
509
515
  ] })
510
516
  ] }),
511
- i.name === r.name && /* @__PURE__ */ e(s, { name: X, size: "m", className: "text-[var(--color-icon-brand-bold)]" })
517
+ i.name === r.name && /* @__PURE__ */ e(s, { name: $, size: "m", className: "text-[var(--color-icon-brand-bold)]" })
512
518
  ]
513
519
  },
514
520
  r.name
@@ -522,7 +528,7 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
522
528
  onSelect: () => f("sidebar"),
523
529
  children: [
524
530
  /* @__PURE__ */ e("span", { className: "flex-1", children: "New sidebar navigation" }),
525
- d === "sidebar" && /* @__PURE__ */ e(s, { name: X, size: "m", className: "text-[var(--color-icon-brand-bold)]" })
531
+ d === "sidebar" && /* @__PURE__ */ e(s, { name: $, size: "m", className: "text-[var(--color-icon-brand-bold)]" })
526
532
  ]
527
533
  }
528
534
  ),
@@ -533,7 +539,7 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
533
539
  onSelect: () => f("horizontal"),
534
540
  children: [
535
541
  /* @__PURE__ */ e("span", { className: "flex-1", children: "Old horizontal menu" }),
536
- d === "horizontal" && /* @__PURE__ */ e(s, { name: X, size: "m", className: "text-[var(--color-icon-brand-bold)]" })
542
+ d === "horizontal" && /* @__PURE__ */ e(s, { name: $, size: "m", className: "text-[var(--color-icon-brand-bold)]" })
537
543
  ]
538
544
  }
539
545
  ),
@@ -541,7 +547,7 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
541
547
  /* @__PURE__ */ e(
542
548
  w,
543
549
  {
544
- icon: Me,
550
+ icon: Ve,
545
551
  className: "cursor-pointer",
546
552
  onSelect: () => {
547
553
  n && n("/user/profile");
@@ -552,7 +558,7 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
552
558
  /* @__PURE__ */ e(
553
559
  w,
554
560
  {
555
- icon: Ve,
561
+ icon: Le,
556
562
  className: "cursor-pointer",
557
563
  onSelect: () => {
558
564
  n && n("/organization/settings");
@@ -564,7 +570,7 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
564
570
  /* @__PURE__ */ e(
565
571
  w,
566
572
  {
567
- icon: Le,
573
+ icon: Te,
568
574
  destructive: !0,
569
575
  className: "cursor-pointer",
570
576
  onSelect: () => {
@@ -579,106 +585,98 @@ function Ie({ navigationData: o, user: a, teams: h, onNavigate: n, navigationMod
579
585
  ] }) }) }),
580
586
  /* @__PURE__ */ e(he, {})
581
587
  ] }),
582
- /* @__PURE__ */ l(Ee, { open: A, onOpenChange: p, commandProps: u ? { shouldFilter: !1 } : void 0, children: [
588
+ /* @__PURE__ */ l(Ee, { open: z, onOpenChange: h, commandProps: p && p.length > 0 ? { shouldFilter: !1 } : void 0, children: [
583
589
  /* @__PURE__ */ e(
584
- Re,
590
+ Ue,
585
591
  {
586
592
  placeholder: "Type a command or search...",
587
593
  value: j,
588
594
  onValueChange: (r) => {
589
- M(r), b?.(r);
595
+ A(r), b?.(r);
590
596
  },
591
597
  clearable: !1
592
598
  }
593
599
  ),
594
- /* @__PURE__ */ l(Ue, { children: [
600
+ /* @__PURE__ */ l(Re, { children: [
595
601
  /* @__PURE__ */ e(je, { children: "No results found." }),
596
602
  y && /* @__PURE__ */ e("div", { className: "py-[var(--space-m)] text-center text-body-sm text-[var(--color-text-tertiary)]", children: "Searching…" }),
597
- u && u.length > 0 && (() => {
598
- const r = Be(u, (t) => t.group ?? "Results");
599
- return Object.entries(r).map(([t, x]) => /* @__PURE__ */ e(D, { heading: t, children: x.map((R) => /* @__PURE__ */ l(
600
- k,
603
+ p && p.length > 0 && (() => {
604
+ const r = Be(p, (t) => t.group ?? "Results");
605
+ return Object.entries(r).map(([t, x]) => /* @__PURE__ */ e(Z, { heading: t, children: x.map((E) => /* @__PURE__ */ l(
606
+ R,
601
607
  {
602
- value: R.id,
608
+ value: E.id,
603
609
  onSelect: () => {
604
- R.onSelect?.(), p(!1);
610
+ E.onSelect?.(), h(!1);
605
611
  },
606
612
  children: [
607
- R.icon && /* @__PURE__ */ e(s, { name: R.icon, size: "s", className: "mr-2" }),
608
- /* @__PURE__ */ e("span", { children: R.label })
613
+ E.icon && /* @__PURE__ */ e(s, { name: E.icon, size: "s", className: "mr-2" }),
614
+ /* @__PURE__ */ e("span", { children: E.label })
609
615
  ]
610
616
  },
611
- R.id
617
+ E.id
612
618
  )) }, t));
613
619
  })(),
614
- /* @__PURE__ */ l(D, { heading: "Quick actions", children: [
615
- /* @__PURE__ */ l(k, { onSelect: () => console.log("Reload"), children: [
616
- /* @__PURE__ */ e(s, { name: Te, size: "s", className: "mr-2" }),
617
- /* @__PURE__ */ e("span", { children: "Reload Page" }),
618
- /* @__PURE__ */ l("span", { className: "text-caption-sm ml-auto text-[var(--color-text-tertiary)]", children: [
619
- K() ? "" : "Ctrl",
620
- "R"
621
- ] })
620
+ !p?.length && /* @__PURE__ */ l(G, { children: [
621
+ /* @__PURE__ */ l(Z, { heading: "Navigation", children: [
622
+ a.main.map((r) => /* @__PURE__ */ l(R, { onSelect: () => {
623
+ n?.(r.url), h(!1);
624
+ }, children: [
625
+ /* @__PURE__ */ e(s, { name: r.icon, size: "s", className: "mr-2" }),
626
+ /* @__PURE__ */ e("span", { children: r.title })
627
+ ] }, r.title)),
628
+ a.operations.map((r) => /* @__PURE__ */ l(R, { onSelect: () => {
629
+ n?.(r.url), h(!1);
630
+ }, children: [
631
+ /* @__PURE__ */ e(s, { name: r.icon, size: "s", className: "mr-2" }),
632
+ /* @__PURE__ */ e("span", { children: r.title })
633
+ ] }, r.title)),
634
+ a.intelligence.map((r) => /* @__PURE__ */ l(R, { onSelect: () => {
635
+ n?.(r.url), h(!1);
636
+ }, children: [
637
+ /* @__PURE__ */ e(s, { name: r.icon, size: "s", className: "mr-2" }),
638
+ /* @__PURE__ */ e("span", { children: r.title })
639
+ ] }, r.title))
622
640
  ] }),
623
- /* @__PURE__ */ l(k, { onSelect: () => p(!1), children: [
624
- /* @__PURE__ */ e(s, { name: $, size: "s", className: "mr-2" }),
625
- /* @__PURE__ */ e("span", { children: "Search" }),
626
- /* @__PURE__ */ l("span", { className: "text-caption-sm ml-auto text-[var(--color-text-tertiary)]", children: [
627
- K() ? "⌘" : "Ctrl",
628
- "K"
629
- ] })
630
- ] })
631
- ] }),
632
- /* @__PURE__ */ l(D, { heading: "Navigation", children: [
633
- o.main.map((r) => /* @__PURE__ */ l(k, { onSelect: () => p(!1), children: [
641
+ /* @__PURE__ */ e(Z, { heading: "Settings", children: a.support.map((r) => /* @__PURE__ */ l(R, { onSelect: () => {
642
+ n?.(r.url), h(!1);
643
+ }, children: [
634
644
  /* @__PURE__ */ e(s, { name: r.icon, size: "s", className: "mr-2" }),
635
645
  /* @__PURE__ */ e("span", { children: r.title })
636
- ] }, r.title)),
637
- o.operations.map((r) => /* @__PURE__ */ l(k, { onSelect: () => p(!1), children: [
638
- /* @__PURE__ */ e(s, { name: r.icon, size: "s", className: "mr-2" }),
639
- /* @__PURE__ */ e("span", { children: r.title })
640
- ] }, r.title)),
641
- o.intelligence.map((r) => /* @__PURE__ */ l(k, { onSelect: () => p(!1), children: [
642
- /* @__PURE__ */ e(s, { name: r.icon, size: "s", className: "mr-2" }),
643
- /* @__PURE__ */ e("span", { children: r.title })
644
- ] }, r.title))
645
- ] }),
646
- /* @__PURE__ */ e(D, { heading: "Settings", children: o.support.map((r) => /* @__PURE__ */ l(k, { onSelect: () => p(!1), children: [
647
- /* @__PURE__ */ e(s, { name: r.icon, size: "s", className: "mr-2" }),
648
- /* @__PURE__ */ e("span", { children: r.title })
649
- ] }, r.title)) }),
650
- /* @__PURE__ */ e(D, { heading: "Switch team", children: h.map((r) => /* @__PURE__ */ l(k, { onSelect: () => p(!1), children: [
651
- /* @__PURE__ */ l(V, { size: "s", className: "mr-2", type: "organization", children: [
652
- /* @__PURE__ */ e(L, { src: r.avatarUrl, alt: r.name }),
653
- /* @__PURE__ */ e(T, { size: "s", type: "organization", children: W(r.name) })
654
- ] }),
655
- /* @__PURE__ */ e("span", { children: r.name })
656
- ] }, r.name)) })
646
+ ] }, r.title)) }),
647
+ /* @__PURE__ */ e(Z, { heading: "Switch team", children: u.map((r) => /* @__PURE__ */ l(R, { onSelect: () => h(!1), children: [
648
+ /* @__PURE__ */ l(M, { size: "s", className: "mr-2", type: "organization", children: [
649
+ /* @__PURE__ */ e(V, { src: r.avatarUrl, alt: r.name }),
650
+ /* @__PURE__ */ e(L, { size: "s", type: "organization", children: W(r.name) })
651
+ ] }),
652
+ /* @__PURE__ */ e("span", { children: r.name })
653
+ ] }, r.name)) })
654
+ ] })
657
655
  ] })
658
656
  ] })
659
657
  ] });
660
658
  }
661
659
  function Pe({
662
- navigationData: o,
663
- user: a,
664
- activeTeam: h,
660
+ navigationData: a,
661
+ user: o,
662
+ activeTeam: u,
665
663
  onNavigate: n,
666
664
  navigationMode: d,
667
665
  onNavigationModeChange: f
668
666
  }) {
669
- const [b, u] = m.useState(!1), y = m.useRef(null);
667
+ const [b, p] = m.useState(!1), y = m.useRef(null);
670
668
  m.useEffect(() => {
671
669
  if (!b) return;
672
670
  const i = (c) => {
673
- y.current && !y.current.contains(c.target) && u(!1);
671
+ y.current && !y.current.contains(c.target) && p(!1);
674
672
  };
675
673
  return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
676
674
  }, [b]);
677
- const A = [
678
- ...o.main,
679
- ...o.operations,
680
- ...o.intelligence
681
- ], p = A.find((i) => i.isActive || i.items?.some((c) => c.isActive))?.title ?? null, [j, M] = m.useState(p), g = A.find((i) => i.title === j)?.items ?? [], H = G(a.name);
675
+ const z = [
676
+ ...a.main,
677
+ ...a.operations,
678
+ ...a.intelligence
679
+ ], h = z.find((i) => i.isActive || i.items?.some((c) => c.isActive))?.title ?? null, [j, A] = m.useState(h), g = z.find((i) => i.title === j)?.items ?? [], T = K(o.name);
682
680
  return /* @__PURE__ */ l("div", { style: { width: "100%" }, children: [
683
681
  /* @__PURE__ */ l(
684
682
  "div",
@@ -749,7 +747,7 @@ function Pe({
749
747
  /* @__PURE__ */ e(
750
748
  "button",
751
749
  {
752
- onClick: () => u((i) => !i),
750
+ onClick: () => p((i) => !i),
753
751
  style: {
754
752
  width: 32,
755
753
  height: 32,
@@ -765,14 +763,14 @@ function Pe({
765
763
  fontWeight: 600,
766
764
  padding: 0
767
765
  },
768
- children: a.avatarUrl ? /* @__PURE__ */ e(
766
+ children: o.avatarUrl ? /* @__PURE__ */ e(
769
767
  "img",
770
768
  {
771
- src: a.avatarUrl,
772
- alt: a.name,
769
+ src: o.avatarUrl,
770
+ alt: o.name,
773
771
  style: { width: "100%", height: "100%", borderRadius: "50%", objectFit: "cover" }
774
772
  }
775
- ) : H
773
+ ) : T
776
774
  }
777
775
  ),
778
776
  b && /* @__PURE__ */ l(
@@ -792,8 +790,8 @@ function Pe({
792
790
  },
793
791
  children: [
794
792
  /* @__PURE__ */ l("div", { style: { padding: "8px 12px", borderBottom: "1px solid #e5e7eb" }, children: [
795
- /* @__PURE__ */ e("div", { style: { fontWeight: 600, color: "#111827" }, children: a.name }),
796
- /* @__PURE__ */ e("div", { style: { fontSize: 12, color: "#6b7280" }, children: a.email })
793
+ /* @__PURE__ */ e("div", { style: { fontWeight: 600, color: "#111827" }, children: o.name }),
794
+ /* @__PURE__ */ e("div", { style: { fontSize: 12, color: "#6b7280" }, children: o.email })
797
795
  ] }),
798
796
  /* @__PURE__ */ l("div", { style: { padding: "4px 0", borderBottom: "1px solid #e5e7eb" }, children: [
799
797
  /* @__PURE__ */ e("div", { style: { padding: "4px 12px", fontSize: 11, fontWeight: 500, color: "#9ca3af", textTransform: "uppercase", letterSpacing: "0.05em" }, children: "Navigation" }),
@@ -801,7 +799,7 @@ function Pe({
801
799
  "button",
802
800
  {
803
801
  onClick: () => {
804
- f("sidebar"), u(!1);
802
+ f("sidebar"), p(!1);
805
803
  },
806
804
  style: {
807
805
  display: "flex",
@@ -831,7 +829,7 @@ function Pe({
831
829
  "button",
832
830
  {
833
831
  onClick: () => {
834
- f("horizontal"), u(!1);
832
+ f("horizontal"), p(!1);
835
833
  },
836
834
  style: {
837
835
  display: "flex",
@@ -862,7 +860,7 @@ function Pe({
862
860
  "button",
863
861
  {
864
862
  onClick: () => {
865
- n?.("/auth/sign-out"), u(!1);
863
+ n?.("/auth/sign-out"), p(!1);
866
864
  },
867
865
  style: {
868
866
  display: "flex",
@@ -905,13 +903,13 @@ function Pe({
905
903
  gap: 2,
906
904
  overflowX: "auto"
907
905
  },
908
- children: A.map((i) => {
906
+ children: z.map((i) => {
909
907
  const c = i.isActive || (i.items?.some((v) => v.isActive) ?? !1);
910
908
  return /* @__PURE__ */ e(
911
909
  "button",
912
910
  {
913
911
  onClick: (v) => {
914
- v.preventDefault(), M(i.title), n?.(i.url);
912
+ v.preventDefault(), A(i.title), n?.(i.url);
915
913
  },
916
914
  style: {
917
915
  padding: "6px 14px",
@@ -984,67 +982,67 @@ function Pe({
984
982
  ] });
985
983
  }
986
984
  function Ze() {
987
- const { state: o, toggleSidebar: a } = ue(), h = o === "collapsed";
985
+ const { state: a, toggleSidebar: o } = ue(), u = a === "collapsed";
988
986
  return m.useEffect(() => {
989
987
  const n = (d) => {
990
- d.key === "[" && (d.preventDefault(), a());
988
+ d.key === "[" && (d.preventDefault(), o());
991
989
  };
992
990
  return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
993
- }, [a]), /* @__PURE__ */ l(S, { delayDuration: 500, children: [
994
- /* @__PURE__ */ e(N, { asChild: !0, children: /* @__PURE__ */ e(me, { className: "-ml-1" }) }),
995
- /* @__PURE__ */ e(z, { side: "bottom", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
996
- /* @__PURE__ */ e("span", { children: h ? "Expand sidebar" : "Collapse sidebar" }),
997
- /* @__PURE__ */ e(F, { size: "s", variant: "dark", children: "[" })
991
+ }, [o]), /* @__PURE__ */ l(k, { delayDuration: 500, children: [
992
+ /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(me, { className: "-ml-1" }) }),
993
+ /* @__PURE__ */ e(N, { side: "bottom", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
994
+ /* @__PURE__ */ e("span", { children: u ? "Expand sidebar" : "Collapse sidebar" }),
995
+ /* @__PURE__ */ e(D, { size: "s", variant: "dark", children: "[" })
998
996
  ] }) })
999
997
  ] });
1000
998
  }
1001
999
  function rr({
1002
- navigationData: o = Fe,
1003
- user: a = Oe,
1004
- teams: h = De,
1000
+ navigationData: a = Fe,
1001
+ user: o = Oe,
1002
+ teams: u = De,
1005
1003
  defaultSidebarOpen: n = !0,
1006
1004
  headerContent: d,
1007
1005
  headerTabs: f,
1008
1006
  headerActions: b,
1009
- children: u,
1007
+ children: p,
1010
1008
  onNavigate: y,
1011
- onSearchChange: A,
1012
- searchItems: p,
1009
+ onSearchChange: z,
1010
+ searchItems: h,
1013
1011
  searchLoading: j
1014
1012
  }) {
1015
- const [M, g] = m.useState("sidebar"), [H] = m.useState(h[0]);
1016
- return M === "horizontal" ? /* @__PURE__ */ l("div", { className: "h-screen overflow-hidden", style: { display: "flex", flexDirection: "column" }, children: [
1013
+ const [A, g] = m.useState("sidebar"), [T] = m.useState(u[0]);
1014
+ return A === "horizontal" ? /* @__PURE__ */ l("div", { className: "h-screen overflow-hidden", style: { display: "flex", flexDirection: "column" }, children: [
1017
1015
  /* @__PURE__ */ e(
1018
1016
  Pe,
1019
1017
  {
1020
- navigationData: o,
1021
- user: a,
1022
- activeTeam: H,
1018
+ navigationData: a,
1019
+ user: o,
1020
+ activeTeam: T,
1023
1021
  onNavigate: y,
1024
- navigationMode: M,
1022
+ navigationMode: A,
1025
1023
  onNavigationModeChange: g
1026
1024
  }
1027
1025
  ),
1028
- /* @__PURE__ */ e("div", { style: { flex: 1, overflow: "auto", minHeight: 0, backgroundColor: "var(--color-surface-base)" }, children: u })
1029
- ] }) : /* @__PURE__ */ e("div", { className: "h-screen overflow-hidden", children: /* @__PURE__ */ l(oe, { defaultOpen: n, children: [
1026
+ /* @__PURE__ */ e("div", { style: { flex: 1, overflow: "auto", minHeight: 0, backgroundColor: "var(--color-surface-base)" }, children: p })
1027
+ ] }) : /* @__PURE__ */ e("div", { className: "h-screen overflow-hidden", children: /* @__PURE__ */ l(ae, { defaultOpen: n, children: [
1030
1028
  /* @__PURE__ */ e(
1031
1029
  Ie,
1032
1030
  {
1033
- navigationData: o,
1034
- user: a,
1035
- teams: h,
1031
+ navigationData: a,
1032
+ user: o,
1033
+ teams: u,
1036
1034
  onNavigate: y,
1037
- navigationMode: M,
1035
+ navigationMode: A,
1038
1036
  onNavigationModeChange: g,
1039
- onSearchChange: A,
1040
- searchItems: p,
1037
+ onSearchChange: z,
1038
+ searchItems: h,
1041
1039
  searchLoading: j
1042
1040
  }
1043
1041
  ),
1044
1042
  /* @__PURE__ */ l(se, { children: [
1045
1043
  (d || b || f) && /* @__PURE__ */ l("header", { className: "flex h-12 shrink-0 items-center gap-2 border-b border-[var(--color-border-primary-subtle)] transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 box-border px-[var(--space-m)]", children: [
1046
1044
  /* @__PURE__ */ e(Ze, {}),
1047
- /* @__PURE__ */ e(Y, { layout: "horizontal", className: "mr-2 h-4" }),
1045
+ /* @__PURE__ */ e(Q, { layout: "horizontal", className: "mr-2 h-4" }),
1048
1046
  /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: d }),
1049
1047
  /* @__PURE__ */ l("div", { className: "flex items-center gap-2 ml-auto shrink-0", children: [
1050
1048
  f && /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: f }),
@@ -1052,7 +1050,7 @@ function rr({
1052
1050
  b && /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: b })
1053
1051
  ] })
1054
1052
  ] }),
1055
- /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto min-h-0 min-w-0", children: u })
1053
+ /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto min-h-0 min-w-0", children: p })
1056
1054
  ] })
1057
1055
  ] }) });
1058
1056
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rafal.lemieszewski/tide-ui",
3
- "version": "0.87.5",
3
+ "version": "0.87.7",
4
4
  "description": "A comprehensive React component library built with Tailwind CSS and Radix UI primitives",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/lib/index.cjs",