1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="94a4704d-595a-a097-10d3-db7070c0616e")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,462235,e=>{"use strict";var t=e.i(549111),n=e.i(655691),a=e.i(176072);let r=(0,e.i(758277).default)("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);var s=e.i(703056),o=e.i(679095),o=o,i=e.i(594840),l=e.i(615452),c=e.i(403437),d=e.i(569437),u=e.i(901120),m=e.i(126060),h=e.i(376142),p=e.i(469747),x=e.i(476825),f=e.i(108146),b=e.i(188556),g=e.i(161688),j=e.i(668262),y=e.i(316446),S=e.i(524513),v=e.i(892725),w=e.i(401109),N=e.i(581572),I=e.i(806730),k=e.i(862245),C=e.i(635284),M=e.i(145493),_=e.i(660032),D=e.i(270704),P=e.i(866986),T=e.i(689292),R=e.i(378132),A=e.i(909971),z=e.i(662337),E=e.i(635790),O=e.i(864706),B=e.i(318261),F=e.i(320184),L=e.i(594355),H=e.i(74827),q=e.i(189730),G=e.i(323457),$=e.i(397854),U=e.i(16844);let W="ijr:nudge:extension:v1",K=new Set,Y=null;function J(){if(null===Y)try{Y="1"===window.localStorage.getItem(W)}catch{Y=!0}return Y}function V(){Y=!0;try{window.localStorage.setItem(W,"1")}catch{}for(let e of K)e()}function Q(){return!0}function X(e){return K.add(e),()=>K.delete(e)}function Z(){let e,a,r,s,o,i,l,c,d=(0,n.c)(11),u=(0,O.useSyncExternalStore)(X,J,Q),m=(0,F.useBrand)(),[h,p]=(0,O.useState)(!1);if(d[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{p((0,$.isDesktopChrome)()&&!(0,$.extensionInstalled)())},a=[],d[0]=e,d[1]=a):(e=d[0],a=d[1]),(0,O.useEffect)(e,a),m&&"openserve"!==m.id||u||!h)return null;let x=m?.name??"IJR";return d[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("button",{"aria-label":"Dismiss",className:"absolute top-2 right-2 text-muted-foreground hover:text-foreground",onClick:V,type:"button",children:(0,t.jsx)(G.XIcon,{className:"size-3.5"})}),d[2]=r):r=d[2],d[3]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(q.PuzzleIcon,{className:"size-3.5 text-primary"}),d[3]=s):s=d[3],d[4]!==x?(o=(0,t.jsxs)("div",{className:"mb-1 flex items-center gap-1.5",children:[s,(0,t.jsxs)("span",{className:"font-medium text-ui",children:[x," in your browser"]})]}),i=(0,t.jsxs)("p",{className:"mb-2 text-meta text-muted-foreground leading-snug",children:["Search from the address bar, ",x," as your new tab, and answers on any page you're reading."]}),d[4]=x,d[5]=o,d[6]=i):(o=d[5],i=d[6]),d[7]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)(A.default,{className:"inline-flex rounded-md bg-primary px-2.5 py-1 font-medium text-meta text-primary-foreground hover:opacity-90",href:"/extension",onClick:ee,children:"Get the extension"}),d[7]=l):l=d[7],d[8]!==o||d[9]!==i?(c=(0,t.jsxs)("div",{className:"relative mx-1 mb-1 rounded-xl border border-primary/30 bg-card/80 p-3 group-data-[collapsible=icon]:hidden",children:[r,o,i,l]}),d[8]=o,d[9]=i,d[10]=c):c=d[10],c}function ee(){(0,U.trackFunnel)("extension_cta_click",{source:"sidebar-nudge"}),V()}var et=e.i(355470),en=e.i(719078),ea=e.i(51844),er=e.i(982411),es=e.i(583805),eo=e.i(963817),ei=e.i(518797),el=e.i(904116),ec=e.i(463415),ed=e.i(811522),eu=e.i(7877),em=e.i(647163),eh=e.i(154531),ep=e.i(109375),ex=e.i(19125),ef=e.i(649075),eb=e.i(167881),eg=e.i(630374),ej=e.i(23750);function ey(e){let a,r,s,o,i,l,c,d=(0,n.c)(20),{selected:u,onToggle:m,avatar:h,name:p,sub:x}=e,f=u?"border-primary/50 bg-primary/[0.06]":"border-border/50 hover:bg-muted/50";d[0]!==f?(a=(0,em.cn)("flex w-full min-w-0 items-center gap-2.5 overflow-hidden rounded-lg border px-2.5 py-2 text-left transition-colors",f),d[0]=f,d[1]=a):a=d[1],d[2]!==p?(r=(0,t.jsx)("span",{className:"truncate font-medium text-ui",children:p}),d[2]=p,d[3]=r):r=d[3],d[4]!==x?(s=x&&(0,t.jsx)("span",{className:"truncate text-caption text-muted-foreground",children:x}),d[4]=x,d[5]=s):s=d[5],d[6]!==r||d[7]!==s?(o=(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[r,s]}),d[6]=r,d[7]=s,d[8]=o):o=d[8];let b=u?"border-primary bg-primary":"border-border";return d[9]!==b?(i=(0,em.cn)("size-4 shrink-0 rounded-full border",b),d[9]=b,d[10]=i):i=d[10],d[11]!==i?(l=(0,t.jsx)("span",{"aria-hidden":!0,
2className:i}),d[11]=i,d[12]=l):l=d[12],d[13]!==h||d[14]!==m||d[15]!==u||d[16]!==a||d[17]!==o||d[18]!==l?(c=(0,t.jsxs)("button",{"aria-pressed":u,className:a,onClick:m,type:"button",children:[h,o,l]}),d[13]=h,d[14]=m,d[15]=u,d[16]=a,d[17]=o,d[18]=l,d[19]=c):c=d[19],c}function eS({open:e,onOpenChange:n}){let{data:a}=(0,B.default)(e?eu.apiRoutes.agentsDm.directory():null,em.fetcher,ef.SWR_STATIC),r=(0,es.useRailNavigate)(),[s,o]=(0,O.useState)(new Set),[i,l]=(0,O.useState)(new Set),[c,d]=(0,O.useState)(""),[u,m]=(0,O.useState)(!1),h=(e,t)=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n},p=c.split(/[\s,;]+/).map(e=>e.trim()).filter(Boolean),x=s.size+i.size+p.length>0;async function f(){if(x&&!u){m(!0);try{let e=await fetch(eu.apiRoutes.agentsDm.openSmart(),{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({userIds:[...s],agentSlugs:[...i],emails:p})});if(!e.ok)return void en.toast.error(400===e.status?"Someone on that list doesn't have an OpenServe account yet.":"Could not start the conversation.");let t=await e.json();n(!1),o(new Set),l(new Set),d(""),r(`/chat/${t.chatId}`)}finally{m(!1)}}}return(0,t.jsx)(eg.Dialog,{onOpenChange:n,open:e,children:(0,t.jsxs)(eg.DialogContent,{className:"max-h-[85dvh] overflow-y-auto overflow-x-hidden sm:max-w-md [&>*]:min-w-0",children:[(0,t.jsxs)(eg.DialogHeader,{children:[(0,t.jsx)(eg.DialogTitle,{children:"New smart conversation"}),(0,t.jsx)(eg.DialogDescription,{children:"A direct conversation with a teammate, agents, or both â the AI is in every exchange."})]}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-4 py-1",children:[(0,t.jsxs)("section",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("h3",{className:"text-caption font-semibold text-muted-foreground uppercase tracking-wide",children:"People"}),0===(a?.people??[]).length?(0,t.jsx)("p",{className:"text-caption text-muted-foreground",children:"Nobody shares a chat with you yet â invite by email below."}):(a?.people??[]).map(e=>{let n;return(0,t.jsx)(ey,{avatar:(0,t.jsx)("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-primary/15 font-semibold text-caption text-primary",children:(n=e.name.trim().split(/\s+/).filter(Boolean),`${n[0]?.charAt(0)??"?"}${n.length>1?n.at(-1)?.charAt(0)??"":""}`.toUpperCase())}),name:e.name,onToggle:()=>o(t=>h(t,e.userId)),selected:s.has(e.userId),sub:`${e.sharedChats} shared ${1===e.sharedChats?"chat":"chats"}`},e.userId)}),(0,t.jsx)(ej.Input,{"aria-label":"Invite by email",className:"h-9",onChange:e=>d(e.target.value),placeholder:"Or by email: [email protected], sam@â¦",value:c})]}),(0,t.jsxs)("section",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("h3",{className:"text-caption font-semibold text-muted-foreground uppercase tracking-wide",children:"Agents"}),eh.WORKFORCE_AGENTS.map(e=>(0,t.jsx)(ey,{avatar:(0,t.jsx)(ea.RobotAvatar,{className:"rounded-lg",size:28,slug:e.slug}),name:(0,ea.agentDisplayName)(e.slug),onToggle:()=>l(t=>h(t,e.slug)),selected:i.has(e.slug),sub:e.tagline},e.slug))]})]}),(0,t.jsxs)(eg.DialogFooter,{children:[(0,t.jsx)(eb.Button,{onClick:()=>n(!1),variant:"ghost",children:"Cancel"}),(0,t.jsxs)(eb.Button,{className:"relative",disabled:!x||u,onClick:f,children:["Start conversation",u&&(0,t.jsx)("span",{className:"absolute right-3 animate-spin",children:(0,t.jsx)(ex.LoaderIcon,{})})]})]})]})})}let ev=eu.apiRoutes.agentsDm.directory(),ew="[&>span:last-child]:text-clip h-8 rounded-md text-ui text-sidebar-foreground/80 transition-colors duration-[var(--dur-instant)] hover:bg-sidebar-accent-foreground/[0.06] hover:text-sidebar-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-foreground",eN="h-8 items-center gap-2 px-2";function eI(e){let a,r,s=(0,n.c)(5),{children:o,present:i}=e,l=void 0!==i&&i;return s[0]!==l?(a=l&&(0,t.jsx)("span",{className:"-right-0.5 -bottom-0.5 absolute size-1.5 rounded-full bg-emerald-500 ring-2 ring-sidebar"}),s[0]=l,s[1]=a):a=s[1],s[2]!==o||s[3]!==a?(r=(0,t.jsxs)("span",{className:"relative flex shrink-0 items-center justify-center [&>svg]:!size-5",children:[o,a]}),s[2]=o,s[3]=a,s[4]=r):r=s[4],r}function ek({user:e}){let n=(0,es.useRailNavigate)(),a=(0,z.usePathname)(),{setOpenMobile:r}=(0,ed.useSidebar)(),s=(0,eo.useOpenDm)(),o=(0,el.useOpenThread)(),i=a?.startsWith("/chat/")?a.split("/")[2]??null:null,{data:l,mutate:c}=(0,B.default)(e?ev:null,em.fetcher,{refreshInterval:3e4,revalidateOnFocus:!0}),[d,u]=(0,O.useState)(null),[m,h]=(0,O.useState)(!1);async function p(e){r(!1),u(e);try{let t=await s({userId:e});t.ok&&o({kind:"person",chatId:t.chatId})}finally{u(null)}}async function x(e,t){if(r(!1),t)return void n(`/chat/${t}`);u(e);try{let t=await fetch(eu.apiRoutes.agentsDm.open(e),{method:"POST",credentials:"include"});if(!t.ok)return void en.toast.error("Could not open that conversation.");let a=await t.json();c(),n(`/chat/${a.chatId}`)}finally{u(null)}}if(!(e&&l))return null;let f=new Set(l.agents.map(e=>e.slug)),b=eh.WORKFORCE_AGENTS.filter(e=>!f.has(e.slug)),g=0===l.agents.length&&0===l.people.length&&0===(l.conversations??[]).length;return(0,t.jsxs)(ep.SidebarSectionGroup,{children:[(0,t.jsxs)(ec.DropdownMenu,{modal:!1,children:[(0,t.jsx)(ep.SidebarSectionHeader,{action:(0,t.jsx)(ec.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"New direct message",className:"flex size-6 shrink-0 items-center justify-center rounded-md text-sidebar-foreground
2/60 hover:bg-sidebar-accent hover:text-sidebar-foreground",title:"New direct message",type:"button",children:(0,t.jsx)(N.PlusIcon,{className:"size-3.5"})})}),id:"dms",label:"Direct messages"}),(0,t.jsxs)(ec.DropdownMenuContent,{align:"start",className:"w-64",side:"right",children:[(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-ui",onSelect:()=>h(!0),children:[(0,t.jsx)(et.SparklesIcon,{className:"size-4 text-primary"}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,t.jsx)("span",{children:"New smart conversationâ¦"}),(0,t.jsx)("span",{className:"truncate text-caption text-muted-foreground",children:"A teammate, agents, or both â AI in every exchange"})]})]}),(0,t.jsx)(ec.DropdownMenuSeparator,{}),0===b.length?(0,t.jsx)(ec.DropdownMenuItem,{className:"text-ui",disabled:!0,children:"Every agent is already listed"}):b.map(e=>(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-ui",onSelect:()=>x(e.slug,null),children:[(0,t.jsx)(ea.RobotAvatar,{size:18,slug:e.slug}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)("span",{className:"truncate text-caption text-muted-foreground",children:e.tagline})]})]},e.slug))]})]}),(0,t.jsx)(ep.SidebarSectionBody,{id:"dms",children:(0,t.jsx)(ed.SidebarGroupContent,{children:g?(0,t.jsx)("div",{className:"px-2 py-1 text-meta text-sidebar-foreground/50",children:"Agents you work with show here. Start one with +."}):(0,t.jsxs)(ed.SidebarMenu,{className:"gap-0.5",children:[l.agents.map(e=>{let n=!!e.dmChatId&&e.dmChatId===i,a=e.unread>0;return(0,t.jsx)(ed.SidebarMenuItem,{children:(0,t.jsxs)(ed.SidebarMenuButton,{className:(0,em.cn)(ew,eN),disabled:d===e.slug,isActive:n,onClick:()=>x(e.slug,e.dmChatId),title:e.tagline,children:[(0,t.jsx)(eI,{present:!0,children:(0,t.jsx)(ea.RobotAvatar,{className:"rounded-[6px]",size:20,slug:e.slug})}),(0,t.jsx)("span",{className:(0,em.cn)("min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip [mask-image:linear-gradient(to_right,#000_calc(100%-14px),transparent)]",a&&"font-semibold text-sidebar-foreground"),children:e.name}),a&&(0,t.jsx)(er.UnreadBadge,{count:e.unread})]})},e.slug)}),(l.conversations??[]).map(e=>(0,t.jsx)(ed.SidebarMenuItem,{children:(0,t.jsxs)(ed.SidebarMenuButton,{className:(0,em.cn)(ew,eN),isActive:e.chatId===i,onClick:()=>{r(!1),n(`/chat/${e.chatId}`)},title:`Smart conversation \xb7 ${e.participants.map(e=>e.name).join(", ")}`,children:[(0,t.jsx)(eI,{present:!0,children:(0,t.jsx)("span",{className:"flex size-5 items-center justify-center rounded-[6px] bg-gradient-to-br from-[#5b31e1] to-[#d734c4] text-white",children:(0,t.jsx)(et.SparklesIcon,{className:"size-3"})})}),(0,t.jsx)("span",{className:(0,em.cn)("min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip [mask-image:linear-gradient(to_right,#000_calc(100%-14px),transparent)]",e.unread>0&&"font-semibold text-sidebar-foreground"),children:e.title}),e.unread>0&&(0,t.jsx)(er.UnreadBadge,{count:e.unread})]})},e.chatId)),l.people.map(e=>(0,t.jsx)(ed.SidebarMenuItem,{children:(0,t.jsxs)("button",{className:(0,em.cn)(ew,eN,"flex w-full px-2 text-left"),disabled:d===e.userId,onClick:()=>p(e.userId),title:`${e.name} \xb7 ${e.sharedChats} shared ${1===e.sharedChats?"chat":"chats"} â message them`,type:"button",children:[(0,t.jsx)(eI,{children:(0,t.jsx)(ei.Avatar,{name:e.name,size:"xs",square:!0})}),(0,t.jsx)("span",{className:"min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip [mask-image:linear-gradient(to_right,#000_calc(100%-14px),transparent)]",children:e.name})]})},e.userId))]})})}),(0,t.jsx)(eS,{onOpenChange:h,open:m})]})}var eC=e.i(76590),eM=e.i(994851),e_=e.i(847464),eD=e.i(58842),eP=e.i(11633),eT=e.i(212703),eR=e.i(482808),eA=e.i(765108),ez=e.i(576389),eE=e.i(281364),eO=e.i(694424),eB=e.i(307024),eF=e.i(144261),eL=e.i(450515),eH=e.i(682494),eq=e.i(10229),eG=e.i(179495),e$=e.i(927396),eU=e.i(209003),eW=e.i(10708);let eK="[&>span:last-child]:text-clip h-8 rounded-md text-ui text-sidebar-foreground/80 transition-colors duration-[var(--dur-instant)] hover:bg-sidebar-accent-foreground
2/[0.06] hover:text-sidebar-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-foreground",eY="application/x-openserve-chat",eJ="mr-0.5 rounded-md text-sidebar-foreground/50 ring-0 transition-colors duration-[var(--dur-instant)] focus-visible:ring-0 hover:text-sidebar-foreground data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",eV={"content-type":"application/json"};async function eQ(e,t,n){try{let a=await fetch(e,{method:t,credentials:"include",headers:eV,body:JSON.stringify(n??{})});return a.ok?await a.json().catch(()=>({})):null}catch{return null}}function eX(e,t){try{window.localStorage.setItem(e,JSON.stringify([...t]))}catch{}}function eZ(e,t){let a,r,s,o,i,l=(0,n.c)(13),c=void 0===t?"os:projects:expanded":t;l[0]!==c?(a=()=>(function(e){try{let t=window.localStorage.getItem(e);if(!t)return null;let n=JSON.parse(t);return Array.isArray(n)?new Set(n.filter(e=>"string"==typeof e)):null}catch{return null}})(c),l[0]=c,l[1]=a):a=l[1];let[d,u]=(0,O.useState)(a);l[2]!==d?(r=(e,t)=>null===d?void 0===t||t:d.has(e),l[2]=d,l[3]=r):r=l[3];let m=r;l[4]!==e||l[5]!==c?(s=t=>{u(n=>{let a=new Set(n??e);return a.has(t)?a.delete(t):a.add(t),eX(c,a),a})},l[4]=e,l[5]=c,l[6]=s):s=l[6];let h=s;l[7]!==c?(o=e=>{u(t=>{if(null===t)return t;let n=new Set(t);return n.add(e),eX(c,n),n})},l[7]=c,l[8]=o):o=l[8];let p=o;return l[9]!==p||l[10]!==m||l[11]!==h?(i={isExpanded:m,toggle:h,expand:p},l[9]=p,l[10]=m,l[11]=h,l[12]=i):i=l[12],i}function e0(e){let a,r,s,o,i,l,c,d,u,m,h,p,x,f,b,g,j,y=(0,n.c)(46),{open:S,title:v,description:w,initialName:N,submitLabel:I,onOpenChange:k,onSubmit:C}=e,[M,_]=(0,O.useState)(N),[D,P]=(0,O.useState)(!1);y[0]!==N||y[1]!==S?(a=()=>{S&&_(N)},r=[S,N],y[0]=N,y[1]=S,y[2]=a,y[3]=r):(a=y[2],r=y[3]),(0,O.useEffect)(a,r),y[4]!==D||y[5]!==M||y[6]!==k||y[7]!==C?(s=async function(){let e=M.trim();if(!e||D)return;P(!0);let t=await C(e);P(!1),t&&k(!1)},y[4]=D,y[5]=M,y[6]=k,y[7]=C,y[8]=s):s=y[8];let T=s;return y[9]!==v?(o=(0,t.jsx)(eg.DialogTitle,{children:v}),y[9]=v,y[10]=o):o=y[10],y[11]!==w?(i=(0,t.jsx)(eg.DialogDescription,{children:w}),y[11]=w,y[12]=i):i=y[12],y[13]!==o||y[14]!==i?(l=(0,t.jsxs)(eg.DialogHeader,{children:[o,i]}),y[13]=o,y[14]=i,y[15]=l):l=y[15],y[16]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)(eW.Label,{className:"font-normal text-muted-foreground",htmlFor:"project-name",children:"Name"}),y[16]=c):c=y[16],y[17]===Symbol.for("react.memo_cache_sentinel")?(d=e=>_(e.target.value),y[17]=d):d=y[17],y[18]!==T?(u=e=>{"Enter"===e.key&&(e.preventDefault(),T())},y[18]=T,y[19]=u):u=y[19],y[20]!==M||y[21]!==u?(m=(0,t.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[c,(0,t.jsx)(ej.Input,{autoFocus:!0,className:"h-10 rounded-lg border-border/50 bg-muted/50 text-ui focu
2s:border-foreground/20 focus:bg-muted",id:"project-name",maxLength:120,onChange:d,onKeyDown:u,placeholder:"Q4 launch",value:M})]}),y[20]=M,y[21]=u,y[22]=m):m=y[22],y[23]!==k?(h=(0,t.jsx)(eb.Button,{onClick:()=>k(!1),variant:"ghost",children:"Cancel"}),y[23]=k,y[24]=h):h=y[24],y[25]!==D||y[26]!==M?(p=D||0===M.trim().length,y[25]=D,y[26]=M,y[27]=p):p=y[27],y[28]!==D?(x=D&&(0,t.jsx)("span",{className:"absolute right-4 animate-spin",children:(0,t.jsx)(ex.LoaderIcon,{})}),y[28]=D,y[29]=x):x=y[29],y[30]!==T||y[31]!==I||y[32]!==p||y[33]!==x?(f=(0,t.jsxs)(eb.Button,{className:"relative",disabled:p,onClick:T,children:[I,x]}),y[30]=T,y[31]=I,y[32]=p,y[33]=x,y[34]=f):f=y[34],y[35]!==h||y[36]!==f?(b=(0,t.jsxs)(eg.DialogFooter,{children:[h,f]}),y[35]=h,y[36]=f,y[37]=b):b=y[37],y[38]!==m||y[39]!==b||y[40]!==l?(g=(0,t.jsxs)(eg.DialogContent,{className:"sm:max-w-sm",children:[l,m,b]}),y[38]=m,y[39]=b,y[40]=l,y[41]=g):g=y[41],y[42]!==k||y[43]!==S||y[44]!==g?(j=(0,t.jsx)(eg.Dialog,{onOpenChange:k,open:S,children:g}),y[42]=k,y[43]=S,y[44]=g,y[45]=j):j=y[45],j}function e1(e){let a,r,s,o,i,l,c,d,u,m=(0,n.c)(26),{chat:h,projects:p,onMove:x}=e;if(m[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsxs)(ec.DropdownMenuSubTrigger,{className:"cursor-pointer text-ui",children:[(0,t.jsx)(eA.FolderInputIcon,{className:"size-3.5 text-muted-foreground"}),(0,t.jsx)("span",{children:"Move to projectâ¦"})]}),m[0]=a):a=m[0],m[1]!==p.length?(r=0===p.length&&(0,t.jsx)(ec.DropdownMenuItem,{className:"text-ui",disabled:!0,children:"No projects yet"}),m[1]=p.length,m[2]=r):r=m[2],m[3]!==h.id||m[4]!==h.projectId||m[5]!==x||m[6]!==p){let e;m[8]!==h.id||m[9]!==h.projectId||m[10]!==x?(e=e=>(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-ui",onSelect:()=>x(h.id,e.id),children:[(0,t.jsx)(eR.FolderIcon,{className:"size-3.5 text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate",children:e.name}),h.projectId===e.id&&(0,t.jsx)(e_.CheckIcon,{className:"ml-auto size-3.5 text-primary"})]},e.id),m[8]=h.id,m[9]=h.projectId,m[10]=x,m[11]=e):e=m[11],s=p.map(e),m[3]=h.id,m[4]=h.projectId,m[5]=x,m[6]=p,m[7]=s}else s=m[7];return m[12]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(ec.DropdownMenuSeparator,{}),m[12]=o):o=m[12],m[13]!==h.id||m[14]!==x?(i=()=>x(h.id,null),m[13]=h.id,m[14]=x,m[15]=i):i=m[15],m[16]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)("span",{children:"No project"}),m[16]=l):l=m[16],m[17]!==h.projectId?(c=null===h.projectId&&(0,t.jsx)(e_.CheckIcon,{className:"ml-auto size-3.5 text-primary"}),m[17]=h.projectId,m[18]=c):c=m[18],m[19]!==i||m[20]!==c?(d=(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-ui",onSelect:i,children:[l,c]}),m[19]=i,m[20]=c,m[21]=d):d=m[21],m[22]!==r||m[23]!==s||m[24]!==d?(u=(0,t.jsxs)(ec.DropdownMenuSub,{children:[a,(0,t.jsxs)(ec.DropdownMenuSubContent,{className:"w-52",children:[r,s,o,d]})]}),m[22]=r,m[23]=s,m[24]=d,m[25]=u):u=m[25],u}function e2(e){let a,r,s,o,i=(0,n.c)(13),{value:l,onSave:c,onCancel:d}=e,[u,m]=(0,O.useState)(l);i[0]!==u||i[1]!==d||i[2]!==c||i[3]!==l?(a=()=>{let e=u.trim();e&&e!==l?c(e):d()},i[0]=u,i[1]=d,i[2]=c,i[3]=l,i[4]=a):a=i[4];let h=a;return i[5]===Symbol.for("react.memo_cache_sentinel")?(r=e=>m(e.target.value),i[5]=r):r=i[5],i[6]!==h||i[7]!==d?(s=e=>{"Enter"===e.key&&(e.preventDefault(),h()),"Escape"===e.key&&(e.preventDefault(),d())},i[6]=h,i[7]=d,i[8]=s):s=i[8],i[9]!==h||i[10]!==u||i[11]!==s?(o=(0,t.jsx)("input",{"aria-label":"Rename",autoFocus:!0,className:"h-6 min-w-0 flex-1 rounded-sm border border-primary/40 bg-background px-1 text-ui text-foreground outline-none",maxLength:120,onBlur:h,onChange:r,onClick:e4,onKeyDown:s,value:u}),i[9]=h,i[10]=u,i[11]=s,i[12]=o):o=i[12],o}function e4(e){e.preventDefault(),e.stopPropagation()}async function e3(e,t){return!!await eQ(eu.apiRoutes.threads.byId(e),"PATCH",{title:t})}function e5(e){let a,r,s,o,i,l,c,d,u,m,h,p,x,f,b,g,j,y,S,v,w,N,I,k,C,M,_,D,P,T,R,z,E,B=(0,n.c)(82),{chat:F,indent:L,isActive:H,projects:q,onMove:G,onRenamed:$}=e,{setOpenMobile:U}=(0,ed.useSidebar)(),W=F.unread>0,[K,Y]=(0,O.useState)(!1);B[0]!==F.id||B[1]!==$?(a=async function(e){(Y(!1),await e3(F.id,e))?$?.():en.toast.error("Could not rename chat.")},B[0]=F.id,B[1]=$,B[2]=a):a=B[2];let J=a;B[3]!==F.id||B[4]!==F.pinnedAt||B[5]!==$?(r=async function(){let e=await fetch(eu.apiRoutes.threads.pin(F.id),{method:F.pinnedAt?"DELETE":"POST",credentials:"include"}).catch(e9);e?.ok?$?.():en.toast.error("Could not update pin.")},B[3]=F.id,B[4]=F.pinnedAt,B[5]=$,B[6]=r):r=B[6];let V=r;B[7]!==F.id||B[8]!==$?(s=async function(){let e=await fetch(eu.apiRoutes.threads.archive(F.id),{method:"POST",credentials:"include"}).catch(e8);e?.ok?(en.toast.success("Archived",{description:"Find it under Chats â Archived."}
2),$?.()):en.toast.error("Could not archive chat.")},B[7]=F.id,B[8]=$,B[9]=s):s=B[9];let Q=s;B[10]!==F.id||B[11]!==$?(o=async function(){let e=await fetch(eu.apiRoutes.chat.byId(F.id),{method:"DELETE",credentials:"include"}).catch(e7);e?.ok?($?.(),en.toast.success("Moved to Trash",{description:"It stays in Drive â Trash for 30 days.",action:{label:"Undo",onClick:async()=>{await fetch(eu.apiRoutes.trash.restore(),{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({family:"chat",id:F.id})}).catch(e6),$?.()}}})):en.toast.error("Could not move the chat to the trash.")},B[10]=F.id,B[11]=$,B[12]=o):o=B[12];let X=o,[Z,ee]=(0,O.useState)(!1),et=L&&"pl-7";B[13]!==et?(i=(0,em.cn)(eK,"group-has-data-[sidebar=menu-action]/menu-item:pr-2.5 group-has-data-[sidebar=menu-action]/menu-item:group-hover/menu-item:pr-8 group-has-data-[sidebar=menu-action]/menu-item:data-[active=true]:pr-8",et),B[13]=et,B[14]=i):i=B[14];let ea=`/chat/${F.id}`;B[15]!==U?(l=()=>U(!1),B[15]=U,B[16]=l):l
2=B[16],B[17]===Symbol.for("react.memo_cache_sentinel")?(d=e=>{e.preventDefault(),ee(!0)},c=e=>{e.preventDefault(),Y(!0)},B[17]=c,B[18]=d):(c=B[17],d=B[18]),B[19]!==F.id?(u=e=>{e.dataTransfer.setData(eY,F.id),e.dataTransfer.effectAllowed="move"},B[19]=F.id,B[20]=u):u=B[20],B[21]!==F.appKind||B[22]!==F.icon?(m=(0,t.jsx)(eG.AppKindIcon,{className:"size-3.5",icon:F.icon,kind:F.appKind}),B[21]=F.appKind,B[22]=F.icon,B[23]=m):m=B[23],B[24]!==F.title||B[25]!==W||B[26]!==K||B[27]!==J?(h=K?(0,t.jsx)(e2,{onCancel:()=>Y(!1),onSave:J,value:F.title}):(0,t.jsx)("span",{className:(0,em.cn)("min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip [mask-image:linear-gradient(to_right,#000_calc(100%-14px),transparent)]",W&&"font-semibold text-sidebar-foreground"),children:F.title}),B[24]=F.title,B[25]=W,B[26]=K,B[27]=J,B[28]=h):h=B[28],B[29]!==F.unread||B[30]!==W?(p=W&&(0,t.jsx)(er.UnreadBadge,{count:F.unread}),B[29]=F.unread,B[30]=W,B[31]=p):p=B[31],B[32]!==u||B[33]!==m||B[34]!==h||B[35]!==p||B[36]!==ea||B[37]!==l?(x=(0,t.jsxs)(A.default,{draggable:!0,href:ea,onClick:l,onContextMenu:d,onDoubleClick:c,onDragStart:u,title:"Double-click to rename",children:[m,h,p]}),B[32]=u,B[33]=m,B[34]=h,B[35]=p,B[36]=ea,B[37]=l,B[38]=x):x=B[38],B[39]!==H||B[40]!==x||B[41]!==i?(f=(0,t.jsx)(ed.SidebarMenuButton,{asChild:!0,className:i,isActive:H,children:x}),B[39]=H,B[40]=x,B[41]=i,B[42]=f):f=B[42];let es=!H;B[43]===Symbol.for("react.memo_cache_sentinel")?(b=(0,t.jsx)(ex.MoreHorizontalIcon,{}),g=(0,t.jsx)("span",{className:"sr-only",children:"More"}),B[43]=b,B[44]=g):(b=B[43],g=B[44]),B[45]!==es?(j=(0,t.jsx)(ec.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(ed.SidebarMenuAction,{className:eJ,showOnHover:es,children:[b,g]})}),B[45]=es,B[46]=j):j=B[46],B[47]!==F||B[48]!==G||B[49]!==q?(y=(0,t.jsx)(e1,{chat:F,onMove:G,projects:q}),B[47]=F,B[48]=G,B[49]=q,B[50]=y):y=B[50],B[51]===Symbol.for("react.memo_cache_sentinel")?(S=(0,t.jsx)(ec.DropdownMenuSeparator,{}),B[51]=S):S=B[51],B[52]===Symbol.for("react.memo_cache_sentinel")?(v=(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-ui",onSelect:()=>Y(!0),children:[(0,t.jsx)(eE.PencilIcon,{className:"size-3.5"}),(0,t.jsx)("span",{children:"Rename"})]}),B[52]=v):v=B[52],B[53]!==F.pinnedAt?(w=F.pinnedAt?(0,t.jsx)(eB.PinOffIcon,{className:"size-3.5 text-muted-foreground"}):(0,t.jsx)(eO.PinIcon,{className:"size-3.5 text-muted-foreground"}),B[53]=F.pinnedAt,B[54]=w):w=B[54];let eo=F.pinnedAt?"Unpin":"Pin";return B[55]!==eo?(N=(0,t.jsx)("span",{children:eo}),B[55]=eo,B[56]=N):N=B[56],B[57]!==w||B[58]!==N||B[59]!==V?(I=(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-ui",onSelect:V,children:[w,N]}),B[57]=w,B[58]=N,B[59]=V,B[60]=I):I=B[60],B[61]===Symbol.for("react.memo_cache_sentinel")?(k=(0,t.jsx)(ec.DropdownMenuSeparator,{}),B[61]=k):k=B[61],B[62]===Symbol.for("react.memo_cache_sentinel")?(C=(0,t.jsx)(eM.ArchiveIcon,{className:"size-3.5"}),M=(0,t.jsx)("span",{children:"Archive"}),B[62]=C,B[63]=M):(C=B[62],M=B[63]),B[64]!==Q?(_=(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-ui",onSelect:Q,children:[C,M]}),B[64]=Q,B[65]=_):_=B[65],B[66]===Symbol.for("react.memo_cache_sentinel")?(D=(0,t.jsx)(eL.Trash2Icon,{className:"size-3.5"}),P=(0,t.jsx)("span",{children:"Move to trash"}),B[66]=D,B[67]=P):(D=B[66],P=B[67]),B[68]!==X?(T=(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-destructive text-ui focu
2s:text-destructive",onSelect:X,children:[D,P]}),B[68]=X,B[69]=T):T=B[69],B[70]!==y||B[71]!==I||B[72]!==_||B[73]!==T?(R=(0,t.jsxs)(ec.DropdownMenuContent,{align:"end",className:"w-56",side:"bottom",children:[y,S,v,I,k,_,T]}),B[70]=y,B[71]=I,B[72]=_,B[73]=T,B[74]=R):R=B[74],B[75]!==Z||B[76]!==j||B[77]!==R?(z=(0,t.jsxs)(ec.DropdownMenu,{modal:!0,onOpenChange:ee,open:Z,children:[j,R]}),B[75]=Z,B[76]=j,B[77]=R,B[78]=z):z=B[78],B[79]!==f||B[80]!==z?(E=(0,t.jsxs)(ed.SidebarMenuItem,{children:[f,z]}),B[79]=f,B[80]=z,B[81]=E):E=B[81],E}function e6(){return null}function e7(){return null}function e8(){return null}function e9(){return null}function te(e){let a,r,s,o,i,l,c,d,u,m,h,p,x,f,b,g,j,y,S,v,w,I,k,C,M,_,D,P,T,R,z,E,B,F,L,H,q=(0,n.c)(73),{project:G,expanded:$,isActive:U,onToggle:W,onRename:K,onRenameInline:Y,onArchive:J,onReport:V,onNewChat:Q,onSettings:X,onParticipants:Z,single:ee,onDropChat:et}=e,{setOpenMobile:ea}=(0,ed.useSidebar)(),es=G.unread>0,[eo,ei]=(0,O.useState)(!1),[el,eu]=(0,O.useState)(!1),eh=void 0!==ee,ep=G.summaryChatId?`/chat/${G.summaryChatId}`:"/chats";q[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,em.cn)(eK,"min-w-0 flex-1 px-2.5"),q[0]=a):a=q[0];let ef=el&&"ring-2 ring-primary/50 ring-inset bg-sidebar-accent";return q[1]!==ef?(r=(0,em.cn)(ef),q[1]=ef,q[2]=r):r=q[2],q[3]!==ea?(s=()=>ea(!1),q[3]=ea,q[4]=s):s=q[4],q[5]===Symbol.for("react.memo_cache_sentinel")?(o=e=>{e.preventDefault(),ei(!0)},i=()=>eu(!1),l=e=>{e.dataTransfer.types.includes(eY)&&(e.preventDefault(),e.dataTransfer.dropEffect="move",eu(!0))},q[5]=o,q[6]=i,q[7]=l):(o=q[5],i=q[6],l=q[7]),q[8]!==et?(c=e=>{let t=e.dataTransfer.getData(eY);eu(!1),t&&(e.preventDefault(),et(t))},q[8]=et,q[9]=c):c=q[9],q[10]!==ee?(d=ee?(0,t.jsx)(eG.AppKindIcon,{className:"size-3.5",icon:ee.icon,kind:ee.appKind}):(0,t.jsx)(eR.FolderIcon,{className:"size-3.5 text-sidebar-foreground/60"}),q[10]=ee,q[11]=d):d=q[11],q[12]!==es||q[13]!==Y||q[14]!==G.name||q[15]!==eo?(u=eo?(0,t.jsx)(e2,{onCancel:()=>ei(!1),onSave:async e=>{ei(!1),await Y(e)||en.toast.error("Could not rename project.")},value:G.name}):(0,t.jsx)("span",{className:(0,em.cn)("min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip [mask-image:linear-gradient(to_right,#000_calc(100%-14px),transparent)]",es&&"font-semibold text-sidebar-foreground"),children:G.name}),q[12]=es,q[13]=Y,q[14]=G.name,q[15]=eo,q[16]=u):u=q[16],q[17]!==es||q[18]!==G.unread?(m=es&&(0,t.jsx)(er.UnreadBadge,{count:G.unread}),q[17]=es,q[18]=G.unread,q[19]=m):m=q[19],q[20]!==ep||q[21]!==u||q[22]!==m||q[23]!==r||q[24]!==s||q[25]!==c||q[26]!==d?(h=(0,t.jsxs)(A.default,{className:r,href:ep,onClick:s,onDoubleClick:o,onDragLeave:i,onDragOver:l,onDrop:c,title:"Double-click to rename",children:[d,u,m]}),q[20]=ep,q[21]=u,q[22]=m,q[23]=r,q[24]=s,q[25]=c,q[26]=d,q[27]=h):h=q[27],q[28]!==U||q[29]!==h?(p=(0,t.jsx)(ed.SidebarMenuButton,{asChild:!0,className:a,isActive:U,children:h}),q[28]=U,q[29]=h,q[30]=p):p=q[30],q[31]===Symbol.for("react.memo_cache_sentinel")?(x=(0,t.jsx)(ec.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(ed.SidebarMenuAction,{className:(0,em.cn)(eJ,"!static hidden shrink-0 group-hover/menu-item:flex data-[state=open]:flex"),children:[(0,t.jsx)(ex.MoreHorizontalIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Project actions"})]})}),q[31]=x):x=q[31],q[32]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsx)(N.PlusIcon,{className:"size-3.5"}),b=(0,t.jsx)("span",{children:"Chat to Project"}),q[32]=f,q[33]=b):(f=q[32],b=q[33]),q[34]!==Q?(g=(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer",onSelect:Q,children:[f,b]}),q[34]=Q,q[35]=g):g=q[35],q[36]===Symbol.for("react.memo_cache_sentinel")?(j=(0,t.jsx)(ec.DropdownMenuSeparator,{}),q[36]=j):j=q[36],q[37]===Symbol.for("react.memo_cache_sentinel")?(y=(0,t.jsx)(eE.PencilIcon,{className:"size-3.5"}),S=(0,t.jsx)("span",{children:"Rename"}),q[37]=y,q[38]=S):(y=q[37],S=q[38]),q[39]!==K?(v=(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer",onSelect:K,children:[y,S]}),q[39]=K,q[40]=v):v=q[40],q[41]===Symbol.for("react.memo_cache_sentinel")?(w=(0,t.jsx)(eH.UsersIcon,{className:"size-3.5"}),I=(0,t.jsx)("span",{children:"Participants"}),q[41]=w,q[42]=I):(w=q[41],I=q[42]),q[43]!==Z?(k=(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer",onSelect:Z,children:[w,I]}),q[43]=Z,q[44]=k):k=q[44],q[45]===Symbol.for("react.memo_cache_sentinel")?(C=(0,t.jsx)(eF.SlidersHorizontalIcon,{className:"size-3.5"}),M=(0,t.jsx)("span",{children:"Settings"}),q[45]=C,q[46]=M):(C=q[45],M=q[46]),q[47]!==X?(_=(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer",onSelect:X,children:[C,M]}),q[47]=X,q[48]=_):_=q[48],q[49]===Symbol.for("react.memo_cache_sentinel")?(D=(0,t.jsx)(eP.ClipboardListIcon,{className:"size-3.5"}),P=(0,t.jsx)("span",{children:"Status report"}),q[49]=D,q[50]=P):(D=q[49],P=q[50]),q[51]!==V?(T=(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer",onSelect:V,children:[D,P]}),q[51]=V,q[52]=T):T=q[52],q[53]===Symbol.for("react.memo_cache_sentinel")?(R=(0,t.jsx)(ec.DropdownMenuSeparator,{}),q[53]=R):R=q[53],q[54]===Symbol.for("react.memo_cache_sentinel")?(z=(0,t.jsx)(eM.ArchiveIcon,{className:"size-3.5"}),E=(0,t.jsx)("span",{children:"Archive"}),q[54]=z,q[55]=E):(z=q[54],E=q[55]),q[56]!==J?(B=(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer",onSelect:J,children:[z,E]}
2),q[56]=J,q[57]=B):B=q[57],q[58]!==g||q[59]!==v||q[60]!==k||q[61]!==_||q[62]!==T||q[63]!==B?(F=(0,t.jsxs)(ec.DropdownMenu,{modal:!0,children:[x,(0,t.jsxs)(ec.DropdownMenuContent,{align:"end",side:"bottom",children:[g,j,v,k,_,T,R,B]})]}),q[58]=g,q[59]=v,q[60]=k,q[61]=_,q[62]=T,q[63]=B,q[64]=F):F=q[64],q[65]!==$||q[66]!==eh||q[67]!==W?(L=eh?null:(0,t.jsx)("button",{"aria-expanded":$,"aria-label":$?"Collapse project":"Expand project",className:"mr-0.5 flex size-5 shrink-0 items-center justify-center rounded text-sidebar-foreground/50 transition-colors hover:text-sidebar-foreground",onClick:W,type:"button",children:(0,t.jsx)(eD.ChevronRightIcon,{className:(0,em.cn)("size-3.5 transition-transform duration-[var(--dur-instant)]",$&&"rotate-90")})}),q[65]=$,q[66]=eh,q[67]=W,q[68]=L):L=q[68],q[69]!==p||q[70]!==F||q[71]!==L?(H=(0,t.jsxs)(ed.SidebarMenuItem,{className:"flex items-center",children:[p,F,L]}),q[69]=p,q[70]=F,q[71]=L,q[72]=H):H=q[72],H}function tt(e){let a,r,s,o,i,l,d,u,m,h,p,x,f,b,g,j,y,S,v,w=(0,n.c)(42),{group:N,expanded:I,onToggle:k,onPromote:C,onHide:M}=e,_=N.chats.reduce(tn,0);w[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,em.cn)(eK,"min-w-0 flex-1 px-2.5"),w[0]=a):a=w[0];let D=`${N.chatCount} chats on this theme`;w[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(et.SparklesIcon,{className:"size-3.5 text-sidebar-foreground/60"}),w[1]=r):r=w[1];let P=_>0&&"font-semibold text-sidebar-foreground";w[2]!==P?(s=(0,em.cn)("min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip [mask-image:linear-gradient(to_right,#000_calc(100%-14px),transparent)]",P),w[2]=P,w[3]=s):s=w[3],w[4]!==N.name||w[5]!==s?(o=(0,t.jsx)("span",{className:s,children:N.name}),w[4]=N.name,w[5]=s,w[6]=o):o=w[6],w[7]!==N.chatCount||w[8]!==_?(i=_>0?(0,t.jsx)(er.UnreadBadge,{count:_}):(0,t.jsx)("span",{className:"shrink-0 text-meta text-sidebar-foreground/50 tabular-nums",children:N.chatCount}),w[7]=N.chatCount,w[8]=_,w[9]=i):i=w[9],w[10]!==I||w[11]!==k||w[12]!==D||w[13]!==o||w[14]!==i?(l=(0,t.jsxs)(ed.SidebarMenuButton,{"aria-expanded":I,className:a,onClick:k,title:D,children:[r,o,i]}),w[10]=I,w[11]=k,w[12]=D,w[13]=o,w[14]=i,w[15]=l):l=w[15],w[16]===Symbol.for("react.memo_cache_sentinel")?(d=(0,t.jsx)(ec.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(ed.SidebarMenuAction,{className:(0,em.cn)(eJ,"!static hidden shrink-0 group-hover/menu-item:flex data-[state=open]:flex"),children:[(0,t.jsx)(ex.MoreHorizontalIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Smart group actions"})]})}),w[16]=d):d=w[16],w[17]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)(c.FolderPlusIcon,{className:"size-3.5"}),m=(0,t.jsx)("span",{children:"Make it a project"}),w[17]=u,w[18]=m):(u=w[17],m=w[18]),w[19]!==C?(h=(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer",onSelect:C,children:[u,m]}),w[19]=C,w[20]=h):h=w[20],w[21]===Symbol.for("react.memo_cache_sentinel")?(p=(0,t.jsx)(ec.DropdownMenuSeparator,{}),w[21]=p):p=w[21],w[22]===Symbol.for("react.memo_cache_sentinel")?(x=(0,t.jsx)(eT.EyeOffIcon,{className:"size-3.5"}),f=(0,t.jsx)("span",{children:"Hide"}),w[22]=x,w[23]=f):(x=w[22],f=w[23]),w[24]!==M?(b=(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer",onSelect:M,children:[x,f]}),w[24]=M,w[25]=b):b=w[25],w[26]!==h||w[27]!==b?(g=(0,t.jsxs)(ec.DropdownMenu,{modal:!0,children:[d,(0,t.jsxs)(ec.DropdownMenuContent,{align:"end",side:"bottom",children:[h,p,b]})]}),w[26]=h,w[27]=b,w[28]=g):g=w[28];let T=I?"Collapse smart group":"Expand smart group",R=I&&"rotate-90";return w[29]!==R?(j=(0,em.cn)("size-3.5 transition-transform duration-[var(--dur-instant)]",R),w[29]=R,w[30]=j):j=w[30],w[31]!==j?(y=(0,t.jsx)(eD.ChevronRightIcon,{className:j}),w[31]=j,w[32]=y):y=w[32],w[33]!==I||w[34]!==k||w[35]!==T||w[36]!==y?(S=(0,t.jsx)("button",{"aria-expanded":I,"aria-label":T,className:"mr-0.5 flex size-5 shrink-0 items-center justify-center rounded text-sidebar-foreground/50 transition-colors hover:text-sidebar-foreground",onClick:k,type:"button",children:y}),w[33]=I,w[34]=k,w[35]=T,w[36]=y,w[37]=S):S=w[37],w[38]!==g||w[39]!==S||w[40]!==l?(v=(0,t.jsxs)(ed.SidebarMenuItem,{className:"flex items-center",children:[l,g,S]}),w[38]=g,w[39]=S,w[40]=l,w[41]=v):v=w[41],v}function tn(e,t){return e+t.unread}function ta(e){let a,r,s,o,i,l,c=(0,n.c)(29),{groups:d,activeChatId:u,projects:m,onMove:h,revalidate:p}=e,x=(0,es.useRailNavigate)(),{setOpenMobile:f}=(0,ed.useSidebar)();c[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],c[0]=a):a=c[0];let{isExpanded:b,toggle:g}=eZ(a,"os:smart-groups:expanded");c[1]!==x||c[2]!==p||c[3]!==f?(r=async e=>{let t=await eQ(eu.apiRoutes.chatProjects.smartGroupPromote(e.id),"POST");t?.project?(p(),en.toast.success(`${e.name} is a project now`),t.project.summaryChatId&&(f(!1),x(`/chat/${t.project.summaryChatId}`))):en.toast.error("Could not make the project.")},c[1]=x,c[2]=p,c[3]=f,c[4]=r):r=c[4];let j=r;c[5]!==p?(s=async e=>
2{await eQ(eu.apiRoutes.chatProjects.smartGroup(e.id),"DELETE")?p():en.toast.error("Could not hide the group.")},c[5]=p,c[6]=s):s=c[6];let y=s;if(0===d.length)return null;if(c[7]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)("div",{className:"mt-2 flex items-center gap-1.5 px-2.5 pb-0.5 text-caption text-sidebar-foreground/45 uppercase tracking-wide",title:"Themes that run through your chats. Each chat also stays in the list above.",children:"Smart groups"}),c[7]=o):o=c[7],c[8]!==u||c[9]!==d||c[10]!==y||c[11]!==b||c[12]!==h||c[13]!==m||c[14]!==j||c[15]!==p||c[16]!==g){let e;c[18]!==u||c[19]!==y||c[20]!==b||c[21]!==h||c[22]!==m||c[23]!==j||c[24]!==p||c[25]!==g?(e=e=>{let n=b(e.id,!1);return(0,t.jsxs)("li",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("ul",{className:"flex flex-col",children:(0,t.jsx)(tt,{expanded:n,group:e,onHide:()=>y(e),onPromote:()=>j(e),onToggle:()=>g(e.id)})}),n&&(0,t.jsx)("ul",{className:"flex flex-col gap-0.5",children:e.chats.map(e=>(0,t.jsx)(e5,{chat:e,indent:!0,isActive:e.id===u,onMove:h,onRenamed:p,projects:m},e.id))})]},e.id)},c[18]=u,c[19]=y,c[20]=b,c[21]=h,c[22]=m,c[23]=j,c[24]=p,c[25]=g,c[26]=e):e=c[26],i=d.map(e),c[8]=u,c[9]=d,c[10]=y,c[11]=b,c[12]=h,c[13]=m,c[14]=j,c[15]=p,c[16]=g,c[17]=i}else i=c[17];return c[27]!==i?(l=(0,t.jsxs)(t.Fragment,{children:[o,(0,t.jsx)(ed.SidebarMenu,{className:"gap-0.5",children:i})]}),c[27]=i,c[28]=l):l=c[28],l}function tr(e){let a,r,s,o,i,l,d,u,m,h,p,x,f,b,g,j,y,S,v,w,I,k,C,M,_,D,P,T,R,A,E,F,L,H=(0,n.c)(83),{user:q}=e,G=(0,z.usePathname)();H[0]!==G?(a=G?.startsWith("/chat/")?G.split("/")[2]??null:null,H[0]=G,H[1]=a):a=H[1];let $=a,{data:U,mutate:W}=(0,B.default)(q?e$.SIDEBAR_TREE_KEY:null,em.fetcher,e$.SIDEBAR_TREE_SWR_OPTIONS);H[2]!==W?(r=()=>{W()},H[2]=W,H[3]=r):r=H[3];let K=r,{mutate:Y}=(0,eq.useSWRConfig)(),J=(0,es.useRailNavigate)(),{openDoor:V}=(0,eU.useChatDoor)(),{setOpenMobile:Q}=(0,ed.useSidebar)();H[4]!==U?.projects?(s=U?.projects??[],H[4]=U?.projects,H[5]=s):s=H[5],H[6]!==s?(o=s.filter(tl),H[6]=s,H[7]=o):o=H[7];let X=o;H[8]!==X?(i=X.map(ti),H[8]=X,H[9]=i):i=H[9];let{isExpanded:Z,toggle:ee,expand:et}=eZ(i);H[10]===Symbol.for("react.memo_cache_sentinel")?(l=new Map,H[10]=l):l=H[10];let ea=(0,O.useRef)(l);H[11]!==$||H[12]!==et||H[13]!==X?(d=()=>{for(let e of X){let t=e.chats.filter(to).length,n=ea.current.get(e.id)??0;ea.current.set(e.id,t);let a=!!$&&e.chats.some(e=>e.id===$);(0===n&&t>0||a&&t>0)&&et(e.id)}},u=[X,$,et],H[11]=$,H[12]=et,H[13]=X,H[14]=d,H[15]=u):(d=H[14],u=H[15]),(0,O.useEffect)(d,u),H[16]!==$||H[17]!==U?(m=U&&$?function(e,t){for(let n of e.projects){if(n.summary?.id===t)return n.summary;let e=n.chats.find(e=>e.id===t);if(e)return e}return e.ungrouped.find(e=>e.id===t)}(U,$)?.unread??0:0,H[16]=$,H[17]=U,H[18]=m):m=H[18];let er=m;F=(0,n.c)(5),L=(0,O.useRef)(null),F[0]!==$||F[1]!==K||F[2]!==er?(A=()=>{if(!$||er<=0)return;let e=`${$}:${er}`;L.current!==e&&(L.current=e,eQ(eu.apiRoutes.threads.read($),"POST").then(e=>{e&&K()}))},E=[$,er,K],F[0]=$,F[1]=K,F[2]=er,F[3]=A,F[4]=E):(A=F[3],E=F[4]),(0,O.useEffect)(A,E);let[eo,ei]=(0,O.useState)(!1),[el,eh]=(0,O.useState)(null);H[19]!==et||H[20]!==K?(h=async(e,t)=>{await eQ(eu.apiRoutes.chatProjects.assign(),"POST",{chatIds:[e],projectId:t})?(t&&et(t),K()):en.toast.error("Could not move chat.")},H[19]=et,H[20]=K,H[21]=h):h=H[21];let ex=h;H[22]!==et||H[23]!==K?(p=async e=>{let t=await eQ(eu.apiRoutes.chatProjects.base(),"POST",{name:e});return t?(t.project?.id&&et(t.project.id),K(),!0):(en.toast.error("Could not create project."),!1)},H[22]=et,H[23]=K,H[24]=p):p=H[24];let ef=p;H[25]!==el||H[26]!==K?(x=async e=>!!el&&(await eQ(eu.apiRoutes.chatProjects.byId(el.id),"PATCH",{name:e})?(K(),!0):(en.toast.error("Could not rename project."),!1)),H[25]=el,H[26]=K,H[27]=x):x=H[27];let eb=x;H[28]!==J||H[29]!==V||H[30]!==Q?(f=(e,t)=>{e.summaryChatId&&(V(t),Q(!1),J(`/chat/${e.summaryChatId}`))},H[28]=J,H[29]=V,H[30]=Q,H[31]=f):f=H[31];let eg=f;H[32]!==Y||H[33]!==J||H[34]!==K?(b=async e=>{let t=await fetch(eu.apiRoutes.chatProjects.report(e.id),{method:"POST",credentials:"include"});if(!t.ok)return void en.toast.error("Could not build the report.");let n=await t.json();await Y(eu.apiRoutes.chat.messages(n.chatId)),K(),J(`/chat/${n.chatId}`)},H[32]=Y,H[33]=J,H[34]=K,H[35]=b):b=H[35];let ej=b;H[36]!==K?(g=async e=>{await eQ(eu.apiRoutes.chatProjects.byId(e.id),"PATCH",{archived:!0})?(en.toast.success(`Archived ${e.name}`),K()):en.toast.error("Could not archive project.")},H[36]=K,H[37]=g):g=H[37];let ey=g;if(!(q&&U))return null;H[38]===Symbol.for("react.memo_cache_sentinel")?(j=(0,t.jsx)(ec.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"New project or project chat",className:"flex size-6 shrink-0 items-center justify-center rounded-md text-sidebar-foreground
2/60 hover:bg-sidebar-accent hover:text-sidebar-foreground data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-foreground",title:"New project or project chat",type:"button",children:(0,t.jsx)(N.PlusIcon,{className:"size-3.5"})})}),H[38]=j):j=H[38],H[39]===Symbol.for("react.memo_cache_sentinel")?(y=(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-ui",onSelect:()=>ei(!0),children:[(0,t.jsx)(c.FolderPlusIcon,{className:"size-3.5 text-muted-foreground"}),(0,t.jsx)("span",{children:"New project"})]}),H[39]=y):y=H[39];let eS=0===X.length;if(H[40]===Symbol.for("react.memo_cache_sentinel")?(S=(0,t.jsx)(ez.MessageSquarePlusIcon,{className:"size-3.5 text-muted-foreground"}),v=(0,t.jsx)("span",{children:"New project chat"}),H[40]=S,H[41]=v):(S=H[40],v=H[41]),H[42]!==eS?(w=(0,t.jsxs)(ec.DropdownMenuSubTrigger,{className:"cursor-pointer text-ui",disabled:eS,children:[S,v]}),H[42]=eS,H[43]=w):w=H[43],H[44]!==J||H[45]!==X||H[46]!==Q){let e;H[48]!==J||H[49]!==Q?(e=e=>(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-ui",onSelect:()=>{Q(!1),J(`/chat?project=${e.id}`)},children:[(0,t.jsx)(eR.FolderIcon,{className:"size-3.5 text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]},e.id),H[48]=J,H[49]=Q,H[50]=e):e=H[50],I=X.map(e),H[44]=J,H[45]=X,H[46]=Q,H[47]=I}else I=H[47];H[51]!==I?(k=(0,t.jsx)(ec.DropdownMenuSubContent,{className:"w-52",children:I}),H[51]=I,H[52]=k):k=H[52],H[53]!==w||H[54]!==k?(C=(0,t.jsx)(ep.SidebarSectionHeader,{action:(0,t.jsxs)(ec.DropdownMenu,{modal:!0,children:[j,(0,t.jsxs)(ec.DropdownMenuContent,{align:"end",className:"w-52",side:"bottom",children:[y,(0,t.jsxs)(ec.DropdownMenuSub,{children:[w,k]})]})]}),href:"/chats/projects",id:"projects",label:"Projects"}),H[53]=w,H[54]=k,H[55]=C):C=H[55],H[56]!==$||H[57]!==ey||H[58]!==Z||H[59]!==ex||H[60]!==J||H[61]!==eg||H[62]!==X||H[63]!==ej||H[64]!==K||H[65]!==Q||H[66]!==ee?(M=(0,t.jsx)(ep.SidebarSectionBody,{id:"projects",children:(0,t.jsx)(ed.SidebarGroupContent,{children:0===X.length?(0,t.jsx)("div",{className:"px-2 py-1 text-meta text-sidebar-foreground/50",children:"Related chats group here. Add one with +."}):(0,t.jsx)(ed.SidebarMenu,{className:"gap-0.5",children:X.map(e=>{let n=Z(e.id),a=e.chats.filter(ts),r=0===a.length?e.summary??null:void 0;return(0,t.jsxs)("li",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("ul",{className:"flex flex-col",children:(0,t.jsx)(te,{expanded:n,isActive:!!e.summaryChatId&&e.summaryChatId===$,onArchive:()=>ey(e),onDropChat:t=>{e.chats.some(e=>e.id===t)||ex(t,e.id)},onNewChat:()=>{Q(!1),J(`/chat?project=${e.id}`)},onParticipants:()=>eg(e,"participants"),onRename:()=>eh(e),onRenameInline:async t=>{let n=await eQ(eu.apiRoutes.chatProjects.byId(e.id),"PATCH",{name:t});return n&&e.summaryChatId&&await eQ(eu.apiRoutes.threads.byId(e.summaryChatId),"PATCH",{title:t}),n&&K(),!!n},onReport:()=>ej(e),onSettings:()=>eg(e,"settings"),onToggle:()=>ee(e.id),project:e,single:r})}),n&&a.length>0&&(0,t.jsx)("ul",{className:"flex flex-col gap-0.5",children:a.map(e=>(0,t.jsx)(e5,{chat:e,indent:!0,isActive:e.id===$,onMove:ex,projects:X},e.id))})]},e.id)})})})}),H[56]=$,H[57]=ey,H[58]=Z,H[59]=ex,H[60]=J,H[61]=eg,H[62]=X,H[63]=ej,H[64]=K,H[65]=Q,H[66]=ee,H[67]=M):M=H[67],H[68]!==C||H[69]!==M?(_=(0,t.jsxs)(ep.SidebarSectionGroup,{children:[C,M]}),H[68]=C,H[69]=M,H[70]=_):_=H[70],H[71]!==eo||H[72]!==ef?(D=(0,t.jsx)(e0,{description:"A project groups related chats and gets its own summary chat.",initialName:"",onOpenChange:ei,onSubmit:ef,open:eo,submitLabel:"Create",title:"New project"}),H[71]=eo,H[72]=ef,H[73]=D):D=H[73];let ev=el?.name??"";H[74]===Symbol.for("react.memo_cache_sentinel")?(P=e=>{e||eh(null)},H[74]=P):P=H[74];let ew=null!==el;return H[75]!==eb||H[76]!==ev||H[77]!==ew?(T=(0,t.jsx)(e0,{description:"Rename this project.",initialName:ev,onOpenChange:P,onSubmit:eb,open:ew,submitLabel:"Save",title:"Rename project"}),H[75]=eb,H[76]=ev,H[77]=ew,H[78]=T):T=H[78],H[79]!==_||H[80]!==D||H[81]!==T?(R=(0,t.jsxs)(t.Fragment,{children:[_,D,T]}),H[79]=_,H[80]=D,H[81]=T,H[82]=R):R=H[82],R}function ts(e){return!e.isSummary}function to(e){return!e.isSummary}function ti(e){return e.id}function tl(e){return!e.archivedAt}function tc(e){let a,r,s,o,i,l,c,d,u,m,h,p,x,f,b,g,j,y=(0,n.c)(49),{user:S}=e,v=(0,z.usePathname)();y[0]!==v?(a=v?.startsWith("/chat/")?v.split("/")[2]??null:null,y[0]=v,y[1]=a):a=y[1];let w=a,{data:I,mutate:k}=(0,B.default)(S?e$.SIDEBAR_TREE_KEY:null,em.fetcher,e$.SIDEBAR_TREE_SWR_OPTIONS);y[2]!==I?.projects?(r=I?.projects??[],y[2]=I?.projects,y[3]=r):r=y[3],y[4]!==r?(s=r.filter(tu),y[4]=r,y[5]=s):s=y[5];let C=s;y[6]!==k?(o=async(e,t)=>{await eQ(eu.apiRoutes.chatProjects.assign(),"POST",{chatIds:[e],projectId:t})?k():en.toast.error("Could not move chat.")},y[6]=k,y[7]=o):o=y[7];let M=o;if(!(S&&I))return null;if(y[8]!==w||y[9]!==I.smartGroups||y[10]!==I.ungrouped||y[11]!==M||y[12]!==k||y[13]!==C||y[14]!==S){let e,n=I.ungrouped.filter(td).slice(0,8);y[23]!==I.smartGroups?(e=I.smartGroups??[],y[23]=I.smartGroups,y[24]=e):e=y[24],d=e,c=ep.SidebarSectionGroup,y[25]===Symbol.for("react.memo_cache_sentinel")?(p=(0,t.jsx)(ep.SidebarSectionHeader,{action:(0,t.jsx)(A.default,{"aria-label":"New chat",className:"flex size-6 shrink-0 items-center justify-center rounded-md text-sidebar-foreground
2/60 hover:bg-sidebar-accent hover:text-sidebar-foreground",href:"/chat",title:"New chat",children:(0,t.jsx)(N.PlusIcon,{className:"size-3.5"})}),href:"/chats",id:"chats",label:"Chats"}),y[25]=p):p=y[25],l=ep.SidebarSectionBody,h="chats",i=ed.SidebarGroupContent,y[26]!==S?(u=(0,t.jsx)(eC.SidebarHistory,{searchOnly:!0,user:S}),y[26]=S,y[27]=u):u=y[27],m=0===n.length?(0,t.jsx)("div",{className:"px-2 py-1 text-meta text-sidebar-foreground/50",children:"Your latest chats land here."}):(0,t.jsx)(ed.SidebarMenu,{className:"gap-0.5",children:n.map(e=>(0,t.jsx)(e5,{chat:e,indent:!1,isActive:e.id===w,onMove:M,onRenamed:()=>k(),projects:C},e.id))}),y[8]=w,y[9]=I.smartGroups,y[10]=I.ungrouped,y[11]=M,y[12]=k,y[13]=C,y[14]=S,y[15]=i,y[16]=l,y[17]=c,y[18]=d,y[19]=u,y[20]=m,y[21]=h,y[22]=p}else i=y[15],l=y[16],c=y[17],d=y[18],u=y[19],m=y[20],h=y[21],p=y[22];return y[28]!==k?(x=()=>k(),y[28]=k,y[29]=x):x=y[29],y[30]!==w||y[31]!==M||y[32]!==C||y[33]!==d||y[34]!==x?(f=(0,t.jsx)(ta,{activeChatId:w,groups:d,onMove:M,projects:C,revalidate:x}),y[30]=w,y[31]=M,y[32]=C,y[33]=d,y[34]=x,y[35]=f):f=y[35],y[36]!==i||y[37]!==f||y[38]!==u||y[39]!==m?(b=(0,t.jsxs)(i,{children:[u,m,f]}),y[36]=i,y[37]=f,y[38]=u,y[39]=m,y[40]=b):b=y[40],y[41]!==l||y[42]!==b||y[43]!==h?(g=(0,t.jsx)(l,{id:h,children:b}),y[41]=l,y[42]=b,y[43]=h,y[44]=g):g=y[44],y[45]!==c||y[46]!==g||y[47]!==p?(j=(0,t.jsxs)(c,{children:[p,g]}),y[45]=c,y[46]=g,y[47]=p,y[48]=j):j=y[48],j}function td(e){return!e.isSummary}function tu(e){return!e.archivedAt}let tm="openserve:sidebar-width";function th(e){return e.closest('[data-slot="sidebar-wrapper"]')}function tp(e){return e?[...e.querySelectorAll('[data-slot="sidebar-gap"], [data-slot="sidebar-container"]')]:[]}function tx(){let{state:e,isMobile:n}=(0,ed.useSidebar)(),a=(0,O.useRef)(null),r=(0,O.useRef)(!1),[s,o]=(0,O.useState)(280),i=(e,t)=>{e.style.setProperty("--sidebar-width",`${t}px`),o(t)};return((0,O.useEffect)(()=>{let e=a.current,t=e?th(e):null;if(t)try{let e=Number(window.localStorage.getItem(tm));Number.isFinite(e)&&e>=208&&e<=480&&(t.style.setProperty("--sidebar-width",`${e}px`),o(e))}catch{}},[]),n||"collapsed"===e)?null:(0,t.jsx)("div",{"aria-label":"Resize sidebar","aria-orientation":"vertical","aria-valuemax":480,"aria-valuemin":208,"aria-valuenow":s,className:"group/resize -right-1 absolute inset-y-0 z-20 w-2 cursor-col-resize touch-none select-none outline-none before:absolute before:inset-y-0 before:left-1/2 before:w-px before:-translate-x-1/2 before:bg-transparent before:transition-colors hover:before:bg-primary/50 focus-visible:before:bg-primary",onDoubleClick:e=>{let t=th(e.currentTarget);t?.style.removeProperty("--sidebar-width"),o(280);try{window.localStorage.removeItem(tm)}catch{}},onKeyDown:e=>{if("ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();let t=th(e.currentTarget);if(!t)return;let n=Math.min(480,Math.max(208,(Number.parseFloat(getComputedStyle(t).getPropertyValue("--sidebar-width"))||280)+("ArrowLeft"===e.key?-16:16)));i(t,n);try{window.localStorage.setItem(tm,String(n))}catch{}},onPointerDown:e=>{if(0===e.button){r.current=!0;try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}for(let t of tp(th(e.currentTarget)))t.style.transition="none"}},onPointerMove:e=>{if(!r.current)return;let t=th(e.currentTarget);if(!t)return;let n=Math.min(480,Math.max(208,e.clientX-t.getBoundingClientRect().left));i(t,n)},onPointerUp:e=>{if(!r.current)return;r.current=!1;let t=th(e.currentTarget);if(!t)return;for(let e of tp(t))e.style.transition="";let n=Number.parseFloat(t.style.getPropertyValue("--sidebar-width"));if(Number.isFinite(n))try{window.localStorage.setItem(tm,String(n))}catch{}},ref:a,role:"separator",tabIndex:0})}let tf=eu.apiRoutes.threads.shared(),tb={edit:"can take part",comment:"can comment",view:"can read"};function tg(e){let a,r,s,o,i,l,c=(0,n.c)(17),{user:d}=e,u=(0,es.useRailNavigate)(),m=(0,z.usePathname)(),{setOpenMobile:h}=(0,ed.useSidebar)();c[0]!==m?(a=m?.startsWith("/chat/")?m.split("/")[2]??null:null,c[0]=m,c[1]=a):a=c[1];let p=a;c[2]===Symbol.for("react.memo_cache_sentinel")?(r={refreshInterval:6e4,revalidateOnFocus:!0},c[2]=r):r=c[2];let{data:x}=(0,B.default)(d?tf:null,em.fetcher,r);c[3]!==x?.chats?(s=x?.chats??[],c[3]=x?.chats,c[4]=s):s=c[4];let f=s;if(!(d&&f.length>0))return null;
2if(c[5]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(ep.SidebarSectionHeader,{id:"shared",label:"Shared with you"}),c[5]=o):o=c[5],c[6]!==p||c[7]!==f||c[8]!==u||c[9]!==h){let e;c[11]!==p||c[12]!==u||c[13]!==h?(e=e=>(0,t.jsx)(ed.SidebarMenuItem,{children:(0,t.jsxs)(ed.SidebarMenuButton,{className:(0,em.cn)("[&>span:last-child]:text-clip h-8 items-center gap-2 rounded-md px-2 text-ui text-sidebar-foreground/80 transition-colors duration-150 hover:bg-sidebar-accent-foreground/[0.06] hover:text-sidebar-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-foreground"),isActive:e.id===p,onClick:()=>{h(!1),u(`/chat/${e.id}`)},title:`${e.ownerName?`${e.ownerName}'s chat`:"Shared chat"} \xb7 you ${tb[e.role]}`,children:[(0,t.jsx)("span",{className:"flex shrink-0 items-center justify-center",children:(0,t.jsx)(ei.Avatar,{name:e.ownerName,size:"xs",src:e.ownerImage})}),(0,t.jsx)("span",{className:"min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip [mask-image:linear-gradient(to_right,#000_calc(100%-14px),transparent)]",children:e.title})]})},e.id),c[11]=p,c[12]=u,c[13]=h,c[14]=e):e=c[14],i=f.map(e),c[6]=p,c[7]=f,c[8]=u,c[9]=h,c[10]=i}else i=c[10];return c[15]!==i?(l=(0,t.jsxs)(ep.SidebarSectionGroup,{children:[o,(0,t.jsx)(ep.SidebarSectionBody,{id:"shared",children:(0,t.jsx)(ed.SidebarGroupContent,{children:(0,t.jsx)(ed.SidebarMenu,{className:"gap-0.5",children:i})})})]}),c[15]=i,c[16]=l):l=c[16],l}function tj(){let e,a,r,s,o,i,l,c=(0,n.c)(11);c[0]===Symbol.for("react.memo_cache_sentinel")?(e=eu.apiRoutes.influence.balance(),c[0]=e):e=c[0],c[1]===Symbol.for("react.memo_cache_sentinel")?(a={refreshInterval:45e3,revalidateOnFocus:!0},c[1]=a):a=c[1];let{data:d}=(0,B.default)(e,em.fetcher,a),u=d?.balance??0,m=(0,O.useRef)(u),[h,p]=(0,O.useState)(!1);if(c[2]!==u?(r=()=>{if(u>m.current){p(!0);let e=setTimeout(()=>p(!1),1200);return m.current=u,()=>clearTimeout(e)}m.current=u},s=[u],c[2]=u,c[3]=r,c[4]=s):(r=c[3],s=c[4]),(0,O.useEffect)(r,s),!d)return null;let x=h&&"scale-110 border-[#f4b90b] text-foreground";return c[5]!==x?(o=(0,em.cn)("inline-flex items-center gap-1 rounded-full border border-border bg-card px-2 py-0.5 font-semibold text-caption text-muted-foreground tabular-nums transition-transform",x),c[5]=x,c[6]=o):o=c[6],c[7]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)("span",{"aria-hidden":"true",className:"text-[#f4b90b]",children:"⬡"}),c[7]=i):i=c[7],c[8]!==u||c[9]!==o?(l=(0,t.jsxs)("span",{className:o,title:"Influence â earned by tagging, confirming, and publishing",children:[i,u]}),c[8]=u,c[9]=o,c[10]=l):l=c[10],l}var ty=e.i(609579),tS=e.i(744864),tv=e.i(195184),tw=e.i(244245),tN=e.i(886806),tI=e.i(26620),tk=e.i(184762);function tC(){return window.IJRNative}function tM(e,t){return fetch(e,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).catch(()=>void 0)}let t_=[1,2,3,4,5];function tD(){let e,a,r,s,o,i,l,c=(0,n.c)(34),d=(0,tI.useCurrentProduct)();c[0]===Symbol.for("react.memo_cache_sentinel")?(e=eu.apiRoutes.productsRate(),c[0]=e):e=c[0];let{data:u,error:m,mutate:h}=(0,B.default)(e,em.fetcher,ef.SWR_STATIC),[p,x]=(0,O.useState)(0),[f,b]=(0,O.useState)(0),[g,j]=(0,O.useState)(""),y=u?.mine.some(e=>e.productId===d.id);if(m||!u||y&&0===f)return null;c[1]!==h||c[2]!==f||c[3]!==d.id?(a=()=>{(0,tN.toast)({type:"success",description:"Thank you â your rating's been saved to your profile. Change it anytime in Settings â Profile."}),h(e=>({averages:e?.averages??[],mine:[...(e?.mine??[]).filter(e=>e.productId!==d.id),{productId:d.id,rating:f}]}),{revalidate:!1}),b(0)},c[1]=h,c[2]=f,c[3]=d.id,c[4]=a):a=c[4];let S=a;c[5]!==d.id||c[6]!==S?(r=e=>{if(b(e),tM(eu.apiRoutes.productsRate(),{productId:d.id,rating:e}),5===e){tM(eu.apiRoutes.growth.reviewFeedback(),{sentiment:"positive",platform:tC()?.canRequestReview?"ios":"web",productId:d.id,rating:e}),tM(eu.apiRoutes.growth.milestone(),{key:"app_review"});let t=tC();t?.canRequestReview&&t.requestReview?.(),S()}},c[5]=d.id,c[6]=S,c[7]=r):r=c[7];let v=r;c[8]!==g||c[9]!==f||c[10]!==d.id||c[11]!==S?(s=()=>{tM(eu.apiRoutes.growth.reviewFeedback(),{sentiment:"negative",message:g.trim()||void 0,platform:tC()?.canRequestReview?"ios":"web",productId:d.id,rating:f}),S()},c[8]=g,c[9]=f,c[10]=d.id,c[11]=S,c[12]=s):s=c[12];let w=s;if(f>0&&f<5){let e,n,a,r,s,o,i,l;return c[13]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("p",{className:"font-medium text-meta text-foreground",children:"What would make it better?"}),n=(0,t.jsx)("p",{className:"text-caption text-muted-foreground leading-4",children:"This goes straight to our team."}),c[13]=e,c[14]=n):(e=c[13],n=c[14]),c[15]===Symbol.for("react.memo_cache_sentinel")?(a=e=>j(e.target.value),c[15]=a):a=c[15],c[16]!==g?(r=(0,t.jsx)(tk.Textarea,{className:"mt-1.5 h-14 min-h-0 rounded-md px-2 py-1.5 text-meta",onChange:a,placeholder:"The one thing we should fixâ¦",value:g}),c[16]=g,c[17]=r):r=c[17],c[18]!==w?(s=(0,t.jsx)(eb.Button,{onClick:w,size:"xs",type:"button",children:"Send"}),c[18]=w,c[19]=s):s=c[19],c[20]!==S?(o=(0,t.jsx)(eb.Button,{onClick:S,size:"xs",type:"button",variant:"ghost",children:"Skip"}),c[20]=S,c[21]=o):o=c[21],c[22]!==s||c[23]!==o?(i=(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[s,o]}),c[22]=s,c[23]=o,c[24]=i):i=c[24],c[25]!==i||c[26]!==r?(l=(0,t.jsxs)("div",{className:"mt-auto px-3 pt-3 pb-2 group-data-[collapsible=icon]:hidden",children:[e,n,r,i]}),c[25]=i,c[26]=r,c[27]=l):l=c[27],l}return c[28]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)("span",{className:"text-caption text-muted-foreground",children:"Rate this app"}),c[28]=o):o=c[28],c[29]!==p||c[30]!==v?(i=t_.map(e=>(0,t.jsx)("button",{"aria-label":`Rate ${e} star${1===e?"":"s"}`,className:"rounded p-0.5 transition-transform hover:scale-110",onClick:()=>v(e),onMouseEnter:()=>x(e),onMouseLeave:()=>x(0),type:"button",children:(0,t.jsx)(tw.StarIcon,{className:(0,em.cn)("size-3.5 transition-colors",e<=p?"fill-amber-400 text-amber-400":"text-muted-foreground
2/50")})},e)),c[29]=p,c[30]=v,c[31]=i):i=c[31],c[32]!==i?(l=(0,t.jsxs)("div",{className:"mt-auto flex items-center justify-between gap-2 px-3 pt-3 pb-2 group-data-[collapsible=icon]:hidden",children:[o,(0,t.jsx)("div",{className:"flex items-center",children:i})]}),c[32]=i,c[33]=l):l=c[33],l}var tP=e.i(861912),tT=e.i(496242),tR=e.i(260258);function tA(){let e,r,s,o,i=(0,n.c)(8),{actor:l}=(0,a.useAuth)(),{user:c}=(0,tP.useUser)(),d=(0,tR.useSignOut)();if(!l)return null;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(tT.ShieldAlertIcon,{className:"size-4 shrink-0 text-amber-600"}),i[0]=e):e=i[0];let u=c?.primaryEmailAddress?.emailAddress??"user";return i[1]!==u?(r=(0,t.jsxs)("span",{className:"text-meta",children:["Impersonating"," ",(0,t.jsx)("span",{className:"font-semibold",children:u})," ","â they cannot see this session"]}),i[1]=u,i[2]=r):r=i[2],i[3]!==d?(s=(0,t.jsx)("button",{className:"rounded-full border border-amber-500/50 px-2.5 py-1 font-medium text-caption transition-colors hover:bg-amber-500/20",onClick:d,type:"button",children:"End impersonation"}),i[3]=d,i[4]=s):s=i[4],i[5]!==r||i[6]!==s?(o=(0,t.jsxs)("div",{className:"-translate-x-1/2 fixed bottom-4 left-1/2 z-50 flex items-center gap-2.5 rounded-full border border-amber-500/50 bg-amber-500/10 px-4 py-2 shadow-[var(--shadow-float)] backdrop-blur-xl",children:[e,r,s]}),i[5]=r,i[6]=s,i[7]=o):o=i[7],o}var tz=e.i(289608),tE=e.i(698394),tO=e.i(992459),tB=e.i(817830),tF=e.i(978935),tL=e.i(159490),tH=e.i(865974),tq=e.i(528008);function tG(){let e,a,r,s,o,i,l,c,d,u,m,h,p=(0,n.c)(44),x=(0,z.usePathname)(),f=(0,tL.useCloseMobileNav)(),[b,g]=(0,O.useState)(!1),{conversations:j,requests:y}=(0,tq.useInbox)();p[0]!==x?(e=x?.startsWith("/messages/")?x.slice(10):"",p[0]=x,p[1]=e):e=p[1];let S=e;if(p[2]!==S||p[3]!==f||p[4]!==j||p[5]!==x||p[6]!==y.length){let e,n,d,u;s=j.slice(0,8),r=ed.SidebarGroup,l="group-data-[collapsible=icon]:hidden",p[14]!==f?(e=(0,t.jsx)(ed.SidebarGroupLabel,{asChild:!0,className:"hover:text-foreground",children:(0,t.jsx)(A.default,{href:"/messages",onClick:f,children:"Messages"})}),p[14]=f,p[15]=e):e=p[15],p[16]===Symbol.for("react.memo_cache_sentinel")?(n=()=>g(!0),p[16]=n):n=p[16],p[17]===Symbol.for("react.memo_cache_sentinel")?(d=(0,t.jsx)("button",{"aria-label":"New message",className:"grid size-6 place-items-center rounded-md text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground",onClick:n,type:"button",children:(0,t.jsx)(tB.SquarePenIcon,{className:"size-3.5"})}),p[17]=d):d=p[17],p[18]!==e?(c=(0,t.jsxs)("div",{className:"flex items-center justify-between pr-1",children:[e,d]}),p[18]=e,p[19]=c):c=p[19],a=ed.SidebarMenu,p[20]!==f||p[21]!==x||p[22]!==y.length?(o=y.length>0?(0,t.jsx)(ed.SidebarMenuItem,{children:(0,t.jsx)(ed.SidebarMenuButton,{asChild:!0,isActive:"/messages"===x,tooltip:"Requests",children:(0,t.jsxs)(A.default,{href:"/messages",onClick:f,children:[(0,t.jsx)(tE.InboxIcon,{}),(0,t.jsx)("span",{className:"flex-1 truncate",children:"Requests"}),(0,t.jsx)("span",{className:"text-meta text-sidebar-foreground/60 tabular-nums",children:y.length})]})})}):null,p[20]=f,p[21]=x,p[22]=y.length,p[23]=o):o=p[23],p[24]!==S||p[25]!==f?(u=e=>{let n=e.unread>0,a=(0,tq.threadHref)(e.key);return(0,t.jsx)(ed.SidebarMenuItem,{children:(0,t.jsx)(ed.SidebarMenuButton,{asChild:!0,isActive:a===`/messages/${S}`,tooltip:e.name,children:(0,t.jsxs)(A.default,{href:a,onClick:t=>{(0,el.openInDock)(t,e.key),f()},children:[(0,t.jsxs)("span",{className:"relative shrink-0",children:[(0,t.jsx)(ei.Avatar,{name:e.name,remote:!0,size:"xs",src:e.avatarUrl}),e.provider?(0,t.jsx)(tH.ProviderMark,{className:"-right-1 -bottom-1 absolute size-3.5",provider:e.provider}):null]}),(0,t.jsx)("span",{className:(0,em.cn)("flex-1 truncate",n&&"font-semibold text-sidebar-foreground"),children:e.name}),n?(0,t.jsx)(er.UnreadBadge,{count:e.unread}):null]})})},a)},p[24]=S,p[25]=f,p[26]=u):u=p[26],i=s.map(u),p[2]=S,p[3]=f,p[4]=j,p[5]=x,p[6]=y.length,p[7]=a,p[8]=r,p[9]=s,p[10]=o,p[11]=i,p[12]=l,p[13]=c}else a=p[7],r=p[8],s=p[9],o=p[10],i=p[11],l=p[12],c=p[13];return p[27]!==f||p[28]!==y.length||p[29]!==s.length?(d=0===s.length&&0===y.length?(0,t.jsx)(ed.SidebarMenuItem,{children:(0,t.jsx)(ed.SidebarMenuButton,{asChild:!0,tooltip:"Messages",children:(0,t.jsxs)(A.default,{href:"/messages",onClick:f,children:[(0,t.jsx)(tO.MessageCircleIcon,{}
2),(0,t.jsx)("span",{className:"text-sidebar-foreground/70",children:"No messages yet"})]})})}):null,p[27]=f,p[28]=y.length,p[29]=s.length,p[30]=d):d=p[30],p[31]!==a||p[32]!==o||p[33]!==i||p[34]!==d?(u=(0,t.jsxs)(a,{children:[o,i,d]}),p[31]=a,p[32]=o,p[33]=i,p[34]=d,p[35]=u):u=p[35],p[36]!==b?(m=(0,t.jsx)(tF.NewMessageDialog,{onOpenChange:g,open:b}),p[36]=b,p[37]=m):m=p[37],p[38]!==r||p[39]!==l||p[40]!==c||p[41]!==u||p[42]!==m?(h=(0,t.jsxs)(r,{className:l,children:[c,u,m]}),p[38]=r,p[39]=l,p[40]=c,p[41]=u,p[42]=m,p[43]=h):h=p[43],h}var t$=e.i(889602),tU=e.i(248333),tW=e.i(162545),tK=e.i(788107),tY=e.i(514897),tJ=e.i(265917),tV=e.i(111369),tQ=e.i(546338),tX=e.i(423241),tZ=e.i(473805),t0=e.i(146445),t1=e.i(397728),t2=e.i(461731);let t4=[{id:"recent",label:"Recent",icon:tZ.ClockIcon},{id:"starred",label:"Starred",icon:tw.StarIcon},{id:"shared",label:"Shared",icon:t1.Share2Icon},{id:"activity",label:"Activity",icon:t$.ActivityIcon},{id:"trash",label:"Trash",icon:eL.Trash2Icon}];function t3(e){let a,r,s,o,i,l,c,d=(0,n.c)(23),{data:u,closeMobileNav:m}=e;if(d[0]!==m||d[1]!==u.hasTeamFolder||d[2]!==u.org||d[3]!==u.teamFolderOpen?(a=u.hasTeamFolder&&u.org&&(0,t.jsx)(ed.SidebarMenuSubItem,{children:(0,t.jsx)(ed.SidebarMenuSubButton,{asChild:!0,className:"text-sidebar-accent-foreground",isActive:u.teamFolderOpen,children:(0,t.jsxs)(A.default,{href:"/drive?team=1",onClick:m,children:[(0,t.jsx)(eH.UsersIcon,{className:"text-indigo-500"}),(0,t.jsxs)("span",{children:["Shared with ",u.org.name]})]})})}),d[0]=m,d[1]=u.hasTeamFolder,d[2]=u.org,d[3]=u.teamFolderOpen,d[4]=a):a=d[4],d[5]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(et.SparklesIcon,{className:"text-indigo-500"}),s=(0,t.jsx)("span",{children:"Genius"}),d[5]=r,d[6]=s):(r=d[5],s=d[6]),d[7]!==m?(o=(0,t.jsxs)(A.default,{href:"/drive?type=chat",onClick:m,children:[r,s]}),d[7]=m,d[8]=o):o=d[8],d[9]!==u.geniusFolderOpen||d[10]!==o?(i=(0,t.jsx)(ed.SidebarMenuSubItem,{children:(0,t.jsx)(ed.SidebarMenuSubButton,{asChild:!0,className:"text-sidebar-accent-foreground",isActive:u.geniusFolderOpen,children:o})}),d[9]=u.geniusFolderOpen,d[10]=o,d[11]=i):i=d[11],d[12]!==m||d[13]!==u.activeFolderId||d[14]!==u.folders){let e;d[16]!==m||d[17]!==u.activeFolderId?(e=e=>(0,t.jsx)(ed.SidebarMenuSubItem,{children:(0,t.jsx)(ed.SidebarMenuSubButton,{asChild:!0,className:"text-sidebar-accent-foreground",isActive:u.activeFolderId===e.id,children:(0,t.jsxs)(A.default,{href:`/drive?folder=${encodeURIComponent(e.id)}`,onClick:m,children:[(0,t.jsx)(eR.FolderIcon,{className:"text-amber-500"}),(0,t.jsx)("span",{children:e.name})]})})},e.id),d[16]=m,d[17]=u.activeFolderId,d[18]=e):e=d[18],l=u.folders.map(e),d[12]=m,d[13]=u.activeFolderId,d[14]=u.folders,d[15]=l}else l=d[15];return d[19]!==a||d[20]!==i||d[21]!==l?(c=(0,t.jsxs)(t.Fragment,{children:[a,i,l]}),d[19]=a,d[20]=i,d[21]=l,d[22]=c):c=d[22],c}function t5(e){let a,r,s,o,i=(0,n.c)(10),{open:l,className:c}=e,d=l?"Collapse Drive":"Expand Drive";i[0]!==c?(a=(0,em.cn)("flex size-5 shrink-0 items-center justify-center rounded-sm text-sidebar-foreground/50 hover:bg-sidebar-accent hover:text-sidebar-foreground group-data-[collapsible=icon]:hidden",c),i[0]=c,i[1]=a):a=i[1];let u=l&&"rotate-90";return i[2]!==u?(r=(0,em.cn)("size-3.5 transition-transform",u),i[2]=u,i[3]=r):r=i[3],i[4]!==r?(s=(0,t.jsx)(eD.ChevronRightIcon,{className:r}),i[4]=r,i[5]=s):s=i[5],i[6]!==d||i[7]!==a||i[8]!==s?(o=(0,t.jsx)(tV.CollapsibleTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":d,className:a,type:"button",children:s})}),i[6]=d,i[7]=a,i[8]=s,i[9]=o):o=i[9],o}let t6="openserve:drive-row-open";function t7(){let e=(0,tL.useCloseMobileNav)(),a=(0,z.usePathname)().startsWith("/drive"),r=function(){let e,t,a,r,s,o,i,l,c=(0,n.c)(22),d=(0,z.useSearchParams)();c[0]!==d?(e=d.get("folder"),c[0]=d,c[1]=e):e=c[1];let u=e;c[2]!==d?(t=d.get("view"),c[2]=d,c[3]=t):t=c[3];let m=t;c[4]!==d?(a="chat"===d.get("type")||"1"===d.get("chats"),c[4]=d,c[5]=a):a=c[5];let h=a,{raw:p}=(0,t2.useUserSettings)();c[6]!==p.driveFolders?(r=Array.isArray(p.driveFolders)?p.driveFolders:[],c[6]=p.driveFolders,c[7]=r):r=c[7];let x=r,{org:f}=(0,H.useActiveOrg)();c[8]!==d?(s=d.get("team"),c[8]=d,c[9]=s):s=c[9];let b="1"===s;c[10]!==f?(o=f?eu.apiRoutes.driveWorkspace.list(f.id):null,c[10]=f,c[11]=o):o=c[11],c[12]===Symbol.for("react.memo_cache_sentinel")?(i={revalidateOnFocus:!1},c[12]=i):i=c[12];let{data:g}=(0,B.default)(o,em.fetcher,i),j=!!f&&(g?.documents.length??0)>0,y=!(u||m||h||b);return c[13]!==u||c[14]!==m||c[15]!==x||c[16]!==h||c[17]!==j||c[18]!==y||c[19]!==f||c[20]!==b?(l={activeFolderId:u,activeView:m,folders:x,geniusFolderOpen:h,org:f,teamFolderOpen:b,hasTeamFolder:j,onAllFiles:y},c[13]=u,c[14]=m,c[15]=x,c[16]=h,c[17]=j,c[18]=y,c[19]=f,c[20]=b,c[21]=l):l=c[21],l}(),[s,o]=(0,O.useState)(null);(0,O.useEffect)(()=>{try{let e=window.localStorage.getItem(t6);("1"===e||"0"===e)&&o("1"===e)}catch{}},[]);let i=s??a;return(0,t.jsx)(ed.SidebarMenuItem,{children:(0,t.jsxs)(tV.Collapsible,{onOpenChange:e=>{o(e);try{window.localStorage.setItem(t6,e?"1":"0")}catch{}},open:i,children:[(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(ed.SidebarMenuButton,{asChild:!0,isActive:a&&r.onAllFiles,tooltip:"Drive",children:(0,t.jsxs)(A.default,{href:"/drive",onClick:e,children:[(0,t.jsx)(t0.HardDriveIcon,{className:"size-4"}),(0,t.jsx)("span",{children:"Drive"})]})}),(0,t.jsx)(t5,{className:"mr-1",open:i})]}),(0,t.jsx)(tV.CollapsibleContent,{children:(0,t.jsxs)(ed.SidebarMenuSub,{className:"mx-0 border-l-0 pr-2 pl-6",children:[(0,t.jsx)(t3,{closeMobileNav:e,data:r}),t4.map(n=>(0,t.jsx)(ed.SidebarMenuSubItem,{children:(0,t.jsx)(ed.SidebarMenuSubButton,{asChild:!0,className:"text-sidebar-accent-foreground",isActive:a&&r.activeView===n.id,children:(0,t.jsxs)(A.default,{href:`/drive?view=${n.id}`,onClick:e,children:[(0,t.jsx)(n.icon,{}),(0,t.jsx)("span",{children:n.label})]})})},n.id))]})})]})})}let t8="ijr:rail:analytics-open",t9={audience:eH.UsersIcon,content:tY.NewspaperIcon,reach:tW.MegaphoneIcon,revenue:tU.CircleDollarSignIcon,interface:tK.MousePointerClickIcon};function ne({userId:e}){let n=(0,tL.useCloseMobileNav)(),a=(0,z.usePathname)(),r=(0,z.useSearchParams)(),s=a.startsWith("/analytics"),o=a.startsWith("/users"),i=s?r.get("section"):null,l=(0,tX.useActiveSpace)(),{data:c}=(0,B.default)([eu.apiRoutes.admin.me(),e],([e])=>(0,em.fetcher)(e),{revalidateOnFocus:!1}),{org:d}=(0,H.useActiveOrg)(),[u,m]=(0,O.useState)(null);if((0,O.useEffect)(()=>{try{let e=window.localStorage.getItem(t8);("1"===e||"0"===e)&&m("1"===e)}catch{}},[]),!(c?.role==="superadmin"||c?.role==="admin"||d||l?.template==="creator"))return null;let h=u??(s||o);return(0,t.jsx)(ed.SidebarMenuItem,{children:(0,t.jsxs)(tV.Collapsible,{onOpenChange:e=>{m(e);try{window.localStorage.setItem(t8,e?"1":"0")}catch{}},open:h,children:[(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(ed.SidebarMenuButton,{asChild:!0,isActive:s&&!i,tooltip:"Heartbeat",children:(0,t.jsxs)(A.default,{href:"/analytics",onClick:n,children:[(0,t.jsx)(t$.ActivityIcon,{className:"size-4"}),(0,t.jsx)("span",{children:"Heartbeat"})]})}),(0,t.jsx)(t5,{className:"mr-1",open:h})]}),(0,t.jsx)(tV.CollapsibleContent,{children:(0,t.jsxs)(ed.SidebarMenuSub,{className:"mx-0 border-l-0 pr-2 pl-6",children:[tQ.ANALYTICS_SECTIONS.map(e=>{let a=t9[e.id];return(0,t.jsx)(ed.SidebarMenuSubItem,{children:(0,t.jsx)(ed.SidebarMenuSubButton,{asChild:!0,className:"text-sidebar-accent-foreground",isActive:i===e.id,children:(0,t.jsxs)(A.default,{href:(0,tQ.analyticsHref)(e.id),onClick:n,children:[(0,t.jsx)(a,{className:"size-3.5"}),(0,t.jsx)("span",{children:(0,tQ.sectionLabel)(e,l?.template)})]})})},e.id)}),(0,t.jsx)(ed.SidebarMenuSubItem,{children:(0,t.jsx)(ed.SidebarMenuSubButton,{asChild:!0,className:"text-sidebar-accent-foreground",isActive:o,children:(0,t.jsxs)(A.default,{href:"/users",onClick:n,children:[(0,t.jsx)(tJ.UsersRoundIcon,{className:"size-3.5"}),(0,t.jsx)("span",{children:"Users"})]})})})]})})]})})}var nt=e.i(872854),nn=e.i(520193),na=e.i(454920),nr=e.i(171422);let ns="ijr:rail:plugins-open",no={media:i.ClapperboardIcon,music:nn.Music2Icon,news:tY.NewspaperIcon,books:nt.BookOpenIcon},ni=[{id:"connectors",label:"Connectors",icon:na.PlugZapIcon},...nr.MEDIA_HUB.map(e=>({id:e.id,label:e.label,icon:no[e.id]??q.PuzzleIcon}))];function nl(){let e=(0,tL.useCloseMobileNav)(),n=(0,z.usePathname)(),a=(0,z.useSearchParams)(),r=n.startsWith("/plugins"),s=r?a.get("tab")??"connectors":null,[o,i]=(0,O.useState)(null);(0,O.useEffect)(()=>{try{let e=window.localStorage.getItem(ns);("1"===e||"0"===e)&&i("1"===e)}catch{}},[]);let l=o??r;return(0,t.jsx)(ed.SidebarMenuItem,{children:(0,t.jsxs)(tV.Collapsible,{onOpenChange:e=>{i(e);try{window.localStorage.setItem(ns,e?"1":"0")}catch{}},open:l,children:[(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(ed.SidebarMenuButton,{asChild:!0,isActive:r&&!a.get("tab"),tooltip:"My Plugins",children:(0,t.jsxs)(A.default,{href:"/plugins",onClick:e,children:[(0,t.jsx)(q.PuzzleIcon,{className:"size-4"}),(0,t.jsx)("span",{children:"My Plugins"})]})}),(0,t.jsx)(t5,{className:"mr-1",open:l})]}),(0,t.jsx)(tV.CollapsibleContent,{children:(0,t.jsx)(ed.SidebarMenuSub,{className:"mx-0 border-l-0 pr-2 pl-6",children:ni.map(n=>{let a=n.icon;return(0,t.jsx)(ed.SidebarMenuSubItem,{children:(0,t.jsx)(ed.SidebarMenuSubButton,{asChild:!0,isActive:s===n.id,children:(0,t.jsxs)(A.default,{href:`/plugins?tab=${n.id}`,onClick:e,children:[(0,t.jsx)(a,{className:"size-4"}),(0,t.jsx)("span",{children:n.label})]})})},n.id)})})})]})})}var nc=e.i(571718);
2function nd(e){let a,r,s,o,i,l,c,d,u,m,h,p=(0,n.c)(23),{userId:x}=e,f=(0,tL.useCloseMobileNav)(),b=(0,z.usePathname)(),g=(0,z.useSearchParams)();p[0]!==b?(a=b.startsWith("/users"),p[0]=b,p[1]=a):a=p[1];let j=a;p[2]!==j||p[3]!==g?(r=j?g.get("view"):null,p[2]=j,p[3]=g,p[4]=r):r=p[4];let y=r;p[5]===Symbol.for("react.memo_cache_sentinel")?(s=eu.apiRoutes.admin.me(),p[5]=s):s=p[5],p[6]!==x?(o=[s,x],p[6]=x,p[7]=o):o=p[7],p[8]===Symbol.for("react.memo_cache_sentinel")?(i={revalidateOnFocus:!1},p[8]=i):i=p[8];let{data:S}=(0,B.default)(o,nu,i),{org:v}=(0,H.useActiveOrg)(),w=S?.role==="superadmin"||S?.role==="admin";return!S||w||v?null:(p[9]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)(tJ.UsersRoundIcon,{className:"size-4"}),c=(0,t.jsx)("span",{children:"Users"}),p[9]=l,p[10]=c):(l=p[9],c=p[10]),p[11]!==f?(d=(0,t.jsxs)(A.default,{href:nc.USERS_CONTACTS_HREF,onClick:f,children:[l,c]}),p[11]=f,p[12]=d):d=p[12],p[13]!==j||p[14]!==d?(u=(0,t.jsx)(ed.SidebarMenuButton,{asChild:!0,isActive:j,tooltip:"Users",children:d}),p[13]=j,p[14]=d,p[15]=u):u=p[15],p[16]!==f||p[17]!==j||p[18]!==y?(m=j?(0,t.jsxs)(ed.SidebarMenuSub,{className:"mx-0 border-l-0 pr-2 pl-6",children:[(0,t.jsx)(ed.SidebarMenuSubItem,{children:(0,t.jsx)(ed.SidebarMenuSubButton,{asChild:!0,className:"text-sidebar-accent-foreground",isActive:"companies"!==y&&"members"!==y,children:(0,t.jsx)(A.default,{href:nc.USERS_CONTACTS_HREF,onClick:f,children:(0,t.jsx)("span",{children:"Contacts"})})})}),(0,t.jsx)(ed.SidebarMenuSubItem,{children:(0,t.jsx)(ed.SidebarMenuSubButton,{asChild:!0,className:"text-sidebar-accent-foreground",isActive:"companies"===y,children:(0,t.jsx)(A.default,{href:nc.USERS_COMPANIES_HREF,onClick:f,children:(0,t.jsx)("span",{children:"Companies"})})})}),(0,t.jsx)(ed.SidebarMenuSubItem,{children:(0,t.jsx)(ed.SidebarMenuSubButton,{asChild:!0,className:"text-sidebar-accent-foreground",isActive:"members"===y,children:(0,t.jsx)(A.default,{href:nc.USERS_MEMBERS_HREF,onClick:f,children:(0,t.jsx)("span",{children:"Members"})})})})]}):null,p[16]=f,p[17]=j,p[18]=y,p[19]=m):m=p[19],p[20]!==m||p[21]!==u?(h=(0,t.jsxs)(ed.SidebarMenuItem,{children:[u,m]}),p[20]=m,p[21]=u,p[22]=h):h=p[22],h)}function nu(e){let[t]=e;return(0,em.fetcher)(t)}var nm=e.i(543758),nh=e.i(576698),np=e.i(155994),nx=e.i(152168),nf=e.i(113772);function nb(){let e,t,a,r=(0,n.c)(11),{raw:s,update:o,isLoading:i}=(0,t2.useUserSettings)(),{skin:l,setSkin:c}=(0,nx.useSkin)(),{setTheme:d}=(0,E.useTheme)(),u=(0,O.useRef)(!1),m=s.appearance,h=m?.skin;if(r[0]!==h)e=nx.SKINS.some(e=>e.id===h)?h:void 0,r[0]=h,r[1]=e;else e=r[1];let p=e;return r[2]!==m||r[3]!==i||r[4]!==p||r[5]!==c||r[6]!==d||r[7]!==l||r[8]!==o?(t=()=>{if(!i){if(!u.current){if(u.current=!0,p&&p!==l){let e=nx.SKINS.find(e=>e.id===p);e&&(c(e.id),d(e.mode))}return}!p&&(l===nx.DEFAULT_SKIN||"daylight"===l)||(0,nf.isCustomSkin)(l)||l!==p&&o({appearance:{...m,skin:l}})}},a=[i,p,l,c,d,o,m],r[2]=m,r[3]=i,r[4]=p,r[5]=c,r[6]=d,r[7]=l,r[8]=o,r[9]=t,r[10]=a):(t=r[9],a=r[10]),(0,O.useEffect)(t,a),null}var ng=e.i(462187),nj=e.i(403094),ny=e.i(563796),nS=e.i(644702),nv=e.i(986925),nw=e.i(765509),nN=e.i(956947);function nI(e){let t=0;for(let n of e)t=n.charCodeAt(0)+((t<<5)-t);return Math.abs(t)%360}let nk=new WeakMap;function nC(){let e,a=(0,n.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(ed.SidebarGroup,{className:"group-data-[collapsible=icon]:hidden",children:(0,t.jsx)(tz.LoadingState,{className:"px-2 py-1",rows:4})}),a[0]=e):e=a[0],e}function nM(e){let a,r,s=(0,n.c)(5),{loader:o,authed:i}=e;s[0]!==o?(a=function(e){let t=nk.get(e);if(t)return t;let n=(0,R.default)(e,{loading:nC});return nk.set(e,n),n}(o),s[0]=o,s[1]=a):a=s[1];let l=a;return s[2]!==l||s[3]!==i?(r=(0,t.jsx)(l,{authed:i}),s[2]=l,s[3]=i,s[4]=r):r=s[4],r}function n_(e){let a,r,s,o,i=(0,n.c)(7),{user:l}=e,[c,d]=(0,O.useState)(!1),[u,m]=(0,O.useState)("general");return i[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{let e=new URL(window.location.href).searchParams.get("settings");e&&(0,np.isSettingsSection)(e)&&(m(e),d(!0))},r=[],i[0]=a,i[1]=r):(a=i[0],r=i[1]),(0,O.useEffect)(a,r),i[2]===Symbol.for("react.memo_cache_sentinel")?(s=e=>{if(d(e),!e){let e=new URL(window.location.href);e.searchParams.has("settings")&&(e.searchParams.delete("settings"),window.history.replaceState(null,"",`${e.pathname}${e.search}${e.hash}`))}},i[2]=s):s=i[2],i[3]!==c||i[4]!==u||i[5]!==l?(o=(0,t.jsx)(np.SettingsDialog,{initialSection:u,onOpenChange:s,open:c,user:l}),i[3]=c,i[4]=u,i[5]=l,i[6]=o):o=i[6],o}function nD(e){let a,r=(0,n.c)(9),{user:s,hideInfluence:o}=e,i=void 0!==o&&o;if(s){let e,n,a;return r[0]!==s?(e=(0,t.jsx)(n1,{user:s}),r[0]=s,r[1]=e):e=r[1],r[2]!==i||r[3]!==s?(n=i?null:(0,t.jsx)(A.default,{className:"absolute inset-y-0 right-2 flex items-center transition-transform hover:scale-105 group-data-[collapsible=icon]:hidden",href:`/reader/${s.id}`,onClick:nP,title:"Your profile â manage and add Influence",children:(0,t.jsx)(tj,{})}),r[2]=i,r[3]=s,r[4]=n):n=r[4],r[5]!==e||r[6]!==n?(a=(0,t.jsxs)("div",{className:"relative group-data-[collapsible=icon]:flex group-data-[collapsible=icon]:justify-center",children:[e,n]}),r[5]=e,r[6]=n,r[7]=a):a=r[7],a}return r[8]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)(nT,{}),r[8]=a):a=r[8],a}function nP(e){return e.stopPropagation()}function nT(){let e,r,s,o,i=(0,n.c)(8),{isLoaded:l,isSignedIn:c}=(0,a.useAuth)(),d=(0,z.useRouter)(),u=(0,O.useRef)(!1);if(i[0]!==l||i[1]!==c||i[2]!==d?(e=()=>{l&&c&&!u.current&&(u.current=!0,d.refresh())},r=[l,c,d],i[0]=l,i[1]=c,i[2]=d,i[3]=e,i[4]=r):(e=i[3],r=i[4]),(0,O.useEffect)(e,r),!l){let e;return i[5]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("div",{className:"mt-1 h-[104px] animate-pulse rounded-xl border border-sidebar-border/80 bg-card/40 group-data-[collapsible=icon]:hidden"}),i[5]=e):e=i[5],e}return c?null:(i[6]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(ed.SidebarMenuItem,{children:(0,t.jsx)(nE,{})}),i[6]=s):s=i[6],i[7]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(ed.SidebarMenu,{children:[s,(0,t.jsx)(ed.SidebarMenuItem,{className:"hidden group-data-[collapsible=icon]:block",children:(0,t.jsx)(nA,{})})]}),(0,t.jsx)(nz,{}),(0,t.jsx)(nR,{})]}),i[7]=o):o=i[7],o)}function nR(){let e,a=(0,n.c)(1),r=(0,F.useBrand)();return r?.id!=="openserve"?null:(a[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(A.default,{className:"mt-1 block px-1 pb-1 text-center text-[11px] text-muted-foreground
2/70 transition-colors hover:text-foreground group-data-[collapsible=icon]:hidden",href:"/company",children:"OpenServe Holdings"}),a[0]=e):e=a[0],e)}function nA(){let e,a,r,s,o=(0,n.c)(6),i=(0,tS.useAuthModal)();return o[0]!==i?(e=()=>i("signin"),o[0]=i,o[1]=e):e=o[1],o[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)(g.LogInIcon,{}),r=(0,t.jsx)("span",{children:"Log in"}),o[2]=a,o[3]=r):(a=o[2],r=o[3]),o[4]!==e?(s=(0,t.jsxs)(ed.SidebarMenuButton,{onClick:e,tooltip:"Log in",children:[a,r]}),o[4]=e,o[5]=s):s=o[5],s}function nz(){let e,a,r,s,o,i,l=(0,n.c)(16),c=(0,F.useBrand)(),d=(0,z.usePathname)();l[0]!==c||l[1]!==d?(e=(0,nv.isCharactersSurface)(d,c),l[0]=c,l[1]=d,l[2]=e):e=l[2];let u=e,m=u?"Your cast remembers you":c&&"ijr"!==c.id?"Pick up where you left off":"Get above the noise";l[3]!==c||l[4]!==u?(a=u?"Log in to keep every conversation â characters pick up right where you left off.":c&&"ijr"!==c.id?(0,nv.brandDisplayText)("Log in for answers tailored to you â saved chats, your topics, and the full IJR suite.",c):"Log in to follow your topics, join the conversation, and publish a journal of your own.",l[3]=c,l[4]=u,l[5]=a):a=l[5];let h=a,p=(0,tS.useAuthModal)();return l[6]!==m?(r=(0,t.jsx)("p",{className:"font-semibold text-[13px] text-foreground",children:m}),l[6]=m,l[7]=r):r=l[7],l[8]!==h?(s=(0,t.jsx)("p",{className:"mt-1 text-[12px] text-muted-foreground leading-4",children:h}),l[8]=h,l[9]=s):s=l[9],l[10]!==p?(o=(0,t.jsx)(eb.Button,{className:"mt-3 h-8 w-full rounded-full",onClick:()=>p("signin"),variant:"outline",children:"Log in"}),l[10]=p,l[11]=o):o=l[11],l[12]!==r||l[13]!==s||l[14]!==o?(i=(0,t.jsxs)("div",{className:"mt-1 rounded-xl border border-sidebar-border/80 bg-card/60 p-3 group-data-[collapsible=icon]:hidden",children:[r,s,o]}),l[12]=r,l[13]=s,l[14]=o,l[15]=i):i=l[15],i}function nE(){let e,a,r,s,o=(0,n.c)(8),{skin:i,setSkin:l}=(0,nx.useSkin)(),{setTheme:c}=(0,E.useTheme)();return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(ec.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(ed.SidebarMenuButton,{tooltip:"Theme",children:[(0,t.jsx)(S.PaletteIcon,{}),(0,t.jsx)("span",{children:"Theme"})]})}),o[0]=e):e=o[0],o[1]!==l||o[2]!==c?(a=e=>{let t=nx.SKINS.find(t=>t.id===e);t&&(l(t.id),c(t.mode))},o[1]=l,o[2]=c,o[3]=a):a=o[3],o[4]===Symbol.for("react.memo_cache_sentinel")?(r=nx.FEATURED_SKINS.map(nO),o[4]=r):r=o[4],o[5]!==i||o[6]!==a?(s=(0,t.jsxs)(ec.DropdownMenu,{children:[e,(0,t.jsx)(ec.DropdownMenuContent,{align:"start",className:"w-56 rounded-lg border border-border/60 bg-card/95 shadow-[var(--shadow-float)] backdrop-blur-xl",side:"top",children:(0,t.jsx)(ec.DropdownMenuRadioGroup,{onValueChange:a,value:i,children:r})})]}),o[5]=i,o[6]=a,o[7]=s):s=o[7],s}function nO(e){return(0,t.jsx)(ec.DropdownMenuRadioItem,{className:"cursor-pointer text-[13px]",value:e.id,children:(0,t.jsxs)("span",{className:"flex flex-col",children:[(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:e.hint})]})},e.id)}let nB="mx-2 mt-1 flex h-9 shrink-0 items-center justify-center gap-1.5 rounded-lg bg-primary font-medium text-[13px] text-primary-foreground shadow-sm transition-all hover:bg-primary/90 active:scale-[0.98] group-data-[collapsible=icon]:mx-auto group-data-[collapsible=icon]:size-8 group-data-[collapsible=icon]:rounded-lg group-data-[collapsible=icon]:p-0 max-md:mx-3.5 max-md:h-11 max-md:rounded-xl max-md:bg-[image:var(--os-gradient,linear-gradient(100deg,#5b31e1,#d734c4))] max-md:font-bold max-md:text-[14px] max-md:text-white max-md:shadow-none",nF={plus:N.PlusIcon,character:T.UserRoundPlusIcon,doc:l.FilePenIcon,sheet:D.Table2Icon,slides:I.PresentationIcon,whiteboard:C.ShapesIcon,image:x.ImagePlusIcon,video:i.ClapperboardIcon,upload:P.UploadIcon,folder:c.FolderPlusIcon,game:d.Gamepad2Icon,build:m.HammerIcon,compose:w.PenIcon,ranked:b.ListOrderedIcon,battle:_.SwordsIcon};function nL(e){let a,r=(0,n.c)(14),{isGuest:s}=e,o=(0,z.usePathname)(),i=(0,F.useBrand)(),l=i?.id??null;r[0]!==s||r[1]!==o||r[2]!==l?(a=(0,nS.resolveNewAction)({pathname:o,brandId:l},!s),r[0]=s,r[1]=o,r[2]=l,r[3]=a):a=r[3];let c=a;switch(c?.kind){case"none":return null;case"news":{let e;return r[4]!==s?(e=(0,t.jsx)(nU,{isGuest:s}
2),r[4]=s,r[5]=e):e=r[5],e}case"meme":{let e;return r[6]!==s?(e=(0,t.jsx)(n$,{isGuest:s}),r[6]=s,r[7]=e):e=r[7],e}case"link":{let e;return r[8]!==c?(e=(0,t.jsx)(nH,{action:c}),r[8]=c,r[9]=e):e=r[9],e}case"menu":{let e;return r[10]!==c?(e=(0,t.jsx)(nq,{action:c}),r[10]=c,r[11]=e):e=r[11],e}default:{let e;return r[12]!==s?(e=(0,t.jsx)(nW,{isGuest:s}),r[12]=s,r[13]=e):e=r[13],e}}}function nH(e){let a,r,s,o,i,l=(0,n.c)(15),{action:c}=e,{setOpenMobile:d}=(0,ed.useSidebar)(),u=nF[c.icon??"plus"];return l[0]!==d?(a=()=>d(!1),l[0]=d,l[1]=a):a=l[1],l[2]!==c.gradient?(r=c.gradient?{background:"linear-gradient(120deg, #5b31e1, #d734c4)"}:void 0,l[2]=c.gradient,l[3]=r):r=l[3],l[4]!==u?(s=(0,t.jsx)(u,{className:"size-4"}),l[4]=u,l[5]=s):s=l[5],l[6]!==c.label?(o=(0,t.jsx)("span",{className:"group-data-[collapsible=icon]:hidden",children:c.label}),l[6]=c.label,l[7]=o):o=l[7],l[8]!==c.href||l[9]!==c.label||l[10]!==a||l[11]!==r||l[12]!==s||l[13]!==o?(i=(0,t.jsxs)(A.default,{"aria-label":c.label,className:nB,href:c.href,onClick:a,style:r,children:[s,o]}),l[8]=c.href,l[9]=c.label,l[10]=a,l[11]=r,l[12]=s,l[13]=o,l[14]=i):i=l[14],i}function nq(e){let a,r,s,o,i,l=(0,n.c)(15),{action:c}=e,d=(0,es.useRailNavigate)(),{setOpenMobile:u}=(0,ed.useSidebar)();l[0]!==d||l[1]!==u?(a=e=>{(u(!1),e.newTab)?window.open(e.href,"_blank","noopener,noreferrer"):d(e.href)},l[0]=d,l[1]=u,l[2]=a):a=l[2];let m=a;if(l[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(ec.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)("button",{"aria-label":"New",className:nB,type:"button",children:[(0,t.jsx)(N.PlusIcon,{className:"size-4"}),(0,t.jsx)("span",{className:"group-data-[collapsible=icon]:hidden",children:"New"})]})}),l[3]=r):r=l[3],l[4]!==c.groups||l[5]!==m){let e;l[7]!==m?(e=(e,n)=>(0,t.jsxs)(O.Fragment,{children:[n>0?(0,t.jsx)(ec.DropdownMenuSeparator,{}):null,e.map(e=>{let n=nF[e.icon];return(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-[13px]",onSelect:()=>m(e),children:[(0,t.jsx)(n,{className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{children:e.label})]},e.href)})]},e.map(nG).join("|")),l[7]=m,l[8]=e):e=l[8],s=c.groups.map(e),l[4]=c.groups,l[5]=m,l[6]=s}else s=l[6];return l[9]!==c.chat||l[10]!==m?(o=c.chat?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ec.DropdownMenuSeparator,{}),(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-[13px]",onSelect:()=>m({label:"",href:"/chat",icon:"plus"}),children:[(0,t.jsx)(j.MessageSquareIcon,{className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{children:"New AI Chat"})]})]}):null,l[9]=c.chat,l[10]=m,l[11]=o):o=l[11],l[12]!==s||l[13]!==o?(i=(0,t.jsxs)(ec.DropdownMenu,{children:[r,(0,t.jsxs)(ec.DropdownMenuContent,{align:"start",className:"w-56 whitespace-nowrap rounded-lg border border-border/60 bg-card/95 shadow-[var(--shadow-float)] backdrop-blur-xl",side:"bottom",sideOffset:6,children:[s,o]})]}),l[12]=s,l[13]=o,l[14]=i):i=l[14],i}function nG(e){return e.href}function n$(e){let a,r,s,o,i,l,c=(0,n.c)(13),{isGuest:d}=e,{setOpenMobile:u}=(0,ed.useSidebar)(),[m,h]=(0,O.useState)(!1);c[0]!==d||c[1]!==u?(a=()=>{d?window.location.assign("/login?next=/memes"):(u(!1),h(!0))},c[0]=d,c[1]=u,c[2]=a):a=c[2],c[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(N.PlusIcon,{className:"size-4"}),s=(0,t.jsx)("span",{className:"group-data-[collapsible=icon]:hidden",children:"New Meme"}),c[3]=r,c[4]=s):(r=c[3],s=c[4]),c[5]!==a?(o=(0,t.jsxs)("button",{"aria-label":"New meme",className:nB,onClick:a,type:"button",children:[r,s]}),c[5]=a,c[6]=o):o=c[6];let p=!d;return c[7]!==m||c[8]!==p?(i=(0,t.jsx)(ty.MemeComposerDialog,{authed:p,onOpenChange:h,open:m}),c[7]=m,c[8]=p,c[9]=i):i=c[9],c[10]!==o||c[11]!==i?(l=(0,t.jsxs)(t.Fragment,{children:[o,i]}),c[10]=o,c[11]=i,c[12]=l):l=c[12],l}function nU({isGuest:e}){let n=(0,z.useRouter)(),a=(0,es.useRailNavigate)(),{setOpenMobile:r}=(0,ed.useSidebar)(),[s,o]=(0,O.useState)(!1),{data:c}=(0,B.default)(e?null:eu.apiRoutes.journals.base(),em.fetcher,{revalidateOnFocus:!1}),d=c?.journals?.[0],m=e=>{r(!1),a(e)},h=async()=>{if(!s&&d){o(!0);try{let e=await fetch(eu.apiRoutes.journals.posts(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({journalId:d.id})}
2),t=await e.json().catch(()=>null);if(e.ok&&t?.post){r(!1);try{let e=await fetch(eu.apiRoutes.press.workFromPost(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({postId:t.post.id})}),a=await e.json().catch(()=>null);if(e.ok&&a?.work)return void n.push(`/write/${a.work.id}`)}catch{}n.push(`/journals/write/${t.post.id}`)}}finally{o(!1)}}},p=async()=>{if(!s&&d){o(!0);try{let e=await fetch(eu.apiRoutes.journals.site(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({journalId:d.id})}),t=await e.json().catch(()=>null);e.ok&&t?.editorUrl&&(r(!1),n.push(t.editorUrl))}finally{o(!1)}}};return d?(0,t.jsxs)(ec.DropdownMenu,{children:[(0,t.jsx)(ec.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)("button",{"aria-label":"New",className:nB,type:"button",children:[(0,t.jsx)(N.PlusIcon,{className:"size-4"}),(0,t.jsx)("span",{className:"group-data-[collapsible=icon]:hidden",children:"New"})]})}),(0,t.jsxs)(ec.DropdownMenuContent,{align:"start",className:"w-56 whitespace-nowrap rounded-lg border border-border/60 bg-card/95 shadow-[var(--shadow-float)] backdrop-blur-xl",side:"bottom",sideOffset:6,children:[(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-[13px]",disabled:s,onSelect:h,children:[(0,t.jsx)(l.FilePenIcon,{className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{children:"New Article"})]}),(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-[13px]",onSelect:()=>m(`/journals/${d.handle}`),children:[(0,t.jsx)(w.PenIcon,{className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{children:"New Post"})]}),(0,t.jsx)(ec.DropdownMenuSeparator,{}),(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-[13px]",onSelect:()=>m(`/studio?room=video&journal=${d.id}`),children:[(0,t.jsx)(i.ClapperboardIcon,{className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{children:"New Video"})]}),(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-[13px]",onSelect:()=>m(`/studio?room=audio&journal=${d.id}`),children:[(0,t.jsx)(y.MicIcon,{className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{children:"New Podcast"})]}),(0,t.jsx)(ec.DropdownMenuSeparator,{}),(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-[13px]",disabled:s,onSelect:p,children:[(0,t.jsx)(u.GlobeIcon,{className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{children:"Your Website"})]})]})]}):(0,t.jsxs)(A.default,{"aria-label":"New journal",className:nB,href:"/journals/new",onClick:()=>r(!1),children:[(0,t.jsx)(N.PlusIcon,{className:"size-4"}),(0,t.jsx)("span",{className:"group-data-[collapsible=icon]:hidden",children:"New Journal"})]})}function nW(e){let a,r,s,o,i,l=(0,n.c)(13),{isGuest:c}=e,{setOpenMobile:d}=(0,ed.useSidebar)(),u=(0,nw.useT)("chat");l[0]!==u?(a=u("chat.nav.newChat","New Chat"),l[0]=u,l[1]=a):a=l[1],l[2]!==a?(r=(0,t.jsx)("span",{className:"group-data-[collapsible=icon]:hidden",children:a}),l[2]=a,l[3]=r):r=l[3];let m=r;if(c){let e,n;return l[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(N.PlusIcon,{className:"size-4"}),l[4]=e):e=l[4],l[5]!==m?(n=(0,t.jsxs)("button",{"aria-label":"New chat",className:nB,onClick:nK,type:"button",children:[e,m]}),l[5]=m,l[6]=n):n=l[6],n}return l[7]!==d?(s=()=>d(!1),l[7]=d,l[8]=s):s=l[8],l[9]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(N.PlusIcon,{className:"size-4"}),l[9]=o):o=l[9],l[10]!==m||l[11]!==s?(i=(0,t.jsxs)(A.default,{"aria-label":"New chat",className:nB,href:"/chat",onClick:s,children:[o,m]}),l[10]=m,l[11]=s,l[12]=i):i=l[12],i}function nK(){return window.location.assign("/chat")}function nY(){let e,a,r=(0,n.c)(8),{toggleSidebar:o,isMobile:i}=(0,ed.useSidebar)(),l=(0,tI.useCurrentProduct)(),c=null===l.suffix||!0===l.wearsHostBrand,d=c?void 0:l.name;return r[0]!==l.icon||r[1]!==c||r[2]!==i?(e=i?(0,t.jsx)(s.ChevronLeftIcon,{className:"size-6",strokeWidth:2.2}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v.PanelLeftIcon,{className:"size-6 group-data-[collapsible=icon]:hidden"}),c?(0,t.jsx)(L.BrandMark,{className:(0,em.cn)("size-6 group-data-[collapsible=icon]:block","hidden text-primary group-data-[collapsible=icon]:group-hover/collapse:hidden"),fallback:(0,t.jsx)(nm.OpenServeLogo,{className:(0,em.cn)("size-6 group-data-[collapsible=icon]:block","hidden text-primary group-data-[collapsible=icon]:group-hover/collapse:hidden")})}):(0,t.jsx)(l.icon,{className:(0,em.cn)("size-5 group-data-[collapsible=icon]:block","hidden text-primary group-data-[collapsible=icon]:group-hover/collapse:hidden")}),(0,t.jsx)(v.PanelLeftIcon,{className:"hidden group-data-[collapsible=icon]:group-hover/collapse:block"})]}),r[0]=l.icon,r[1]=c,r[2]=i,r[3]=e):e=r[3],r[4]!==d||r[5]!==e||r[6]!==o?(a=(0,t.jsx)(eb.Button,{"aria-label":"Toggle sidebar",className:"group/collapse size-11 text-sidebar-foreground
2/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground group-data-[collapsible=icon]:size-8",onClick:o,size:"icon",title:d,variant:"ghost",children:e}),r[4]=d,r[5]=e,r[6]=o,r[7]=a):a=r[7],a}function nJ(e){let a,r,s,o,i,l,c=(0,n.c)(19),{isGuest:d}=e,u=(0,nw.useT)("chat");c[0]!==u?(a=u("chat.nav.home","Home"),c[0]=u,c[1]=a):a=c[1];let m=a,{setOpenMobile:h}=(0,ed.useSidebar)();c[2]!==h?(r=()=>{(0,tX.setActiveSpace)(null),(0,nN.setPreviewTemplate)(null),h(!1)},c[2]=h,c[3]=r):r=c[3];let x=r;if(d){let e,n,a;return c[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(p.HomeIcon,{}),c[4]=e):e=c[4],c[5]!==m?(n=(0,t.jsx)("span",{children:m}),c[5]=m,c[6]=n):n=c[6],c[7]!==m||c[8]!==n?(a=(0,t.jsx)(ed.SidebarMenuItem,{children:(0,t.jsxs)(ed.SidebarMenuButton,{onClick:nV,tooltip:m,children:[e,n]})}),c[7]=m,c[8]=n,c[9]=a):a=c[9],a}return c[10]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(p.HomeIcon,{}),c[10]=s):s=c[10],c[11]!==m?(o=(0,t.jsx)("span",{children:m}),c[11]=m,c[12]=o):o=c[12],c[13]!==x||c[14]!==o?(i=(0,t.jsxs)(A.default,{href:"/",onClick:x,children:[s,o]}),c[13]=x,c[14]=o,c[15]=i):i=c[15],c[16]!==m||c[17]!==i?(l=(0,t.jsx)(ed.SidebarMenuItem,{children:(0,t.jsx)(ed.SidebarMenuButton,{asChild:!0,tooltip:m,children:i})}),c[16]=m,c[17]=i,c[18]=l):l=c[18],l}function nV(){return window.location.assign("/")}function nQ(e){let a,r,s,o,i,l=(0,n.c)(10),{user:c}=e,{pendingQuery:d,hydrated:u,clearPendingQuery:m}=(0,ny.useGuestQuota)();if(!(c&&u&&d))return null;l[0]!==m||l[1]!==d?(a=()=>{m(),window.location.assign(`/chat?query=${encodeURIComponent(d)}`)},l[0]=m,l[1]=d,l[2]=a):a=l[2];let p=a;return l[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(ed.SidebarGroupLabel,{children:"Continue from guest"}),l[3]=r):r=l[3],l[4]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(h.HistoryIcon,{}),l[4]=s):s=l[4],l[5]!==d?(o=(0,t.jsx)("span",{children:d}),l[5]=d,l[6]=o):o=l[6],l[7]!==p||l[8]!==o?(i=(0,t.jsxs)(ed.SidebarGroup,{className:"group-data-[collapsible=icon]:hidden",children:[r,(0,t.jsx)(ed.SidebarGroupContent,{children:(0,t.jsx)(ed.SidebarMenu,{children:(0,t.jsx)(ed.SidebarMenuItem,{children:(0,t.jsxs)(ed.SidebarMenuButton,{onClick:p,children:[s,o]})})})})]}),l[7]=p,l[8]=o,l[9]=i):i=l[9],i}function nX(){let e,a=(0,n.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(t7,{}),a[0]=e):e=a[0],e}function nZ(){let e,a=(0,n.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(nl,{}),a[0]=e):e=a[0],e}function n0(){let e,a,r,s,o,i,l=(0,n.c)(11),c=(0,z.usePathname)(),{setOpenMobile:d}=(0,ed.useSidebar)();return l[0]!==c?(e=c.startsWith("/inspiration"),l[0]=c,l[1]=e):e=l[1],l[2]!==d?(a=()=>d(!1),l[2]=d,l[3]=a):a=l[3],l[4]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(f.LightbulbIcon,{className:"size-4"}),s=(0,t.jsx)("span",{children:"Inspire"}),l[4]=r,l[5]=s):(r=l[4],s=l[5]),l[6]!==a?(o=(0,t.jsxs)(A.default,{href:"/inspiration",onClick:a,children:[r,s]}),l[6]=a,l[7]=o):o=l[7],l[8]!==e||l[9]!==o?(i=(0,t.jsx)(ed.SidebarMenuItem,{children:(0,t.jsx)(ed.SidebarMenuButton,{asChild:!0,isActive:e,children:o})}),l[8]=e,l[9]=o,l[10]=i):i=l[10],i}function n1(e){let a,s,i,l,c,d,u,m,h,p,x,b,g,j,y,v,w,I,C,_,D,P,T,R,z,B,L,q,G,$,U,W,K,Y,J,V,Q,X,Z,ee,et,en,ea,er,es,eo,ei,el=(0,n.c)(101),{user:eu}=e,{setTheme:em}=(0,E.useTheme)(),{skin:eh,setSkin:ep}=(0,nx.useSkin)(),ex=(0,nf.useCustomThemes)(),[ef,eb]=(0,O.useState)(!1),[eg,ej]=(0,O.useState)("general");el[0]===Symbol.for("react.memo_cache_sentinel")?(a=e=>{ej(e),eb(!0)},el[0]=a):a=el[0];let ey=a;el[1]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{let e=e=>{","===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),eb(!0))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},i=[],el[1]=s,el[2]=i):(s=el[1],i=el[2]),(0,O.useEffect)(s,i);let{entitlements:eS}=(0,ng.useEntitlements)(),{managedBy:ev}=(0,nj.useFamily)(),{org:ew,loaded:eN}=(0,H.useActiveOrg)(),{isMobile:eI,state:ek}=(0,ed.useSidebar)(),eC=(0,F.useBrand)(),eM=!eC||"ijr"===eC.id,[e_,eD]=(0,O.useState)(!1),eP=(0,O.useRef)(null),eT="collapsed"===ek&&!eI;el[3]!==eT?(l=()=>{eT&&(eP.current&&clearTimeout(eP.current),eD(!0))},el[3]=eT,el[4]=l):l=el[4];let eR=l;el[5]!==eT?(c=()=>{eT&&(eP.current=setTimeout(()=>eD(!1),150))},el[5]=eT,el[6]=c):c=el[6];let eA=c;el[7]===Symbol.for("react.memo_cache_sentinel")?(d=()=>()=>{eP.current&&clearTimeout(eP.current)},u=[],el[7]=d,el[8]=u):(d=el[7],u=el[8]),(0,O.useEffect)(d,u);let ez="free"===(eS?.plan?.tier??"free"),[eE,eO]=(0,O.useState)(!1),[eB,eF]=(0,O.useState)(void 0),eL=void 0===eB?eu.image:eB;el[9]!==eu.email||el[10]!==eu.name?(m=eu.name?.trim()||eu.email||"Account",el[9]=eu.email,el[10]=eu.name,el[11]=m):m=el[11];let eH=m;el[12]===Symbol.for("react.memo_cache_sentinel")?(h=e=>eF(e),el[12]=h):h=el[12],el[13]!==eH||el[14]!==eE||el[15]!==eL?(p=(0,t.jsx)(nh.ProfilePhotoDialog,{currentUrl:eL,displayName:eH,onOpenChange:eO,onSaved:h,open:eE}),el[13]=eH,el[14]=eE,el[15]=eL,el[16]=p):p=el[16],el[17]!==ef||el[18]!==eg||el[19]!==eu?(x=(0,t.jsx)(np.SettingsDialog,{initialSection:eg,onOpenChange:eb,open:ef,user:eu}),el[17]=ef,el[18]=eg,el[19]=eu,el[20]=x):x=el[20],el[21]!==eH||el[22]!==eL||el[23]!==eu.email?(b=(0,t.jsx)("span",{className:"relative shrink-0",children:eL?(0,t.jsx)("img",{alt:"",className:"size-7 rounded-full object-cover ring-1 ring-sidebar-border/50 group-data-[collapsible=icon]:size-8 max-md:size-9",src:eL}):(0,t.jsx)("div",{className:"flex size-7 items-center justify-center rounded-full font-semibold text-[11px] text-white uppercase ring-1 ring-sidebar-border/50 group-data-[collapsible=icon]:size-8 max-md:size-9 max-md:text-[13px]",style:{background:`linear-gradient(135deg, oklch(0.55 0.17 ${nI(eu.email??"")}), oklch(0.42 0.15 ${nI(eu.email??"")+60}))`},children:eH.slice(0,1)})}),el[21]=eH,el[22]=eL,el[23]=eu.email,el[24]=b):b=el[24],el[25]!==eH?(g=(0,t.jsx)("span",{className:"truncate font-medium text-[13px] text-sidebar-foreground max-md:font-semibold max-md:text-[15px] max-md:text-sidebar-accent-foreground",children:eH}),el[25]=eH,el[26]=g):g=el[26],el[27]!==ew?.name||el[28]!==eN?(j=eN&&(0,t.jsx)("span",{className:"truncate text-[10px] text-sidebar-foreground
2/60 max-md:text-xs",children:ew?.name??"Personal"}),el[27]=ew?.name,el[28]=eN,el[29]=j):j=el[29],el[30]!==g||el[31]!==j?(y=(0,t.jsxs)("span",{className:"flex min-w-0 flex-col leading-tight group-data-[collapsible=icon]:hidden",children:[g,j]}),el[30]=g,el[31]=j,el[32]=y):y=el[32],el[33]!==ev?(v=ev&&(0,t.jsx)(M.ShieldIcon,{className:"size-3.5 shrink-0 text-primary group-data-[collapsible=icon]:hidden"}),el[33]=ev,el[34]=v):v=el[34],el[35]!==eA||el[36]!==eR||el[37]!==b||el[38]!==y||el[39]!==v?(w=(0,t.jsx)(ec.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(ed.SidebarMenuButton,{className:"h-10 w-full overflow-visible rounded-lg bg-sidebar-accent/40 py-0 pr-16 pl-1.5 hover:bg-sidebar-accent data-[state=open]:bg-sidebar-accent group-data-[collapsible=icon]:mx-auto group-data-[collapsible=icon]:size-8 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:p-0 max-md:h-auto max-md:gap-3 max-md:rounded-2xl max-md:bg-card max-md:py-3 max-md:pl-3.5 max-md:hover:bg-card max-md:data-[state=open]:bg-card","data-testid":"user-nav-button",onMouseEnter:eR,onMouseLeave:eA,children:[b,y,v]})}),el[35]=eA,el[36]=eR,el[37]=b,el[38]=y,el[39]=v,el[40]=w):w=el[40],el[41]===Symbol.for("react.memo_cache_sentinel")?(I=()=>eO(!0),el[41]=I):I=el[41],el[42]!==eu?(C=(0,t.jsx)(H.AccountSwitcherSection,{onOpenProfile:I,user:eu}),el[42]=eu,el[43]=C):C=el[43],el[44]===Symbol.for("react.memo_cache_sentinel")?(_=(0,t.jsx)(ec.DropdownMenuSeparator,{}),el[44]=_):_=el[44],el[45]!==eM?(D=eM?(0,t.jsx)(ec.DropdownMenuItem,{asChild:!0,className:"cursor-pointer text-[14px]",children:(0,t.jsxs)("a",{className:"flex items-center gap-2",href:(0,tI.openServeHref)("/chat?heartbeat=newsroom"),children:[(0,t.jsx)(tv.GeniusMark,{className:"fill-[#5b31e1]",size:16}),(0,t.jsx)("span",{children:"My OpenServe"})]})}):null,el[45]=eM,el[46]=D):D=el[46],el[47]===Symbol.for("react.memo_cache_sentinel")?(P=(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer text-[14px]",onSelect:()=>ey("general"),children:[(0,t.jsx)(k.SettingsIcon,{className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{children:"Settings"}),(0,t.jsx)("span",{className:"ml-auto shrink-0 whitespace-nowrap font-mono text-[12px] text-muted-foreground",title:"â plus comma",children:"â"})]}),el[47]=P):P=el[47],el[48]===Symbol.for("react.memo_cache_sentinel")?(T=(0,t.jsxs)(ec.DropdownMenuSubTrigger,{className:"cursor-pointer text-[14px]",children:[(0,t.jsx)(S.PaletteIcon,{className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{children:"Theme"})]}),el[48]=T):T=el[48];let eq=eI?-232:void 0;el[49]!==ex||el[50]!==ep||el[51]!==em?(R=e=>{let t=nx.SKINS.find(t=>t.id===e);if(t){ep(t.id),em(t.mode);return}let n=ex.find(t=>(0,nf.customSkinId)(t.id)===e);n&&(ep(e),em(n.mode))},el[49]=ex,el[50]=ep,el[51]=em,el[52]=R):R=el[52],el[53]===Symbol.for("react.memo_cache_sentinel")?(z=nx.FEATURED_SKINS.map(n4),el[53]=z):z=el[53],el[54]!==ex.length?(B=ex.length>0&&(0,t.jsx)(ec.DropdownMenuSeparator,{}),el[54]=ex.length,el[55]=B):B=el[55],el[56]!==ex?(L=ex.map(n2),el[56]=ex,el[57]=L):L=el[57],el[58]!==eh||el[59]!==R||el[60]!==B||el[61]!==L?(q=(0,t.jsxs)(ec.DropdownMenuRadioGroup,{onValueChange:R,value:eh,children:[z,B,L]}),el[58]=eh,el[59]=R,el[60]=B,el[61]=L,el[62]=q):q=el[62],el[63]===Symbol.for("react.memo_cache_sentinel")?(G=(0,t.jsx)(ec.DropdownMenuSeparator,{}),el[63]=G):G=el[63],el[64]===Symbol.for("react.memo_cache_sentinel")?($=(0,t.jsxs)(ec.DropdownMenuItem,{className:"cursor-pointer gap-2 text-[14px]",onSelect:()=>ey("appearance"),children:[(0,t.jsx)(N.PlusIcon,{className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{children:"Customize themesâ¦"})]}),el[64]=$):$=el[64],el[65]!==eq||el[66]!==q?(U=(0,t.jsxs)(ec.DropdownMenuSub,{children:[T,(0,t.jsxs)(ec.DropdownMenuSubContent,{className:"max-h-[60vh] w-56 max-w-[calc(100vw-1.5rem)] overflow-y-auto rounded-lg border border-border/60 bg-card/95 shadow-[var(--shadow-float)] backdrop-blur-xl",collisionPadding:12,sideOffset:eq,children:[q,G,$]})]}),el[65]=eq,el[66]=q,el[67]=U):U=el[67],el[68]!==ez?(W=ez&&(0,t.jsx)(ec.DropdownMenuSeparator,{}),el[68]=ez,el[69]=W):W=el[69],el[70]!==ez?(K=ez&&(0,t.jsx)(ec.DropdownMenuItem,{asChild:!0,className:"upgrade-beacon cursor-pointer font-medium text-[14px]","data-testid":"user-nav-item-upgrade",children:(0,t.jsxs)(A.default,{className:"flex items-center gap-2",href:"/settings/billing",children:[(0,t.jsx)(r,{className:"size-4 text-primary"}),(0,t.jsx)("span",{children:"Upgrade plan"})]})}),el[70]=ez,el[71]=K):K=el[71],el[72]===Symbol.for("react.memo_cache_sentinel")?(Y=(0,t.jsx)(ec.DropdownMenuSeparator,{}),el[72]=Y):Y=el[72],el[73]===Symbol.for("react.memo_cache_sentinel")?(J=(0,t.jsx)(ec.DropdownMenuItem,{asChild:!0,className:"cursor-pointer text-[14px]",children:(0,t.jsxs)(A.default,{className:"flex items-center gap-2",href:"/improve",children:[(0,t.jsx)(f.LightbulbIcon,{className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{children:"Give feedback"})]})}),el[73]=J):J=el[73],el[74]===Symbol.for("react.memo_cache_sentinel")?(V=(0,t.jsxs)(ec.DropdownMenuSubTrigger,{className:"cursor-pointer text-[14px]",children:[(0,t.jsx)(o.default,{className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{children:"Help"})]}),el[74]=V):V=el[74];let eG=eI?-200:void 0;return el[75]===Symbol.for("react.memo_cache_sentinel")?(Q=(0,t.jsx)(ec.DropdownMenuItem,{className:"cursor-pointer text-[14px]",children:(0,t.jsx)("span",{children:"Get started"})}),el[75]=Q):Q=el[75],el[76]===Symbol.for("react.memo_cache_sentinel")?(X=(0,t.jsx)(ec.DropdownMenuItem,{className:"cursor-pointer text-[14px]",children:(0,t.jsx)("span",{children:"Help center"})}),el[76]=X):X=el[76],el[77]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,t.jsx)(ec.DropdownMenuItem,{className:"cursor-pointer text-[14px]",children:(0,t.jsx)("span",{children:"Contact support"})}),ee=(0,t.jsx)(ec.DropdownMenuSeparator,{}),el[77]=Z,el[78]=ee):(Z=el[77],ee=el[78]),el[79]===Symbol.for("react.memo_cache_sentinel")?(et=(0,t.jsx)(ec.DropdownMenuItem,{asChild:!0,className:"cursor-pointer text-[14px]",children:(0,t.jsx)(A.default,{href:"/terms",children:(0,t.jsx)("span",{children:"Terms of service"})})}),el[79]=et):et=el[79],el[80]===Symbol.for("react.memo_cache_sentinel")?(en=(0,t.jsx)(ec.DropdownMenuItem,{asChild:!0,className:"cursor-pointer text-[14px]",children:(0,t.jsx)(A.default,{href:"/privacy",children:(0,t.jsx)("span",{children:"Privacy policy"})})}),el[80]=en):en=el[80],el[81]===Symbol.for("react.memo_cache_sentinel")?(ea=(0,t.jsx)(ec.DropdownMenuItem,{asChild:!0,className:"cursor-pointer text-[14px]",children:(0,t.jsx)(A.default,{href:"/cookies",children:(0,t.jsx)("span",{children:"Cookie policy"})})}),el[81]=ea):ea=el[81],el[82]!==eG?(er=(0,t.jsxs)(ec.DropdownMenuSub,{children:[V,(0,t.jsxs)(ec.DropdownMenuSubContent,{className:"max-h-[60vh] w-48 max-w-[calc(100vw-1.5rem)] overflow-y-auto rounded-lg border border-border/60 bg-card/95 shadow-[var(--shadow-float)] backdrop-blur-xl",collisionPadding:12,sideOffset:eG,children:[Q,X,Z,ee,et,en,ea]})]}),el[82]=eG,el[83]=er):er=el[83],el[84]!==eA||el[85]!==eR||el[86]!==C||el[87]!==D||el[88]!==U||el[89]!==W||el[90]!==K||el[91]!==er?(es=(0,t.jsxs)(ec.DropdownMenuContent,{align:"start",className:"w-[var(--radix-dropdown-menu-trigger-width)] min-w-64 max-w-[calc(80vw-1rem)] rounded-lg border border-border/60 bg-card/95 shadow-[var(--shadow-float)] backdrop-blur-xl","data-testid":"user-nav-menu",onMouseEnter:eR,onMouseLeave:eA,side:"top",sideOffset:8,children:[C,_,D,P,U,W,K,Y,J,er]}),el[84]=eA,el[85]=eR,el[86]=C,el[87]=D,el[88]=U,el[89]=W,el[90]=K,el[91]=er,el[92]=es):es=el[92],el[93]!==e_||el[94]!==w||el[95]!==es?(eo=(0,t.jsxs)(ec.DropdownMenu,{modal:!1,onOpenChange:eD,open:e_,children:[w,es]}),el[93]=e_,el[94]=w,el[95]=es,el[96]=eo):eo=el[96],el[97]!==p||el[98]!==x||el[99]!==eo?(ei=(0,t.jsxs)(t.Fragment,{children:[p,x,eo]}),el[97]=p,el[98]=x,el[99]=eo,el[100]=ei):ei=el[100],ei}function n2(e){return(0,t.jsx)(ec.DropdownMenuRadioItem,{className:"cursor-pointer text-[14px]",value:(0,nf.customSkinId)(e.id),children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"size-3 shrink-0 rounded-full border border-border/40",style:{background:e.vars["--color-accent"]}}),e.name]})},e.id)}function n4(e){return(0,t.jsx)(ec.DropdownMenuRadioItem,{className:"cursor-pointer text-[14px]",value:e.id,children:(0,t.jsxs)("span",{className:"flex flex-col",children:[(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"text-[12px] text-muted-foreground",children:e.hint})]})},e.id)}e.s(["AccountFooter",0,nD,"AppSidebar",0,function(e){let a,r,s,o,i,l,c,d,u,m,h,p,x,f,b,g,j,y=(0,n.c)(48),{user:S}=e,v=(0,z.usePathname)(),w=(0,F.useBrand)(),N=function(e){let t,a=(0,n.c)(2),{data:r}=(0,B.default)(e?e$.SIDEBAR_TREE_KEY:null,em.fetcher,e$.SIDEBAR_TREE_SWR_OPTIONS);if(a[0]!==r){e:{let e=new Set;if(!r){t=e;break e}for(let t of r.projects)for(let n of(t.summary&&e.add(t.summary.id),t.chats))e.add(n.id);for(let t of r.ungrouped)e.add(t.id);t=e}a[0]=r,a[1]=t}else t=a[1];return t}(S),I=w?.id??null;y[0]!==v||y[1]!==I?(a=(0,nS.resolveAppNav)({pathname:v,brandId:I}),y[0]=v,y[1]=I,y[2]=a):a=y[2];let k=a,C=k?S?k.user:k.guest:null,M=!C||(C.chatRail??!C.nav),_=C?.newChat??!0,D=!!k&&(k.animated??!0),P=(!w||!0===w.browserExtension)&&(k?.extensionNudge??!0);y[3]!==S?(r=S&&(0,t.jsx)(n_,{user:S}),y[3]=S,y[4]=r):r=y[4],y[5]!==S?(s=S&&(0,t.jsx)(nb,{}),y[5]=S,y[6]=s):s=y[6],y[7]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(tA,{}),y[7]=o):o=y[7],y[8]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsxs)(ed.SidebarHeader,{className:"flex-row items-center justify-between gap-2 p-2 shrink-0 group-data-[collapsible=icon]:justify-center",children:[(0,t.jsx)("div",{className:"flex min-w-0 flex-1 items-center group-data-[collapsible=icon]:hidden",children:(0,t.jsx)(tI.ProductBrandLink,{})}),(0,t.jsx)(nY,{})]}),y[8]=i):i=y[8],y[9]!==_||y[10]!==S?(l=_?(0,t.jsx)(nL,{isGuest:!S}):null,y[9]=_,y[10]=S,y[11]=l):l=y[11];let T=D?"app-nav-animated":void 0;y[12]!==C||y[13]!==S?(c=C?.nav?(0,t.jsx)(nM,{authed:!!S,loader:C.nav}):null,y[12]=C,y[13]=S,y[14]=c):c=y[14],y[15]!==C?.messagesSection||y[16]!==S?(d=C?.messagesSection&&S?(0,t.jsx)(tG,{}):null,y[15]=C?.messagesSection,y[16]=S,y[17]=d):d=y[17],y[18]!==w?.id||y[19]!==M||y[20]!==N||y[21]!==S?(u=M?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ed.SidebarGroup,{children:(0,t.jsxs)(ed.SidebarMenu,{children:[(0,t.jsx)(nJ,{isGuest:!S}),S?(0,t.jsx)(nX,{}):null,S?(0,t.jsx)(nZ,{}):null,S?(0,t.jsx)(ne,{userId:S.id}):null,S?(0,t.jsx)(nd,{userId:S.id}):null,w?.id==="openserve"?(0,t.jsx)(n0,{}):null]})}),(0,t.jsx)(nQ,{user:S}),S?(0,t.jsx)(ep.SidebarSectionList,{sections:{chats:(0,t.jsx)(tc,{user:S}),projects:(0,t.jsx)(tr,{user:S}),shared:(0,t.jsx)(tg,{user:S}),dms:(0,t.jsx)(ek,{user:S})}}):(0,t.jsx)(eC.SidebarHistory,{excludeChatIds:N,user:S})]}):null,y[18]=w?.id,y[19]=M,y[20]=N,y[21]=S,y[22]=u):u=y[22],y[23]!==S?(m=S?(0,t.jsx)(tD,{}):null,y[23]=S,y[24]=m):m=y[24],y[25]!==d||y[26]!==u||y[27]!==m||y[28]!==T||y[29]!==c?(h=(0,t.jsxs)(ed.SidebarContent,{className:T,children:[c,d,u,m]}),y[25]=d,y[26]=u,y[27]=m,y[28]=T,y[29]=c,y[30]=h):h=y[30],y[31]!==P?(p=P&&(0,t.jsx)(Z,{}),y[31]=P,y[32]=p):p=y[32];let R=k?.hideInfluence??!1;return y[33]!==R||y[34]!==S?(x=(0,t.jsx)(nD,{hideInfluence:R,user:S}),y[33]=R,y[34]=S,y[35]=x):x=y[35],y[36]!==p||y[37]!==x?(f=(0,t.jsxs)(ed.SidebarFooter,{className:"shrink-0 border-sidebar-border/80 border-t pt-2 max-md:border-t-0 max-md:px-3 max-md:pt-0 max-md:pb-3",children:[p,x]}),y[36]=p,y[37]=x,y[38]=f):f=y[38],y[39]===Symbol.for("react.memo_cache_sentinel")?(b=(0,t.jsx)(tx,{}
2),y[39]=b):b=y[39],y[40]!==h||y[41]!==f||y[42]!==s||y[43]!==l?(g=(0,t.jsxs)(ed.Sidebar,{collapsible:"icon",children:[s,o,i,l,h,f,b]}),y[40]=h,y[41]=f,y[42]=s,y[43]=l,y[44]=g):g=y[44],y[45]!==g||y[46]!==r?(j=(0,t.jsxs)(t.Fragment,{children:[r,g]}),y[45]=g,y[46]=r,y[47]=j):j=y[47],j}],462235)},209003,e=>{"use strict";var t=e.i(655691),n=e.i(318261);e.s(["useChatDoor",0,function(){let e,a,r,s,o=(0,t.c)(9);o[0]===Symbol.for("react.memo_cache_sentinel")?(e={fallbackData:null},o[0]=e):e=o[0];let{data:i,mutate:l}=(0,n.default)("chat-door",null,e);o[1]!==l?(a=e=>{l(e,!1)},o[1]=l,o[2]=a):a=o[2];let c=a;o[3]!==l?(r=()=>{l(null,!1)},o[3]=l,o[4]=r):r=o[4];let d=r,u=i??null;return o[5]!==d||o[6]!==c||o[7]!==u?(s={door:u,openDoor:c,clearDoor:d},o[5]=d,o[6]=c,o[7]=u,o[8]=s):s=o[8],s}])},609579,e=>{"use strict";var t=e.i(549111),n=e.i(655691),a=e.i(476825),r=e.i(463402),s=e.i(864706),o=e.i(466071);e.i(811998);var i=e.i(208945),l=e.i(194235),c=e.i(167881),d=e.i(630374),u=e.i(184762),m=e.i(7877),h=e.i(709067),p=e.i(765728),x=e.i(647163);function f({authed:e,onPosted:n,journal:o,sides:d=p.MEME_WARS_SIDES}){let b=(0,s.useRef)(null),[g,j]=(0,s.useState)(null),[y,S]=(0,s.useState)(""),[v,w]=(0,s.useState)("right"),{busy:N,note:I,run:k}=(0,l.useSave)(),C=async()=>{!(g&&y.trim())||N||await k(async()=>{try{await (0,l.requestJson)(m.apiRoutes.discover.memes(),{method:"POST",body:JSON.stringify(o?{imageUrl:g,caption:y.trim(),journalId:o.id,side:v}:{imageUrl:g,caption:y.trim(),side:v})})}catch(e){throw Error(e instanceof Error&&"moderation"===e.message?"That line doesn't pass the house rules":"No question marks, 140 characters max")}return!0},{saved:"Posted into today's battle",failed:"Couldn't post that"})&&(j(null),S(""),n())};return e?(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"flex w-fit items-center gap-1 rounded-full border border-border p-0.5",children:["right","left"].map(e=>(0,t.jsx)("button",{"aria-pressed":v===e,className:(0,x.cn)("rounded-full px-2.5 py-1 font-semibold text-meta transition-colors",v===e?"text-white":"text-muted-foreground hover:text-foreground"),onClick:()=>w(e),style:v===e?{backgroundColor:d[e].color}:void 0,type:"button",children:d[e].label},e))}),(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-3 sm:flex-row",children:[(0,t.jsx)("button",{className:"flex h-40 w-full shrink-0 items-center justify-center overflow-hidden rounded-xl border border-border/60 border-dashed bg-muted/40 text-muted-foreground hover:border-[var(--color-accent)] sm:w-40",onClick:()=>b.current?.click(),type:"button",children:g?(0,t.jsx)("img",{alt:"",className:"h-full w-full object-cover",src:g}
2):N?(0,t.jsx)(r.Loader2Icon,{className:"size-5 animate-spin"}):(0,t.jsx)(a.ImagePlusIcon,{className:"size-6"})}),(0,t.jsx)("input",{accept:"image/png,image/jpeg,image/webp",className:"hidden",onChange:e=>{let t=e.target.files?.[0];t&&k(async()=>{let e=new FormData;e.append("file",t);let n=await fetch(m.apiRoutes.files.upload(),{method:"POST",credentials:"include",body:e}),a=await n.json().catch(()=>null);if(!(n.ok&&a?.url))throw Error("Try a JPEG or PNG under 8 MB");j(a.url)},{saved:"Card attached",failed:"That upload didn't take"})},ref:b,type:"file"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,t.jsx)(u.Textarea,{className:"min-h-20 text-label",maxLength:140,onChange:e=>S(e.target.value),placeholder:"The line under it (no question marks)",value:y}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:(0,x.cn)("text-caption",I?.kind==="error"?"text-destructive":"text-muted-foreground"),children:I?.kind==="error"?I.text:"Your meme counts in today's tally the moment it posts."}),(0,t.jsx)(c.Button,{className:"rounded-full bg-[var(--color-accent)] px-4 font-semibold text-ui text-white hover:bg-[var(--color-accent)]/90",disabled:!(g&&y.trim())||N,onClick:C,size:"sm",type:"button",children:"Post"})]})]})]})]}):(0,t.jsxs)("button",{className:(0,x.cn)(i.CARD_CLASS,"w-full rounded-2xl border-dashed px-4 py-5 text-left text-label text-muted-foreground hover:border-[var(--color-accent)] hover:text-foreground"),onClick:()=>(0,h.goToLogin)(),type:"button",children:[(0,t.jsx)(a.ImagePlusIcon,{className:"mr-2 inline size-4"}),"Post your own into today's battle â free account."]})}e.s(["MemeComposerDialog",0,function(e){let a,r,s,i,l,c,u,h=(0,n.c)(22),{open:p,onOpenChange:x,authed:b,journal:g,sides:j}=e,y=g?"New post":"New meme";h[0]!==y?(a=(0,t.jsx)(d.DialogTitle,{children:y}),h[0]=y,h[1]=a):a=h[1];let S=g?"A picture, one line, and the side it fields for. It lands in today's round and counts the moment it posts.":"Post a meme into today's battle. It counts in the tally the moment it lands.";return h[2]!==S?(r=(0,t.jsx)(d.DialogDescription,{children:S}),h[2]=S,h[3]=r):r=h[3],h[4]!==a||h[5]!==r?(s=(0,t.jsxs)(d.DialogHeader,{children:[a,r]}),h[4]=a,h[5]=r,h[6]=s):s=h[6],h[7]!==g||h[8]!==x?(i=()=>{(0,o.mutate)(g?m.apiRoutes.discover.memes({journal:g.handle}):m.apiRoutes.discover.memes()),x(!1)},h[7]=g,h[8]=x,h[9]=i):i=h[9],h[10]!==b||h[11]!==g||h[12]!==j||h[13]!==i?(l=(0,t.jsx)(f,{authed:b,journal:g,onPosted:i,sides:j}),h[10]=b,h[11]=g,h[12]=j,h[13]=i,h[14]=l):l=h[14],h[15]!==s||h[16]!==l?(c=(0,t.jsxs)(d.DialogContent,{className:"sm:max-w-xl",children:[s,l]}),h[15]=s,h[16]=l,h[17]=c):c=h[17],h[18]!==x||h[19]!==p||h[20]!==c?(u=(0,t.jsx)(d.Dialog,{onOpenChange:x,open:p,children:c}),h[18]=x,h[19]=p,h[20]=c,h[21]=u):u=h[21],u}])},865974,683599,e=>{"use strict";var t=e.i(549111),n=e.i(655691),a=e.i(250954),r=e.i(238153),s=e.i(492421),o=e.i(737038),i=e.i(632713),l=e.i(539392),c=e.i(504244),d=e.i(511518),u=e.i(847464),m=e.i(974089),h=e.i(138758),p=e.i(323457),x=e.i(909971),f=e.i(864706),b=e.i(719078),g=e.i(10229),j=e.i(982411),y=e.i(963817),S=e.i(518797),v=e.i(289608),w=e.i(463415),N=e.i(885120),I=e.i(893914),k=e.i(647163),C=e.i(904116);function M(e){let a,r,s,o,i,l,c,d,u=(0,n.c)(19),{className:m,dot:h}=e,p=void 0===h?"size-1.5":h;return u[0]!==m?(a=(0,k.cn)("inline-flex items-center gap-[3px]",m),u[0]=m,u[1]=a):a=u[1],u[2]!==p?(r=(0,k.cn)("typing-dot rounded-full bg-current",p),u[2]=p,u[3]=r):r=u[3],u[4]!==r?(s=(0,t.jsx)("span",{className:r}),u[4]=r,u[5]=s):s=u[5],u[6]!==p?(o=(0,k.cn)("typing-dot rounded-full bg-current",p),u[6]=p,u[7]=o):o=u[7],u[8]!==o?(i=(0,t.jsx)("span",{className:o}),u[8]=o,u[9]=i):i=u[9],u[10]!==p?(l=(0,k.cn)("typing-dot rounded-full bg-current",p),u[10]=p,u[11]=l):l=u[11],u[12]!==l?(c=(0,t.jsx)("span",{className:l}),u[12]=l,u[13]=c):c=u[13],u[14]!==a||u[15]!==s||u[16]!==i||u[17]!==c?(d=(0,t.jsxs)("span",{"aria-hidden":!0,className:a,children:[s,i,c]}),u[14]=a,u[15]=s,u[16]=i,u[17]=c,u[18]=d):d=u[18],d}e.s(["TypingDots",0,M],683599);var _=e.i(228365),D=e.i(528008);function P(e){var t,n;return e?(t=new Date(e),n={addSuffix:!1},function(e,t,n){let a,u=(0,s.getDefaultOptions)(),m=n?.locale??u.locale??r.defaultLocale,h=(0,c.compareAsc)(e,t);if(isNaN(h))throw RangeError("Invalid time value");let p=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:h}),[x,f]=(0,l.normalizeDates)(n?.in,...h>0?[t,e]:[e,t]),b=(0,o.getRoundingMethod)(n?.roundingMethod??"round"),g=f.getTime()-x.getTime(),j=g/d.millisecondsInMinute,y=(g-((0,i.getTimezoneOffsetInMilliseconds)(f)-(0,i.getTimezoneOffsetInMilliseconds)(x)))/d.millisecondsInMinute,S=n?.unit;if("second"===(a=S||(j<1?"second":j<60?"minute":j<d.minutesInDay?"hour":y<d.minutesInMonth?"day":y<d.minutesInYear?"month":"year"))){let e=b(g/1e3);return m.formatDistance("xSeconds",e,p)}if("minute"===a){let e=b(j);return m.formatDistance("xMinutes",e,p)}if("hour"===a){let e=b(j/60);return m.formatDistance("xHours",e,p)}if("day"===a){let e=b(y/d.minutesInDay);return m.formatDistance("xDays",e,p)}if("month"===a){let e=b(y/d.minutesInMonth);return 12===e&&"month"!==S?m.formatDistance("xYears",1,p):m.formatDistance("xMonths",e,p)}else{let e=b(y/d.minutesInYear);return m.formatDistance("xYears",e,p)}}(t,(0,a.constructNow)(t),n)).replace(" minutes","m").replace(" minute","m").replace(" hours","h").replace(" hour","h").replace(" days","d").replace(" day","d").replace(" seconds","s").replace(" second","s"):""}function T(e){let a,r,s,o,i,l=(0,n.c)(14),{provider:c,className:d}=e,u=I.MESSENGER_CATALOG[c].connector??c;l[0]!==u?(a=(0,N.connectorById)(u),l[0]=u,l[1]=a):a=l[1];let m=a,h=m?.icon;
2if(!h)return null;let p=D.PROVIDER_LABEL[c];l[2]!==d?(r=(0,k.cn)("flex items-center justify-center rounded-full bg-popover ring-2 ring-popover",d),l[2]=d,l[3]=r):r=l[3];let x=D.PROVIDER_LABEL[c],f=m?.accent;return l[4]!==f?(s={color:f},l[4]=f,l[5]=s):s=l[5],l[6]!==h||l[7]!==s?(o=(0,t.jsx)(h,{className:"size-3",style:s}),l[6]=h,l[7]=s,l[8]=o):o=l[8],l[9]!==p||l[10]!==r||l[11]!==x||l[12]!==o?(i=(0,t.jsx)("span",{"aria-label":p,className:r,role:"img",title:x,children:o}),l[9]=p,l[10]=r,l[11]=x,l[12]=o,l[13]=i):i=l[13],i}function R(e){let a,r,s,o=(0,n.c)(9),{row:i,compact:l}=e,c=l?"sm":"md";return o[0]!==i.avatarUrl||o[1]!==i.name||o[2]!==c?(a=(0,t.jsx)(S.Avatar,{name:i.name,remote:!0,size:c,src:i.avatarUrl}),o[0]=i.avatarUrl,o[1]=i.name,o[2]=c,o[3]=a):a=o[3],o[4]!==i.provider?(r=i.provider?(0,t.jsx)(T,{className:"-right-1 -bottom-1 absolute size-[18px]",provider:i.provider}):null,o[4]=i.provider,o[5]=r):r=o[5],o[6]!==a||o[7]!==r?(s=(0,t.jsxs)("span",{className:"relative shrink-0",children:[a,r]}),o[6]=a,o[7]=r,o[8]=s):s=o[8],s}function A(e){let a,r,s,o,i,l,c,d,u,m,h,p,f,b,g,S,v=(0,n.c)(54),{row:w,compact:N,active:I,popOut:D,onOpen:T}=e,A=w.unread>0;v[0]!==w.person?(a=w.person?(0,y.relationLabel)(w.person):null,v[0]=w.person,v[1]=a):a=v[1];let z=a,E=(0,_.useTypingIn)("person"===w.key.kind?w.key.chatId:null),O=I?"page":void 0,B=A&&"bg-[color-mix(in_srgb,#5b31e1_7%,transparent)]",F=I&&"bg-muted";v[2]!==B||v[3]!==F?(r=(0,k.cn)("flex items-center gap-3 rounded-xl px-2.5 py-2.5 transition-[background-color,transform] duration-[var(--dur-instant)] hover:bg-muted/60 active:scale-[0.985]",B,F),v[2]=B,v[3]=F,v[4]=r):r=v[4];let L=w.href;v[5]!==T||v[6]!==D||v[7]!==w.key?(s=e=>{D&&(0,C.openInDock)(e,w.key),T?.()},v[5]=T,v[6]=D,v[7]=w.key,v[8]=s):s=v[8],v[9]!==N||v[10]!==w?(o=(0,t.jsx)(R,{compact:N,row:w}),v[9]=N,v[10]=w,v[11]=o):o=v[11];let H=A&&"font-semibold";v[12]!==H?(i=(0,k.cn)("truncate text-ui",H),v[12]=H,v[13]=i):i=v[13],v[14]!==w.name||v[15]!==i?(l=(0,t.jsx)("span",{className:i,children:w.name}),v[14]=w.name,v[15]=i,v[16]=l):l=v[16],v[17]!==w.person?.journal?(c=w.person?.journal?(0,t.jsx)("span",{className:"shrink-0 rounded bg-primary/10 px-1 font-semibold text-[10px] text-primary uppercase tracking-wide",children:"Writer"}):null,v[17]=w.person?.journal,v[18]=c):c=v[18];let q=A?"font-semibold text-primary":"text-muted-foreground";return v[19]!==q?(d=(0,k.cn)("ml-auto shrink-0 text-caption",q),v[19]=q,v[20]=d):d=v[20],v[21]!==w.lastAt?(u=P(w.lastAt),v[21]=w.lastAt,v[22]=u):u=v[22],v[23]!==d||v[24]!==u?(m=(0,t.jsx)("span",{className:d,children:u}),v[23]=d,v[24]=u,v[25]=m):m=v[25],v[26]!==l||v[27]!==c||v[28]!==m?(h=(0,t.jsxs)("span",{className:"flex items-baseline gap-2",children:[l,c,m]}),v[26]=l,v[27]=c,v[28]=m,v[29]=h):h=v[29],v[30]!==N||v[31]!==z?(p=!N&&z?(0,t.jsx)("span",{className:"truncate text-caption text-muted-foreground",children:z}):null,v[30]=N,v[31]=z,v[32]=p):p=v[32],v[33]!==w.lastFromMe||v[34]!==w.lastText||v[35]!==w.request||v[36]!==E||v[37]!==A?(f=E?(0,t.jsxs)("span",{className:"kit-rise flex items-center gap-1.5 text-meta text-primary",children:[(0,t.jsx)(M,{dot:"size-1"}),E," is typing"]}):(0,t.jsx)("span",{className:(0,k.cn)("truncate text-meta",A?"text-foreground":"text-muted-foreground"),children:"sent"===w.request?"Request sent":w.lastText?`${w.lastFromMe?"You: ":""}${w.lastText}`:"Say hello"}),v[33]=w.lastFromMe,v[34]=w.lastText,v[35]=w.request,v[36]=E,v[37]=A,v[38]=f):f=v[38],v[39]!==h||v[40]!==p||v[41]!==f?(b=(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col",children:[h,p,f]}),v[39]=h,v[40]=p,v[41]=f,v[42]=b):b=v[42],v[43]!==w.unread||v[44]!==A?(g=A?(0,t.jsx)(j.UnreadBadge,{className:"count-pop ml-0",count:w.unread},w.unread):null,v[43]=w.unread,v[44]=A,v[45]=g):g=v[45],v[46]!==w.href||v[47]!==O||v[48]!==b||v[49]!==g||v[50]!==r||v[51]!==s||v[52]!==o?(S=(0,t.jsxs)(x.default,{"aria-current":O,className:r,href:L,onClick:s,children:[o,b,g]}),v[46]=w.href,v[47]=O,v[48]=b,v[49]=g,v[50]=r,v[51]=s,v[52]=o,v[53]=S):S=v[53],S}function z({row:e,popOut:n,onOpen:a}){let{mutate:r}=(0,g.useSWRConfig)(),[s,o]=(0,f.useState)(!1),[i,l]=(0,f.useState)(!1),c="person"===e.key.kind?e.key.chatId:null,d=async e=>{if(c){o(!0);try{if(!await (0,y.respondToRequest)(c,e))return void b.toast.error("Couldn't do that.");await r(y.DM_LIST_KEY)}finally{o(!1)}}};return i?null:(0,t.jsxs)("div",{className:"kit-rise flex items-start gap-3 rounded-xl px-2.5 py-2.5",children:[(0,t.jsx)(R,{compact:!1,row:e}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,t.jsxs)("span",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"truncate font-semibold text-ui",children:e.name}),(0,t.jsx)("span",{className:"ml-auto shrink-0 text-caption text-muted-foreground",children:P(e.lastAt)}
2)]}),e.lastText?(0,t.jsx)("span",{className:"line-clamp-2 text-meta text-muted-foreground",children:e.lastText}):null,(0,t.jsxs)("span",{className:"mt-1 flex items-center gap-1.5",children:[(0,t.jsxs)("button",{className:"inline-flex h-7 items-center gap-1 rounded-full bg-primary px-3 font-medium text-meta text-primary-foreground transition-transform duration-[var(--dur-instant)] active:scale-95 disabled:opacity-60",disabled:s,onClick:()=>d("accept"),type:"button",children:[(0,t.jsx)(u.CheckIcon,{className:"size-3.5"}),"Accept"]}),(0,t.jsx)(x.default,{className:"inline-flex h-7 items-center rounded-full border border-border px-3 text-meta hover:bg-muted",href:e.href,onClick:t=>{n&&(0,C.openInDock)(t,e.key),a?.()},children:"View"}),(0,t.jsxs)(w.DropdownMenu,{children:[(0,t.jsx)(w.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"More",className:"grid size-7 place-items-center rounded-full text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-60",disabled:s,type:"button",children:(0,t.jsx)(m.MoreHorizontalIcon,{className:"size-4"})})}),(0,t.jsxs)(w.DropdownMenuContent,{align:"start",children:[(0,t.jsx)(w.DropdownMenuItem,{onSelect:()=>d("ignore"),children:"Ignore"}),(0,t.jsx)(w.DropdownMenuItem,{onSelect:()=>{if(!c)return;l(!0);let t=!1,n=window.setTimeout(async()=>{if(!t){if(!await (0,y.respondToRequest)(c,"block")){l(!1),b.toast.error("Couldn't block them.");return}await r(y.DM_LIST_KEY)}},5e3);(0,b.toast)(`Blocked ${e.name}`,{duration:5e3,action:{label:"Undo",onClick:()=>{t=!0,window.clearTimeout(n),l(!1)}}})},children:"Block"})]})]})]})]})]})}e.s(["FilterChips",0,function(e){let a,r,s,o,i=(0,n.c)(12),{filter:l,onFilter:c,counts:d,providers:u,className:m}=e;i[0]!==u?(a=["all","unread","reply","requests","writers",...u],i[0]=u,i[1]=a):a=i[1];let h=a;return i[2]!==m?(r=(0,k.cn)("scrollbar-none flex items-center gap-1.5 overflow-x-auto",m),i[2]=m,i[3]=r):r=i[3],i[4]!==h||i[5]!==d||i[6]!==l||i[7]!==c?(s=h.map(e=>{let n=d[e]??0,a=l===e;return(0,t.jsxs)("button",{"aria-selected":a,className:(0,k.cn)("inline-flex h-7 shrink-0 items-center gap-1 rounded-full border px-2.5 font-medium text-meta transition-colors",a?"border-foreground bg-foreground text-background":"border-border text-muted-foreground hover:bg-muted hover:text-foreground"),onClick:()=>c(e),role:"tab",type:"button",children:[D.FILTER_LABEL[e],n>0&&"all"!==e?(0,t.jsx)("span",{className:(0,k.cn)("rounded-full px-1 text-[10px] tabular-nums",a?"bg-background/20":"bg-muted"),children:n}):null]},e)}),i[4]=h,i[5]=d,i[6]=l,i[7]=c,i[8]=s):s=i[8],i[9]!==r||i[10]!==s?(o=(0,t.jsx)("div",{className:r,role:"tablist",children:s}),i[9]=r,i[10]=s,i[11]=o):o=i[11],o},"InboxSearch",0,function(e){let a,r,s,o,i,l,c=(0,n.c)(15),{value:d,onChange:u,className:m}=e;return c[0]!==m?(a=(0,k.cn)("flex h-9 items-center gap-2 rounded-full border border-border/60 bg-muted/40 px-3 focus-within:border-border-strong",m),c[0]=m,c[1]=a):a=c[1],c[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(h.SearchIcon,{className:"size-4 shrink-0 text-muted-foreground"}),c[2]=r):r=c[2],c[3]!==u?(s=e=>u(e.target.value),c[3]=u,c[4]=s):s=c[4],c[5]!==s||c[6]!==d?(o=(0,t.jsx)("input",{"aria-label":"Find a conversation",className:"h-full min-w-0 flex-1 bg-transparent text-ui outline-none placeholder:text-muted-foreground/60",onChange:s,placeholder:"Find a conversation",type:"text",value:d}),c[5]=s,c[6]=d,c[7]=o):o=c[7],c[8]!==u||c[9]!==d?(i=d?(0,t.jsx)("button",{"aria-label":"Clear",className:"grid size-6 place-items-center rounded-full text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>u(""),type:"button",children:(0,t.jsx)(p.XIcon,{className:"size-3.5"})}):null,c[8]=u,c[9]=d,c[10]=i):i=c[10],c[11]!==a||c[12]!==o||c[13]!==i?(l=(0,t.jsxs)("label",{className:a,children:[r,o,i]}),c[11]=a,c[12]=o,c[13]=i,c[14]=l):l=c[14],l},"MessengerList",0,function(e){let a,r,s,o,i,l=(0,n.c)(28),{compact:c,filter:d,query:u,active:m,popOut:h,onOpen:p}=e,x=void 0!==c&&c,f=void 0===u?"":u,b=void 0===m?null:m,g=void 0!==h&&h,{conversations:j,requests:y,isLoading:S,error:w,retry:N}=(0,D.useInbox)();if(w&&0===j.length){let e;return l[0]!==w||l[1]!==N?(e=(0,t.jsx)(v.ErrorState,{className:"m-3",error:w,retry:N,title:"Couldn't load your messages."}),l[0]=w,l[1]=N,l[2]=e):e=l[2],e}if(S){let e;return l[3]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(v.L
2oadingState,{className:"py-8"}),l[3]=e):e=l[3],e}if(l[4]!==b||l[5]!==x||l[6]!==j||l[7]!==d||l[8]!==p||l[9]!==g||l[10]!==f||l[11]!==y){o=Symbol.for("react.early_return_sentinel");e:{let e,n=(0,D.filterRows)(j,y,d,f);if(0===n.length){let e,n=f?"No one by that name.":"requests"===d?"No requests waiting.":"all"===d?"No messages yet.":`Nothing under ${D.FILTER_LABEL[d]}.`;l[16]!==n?(e=(0,t.jsx)(v.EmptyState,{className:"mx-3 my-4 px-4 py-8",title:n}),l[16]=n,l[17]=e):e=l[17],o=e;break e}a="flex flex-col gap-0.5 p-1.5",r=`${d}|${f}`,l[18]!==b||l[19]!==x||l[20]!==d||l[21]!==p||l[22]!==g?(e=(e,n)=>(0,t.jsx)("div",{className:"settle-in",style:{"--settle-i":n},children:"requests"===d?(0,t.jsx)(z,{onOpen:p,popOut:g,row:e}):(0,t.jsx)(A,{active:(0,D.sameKey)(b,e.key),compact:x,onOpen:p,popOut:g,row:e})},e.href),l[18]=b,l[19]=x,l[20]=d,l[21]=p,l[22]=g,l[23]=e):e=l[23],s=n.map(e)}l[4]=b,l[5]=x,l[6]=j,l[7]=d,l[8]=p,l[9]=g,l[10]=f,l[11]=y,l[12]=a,l[13]=r,l[14]=s,l[15]=o}else a=l[12],r=l[13],s=l[14],o=l[15];return o!==Symbol.for("react.early_return_sentinel")?o:(l[24]!==a||l[25]!==r||l[26]!==s?(i=(0,t.jsx)("div",{className:a,children:s},r),l[24]=a,l[25]=r,l[26]=s,l[27]=i):i=l[27],i)},"ProviderMark",0,T],865974)},228365,e=>{"use strict";var t=e.i(655691),n=e.i(864706);let a=new Map,r=new Map,s=new Set;function o(e){return s.add(e),()=>s.delete(e)}function i(){return null}e.s(["setTypingIn",0,function e(t,n,o){let i=r.get(t);i&&(clearTimeout(i),r.delete(t));let l=new Map(a);o?(l.set(t,n),r.set(t,setTimeout(()=>e(t,n,!1),6e3))):l.delete(t);for(let e of(a=l,s))e()},"useTypingIn",0,function(e){let r,s=(0,t.c)(2);return s[0]!==e?(r=()=>e?a.get(e)??null:null,s[0]=e,s[1]=r):r=s[1],(0,n.useSyncExternalStore)(o,r,i)}])},159490,322950,e=>{"use strict";var t=e.i(549111),n=e.i(655691),a=e.i(785942),r=e.i(594840),s=e.i(170165),o=e.i(615452),i=e.i(423979),l=e.i(569437),c=e.i(901120),d=e.i(815396),u=e.i(184032),m=e.i(716264),h=e.i(984968);e.s(["LineChartIcon",()=>h.default],322950);var h=h,p=e.i(520193),x=e.i(281364),f=e.i(355470),b=e.i(660032),g=e.i(198480),j=e.i(395977),y=e.i(909971),S=e.i(320184),v=e.i(811522);function w(){let e,t=(0,n.c)(2),{setOpenMobile:a}=(0,v.useSidebar)();return t[0]!==a?(e=()=>a(!1),t[0]=a,t[1]=e):e=t[1],e}let N=[{href:"/discover?topic=Politics",label:"Politics",icon:m.LandmarkIcon},{href:"/discover?topic=World",label:"World",icon:c.GlobeIcon},{href:"/sports",label:"Sports",icon:g.TrophyIcon},{href:"/discover/markets",label:"Markets",icon:h.default},{href:"/discover?topic=Business",label:"Business",icon:a.BriefcaseIcon},{href:"/entertainment",label:"Entertainment",icon:r.ClapperboardIcon},{href:"/music",label:"Music",icon:p.Music2Icon},{href:"/discover?topic=Health",label:"Health",icon:u.HeartPulseIcon},{href:"/discover?topic=Tech",label:"Tech",icon:s.CpuIcon},{href:"/discover?topic=Science",label:"Science",icon:i.FlaskConicalIcon},{href:"/discover?topic=Good News",label:"Good News",icon:d.HandHeartIcon},{href:"/encouragement",label:"Encouragement",icon:f.SparklesIcon},{href:"/discover/video",label:"Video",icon:j.VideoIcon},{href:"/memes",label:"Meme Wars",icon:b.SwordsIcon}];e.s(["CreateDoorsGroup",0,function(){let e,a,s,i,c,d,u=(0,n.c)(16),m=w(),h=(0,S.useBrand)(),p=!h||"ijr"===h.id,f=p?"Write":"Create";if(u[0]!==m||u[1]!==p||u[2]!==f){let n=p?[{label:"Post",href:"/journals/mine",icon:x.PencilIcon},{label:"Journal",href:"/journals/new",icon:o.FilePenIcon}]:[{label:"Game",href:"/arcade/studio",icon:l.Gamepad2Icon},{label:"Post",href:"/journals/mine",icon:x.PencilIcon},{label:"Media",href:"/studio",icon:r.ClapperboardIcon}];a=v.SidebarGroup,u[7]!==f?(i=(0,t.jsx)(v.SidebarGroupLabel,{children:f}),u[7]=f,u[8]=i):i=u[8],e=v.SidebarMenu,s=n.map(e=>(0,t.jsx)(v.SidebarMenuItem,{children:(0,t.jsx)(v.SidebarMenuButton,{asChild:!0,tooltip:`${p?"Write":"Create"} a ${e.label.toLowerCase()}`,children:(0,t.jsxs)(y.default,{href:e.href,onClick:m,children:[(0,t.jsx)(e.icon,{}),(0,t.jsx)("span",{children:e.label})]})})},e.label)),u[0]=m,u[1]=p,u[2]=f,u[3]=e,u[4]=a,u[5]=s,u[6]=i}else e=u[3],a=u[4],s=u[5],i=u[6];return u[9]!==e||u[10]!==s?(c=(0,t.jsx)(e,{children:s}),u[9]=e,u[10]=s,u[11]=c):c=u[11],u[12]!==a||u[13]!==i||u[14]!==c?(d=(0,t.jsxs)(a,{children:[i,c]}),u[12]=a,u[13]=i,u[14]=c,u[15]=d):d=u[15],d},"NEWS_SECTIONS",0,N,"useCloseMobileNav",0,w],159490)},875842,e=>{"use strict";function t(e){return e>=5&&e<12?"morning":e>=12&&e<17?"afternoon":e>=17&&e<22?"evening":"late"}let n=[{kind:"salutation",bucket:"morning",day:"any",text:"Good morning{name}."},{kind:"salutation",bucket:"morning",day:"any",text:"Rise and shine{name}."},{kind:"salutation",bucket:"morning",day:"any",text:"Morning{name}."},{kind:"salutation",bucket:"afternoon",day:"any",text:"Good afternoon{name}."},{kind:"salutation",bucket:"afternoon",day:"any",text:"Afternoon{name}."},{kind:"salutation",bucket:"evening",day:"any",text:"Good evening{name}."},{kind:"salutation",bucket:"evening",day:"any",text:"Evening{name}."},{kind:"salutation",bucket:"late",day:"any",text:"Up late{name}?"},{kind:"salutation",bucket:"late",day:"any",text:"Night owl hours{name}."},{kind:"quip",bucket:"morning",day:"any",text:"Coffee's optional â curiosity isn't."},{kind:"quip",bucket:"morning",day:"any",text:"First question of the day sets the tone."},{kind:"quip",bucket:"morning",day:"any",text:"Fresh brain. Point it at something interesting."},{kind:"quip",bucket:"afternoon",day:"any",text:"Perfect time for a deep dive."},{kind:"quip",bucket:"afternoon",day:"any",text:"Beat the slump with a good question."},{kind:"quip",bucket:"afternoon",day:"any",text:"Plenty of day left to learn something."},{kind:"quip",bucket:"evening",day:"any",text:"Winding down, or just getting curious?"},{kind:"quip",bucket:"evening",day:"any",text:"The day's not done asking."},{kind:"quip",bucket:"evening",day:"any",text:"Good questions pair well with dinner."},{kind:"quip",bucket:"late",day:"any",text:"The best questions come out after dark."},{kind:"quip",bucket:"late",day:"any",text:"Quiet hours, clear thoughts."},{kind:"quip",bucket:"late",day:"any",text:"Tomorrow-you will thank tonight-you for asking."},{kind:"quip",bucket:"any",day:0,text:"Sunday thoughts welcome here."},{kind:"quip",bucket:"any",day:0,text:"No meetings. Just questions."},{kind:"quip",bucket:"any",day:1,text:"New week, clean slate."},{kind:"quip",bucket:"any",day:1,text:"Monday's a good day to get ahead of it."}
2,{kind:"quip",bucket:"any",day:3,text:"Halfway through the week â keep the momentum."},{kind:"quip",bucket:"any",day:5,text:"It's Friday. Ask something fun."},{kind:"quip",bucket:"any",day:5,text:"Friday brain? Ask anyway."},{kind:"quip",bucket:"any",day:6,text:"Weekend curiosity hits different."}].map((e,t)=>({...e,id:`default-${t}`}));function a(e,t,n,a){return e.filter(e=>e.kind===t&&""!==e.text.trim()&&("any"===e.bucket||e.bucket===n)&&("any"===e.day||e.day===a))}e.s(["bucketFor",0,t,"buildGreeting",0,function(e,r=n){let s=t(e.getHours()),o=e.getDay(),i=24*Math.floor((e.getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5)+e.getHours(),l=a(r,"salutation",s,o);0===l.length&&(l=a(n,"salutation",s,o));let c=a(r,"quip",s,o);0===c.length&&(c=a(n,"quip",s,o));let d=l[i%l.length]?.text??"Hello{name}.",u=c[i%c.length]?.text??"",[m,h]=d.split("{name}");return{salutationStart:m,salutationEnd:h??"",quip:u}},"firstNameOf",0,function(e){return e&&e.trim().split(/\s+/)[0]||null}])},171422,e=>{"use strict";let t=[{id:"media",label:"Media",blurb:"Everything you watch. Play is here, your streaming subscriptions connect beside it, and once they're on, Friday's what-to-watch arrives without you asking.",ours:{title:"Play",doors:[{href:"/play",label:"Play",hint:"Your catalogues, your list, and the day's video."},{href:"/studio",label:"Studio",hint:"Make something of your own â a clip, a reel, a film."}]},ask:{label:"Ask what to watch",query:"What should I watch tonight, based on what I've been watching?"},curatedIds:["youtube"],slugs:["netflix","prime_video","disney_plus","hulu","max","apple_tv","peacock","paramount_plus","plex","trakt","letterboxd","twitch","vimeo"],emptyHint:"No streaming services connect yet. YouTube is on the rail today, and the rest arrive as the catalog adds them."},{id:"music",label:"Music",blurb:"Music and podcasts. Tie in the accounts you already listen on, and Genius works from your real library â then keeps a playlist coming every week on its own.",ours:null,ask:{label:"Ask for something to hear",query:"Find me a podcast episode worth hearing this week, based on what I listen to."},curatedIds:[],slugs:["spotify","apple_music","youtube_music","soundcloud","tidal","deezer","pandora","last_fm","audiomack","pocket_casts","overcast","listen_notes","podbean","buzzsprout","transistor"],emptyHint:"No music or podcast accounts connect yet â they arrive as the catalog adds them."},{id:"news",label:"News",blurb:"What you read of the day. IJR is here, your other news accounts connect beside it, and one brief can arrive every morning across all of it â folded, with the other side attached.",ours:{title:"IJR",doors:[{href:(0,e.i(360386).openUrl)("/discover"),label:"IJR",hint:"The feed, your sections, and what you saved.",external:!0},{href:"/write",label:"Write",hint:"Publish your own â a journal, a post, a newsletter."}]},ask:{label:"Brief me on today",query:"Brief me on today's news across the sources I follow."},curatedIds:["substack","newsbreak","reddit"],slugs:["feedly","pocket","instapaper","flipboard","google_news","hacker_news","medium","ghost","beehiiv"],emptyHint:"No other news accounts connect yet â Substack and NewsBreak are on the rail today."},{id:"books",label:"Books",blurb:"What you read of books. Your book accounts tie into Library, so a shelf you built elsewhere reads, listens and gets asked about here â a book a week in the short version, on its own.",ours:{title:"Library",doors:[{href:"/library",label:"Library",hint:"The catalog â full books and summaries."},{href:"/library/shelf",label:"Your shelf",hint:"What you're reading, saved and finished."},{href:"/library/notebook",label:"Notebook",hint:"Your highlights and notes across every book."}]},ask:{label:"Ask about a book",query:"What should I read next, and what's the short version of it?"},curatedIds:[],slugs:["goodreads","audible","kindle","storygraph","libby","overdrive","google_books","open_library","scribd","readwise"],emptyHint:"No book accounts connect yet â they arrive as the catalog adds them."}];t.map(e=>e.id),e.s(["MEDIA_HUB",0,t,"mediumById",0,function(e){return t.find(t=>
2t.id===e)}])},984968,e=>{"use strict";let t=(0,e.i(758277).default)("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);e.s(["default",0,t])},11633,e=>{"use strict";let t=(0,e.i(758277).default)("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);e.s(["ClipboardListIcon",0,t],11633)},615452,494429,e=>{"use strict";let t=(0,e.i(758277).default)("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]);e.s(["default",0,t],494429),e.s(["FilePenIcon",0,t],615452)},815396,e=>{"use strict";let t=(0,e.i(758277).default)("HandHeart",[["path",{d:"M11 14h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 16",key:"1ifwr1"}],["path",{d:"m7 20 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9",key:"17abbs"}],["path",{d:"m2 15 6 6",key:"10dquu"}],["path",{d:"M19.5 8.5c.7-.7 1.5-1.6 1.5-2.7A2.73 2.73 0 0 0 16 4a2.78 2.78 0 0 0-5 1.8c0 1.2.8 2 1.5 2.8L16 12Z",key:"1h3036"}]]);e.s(["HandHeartIcon",0,t],815396)},184032,e=>{"use strict";let t=(0,e.i(758277).default)("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]);e.s(["HeartPulseIcon",0,t],184032)},161688,e=>{"use strict";let t=(0,e.i(758277).default)("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);e.s(["LogInIcon",0,t],161688)},401109,689292,e=>{"use strict";var t=e.i(758277);let n=(0,t.default)("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);e.s(["PenIcon",0,n],401109);let a=(0,t.default)("UserRoundPlus",[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M22 19h-6",key:"vcuq98"}]]);e.s(["UserRoundPlusIcon",0,a],689292)},395977,e=>{"use strict";let t=(0,e.i(758277).default)("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);e.s(["VideoIcon",0,t],395977)}]); 3 4//# debugId=94a4704d-595a-a097-10d3-db7070c0616e
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.