PageSourceSearch

https://certera.ai/_next/static/immutable/chunks/32au6chlj2naz.js

js certera.ai collected 2026-10-05 11:54:53 UTC 27,428 bytes, 3 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a10935-b9e3-7a71-86c5-d32dbf735aea")}catch(e){}}();(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,460313,e=>{"use strict";var a=e.i(530343),t=e.i(928335),r=e.i(845953),n=e.i(362500),s=e.i(51075),i=e.i(911029);e.i(313460);var o=e.i(231665),l=e.i(3785),d=e.i(917356),c=e.i(543250),u=e.i(136131),h=e.i(672687),m=e.i(980939),x=e.i(3909);function p(){return()=>{}}var f="Avatar",[b,g]=(0,c.createContextScope)(f),[j,v]=b(f),y=t.forwardRef((e,r)=>{let{__scopeAvatar:n,...s}=e,[i,o]=t.useState("idle");return(0,a.jsx)(j,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:(0,a.jsx)(m.Primitive.span,{...s,ref:r})})});y.displayName=f;var w="AvatarImage",N=t.forwardRef((e,r)=>{let{__scopeAvatar:n,src:s,onLoadingStatusChange:i=()=>{},...o}=e,l=v(w,n),d=function(e,{referrerPolicy:a,crossOrigin:r}){let n=(0,x.useSyncExternalStore)(p,()=>!0,()=>!1),s=t.useRef(null),i=n?(s.current||(s.current=new window.Image),s.current):null,[o,l]=t.useState(()=>C(i,e));return(0,h.useLayoutEffect)(()=>
1{l(C(i,e))},[i,e]),(0,h.useLayoutEffect)(()=>{let e=e=>()=>{l(e)};if(!i)return;let t=e("loaded"),n=e("error");return i.addEventListener("load",t),i.addEventListener("error",n),a&&(i.referrerPolicy=a),"string"==typeof r&&(i.crossOrigin=r),()=>{i.removeEventListener("load",t),i.removeEventListener("error",n)}},[i,r,a]),o}(s,o),c=(0,u.useCallbackRef)(e=>{i(e),l.onImageLoadingStatusChange(e)});return(0,h.useLayoutEffect)(()=>{"idle"!==d&&c(d)},[d,c]),"loaded"===d?(0,a.jsx)(m.Primitive.img,{...o,ref:r,src:s}):null});N.displayName=w;var S="AvatarFallback",M=t.forwardRef((e,r)=>{let{__scopeAvatar:n,delayMs:s,...i}=e,o=v(S,n),[l,d]=t.useState(void 0===s);return t.useEffect(()=>{if(void 0!==s){let e=window.setTimeout(()=>d(!0),s);return()=>window.clearTimeout(e)}},[s]),l&&"loaded"!==o.imageLoadingStatus?(0,a.jsx)(m.Primitive.span,{...i,ref:r}):null});function C(e,a){return e?a?(e.src!==a&&(e.src=a),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}M.displayName=S,e.s(["Avatar",0,y,"AvatarFallback",0,M,"AvatarImage",0,N,"Fallback",0,M,"Image",0,N,"Root",0,y,"createAvatarScope",0,g],585609);var k=e.i(585609),k=k,A=e.i(647163);function I({className:e,size:t="default",...r}){return(0,a.jsx)(k.Root,{"data-slot":"avatar","data-size":t,className:(0,A.cn)("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...r})}function D({className:e,...t}){return(0,a.jsx)(k.Image,{"data-slot":"avatar-image",className:(0,A.cn)("aspect-square size-full rounded-full object-cover",e),...t})}function T({className:e,...t}){return(0,a.jsx)(k.Fallback,{"data-slot":"avatar-fallback",className:(0,A.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...t})}var z=e.i(463415),R=e.i(728231),E=e.i(158351),F=e.i(811522),B=e.i(563856),L=e.i(538722);let H=(0,L.default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]),O=(0,L.default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]),U=(0,L.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);function _({user:e}){var t,r;let n,{isMobile:o}=(0,F.useSidebar)(),l=(0,i.useClerk)(),c=(0,s.useRouter)(),{resolvedTheme:u,setTheme:h}=(0,d.useTheme)(),m=(t=e.name,r=e.email,(n=t.trim().split(/\s+/).filter(Boolean)).length>0?n.slice(0,2).map(e=>e[0]).join("").toUpperCase():r.slice(0,2).toUpperCase()),x="dark"===u,p=x?"light":"dark";async function f(){(0,E.clearChatSessionState)(),await l.signOut(),c.replace("/login")}return(0,a.jsx)(F.SidebarMenu,{children:(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsxs)(z.DropdownMenu,{children:[(0,a.jsx)(z.DropdownMenuTrigger,{asChild:!0,children:(0,a.jsxs)(F.SidebarMenuButton,{size:"lg",title:e.name,className:"![scale:1] bg-transparent hover:![scale:1] hover:!bg-transparent focus:![scale:1] focus:!bg-transparent active:![scale:1] active:!bg-transparent data-[state=open]:![scale:1] data-[state=open]:!bg-transparent",children:[(0,a.jsxs)(I,{className:"h-8 w-8 rounded-lg",children:[e.avatar?(0,a.jsx)(D,{src:e.avatar,alt:e.name}):null,(0,a.jsx)(T,{className:"rounded-lg",children:m})]}),(0,a.jsxs)("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[(0,a.jsx)("span",{className:"truncate font-medium",children:e.name}),(0,a.jsx)("span",{className:"truncate text-xs",children:e.email})]}),(0,a.jsx)(B.ChevronsUpDownIcon,{className:"ml-auto size-4"})]})}),(0,a.jsxs)(z.DropdownMenuContent,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-72 rounded-lg",side:o?"bottom":"right",align:"end",sideOffset:4,children:[(0,a.jsx)(z.DropdownMenuLabel,{className:"p-0 font-normal",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[(0,a.jsxs)(I,{className:"h-8 w-8 rounded-lg",children:[e.avatar?(0,a.jsx)(D,{src:e.avatar,alt:e.name}):null,(0,a.jsx)(T,{className:"rounded-lg",children:m})]}),(0,a.jsxs)("div",{className:"grid min-w-0 flex-1 text-left text-sm leading-tight",children:[(0,a.jsx)("span",{className:"truncate font-medium",children:e.name}),(0,a.jsx)("span",{className:"text-xs break-all text-muted-foreground",children:e.email})]})]})}),(0,a.jsx)(z.DropdownMenuSeparator,{}),(0,a.jsx)(z.DropdownMenuGroup,{children:(0,a.jsxs)("div",{className:"group/theme-row flex items-center gap-2 px-1 py-1.5 text-sm",children:[x?(0,a.jsx)(O,{className:"size-4"}):(0,a.jsx)(U,{className:"size-4"}),(0,a.jsx)("span",{children:"Theme"}),(0,a.jsxs)(R.Tooltip,{children:[(0,a.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,a.jsxs)("button",{type:"button","aria-label":`Switch to ${p} theme`,onClick:()=>h(p),className:"ml-auto inline-flex items-center rounded-full border border-border bg-muted p-0.5",children:[(0,a.jsx)("span",{className:"inline-flex size-6 items-center justify-center rounded-full text-muted-foreground transition-colors hover:text-foreground data-[active=true]:bg-background data-[active=true]:text-foreground data-[active=true]:shadow-xs","data-active":!x,children:(0,a.jsx)(U,{className:"size-3.5"})}),(0,a.jsx)("span",{className:"inline-flex size-6 items-center justify-center rounded-full text-muted-foreground transition-colors hover:text-foreground data-[active=true]:bg-background data-[active=true]:text-foreground data-[active=true]:shadow-xs","data-active":x,children:(0,a.jsx)(O,{className:"size-3.5"})})]})}),(0,a.jsx)(R.TooltipContent,{side:"left",children:"Switch theme (D)"})]})]})}),(0,a.jsx)(z.DropdownMenuSeparator,{}),(0,a.jsxs)(z.DropdownMenuItem,{onClick:()=>void f(),className:"text-foreground transition-colors focus:bg-accent focus:text-accent-foreground",children:[(0,a.jsx)(H,{}
1),"Log out"]})]})]})})})}var P=e.i(541046),G=e.i(883394),q=e.i(421691),V=e.i(893872),$=e.i(578241),K=e.i(354057),Q=e.i(67784);let W=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;var Y=e.i(330009),J=e.i(167881),X=e.i(630374),Z=e.i(23750),ee=e.i(671428),ea=e.i(881046),et=e.i(228648);let er=(0,L.default)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);var en=e.i(499515);let es=(0,L.default)("file-spreadsheet",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);var ei=e.i(374380),eo=e.i(331042);let el=(0,L.default)("log-in",[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]),ed=(0,L.default)("messages-square",[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]);var ec=e.i(801057),eu=e.i(579838),eh=e.i(623056),em=e.i(97697),ex=e.i(247116),ep=e.i(288860);function ef(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}function eb(e){let a=[];for(let t of[...e].sort((e,a)=>(a.updatedAt??a.createdAt)-(e.updatedAt??e.createdAt))){let e=function(e,a=new Date){let t=new Date(e),r=Math.floor((ef(a)-ef(t))/864e5);return r<=0?"Today":1===r?"Yesterday":r<7?new Intl.DateTimeFormat(void 0,{weekday:"long",month:"short",day:"numeric"}).format(t):new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}).format(t)}(t.updatedAt??t.createdAt),r=a.at(-1);if(r?.label===e){r.conversations.push(t);continue}a.push({label:e,conversations:[t]})}return a}function eg(){return(0,a.jsx)(a.Fragment,{children:Array.from({length:5}).map((e,t)=>(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[(0,a.jsx)(ee.Skeleton,{className:"size-4 shrink-0 rounded-full bg-sidebar-accent"}),(0,a.jsx)(ee.Skeleton,{className:"h-4 flex-1 bg-sidebar-accent"})]})},t))})}function ej(){return(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsxs)("div",{className:"mx-2 px-3 py-3 text-center",children:[(0,a.jsx)(ec.MessageSquarePlusIcon,{className:"mx-auto mb-2 size-4 text-sidebar-foreground/60"}),(0,a.jsx)("p",{className:"text-xs leading-4 whitespace-nowrap text-sidebar-foreground/70",children:"Start a new chat to see it here."})]})})}function ev(){return(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsxs)("div",{className:"mx-2 rounded-lg border border-sidebar-border bg-sidebar-accent/40 px-3 py-3 text-sidebar-foreground",children:[(0,a.jsx)(ea.AlertTriangleIcon,{className:"mb-2 size-4 text-destructive"}),(0,a.jsx)("p",{className:"text-xs leading-4 font-medium",children:"Chats are unavailable."}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-4 text-sidebar-foreground/70",children:"We cannot load or save conversations during the upstream database outage."})]})})}function ey({title:e}){return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"sr-only",children:"Response running: "}),(0,a.jsx)(P.default,{text:e,speed:1.6,color:"var(--percipient-gray)",shineColor:"var(--percipient-light-green)",className:"font-medium"})]})}e.s(["AppSidebar",0,function({...e}){var d;let c,u=(0,s.usePathname)(),h=(0,s.useRouter)(),{isMobile:m}=(0,F.useSidebar)(),{isLoaded:x,user:p}=(0,i.useUser)(),{isAuthenticated:f,isLoading:b}=(0,o.useConvexAuth)(),{isUnavailable:g}=(0,$.useConvexHealth)(),j=!(f||p||!x||b),v=(0,l.useQuery)(G.api.conversations.queries.listRecent,f?{limit:30}:"skip"),y=v?.conversations,w=v?.hasMore??!1,N=(0,l.useQuery)(G.api.users.current,f?{}:"skip"),S=(0,l.useMutation)(G.api.conversations.mutations.updateTitle),M=(0,l.useMutation)(G.api.conversations.mutations.remove),[C,
1k]=t.useState(null),[I,D]=t.useState(null),[T,R]=t.useState(!1),[E,B]=t.useState(""),[L,H]=t.useState(!1),[O,U]=t.useState(!1),[P,ea]=t.useState(void 0),ef=(0,K.useWorkflowActivityStore)(e=>e.activeTargetKeys),ew=t.useRef(null),eN=(c=u.match(/^\/chat\/([^/]+)$/)?.[1])&&W.test(c)?c:void 0;function eS(e){return window.location.pathname===e}function eM(e,a,t){if(j){t?.clearConversation&&(0,V.notifyChatConversationChange)({clearConversation:!0}),eS(a)&&e.preventDefault();return}eS(a)?e.preventDefault():t?.clearConversation&&(0,V.notifyChatConversationChange)({clearConversation:!0})}function eC(){R(!1),window.setTimeout(()=>{D(null)},180)}async function ek(e){e.preventDefault();let a=E.trim();if(C&&a&&a!==C.title){H(!0);try{await S({id:C.id,title:a}),k(null)}catch(e){console.error("[app-sidebar] Failed to rename conversation:",e)}finally{H(!1)}}}async function eA(){if(!I)return;let e=u===I.href||window.location.pathname===I.href;U(!0),eC();try{await new Promise(e=>window.setTimeout(e,180)),await M({id:I.id}),e&&((0,V.notifyChatConversationChange)({clearConversation:!0}),h.replace("/chat"))}finally{U(!1)}}t.useEffect(()=>{if(!j)return;let e=!1;async function a(){try{let a=await fetch("/api/chat/anonymous/threads",{cache:"no-store"});if(!a.ok)return;let t=await a.json();e||ea(t)}catch{console.error("[app-sidebar] Failed to fetch anonymous threads")}}return a(),window.addEventListener(V.CHAT_CONVERSATION_CHANGE_EVENT,a),()=>{e=!0,window.removeEventListener(V.CHAT_CONVERSATION_CHANGE_EVENT,a)}},[j]);let eI=x&&p?{name:p.fullName||p.username||"User",email:p.primaryEmailAddress?.emailAddress||"Signed in",avatar:p.imageUrl||void 0}:null,eD=t.useMemo(()=>y?eb(y):[],[y]),eT=t.useMemo(()=>P?eb(P):[],[P]),[ez,eR]=t.useState(!1),eE=N?.role==="admin",eF=(0,l.useQuery)(G.api.voteVerification.queries.flaggedCount,eE?{}:"skip"),eB="h-9 rounded-lg border border-transparent px-2.5 transition-colors hover:border-sidebar-border/60 hover:bg-sidebar-accent/85 hover:text-sidebar-accent-foreground data-active:border-sidebar-border/70 data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-active:hover:border-sidebar-border/70 data-active:hover:bg-sidebar-accent data-active:hover:text-sidebar-accent-foreground",eL="border border-sidebar-border/80 bg-popover shadow-lg ring-1 ring-sidebar-border/70 dark:border-white/10 dark:bg-percipient-charcoal dark:text-percipient-off-white dark:shadow-black/45 dark:ring-white/10";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(F.Sidebar,{collapsible:"icon",...e,children:[(0,a.jsx)(F.SidebarHeader,{children:(0,a.jsx)(F.SidebarMenu,{children:(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsxs)(z.DropdownMenu,{open:ez,onOpenChange:eR,children:[(0,a.jsx)(z.DropdownMenuTrigger,{asChild:!0,children:(0,a.jsxs)(F.SidebarMenuButton,{"aria-label":"Open Certera menu",size:"lg",className:"relative ![scale:1] justify-center bg-transparent transition-colors hover:![scale:1] hover:!bg-transparent focus:![scale:1] focus:!bg-transparent active:![scale:1] active:!bg-transparent data-[state=open]:![scale:1] data-[state=open]:!bg-transparent",children:[(0,a.jsx)(r.default,{src:"/2.png",alt:"",width:32,height:32,className:"hidden size-8 shrink-0 object-contain group-data-[collapsible=icon]:block",priority:!0}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-1.5 group-data-[collapsible=icon]:hidden",children:[(0,a.jsx)(r.default,{src:"/certera-wordmark.png",alt:"Certera.AI",width:442,height:90,className:"h-8 w-36 object-contain object-center",priority:!0}),(0,a.jsx)(en.ChevronDownIcon,{className:(0,A.cn)("shrink-0 transition-transform duration-200 ease-out",ez&&"rotate-180")})]})]})}),(0,a.jsxs)(z.DropdownMenuContent,{align:"start",side:m?"bottom":"right",sideOffset:4,className:(0,A.cn)(eL,"w-60 space-y-2 rounded-lg duration-200 data-open:fade-in-0 data-open:zoom-in-98 data-closed:fade-out-0 data-closed:zoom-out-98"),children:[(0,a.jsx)(z.DropdownMenuItem,{asChild:!0,children:(0,a.jsx)(n.default,{href:"/about",target:"_blank",rel:"noopener noreferrer",children:"About"})}),(0,a.jsx)(z.DropdownMenuItem,{asChild:!0,children:(0,a.jsx)(n.default,{href:"mailto:[email protected]",children:"Get Help"})}),(0,a.jsx)(z.DropdownMenuItem,{asChild:!0,children:(0,a.jsx)(n.default,{href:"/research",target:"_blank",rel:"noopener noreferrer",children:"Research"})})]})]})})})}),(0,a.jsxs)(F.SidebarContent,{className:"overflow-hidden group-data-[collapsible=icon]:pt-2",children:[(0,a.jsx)(F.SidebarGroup,{className:"shrink-0",children:(0,a.jsx)(F.SidebarGroupContent,{children:(0,a.jsx)(F.SidebarMenu,{className:"gap-1.5",children:(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsx)(F.SidebarMenuButton,{asChild:!0,isActive:"/chat"===u,tooltip:"New chat",className:eB,children:(0,a.jsxs)(n.default,{href:"/chat",onClick:e=>eM(e,"/chat",{clearConversation:!0}
1),children:[(0,a.jsx)(ec.MessageSquarePlusIcon,{}),(0,a.jsx)("span",{children:"New chat"})]})})})})})}),(0,a.jsxs)("div",{className:"sidebar-conversations-scrollbar flex min-h-0 flex-1 scroll-fade flex-col overflow-x-hidden overflow-y-auto overscroll-none",children:[(0,a.jsx)(F.SidebarGroup,{className:"shrink-0 pt-0",children:(0,a.jsx)(F.SidebarGroupContent,{children:(0,a.jsxs)(F.SidebarMenu,{className:"gap-1.5",children:[(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsx)(F.SidebarMenuButton,{asChild:!0,isActive:"/chats"===u,tooltip:"Chats",className:eB,children:(0,a.jsxs)(n.default,{href:"/chats",onClick:e=>eM(e,"/chats"),children:[(0,a.jsx)(ed,{}),(0,a.jsx)("span",{children:"Chats"})]})})}),(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsx)(F.SidebarMenuButton,{asChild:!0,isActive:"/legal-llm-leaderboard"===u,tooltip:"Leaderboard",className:eB,children:(0,a.jsxs)(n.default,{href:"/legal-llm-leaderboard",onClick:e=>eM(e,"/legal-llm-leaderboard"),children:[(0,a.jsx)(em.TrophyIcon,{}),(0,a.jsx)("span",{children:"Leaderboard"})]})})}),(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsx)(F.SidebarMenuButton,{asChild:!0,tooltip:"Research",className:eB,children:(0,a.jsxs)(n.default,{href:"/research",target:"_blank",rel:"noopener noreferrer",children:[(0,a.jsx)(er,{}),(0,a.jsx)("span",{children:"Research"})]})})}),eE?(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsx)(F.SidebarMenuButton,{asChild:!0,isActive:"/dashboard"===u,tooltip:"Usage analytics",className:eB,children:(0,a.jsxs)(n.default,{href:"/dashboard",onClick:e=>eM(e,"/dashboard"),children:[(0,a.jsx)(et.BarChart3Icon,{}),(0,a.jsx)("span",{children:"Usage analytics"})]})})})}):null,(d=N??null,d?.role==="admin"||d?.role==="reviewer")?(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsx)(F.SidebarMenuButton,{asChild:!0,isActive:"/evaluations"===u,tooltip:"Automated evaluations",className:eB,children:(0,a.jsxs)(n.default,{href:"/evaluations",onClick:e=>eM(e,"/evaluations"),children:[(0,a.jsx)(es,{}),(0,a.jsx)("span",{children:"Automated evaluations"})]})})}):null,eE?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsx)(F.SidebarMenuButton,{asChild:!0,isActive:"/domain-leaderboard"===u,tooltip:"Domain leaderboard",className:eB,children:(0,a.jsxs)(n.default,{href:"/domain-leaderboard",onClick:e=>eM(e,"/domain-leaderboard"),children:[(0,a.jsx)(eo.LayersIcon,{}),(0,a.jsx)("span",{children:"Domain leaderboard"})]})})}),(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsx)(F.SidebarMenuButton,{asChild:!0,isActive:"/user-leaderboard"===u,tooltip:"User leaderboard",className:eB,children:(0,a.jsxs)(n.default,{href:"/user-leaderboard",onClick:e=>eM(e,"/user-leaderboard"),children:[(0,a.jsx)(ep.UsersRoundIcon,{}),(0,a.jsx)("span",{children:"User leaderboard"})]})})}),(0,a.jsxs)(F.SidebarMenuItem,{children:[(0,a.jsx)(F.SidebarMenuButton,{asChild:!0,isActive:"/flagged-votes"===u,tooltip:"Flagged votes",className:eB,children:(0,a.jsxs)(n.default,{href:"/flagged-votes",onClick:e=>eM(e,"/flagged-votes"),children:[(0,a.jsx)(ei.FlagIcon,{}),(0,a.jsx)("span",{children:"Flagged votes"})]})}),eF&&eF>0?(0,a.jsx)(F.SidebarMenuBadge,{children:eF>99?"99+":eF}):null]})]}):null]})})}),(0,a.jsxs)(F.SidebarGroup,{className:"pt-0 group-data-[collapsible=icon]:hidden",children:[(0,a.jsx)(F.SidebarGroupLabel,{children:"Conversations"}),(0,a.jsx)(F.SidebarGroupContent,{className:"pr-1",children:(0,a.jsx)(F.SidebarMenu,{className:"gap-1",children:j?void 0===P&&g?(0,a.jsx)(ev,{}):void 0===P?(0,a.jsx)(eg,{}):0===P.length?(0,a.jsx)(ej,{}):eT.map((e,r)=>(0,a.jsxs)(t.Fragment,{children:[(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsx)("div",{className:(0,A.cn)("px-2 pb-1 text-xs font-medium whitespace-nowrap text-sidebar-foreground/55 group-data-[collapsible=icon]:hidden",0===r?"pt-1":"pt-3"),children:e.label})}),e.conversations.map(e=>{let t=e.title??"New conversation",r=(0,Q.workflowTargetKey)("anonymous",e.id),s=ef.has(r);return(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsx)(F.SidebarMenuButton,{asChild:!0,isActive:eN===e.id,children:(0,a.jsxs)(n.default,{href:`/chat/${e.id}`,onClick:a=>eM(a,`/chat/${e.id}`),children:[(0,a.jsx)(q.ChatModeIcon,{conversationType:e.conversationType,battleSelectionMode:e.battleSelectionMode}),s?(0,a.jsx)(ey,{title:t}):(0,a.jsx)("span",{className:"@container flex-1 overflow-hidden",children:(0,a.jsx)("span",{className:"inline-block max-w-full truncate align-top motion-safe:in-[a:hover]:max-w-none motion-safe:in-[a:hover]:translate-x-[min(0px,calc(100cqw-100%))] motion-safe:in-[a:hover]:transition-transform motion-safe:in-[a:hover]:duration-2000 motion-safe:in-[a:hover]:ease-linear",children:t})})]})})},e.id)})]},e.label)):void 0===y&&g?(0,a.jsx)(ev,{}):void 0===y?(0,a.jsx)(eg,{}):0===y.length?(0,a.jsx)(ej,{}):(0,a.jsxs)(a.Fragment,{children:[eD.map((e,r)=>(0,a.jsxs)(t.Fragment,{children:[(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsx)("div",{className:(0,A.cn)("px-2 pb-1 text-xs font-medium whitespace-nowrap text-sidebar-foreground
1/55 group-data-[collapsible=icon]:hidden",0===r?"pt-1":"pt-3"),children:e.label})}),e.conversations.map(e=>{let t=`/chat/${e._id}`,r=e.title??"New conversation",s={id:e._id,href:t,title:r},i=(0,Q.workflowTargetKey)("conversation",e._id),o=ef.has(i);return(0,a.jsxs)(F.SidebarMenuItem,{children:[(0,a.jsx)(F.SidebarMenuButton,{asChild:!0,isActive:u===t,children:(0,a.jsxs)(n.default,{href:t,onClick:e=>eM(e,t),children:[(0,a.jsx)(q.ChatModeIcon,{conversationType:e.conversationType,battleSelectionMode:e.battleSelectionMode}),o?(0,a.jsx)(ey,{title:r}):(0,a.jsx)("span",{className:"@container flex-1 overflow-hidden",children:(0,a.jsx)("span",{className:"inline-block max-w-full truncate align-top motion-safe:in-[a:hover]:max-w-none motion-safe:in-[a:hover]:translate-x-[min(0px,calc(100cqw-100%))] motion-safe:in-[a:hover]:transition-transform motion-safe:in-[a:hover]:duration-2000 motion-safe:in-[a:hover]:ease-linear",children:r})})]})}),o?null:(0,a.jsxs)(z.DropdownMenu,{children:[(0,a.jsx)(z.DropdownMenuTrigger,{asChild:!0,children:(0,a.jsxs)(F.SidebarMenuAction,{children:[(0,a.jsx)(eu.MoreHorizontalIcon,{}),(0,a.jsx)("span",{className:"sr-only",children:"Conversation actions"})]})}),(0,a.jsxs)(z.DropdownMenuContent,{align:"end",side:"right",className:eL,children:[(0,a.jsxs)(z.DropdownMenuItem,{onSelect:()=>{window.setTimeout(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur(),k(s),B(s.title)},0)},children:[(0,a.jsx)(eh.PencilIcon,{}),(0,a.jsx)("span",{children:"Rename"})]}),(0,a.jsxs)(z.DropdownMenuItem,{variant:"destructive",onSelect:()=>{window.setTimeout(()=>{D(s),R(!0)},0)},children:[(0,a.jsx)(ex.Trash2Icon,{}),(0,a.jsx)("span",{children:"Remove"})]})]})]})]},e._id)})]},e.label)),w?(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsx)(F.SidebarMenuButton,{asChild:!0,isActive:"/chats"===u,tooltip:"All chats",className:"text-sidebar-foreground/70",children:(0,a.jsxs)(n.default,{href:"/chats",onClick:e=>eM(e,"/chats"),children:[(0,a.jsx)("span",{className:"flex size-4.5 shrink-0 items-center justify-center rounded-full border border-sidebar-foreground/30 bg-transparent",children:(0,a.jsx)(eu.MoreHorizontalIcon,{})}),(0,a.jsx)("span",{children:"All chats"})]})})}):null]})})})]})]})]}),(0,a.jsxs)(F.SidebarFooter,{children:[eI?(0,a.jsx)(_,{user:eI}):x?(0,a.jsx)(F.SidebarMenu,{children:(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsx)(F.SidebarMenuButton,{asChild:!0,size:"lg",tooltip:"Log in",className:"justify-center bg-secondary font-semibold text-secondary-foreground group-data-[collapsible=icon]:p-0! hover:bg-secondary/90 hover:text-secondary-foreground focus:bg-secondary focus:text-secondary-foreground active:bg-secondary active:text-secondary-foreground",children:(0,a.jsxs)(n.default,{href:"/login",children:[(0,a.jsx)(el,{}),(0,a.jsx)("span",{className:"group-data-[collapsible=icon]:hidden",children:"Log in"})]})})})}):(0,a.jsx)(F.SidebarMenu,{children:(0,a.jsx)(F.SidebarMenuItem,{children:(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-2 group-data-[collapsible=icon]:size-8 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:p-0",children:[(0,a.jsx)(ee.Skeleton,{className:"size-8 shrink-0 rounded-lg bg-sidebar-accent"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 space-y-2 group-data-[collapsible=icon]:hidden",children:[(0,a.jsx)(ee.Skeleton,{className:"h-3.5 w-24 bg-sidebar-accent"}),(0,a.jsx)(ee.Skeleton,{className:"h-3 w-32 bg-sidebar-accent"})]})]})})}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-3 px-3 py-2 text-xs text-sidebar-foreground/60 group-data-[collapsible=icon]:hidden",children:[(0,a.jsx)(n.default,{href:"/terms",target:"_blank",rel:"noopener noreferrer",className:"transition-colors hover:text-sidebar-foreground",children:"Terms"}),(0,a.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,a.jsx)(n.default,{href:"https://percipient.co/privacy-policy/",target:"_blank",rel:"noopener noreferrer",className:"transition-colors hover:text-sidebar-foreground",children:"Privacy"})]})]})]}),(0,a.jsx)(X.Dialog,{open:null!==C,onOpenChange:e=>!e&&k(null),children:(0,a.jsx)(X.DialogContent,{className:"duration-150 data-open:zoom-in-100 data-closed:zoom-out-100",onOpenAutoFocus:e=>{e.preventDefault(),ew.current?.focus(),ew.current?.select()},children:(0,a.jsxs)("form",{onSubmit:ek,children:[(0,a.jsxs)(X.DialogHeader,{children:[(0,a.jsx)(X.DialogTitle,{children:"Rename conversation"}),(0,a.jsx)(X.DialogDescription,{children:"Update the title shown in your conversation list."})]}),(0,a.jsx)(Z.Input,{ref:ew,className:"mt-4",value:E,onChange:e=>B(e.currentTarget.value)}),(0,a.jsxs)(X.DialogFooter,{className:"mx-0 mt-4 mb-0 border-t-0 bg-transparent p-0",children:[(0,a.jsx)(X.DialogClose,{asChild:!0,children:(0,a.jsx)(J.Button,{type:"button",variant:"outline",children:"Cancel"})}),(0,a.jsx)(J.Button,{disabled:!E.trim()||L,type:"submit",children:"Save"})]})]})})}),(0,a.jsx)(Y.AlertDialog,{open:T,onOpenChange:e=>{e||eC()},children:(0,a.jsxs)(Y.AlertDialogContent,{className:"duration-150 data-open:zoom-in-100 data-closed:zoom-out-100",children:[(0,a.jsxs)(Y.AlertDialogHeader,{children:[(0,a.jsx)(Y.AlertDialogTitle,{children:"Remove c
1onversation?"}),(0,a.jsxs)(Y.AlertDialogDescription,{children:['This will permanently remove "',I?.title,'" and its messages. This action cannot be undone.']})]}),(0,a.jsxs)(Y.AlertDialogFooter,{className:"mx-0 mb-0 border-t-0 bg-transparent p-0",children:[(0,a.jsx)(Y.AlertDialogCancel,{disabled:O,children:"Cancel"}),(0,a.jsx)(J.Button,{disabled:O,onClick:()=>void eA(),variant:"destructive",children:"Remove"})]})]})})]})}],460313)}]);
2
3//# chunkId=01a10935-b9e3-7a71-86c5-d32dbf735aea

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.