1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._posthogReleaseId=e._posthogReleaseId||"01a0d2c8-6b7d-0000-f70a-d8c4c3e4bcf2";var n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="ab4e441f-3c49-5ace-90d7-33b5dd39e16a")}catch(e){}}();(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,479336,e=>{"use strict";var t=e.i(843476),r=e.i(618566),n=e.i(271645),i=e.i(174080),a=e.i(613176),s=e.i(108286);let o=["/home","/new","/chat","/feeds/discover","/mcp-api-cli?view=mcp","/history","/settings"],l=(0,n.createContext)(null);function c(e,t){let r=!1,n=()=>{r||e.prefetch(t,{kind:"auto",onInvalidate:n})};return n(),()=>{r=!0}}function d(){let e=(0,r.usePathname)();return(0,n.useLayoutEffect)(()=>{(0,s.storeWorkspaceReturnUrl)()},[e]),null}function u(){let e=(0,r.usePathname)(),t=(0,r.useRouter)();return(0,n.useLayoutEffect)(()=>{if("/sources"!==e)return c(t,"/sources")},[e,t]),null}e.s(["AppSidebarHost",0,function({children:e,sidebarComponent:s=a.AppSidebar}){let p=(0,r.useRouter)(),[m]=(0,n.useState)(()=>{if("u"<typeof document)return null;let e=document.createElement("div");return e.style.display="contents",e.setAttribute("data-app-sidebar-host",""),e}),[x,h]=(0,n.useState)(null),g=(0,n.useRef)(null),f=(0,n.useRef)(null),b=(0,n.useCallback)(e=>{g.current=e.owner,h(e)},[]),v=(0,n.useCallback)(e=>{if(g.current!==e||!m)return;g.current=null;let t=m.querySelector("[data-sidebar-scroll]");t&&(f.current=t.scrollTop)},[m]);(0,n.useLayoutEffect)(()=>{if(!m)return;let e=x?.frame;if(e){m.parentElement!==e&&e.appendChild(m);let t=f.current;if(null!==t){let e=m.querySelector("[data-sidebar-scroll]");e&&(e.scrollTop=t,f.current=null)}}else m.remove()},[m,x]);let j=(0,n.useMemo)(()=>({attach:b,detach:v}),[b,v]);return(0,n.useLayoutEffect)(()=>{let e=o.map(e=>c(p,e));return()=>e.forEach(e=>e())},[p]),(0,t.jsxs)(l.Provider,{value:j,children:[e,m&&x?(0,i.createPortal)((0,t.jsx)(s,{...x.props}),m):null,(0,t.jsxs)(n.Suspense,{fallback:null,children:[(0,t.jsx)(d,{}),(0,t.jsx)(u,{})]})]})},"COLD_CRITICAL_SIDEBAR_HREFS",0,o,"useAppSidebarHost",0,function(){return(0,n.useContext)(l)}])},613176,e=>{"use strict";var t=e.i(843476),r=e.i(86575),n=e.i(420256),i=e.i(896874),a=e.i(816458),s=e.i(618566),o=e.i(271645),l=e.i(166989),c=e.i(657688),d=e.i(948148),u=e.i(846696),p=e.i(370937),m=e.i(990218),x=e.i(397733),h=e.i(23084),g=e.i(371532),f=e.i(102321),b=e.i(269999);e.i(914771);var v=e.i(463415),j=e.i(200093),y=e.i(728231),w=e.i(804148),S=e.i(692605),N=e.i(87865),k=e.i(939914),C=e.i(503432),I=e.i(588077),T=e.i(827958),A=e.i(195877),E=e.i(72118),R=e.i(798975),P=e.i(803618),_=e.i(877279),F=e.i(189130),L=e.i(271983),z=e.i(916107),M=e.i(756733),O=e.i(89394),D=e.i(65195),B=e.i(253139),U=e.i(156481),H=e.i(647163);e.i(404948);var $=e.i(853651),W=e.i(330389);function K({count:e,mobile:r=!1}){let n=(0,d.useTranslations)("feeds");return(0,t.jsx)(S.AppSidebarCount,{ariaLabel:n("unreadCount",{unread:e}),count:e,mobile:r})}function V(){return"flex flex-col gap-[2px]"}function q(){let e=(0,d.useTranslations)("appSidebar");return(0,t.jsxs)("div",{className:"flex min-h-8 items-center gap-2 rounded-[8px] px-[6px] text-[12px] text-sidebar-supporting-foreground","data-sidebar-feed-loading":!0,role:"status",children:[(0,t.jsx)(b.Ring,{"aria-hidden":"true",className:"size-3.5"}),(0,t.jsx)("span",{children:e("feedsLoading")})]})}function Y(e,t){return(0,H.cn)("group/row relative flex touch-manipulation items-center gap-[2px] rounded-[8px] transition-colors",e?"h-8 px-[6px] active:bg-sidebar-accent active:text-sidebar-accent-foreground":"h-8 px-[6px] py-1",t?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-resting-foreground hover:bg-sidebar-accent/70 hover:text-sidebar-accent-foreground")}function G(){return"flex min-w-0 flex-1 items-center gap-[6px] rounded-[6px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring"}function X(e=!1){return(0,H.cn)("flex shrink-0 items-center justify-center text-sidebar-resting-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e?"size-8 rounded-[8px]":"-my-0.5 size-6 rounded-[6px]")}function J(e){return e?"flex items-center":"flex size-6 shrink-0 items-center opacity-0 pointer-events-none transition-opacity group-hover/row:opacity-100 group-hover/row:pointer-events-auto group-focus-within/row:opacity-100 group-focus-within/row:pointer-events-auto group-has-[[data-popup-open]]/row:opacity-100 group-has-[[data-popup-open]]/row:pointer-events-auto"}function Q({href:e,title:r,domain:n,count:i,active:a,mobile:s,onArmPrefetch:o,onCancelPrefetch:l,onDestinationNavigate:c,onNavigate:u,onMarkRead:m,onCopyUrl:x,onMoveToFolder:h,collections:f,currentFolderId:b,isMoving:j,removeHref:y,settingsHref:w,monitorId:S,dragging:N=!1,dragAttributes:k,dragListeners:C,onClickCapture:I,dragStyle:A,rowRef:E}){let P=(0,d.useTranslations)("feeds"),_=(0,d.useTranslations)("appSidebar");return(0,t.jsxs)("div",{className:(0,H.cn)(Y(s,a),"select-none",!s&&"touch-none cursor-grab active:cursor-grabbing focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:outline-none",N&&"z-10 bg-sidebar-accent text-sidebar-accent-foreground opacity-90 shadow-hairline"),"data-drag-source":N?"":void 0,"data-dnd-dragging":N?"true":void 0,onClickCapture:I,onKeyDown:e=>{if(e.target!==e.currentTarget)return;let t=C?.onKeyDown;t?.(e)},onPointerDown:C?.onPointerDown,ref:E,style:A,...k,children:[(0,t.jsxs)($.Link,{"aria-current":a?"page":void 0,className:G(),draggable:!1,href:e,onBlur:l,onDragStart:e=>e.preventDefault(),onFocus:o,onNavigate:c,onPointerEnter:o,onPointerLeave:l,role:"link",children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"size-5 shrink-0"}),(0,t.jsx)(p.FaviconImage,{className:"size-5 shrink-0 rounded-[4px] opacity-90 group-hover/row:opacity-100",domain:n??""}),(0,t.jsx)("span",{className:(0,H.cn)("min-w-0 flex-1 truncate font-medium",s?"text-[13px] leading-5 tracking-[-0.065px]":"text-[14px] leading-[20px] tracking-[-0.07px]"),children:r})]}),(0,t.jsx)("span",{className:J(s),"data-sidebar-drag-action":!0,onPointerDown:e=>e.stopPropagation(),children:(0,t.jsxs)(v.Menu,{children:[(0,t.jsx)(v.MenuTrigger,{"aria-label":P("feedOptions",{name:r}),className:X(s),children:(0,t.jsx)(g.MoreHorizontal,{"aria-hidden":"true",className:"size-3.5"})}),(0,t.jsxs)(v.MenuPopup,{align:"start",children:[(0,t.jsxs)(v.MenuItem,{onClick:m,children:[(0,t.jsx)(R.FigmaSidebarIcon,{name:"mark-all-read"}),_("markAllAsRead")]}),(0,t.jsxs)(v.MenuItem,{onClick:x,children:[(0,t.jsx)(g.Copy,{"aria-hidden":"true"}),P("copyUrl.action")]}),(0,t.jsx)(T.FeedFolderMoveSubmenu,{collections:f,currentFolderId:b,disabled:j,onMove:h}),S?(0,t.jsxs)(v.MenuItem,{render:(0,t.jsx)($.Link,{href:`/monitors/${S}`,onClick:u}
1),children:[(0,t.jsx)(R.FigmaSidebarIcon,{name:"smry-mark"}),"View monitor"]}):null,(0,t.jsxs)(v.MenuItem,{render:(0,t.jsx)($.Link,{href:w,onClick:u}),children:[(0,t.jsx)(g.Settings,{"aria-hidden":"true"}),P("settings.action")]}),(0,t.jsx)(v.MenuSeparator,{}),(0,t.jsxs)(v.MenuItem,{render:(0,t.jsx)($.Link,{href:y,onClick:u}),variant:"destructive",children:[(0,t.jsx)(g.Trash2,{"aria-hidden":"true"}),S?"Delete monitor":P("remove.action")]})]})]})}),(0,t.jsx)(K,{count:i,mobile:s})]})}function Z({domain:e,mobile:r,title:n}){let i=(0,d.useTranslations)("feeds");return(0,t.jsxs)("div",{"aria-busy":"true",className:(0,H.cn)(Y(r,!1),"cursor-progress"),"data-feed-pending":"",children:[(0,t.jsxs)("span",{className:G(),children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"size-5 shrink-0"}),(0,t.jsx)(p.FaviconImage,{className:"size-5 shrink-0 rounded-[4px] opacity-90",domain:e??""}),(0,t.jsx)("span",{className:(0,H.cn)("min-w-0 flex-1 truncate font-medium",r?"text-[13px] leading-5 tracking-[-0.065px]":"text-[14px] leading-[20px] tracking-[-0.07px]"),children:n})]}),(0,t.jsx)(b.Ring,{className:"mr-1 size-3.5 text-muted-foreground",label:i("discovery.following")})]})}function ee({containerId:e,containerSize:r,subscription:n,...i}){return(0,t.jsx)(E.FeedSidebarSortable,{containerSize:r,disabled:i.mobile,group:e,id:`feed:${n.id}`,itemId:n.id,itemName:n.title,type:"sidebar-feed",children:({attributes:e,dragging:r,listeners:n,onClickCapture:a,rowRef:s,style:o})=>(0,t.jsx)(Q,{...i,dragAttributes:e,dragListeners:n,dragStyle:o,dragging:r,onClickCapture:a,rowRef:s})})}function et({collection:e,count:r,active:n,expanded:i,hasMembers:a,panelId:s,mobile:o,onToggle:l,onArmPrefetch:c,onCancelPrefetch:u,onExportOpml:p,onImportOpml:m,onDestinationNavigate:x,onNavigate:h,onMarkRead:g,isExportingOpml:f,isImportingOpml:b,href:j,filterHref:y,manageHref:w,deleteHref:S,dragging:N=!1,dragAttributes:k,dragListeners:C,onClickCapture:I,rowRef:T}){let A=(0,d.useTranslations)("feeds"),E=(0,d.useTranslations)("appSidebar"),P="unsorted"===e.kind?A("collections.unsortedName"):e.name,_=(0,H.cn)("flex shrink-0 items-center justify-center rounded-[6px] text-sidebar-resting-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",o?"size-8":"-my-0.5 size-6");return(0,t.jsxs)("div",{className:(0,H.cn)(Y(o,n),"select-none items-center",!o&&"touch-none cursor-grab active:cursor-grabbing focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:outline-none",N&&"z-10 bg-sidebar-accent text-sidebar-accent-foreground opacity-90 shadow-hairline"),"data-drag-source":N?"":void 0,"data-dnd-dragging":N?"true":void 0,onClickCapture:I,onKeyDown:e=>{if(e.target!==e.currentTarget)return;let t=C?.onKeyDown;t?.(e)},onPointerDown:C?.onPointerDown,ref:T,...k,children:[a?(0,t.jsx)("button",{"aria-controls":s,"aria-expanded":i,"aria-label":A(i?"collections.collapse":"collections.expand",{name:P}),className:_,"data-sidebar-drag-action":!0,onClick:l,onPointerDown:e=>e.stopPropagation(),type:"button",children:(0,t.jsx)(R.FigmaSidebarIcon,{className:(0,H.cn)("size-5 transition-transform duration-150 motion-reduce:transition-none",!i&&"-rotate-90"),name:"chevron-down"})}):(0,t.jsx)("span",{"aria-hidden":"true",className:(0,H.cn)("shrink-0",o?"size-8":"-my-0.5 size-6")}),(0,t.jsxs)($.Link,{"aria-current":n?"page":void 0,className:"flex min-w-0 flex-1 items-center gap-[6px] rounded-[6px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",draggable:!1,href:j,onBlur:u,onDragStart:e=>e.preventDefault(),onFocus:c,onNavigate:x,onPointerEnter:c,onPointerLeave:u,role:"link",children:[(0,t.jsx)(R.FigmaSidebarIcon,{className:"size-5",name:"folder"}),(0,t.jsx)("span",{className:(0,H.cn)("min-w-0 flex-1 truncate font-normal",o?"text-[13px] leading-5 tracking-[-0.065px]":"text-[14px] leading-[20px] tracking-[-0.07px]"),children:P})]}),(0,t.jsx)("span",{className:J(o),"data-sidebar-drag-action":!0,onPointerDown:e=>e.stopPropagation(),children:(0,t.jsxs)(v.Menu,{children:[(0,t.jsx)(v.MenuTrigger,{"aria-label":A("collections.options",{name:P}),className:X(o),children:(0,t.jsx)(R.FigmaSidebarIcon,{name:"plus"})}),(0,t.jsxs)(v.MenuPopup,{align:"start",className:"w-[200px]",sideOffset:6,children:[(0,t.jsxs)(v.MenuItem,{render:(0,t.jsx)($.Link,{href:`/feeds/discover?collection=${e.id}`,prefetch:!0,onClick:h}),children:[(0,t.jsx)(R.FigmaSidebarIcon,{className:"size-5",name:"follow-source"}),E("followSource")]}),"custom"===e.kind?(0,t.jsxs)(v.MenuItem,{render:(0,t.jsx)($.Link,{href:w,onClick:h}),children:[(0,t.jsx)(R.FigmaSidebarIcon,{className:"size-5",name:"rename"}),E("renameFolder")]}):null,(0,t.jsxs)(v.MenuItem,{render:(0,t.jsx)($.Link,{href:y,onClick:h}),children:[(0,t.jsx)(R.FigmaSidebarIcon,{className:"size-5",name:"rename"}),E("filterStories")]}),(0,t.jsx)(v.MenuSeparator,{}),(0,t.jsxs)(v.MenuItem,{onClick:g,children:[(0,t.jsx)(R.FigmaSidebarIcon,{className:"size-5",name:"mark-all-read"}),E("markAllAsRead")]}),(0,t.jsx)(v.MenuSeparator,{}),(0,t.jsxs)(v.MenuItem,{disabled:b,onClick:m,children:[(0,t.jsx)(R.FigmaSidebarIcon,{className:"size-5",name:"import-opml"}),E("importOpml")]}),(0,t.jsxs)(v.MenuItem,{disabled:f,onClick:p,children:[(0,t.jsx)(R.FigmaSidebarIcon,{className:"size-5",name:"export-opml"}),E("exportOpml")]}),"custom"===e.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v.MenuSeparator,{}),(0,t.jsxs)(v.MenuItem,{render:(0,t.jsx)($.Link,{href:S,onClick:h}),children:[(0,t.jsx)(R.FigmaSidebarIcon,{className:"size-5",name:"delete-folder"}),E("deleteFolder")]})]}):null]})]})}),(0,t.jsx)(K,{count:r,mobile:o})]})}function er({children:e,containerSize:r,...n}){let{collection:i,mobile:a}=n,s=(0,d.useTranslations)("feeds"),o="unsorted"===i.kind?s("collections.unsortedName"):i.name;return(0,t.jsx)(E.FeedSidebarSortable,{containerSize:r,disabled:a,group:"sidebar-collections",id:`collection:${i.id}`,itemId:i.id,itemName:o,type:"sidebar-collection",children:({attributes:r,dragging:a,dropTarget:s,handleRef:o,listeners:l,onClickCapture:c,ref:d,style:u})=>(0,t.jsxs)("div",{className:(0,H.cn)(V(),s&&"rounded-[8px] bg-sidebar-accent/50"),"data-feed-drop-target":s?"true":void 0,"data-testid":`sortable-collection-${i.id}`,ref:d,style:u,children:[(0,t.jsx)(et,{...n,dragAttributes:r,dragListeners:l,dragging:a,onClickCapture:c,rowRef:o}),e]})})}function en({href:e,icon:r,label:n,mobile:i,onClick:a}){return(0,t.jsxs)(f.Button,{className:(0,H.cn)("w-full justify-start gap-[6px] rounded-[8px] p-[6px] font-normal text-sidebar-resting-foreground hover:bg-sidebar-accent/70 hover:text-sidebar-accent-foreground",i?"min-h-8 text-[13px] leading-5 tracking-[-0.065px]":"min-h-8 text-[14px] leading-[20px] tracking-[-0.07px]"),onClick:a,nativeButton:!e,render:e?(0,t.jsx)($.Link,{href:e}):void 0,size:"sm",variant:"ghost",children:[r,(0,t.jsx)("span",{className:"min-w-0 truncate",children:n})]})}function ei({onNavigate:e,onRequestSignIn:r}){let n=(0,d.useTranslations)("appSidebar"),i=(0,d.useTranslations)("nav");return(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 rounded-[8px] p-[6px]",children:[(0,t.jsxs)("div",{className:"flex w-full flex-col items-center gap-[6px]",children:[(0,t.jsx)(R.FigmaSidebarIcon,{className:"size-[22.4px] text-sidebar-detail-foreground",name:"account"}),(0,t.jsx)("p",{className:"w-40 text-center text-[12px] font-normal leading-[18px] tracking-[-0.06px] text-sidebar-detail-foreground",children:n("feedsGuestPrompt")})]}),(0,t.jsx)(f.Button,{className:"relative h-7 rounded-[6px] bg-sidebar-foreground
1/[0.13] px-2 text-[12px] font-medium leading-[18px] tracking-[-0.06px] text-sidebar-foreground hover:bg-sidebar-foreground/[0.17] before:absolute before:-inset-x-2 before:-inset-y-2 before:content-[''] sm:text-[12px]",onClick:r??e,nativeButton:!!r,render:r?void 0:(0,t.jsx)($.Link,{href:"/feeds"}),size:"sm",variant:"secondary",children:i("signIn")})]})}function ea({allFeedsActive:e=!1,id:r,selectedFeedId:n,selectedCollectionId:l,mobile:c=!1,onFeedsPage:p=!1,onNavigate:m,onRequestFollowSources:x,onRequestSignIn:h,unreadOnly:f=!1}){let b=(0,d.useTranslations)("appSidebar"),v=(0,d.useTranslations)("feeds"),{subscriptions:j,collections:y,error:w,isLoading:N,isSignedIn:k,refetch:C}=(0,M.useFeedSubscriptions)(),I=(0,o.useSyncExternalStore)(_.subscribeFeedSidebarOrder,_.getFeedSidebarOrderSnapshot,_.getFeedSidebarOrderServerSnapshot),T=(0,o.useSyncExternalStore)(_.subscribeCollectionSidebarOrder,_.getCollectionSidebarOrderSnapshot,_.getCollectionSidebarOrderServerSnapshot),$=(0,_.orderSidebarItemsByPreference)(j,I,e=>e.id),Y=(0,_.orderSidebarItemsByPreference)((0,P.groupSubscriptions)(y,$).grouped,T,e=>e.collection.id),G=(0,O.useCollapsedFeedCollections)(),X=(0,o.useRef)(null),J=(0,o.useRef)(null),Q=(0,a.useOpmlImport)(),et=(0,o.useRef)(null),es=(0,o.useRef)(void 0),{exportOpml:eo,isExportingOpml:el}=(0,M.useFeedOpmlTransfer)(),[ec,ed]=(0,o.useState)(()=>{let e=(0,B.getLatestRssSubscriptionReveal)();return e?new Map([[e.folderId,!0]]):new Map}),eu=(0,o.useId)(),ep=(0,M.useFeedPrefetch)(),em=(0,M.useFeedMarkRead)(),{isUpdatingSubscription:ex,updateSubscription:eh}=(0,M.useFeedSubscriptionUpdater)(),eg=(0,o.useRef)(null),ef=(0,o.useRef)(null),eb=(0,o.useCallback)(()=>{null!==ef.current&&(clearTimeout(ef.current),ef.current=null)},[]),ev=(0,o.useCallback)(e=>{eb(),ef.current=setTimeout(()=>{ef.current=null,ep(e,{unreadOnly:f})},120)},[eb,ep,f]),ej=(0,s.useRouter)(),ey=(0,o.useCallback)((e,t,r)=>{eb(),ep(r,{unreadOnly:f}),m?.();let n=new URLSearchParams(window.location.search),i=(0,W.hasWorkspaceSidebar)((0,W.parseFeedWorkspace)({view:n.get("view"),article:n.get("article")},(0,W.feedWorkspaceDefault)(window.location.pathname))),a=new URL(t,window.location.origin);i&&a.searchParams.set("view","timeline-chat");let s=a.pathname+a.search;if(!p){i&&(e.preventDefault(),ej.push(s));return}e.preventDefault(),window.history.pushState(null,"",s)},[eb,p,m,ep,ej,f]);(0,z.useExternalSync)(()=>eb,[eb]),(0,z.useExternalSync)(()=>{let e=e=>{let t=e.detail;(0,B.isRssSubscriptionRevealDetail)(t)&&ed(e=>{if(!0===e.get(t.folderId))return e;let r=new Map(e);return r.set(t.folderId,!0),r})};return window.addEventListener(B.RSS_SUBSCRIPTION_REVEAL_EVENT,e),()=>window.removeEventListener(B.RSS_SUBSCRIPTION_REVEAL_EVENT,e)},[]),(0,o.useLayoutEffect)(()=>{if(N||!X.current||!J.current)return;let e=Math.max(c?D.DEFAULT_MOBILE_APP_SIDEBAR_FEED_TREE_HEIGHT:D.DEFAULT_APP_SIDEBAR_FEED_TREE_HEIGHT,Math.ceil(J.current.getBoundingClientRect().height));X.current.style.minHeight=`${e}px`,(0,D.rememberAppSidebarFeedTreeHeight)(e,c)},[y,N,c,j]);let ew=j.reduce((e,t)=>e+t.unreadCount,0),eS=(0,o.useCallback)((e,t)=>{let r=(eg.current??Promise.resolve()).then(async()=>{try{return await eh({folderId:t,subscriptionId:e}),!0}catch(e){return u.toast.error(e instanceof Error?e.message:v("collections.saveFailure")),!1}});return eg.current=r.then(()=>void 0),r},[v,eh]),eN=(0,F.buildFeedsHref)({unreadOnly:f}),ek=(0,t.jsx)(S.AppSidebarNavRow,{active:e&&!l,collapsed:!1,href:eN,hierarchy:"secondary",icon:(0,t.jsx)(R.FigmaSidebarIcon,{className:"size-5",name:"grid"}),label:b("allFeeds"),mobile:c,onNavigate:e=>ey(e,eN,{}),trailing:(0,t.jsx)(K,{count:ew,mobile:c})}),eC=null;return eC=N?(0,t.jsx)(q,{}):k?w&&0===j.length&&0===y.length?(0,t.jsx)("div",{className:V(),children:(0,t.jsx)(en,{icon:(0,t.jsx)(g.RefreshCw,{"aria-hidden":"true",className:c?"size-[15px]":"size-4",strokeWidth:c?1.75:void 0}),label:b("feedsRetry"),mobile:c,onClick:()=>void C()})}):y.length>0||j.length>0?(0,t.jsx)(E.FeedSidebarDragProvider,{onDragEnd:({active:e,over:t})=>{if(!t||e.id===t.id)return;let r=(0,A.getFeedSidebarSortableData)(e.data.current),n=(0,A.getFeedSidebarSortableData)(t.data.current);if(!r||!n)return;let i=(0,A.resolveFeedSidebarDrop)(r,n);if(i){if("reorder-folder"===i.type){let e=Y.map(e=>e.collection.id),t=(0,_.reorderSidebarPreference)(T,e,i.sourceFolderId,i.targetFolderId);t!==T&&(0,_.writeCollectionSidebarOrder)(window.localStorage,t);return}
1if("reorder-feed"===i.type){let e=(0,_.getVisibleFeedIdsForCollection)(Y,i.folderId),t=(0,_.reorderSidebarPreference)(I,e,i.sourceSubscriptionId,i.targetSubscriptionId);t!==I&&(0,_.writeFeedSidebarOrder)(window.localStorage,t);return}eS(i.subscriptionId,i.targetFolderId).then(e=>{if(!e||null===i.targetSubscriptionId)return;let t=Y.flatMap(e=>e.subscriptions.map(e=>e.id)),r=(0,_.readFeedSidebarOrder)(window.localStorage),n=(0,_.moveSidebarPreferenceBefore)(r,t,i.subscriptionId,i.targetSubscriptionId);n!==r&&(0,_.writeFeedSidebarOrder)(window.localStorage,n)})}},children:(0,t.jsx)(E.FeedSidebarSortableList,{ids:Y.map(e=>`collection:${e.collection.id}`),children:(0,t.jsxs)("div",{className:V(),children:[Y.map(e=>{let r,i=e.collection.id,a=(0,F.buildFeedsHref)({collectionId:i,unreadOnly:f}),s=`${eu}-${i}`,o=e.subscriptions.length>0,d="unsorted"===e.collection.kind&&(l===i||e.subscriptions.some(e=>e.feedId===n)),p="unsorted"===e.collection.kind?ec.get(i)??d:!G.has(i);return(0,t.jsx)(er,{active:l===i,collection:e.collection,containerSize:Y.length,count:e.unreadCount,deleteHref:(0,F.buildFeedsHref)({collectionId:i,manage:"delete",unreadOnly:f}),expanded:p,hasMembers:o,href:a,filterHref:(0,F.buildFeedsHref)({collectionId:i,manage:"filter",unreadOnly:f}),isExportingOpml:el,isImportingOpml:Q.open,manageHref:(0,F.buildFeedsHref)({collectionId:i,manage:"edit",unreadOnly:f}),mobile:c,onArmPrefetch:()=>ev({collectionId:i}),onCancelPrefetch:eb,onExportOpml:()=>{eo(i).catch(e=>{u.toast.error(e instanceof Error?e.message:v("opml.exportFailure"))})},onImportOpml:()=>{es.current=i,et.current?.click()},onMarkRead:()=>{em({collectionId:i}).catch(()=>{})},onDestinationNavigate:e=>ey(e,a,{collectionId:i}),onNavigate:m,onToggle:()=>{"unsorted"===e.collection.kind?ed(e=>{let t=new Map(e),r=e.get(i)??d;return t.set(i,!r),t}):(0,O.rememberFeedCollectionCollapsed)(i,p)},panelId:s,children:o&&p?(0,t.jsx)(E.FeedSidebarSortableList,{ids:e.subscriptions.map(e=>`feed:${e.id}`),children:(0,t.jsx)("div",{className:"relative flex flex-col gap-[2px] before:absolute before:inset-y-0 before:start-4 before:w-px before:bg-sidebar-guide before:content-['']",id:s,style:(r=Math.max(32,34*e.subscriptions.length-2),{contentVisibility:"auto",containIntrinsicSize:`auto ${r}px`}),children:e.subscriptions.map(r=>((e,r,i)=>{if((0,U.isProvisionalSubscription)(e))return(0,t.jsx)(Z,{domain:(0,H.extractHostname)(e.siteUrl??e.feedUrl),mobile:c,title:e.title},e.id);let a=(0,L.toMonitorSubscription)(e)?.id,s=(0,F.buildFeedsHref)({feedId:e.feedId,unreadOnly:f});return(0,t.jsx)(ee,{active:n===e.feedId,containerId:r,containerSize:i,count:e.unreadCount,collections:y,currentFolderId:e.folderId,domain:(0,H.extractHostname)(e.siteUrl??e.feedUrl),href:s,isMoving:ex,mobile:c,onArmPrefetch:()=>ev({feedId:e.feedId}),onCancelPrefetch:eb,onCopyUrl:()=>{navigator.clipboard?navigator.clipboard.writeText(e.feedUrl).then(()=>u.toast.success(v("copyUrl.success"))).catch(()=>u.toast.error(v("copyUrl.failure"))):u.toast.error(v("copyUrl.failure"))},onMarkRead:()=>{em({feedId:e.feedId}).catch(()=>{})},onMoveToFolder:t=>{eS(e.id,t)},onDestinationNavigate:t=>ey(t,s,{feedId:e.feedId}),onNavigate:m,removeHref:(0,F.buildFeedsHref)({feedId:e.feedId,manage:"remove",unreadOnly:f}),settingsHref:(0,F.buildFeedsHref)({feedId:e.feedId,manage:"settings",unreadOnly:f}),monitorId:a,subscription:e,title:e.title},e.id)})(r,i,e.subscriptions.length))})}):null},i)}),0===j.length?(0,t.jsx)(en,{href:x?void 0:"/feeds/discover",icon:(0,t.jsx)(R.FigmaSidebarIcon,{className:"size-5",name:"follow-source"}),label:b("followSources"),mobile:c,onClick:x??m}):null]})})}):(0,t.jsx)("div",{className:V(),children:(0,t.jsx)(en,{href:x?void 0:"/feeds/discover",icon:(0,t.jsx)(R.FigmaSidebarIcon,{className:"size-5",name:"follow-source"}),label:b("followSources"),mobile:c,onClick:x??m})}):(0,t.jsx)(ei,{onNavigate:m,onRequestSignIn:h}),(0,t.jsxs)(t.Fragment,{children:[Q.open&&(0,t.jsx)(i.OpmlImportDialog,{importer:Q}),(0,t.jsx)("input",{ref:et,accept:".opml,.xml,application/xml,text/xml,text/x-opml","aria-hidden":"true",className:"sr-only",onChange:e=>{let t=e.currentTarget.files?.[0];e.currentTarget.value="";let r=es.current,n=y.find(e=>e.id===r);es.current=void 0,t&&void 0!==r&&Q.load(t,{id:r,name:n?.name??""})},tabIndex:-1,type:"file"}),(0,t.jsx)("div",{"aria-busy":N,className:V(),id:r,ref:X,style:{minHeight:c?D.MOBILE_APP_SIDEBAR_FEED_TREE_HEIGHT_STYLE_VALUE:D.APP_SIDEBAR_FEED_TREE_HEIGHT_STYLE_VALUE},children:(0,t.jsxs)("div",{className:V(),ref:J,children:[!N&&k?ek:null,eC]})})]})}let es=["library","feeds","chat"],eo="library",el="smry-app-sidebar-tab",ec={home:"library",new:"library",dashboard:"library",history:"library",highlights:"library",sources:"library",books:"library",files:"library",feed:"feeds",feeds:"feeds",feedsDiscover:"feeds",monitors:"feeds",newsletters:"feeds",chat:"chat",mcpApiCli:"chat"};function ed(e,t){return`${e}-tab-${t}`}function eu(e,t){return`${e}-panel-${t}`}let ep=new Set,em=null;function ex(e){ep.add(e);let t=t=>{(null===t.key||t.key===el)&&(em=null,e())};return window.addEventListener("storage",t),()=>{ep.delete(e),window.removeEventListener("storage",t)}}function eh(){return null===em&&(em=function(){try{let e=window.localStorage.getItem(el);return"string"==typeof e&&es.includes(e)?e:null}catch{return null}}()??eo),em}function eg(){return eo}function ef({baseId:e,tabs:r,value:n,onValueChange:i,collapsed:a=!1,mobile:s=!1,label:o}){return(0,t.jsx)("div",{role:"tablist","aria-label":o,"aria-orientation":a?"vertical":"horizontal","data-sidebar-tab-strip":!0,onKeyDown:t=>{let r=a?"ArrowUp":"ArrowLeft",s=a?"ArrowDown":"ArrowRight",o=null,l=es.indexOf(n);if(t.key===r?o=(l-1+es.length)%es.length:t.key===s?o=(l+1)%es.length:"Home"===t.key?o=0:"End"===t.key&&(o=es.length-1),null===o)return;t.preventDefault();let c=es[o];c&&(i(c),t.currentTarget.querySelector(`#${ed(e,c)}`)?.focus())},className:(0,H.cn)("flex shrink-0 rounded-[9px] bg-sidebar-accent/45 p-0.5",a?"w-8 flex-col gap-0.5":"h-8 w-full items-center gap-0.5"),children:r.map(r=>
1{let o=r.id===n,l=(0,t.jsx)("button",{type:"button",role:"tab",id:ed(e,r.id),"aria-selected":o,"aria-controls":o?eu(e,r.id):void 0,"aria-label":a?r.ariaLabel??r.label:r.ariaLabel,tabIndex:o?0:-1,"data-sidebar-tab":r.id,onClick:()=>i(r.id),className:(0,H.cn)("flex shrink-0 items-center justify-center rounded-[7px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",a?"size-7":(0,H.cn)("h-7 min-w-0 flex-1 gap-1 px-1 leading-5",s?"text-[12px]":"text-[12.5px] tracking-[-0.06px]"),o?"bg-sidebar text-sidebar-accent-foreground shadow-[inset_0_0_0_1px_var(--sidebar-border)]":(0,H.cn)("text-sidebar-resting-foreground hover:text-sidebar-accent-foreground",s&&"active:text-sidebar-accent-foreground")),children:a?(0,t.jsx)("span",{"aria-hidden":"true",className:"flex size-5 items-center justify-center",children:r.icon}):(0,t.jsx)("span",{className:"min-w-0 truncate",children:r.label})});return(0,t.jsx)(S.AppSidebarIconTooltip,{collapsed:a,label:r.ariaLabel??r.label,children:l},r.id)})})}var eb=e.i(192875),ev=e.i(523478);function ej({name:e,prompt:r,disabled:n,previewArticles:i}){let a=(0,d.useTranslations)("appSidebar"),s=(0,d.useFormatter)(),l=JSON.stringify([e.trim(),r.trim()]),[c,u]=(0,o.useState)(null),[p,m]=(0,o.useState)(null),[x,h]=(0,o.useState)(null),g=(0,o.useRef)(null),b=(0,o.useRef)(null),v=(0,o.useRef)(null);(0,z.useExternalSync)(()=>()=>b.current?.abort(),[]);let j=p===l,y=null!==c&&c.key!==l,w=!!(e.trim()&&r.trim())&&!n&&!j,S=async(t=!1)=>{if(!w||v.current===l)return;v.current=l,g.current?.scrollIntoView({block:"start"}),b.current?.abort();let n=new AbortController;b.current=n,m(l),h(null);try{let a=await i({name:e.trim(),classificationPrompt:r.trim(),...t&&c?.key===l&&c.nextCursor?{cursor:c.nextCursor}:{}},n.signal);if(n.signal.aborted)return;u({...a,key:l,matches:t&&c?.key===l?[...c.matches,...a.matches]:a.matches,scanned:a.scanned+(t&&c?.key===l?c.scanned:0),unavailable:a.unavailable+(t&&c?.key===l?c.unavailable:0)})}catch{n.signal.aborted||h({key:l})}finally{n.signal.aborted||(v.current=null,m(null))}};return(0,t.jsxs)("section",{ref:g,"aria-label":a("tagPreviewTitle"),className:"flex min-h-[calc(85dvh-6rem)] flex-col bg-muted/30 p-5 md:min-h-0 md:overflow-y-auto md:border-l md:border-border/60 md:p-6",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsx)("h3",{className:"text-base font-medium",children:a("tagPreviewTitle")}),(0,t.jsx)(f.Button,{type:"button",variant:"outline",size:"sm",static:!0,className:"min-h-11 sm:min-h-8",disabled:!w,onClick:()=>void S(),children:a(c?"tagPreviewRefresh":"tagPreviewAction")})]}),(0,t.jsx)("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:a("tagPreviewReadOnly")}),(0,t.jsx)("div",{role:"status",className:"mt-4 text-sm leading-6",children:j?a("tagPreviewScanning",{count:100}):y?a("tagPreviewStale"):c?a("tagPreviewCount",{matches:c.matches.length,count:c.scanned}):""}),c||j?null:(0,t.jsxs)("div",{className:"flex flex-1 flex-col items-start justify-start py-5 md:justify-center md:py-8",children:[(0,t.jsx)("p",{className:"text-base font-medium",children:a("tagPreviewEmptyTitle")}),(0,t.jsx)("p",{className:"mt-2 max-w-sm text-sm leading-6 text-muted-foreground",children:a("tagPreviewIntro",{count:100})})]}),j&&!c?(0,t.jsx)("div",{"aria-hidden":"true",className:"mt-5 space-y-6",children:[0,1,2,3,4].map(e=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(ev.LoadingSkeleton,{className:"h-3 w-1/3"}),(0,t.jsx)(ev.LoadingSkeleton,{className:"h-4 w-5/6"})]},e))}):null,c?(0,t.jsxs)("div",{className:"mt-3",children:[c.unavailable>0?(0,t.jsx)("p",{className:"mb-3 text-xs leading-5 text-muted-foreground",children:a("tagPreviewUnavailable",{count:c.unavailable})}):null,0===c.matches.length?(0,t.jsx)("p",{className:"py-6 text-sm leading-6 text-muted-foreground",children:a("tagPreviewNoMatches")}):(0,t.jsx)("ul",{className:"divide-y divide-border/50",children:c.matches.map(e=>(0,t.jsxs)("li",{className:"py-3",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"truncate",children:e.domain||a("tagPreviewSavedArticle")}),(0,t.jsx)("time",{dateTime:e.savedAt,className:"shrink-0",children:s.dateTime(new Date(e.savedAt),{month:"short",day:"numeric"})})]}),(0,t.jsx)("p",{className:"mt-1 break-words text-sm font-medium leading-6",children:e.title})]},e.id))}),c.nextCursor?(0,t.jsx)(f.Button,{type:"button",variant:"outline",static:!0,className:"mt-4 min-h-11",disabled:!w||y,onClick:()=>void S(!0),children:a("tagPreviewMore",{count:100})}):y?null:(0,t.jsx)("p",{className:"mt-4 text-xs text-muted-foreground",children:a("tagPreviewEnd")})]}):null,x?.key===l?(0,t.jsx)("p",{role:"alert",className:"mt-3 text-sm leading-6",children:a("tagPreviewFailed")}):null]})}var ey=e.i(915124),ew=e.i(23750),eS=e.i(184762),eN=e.i(50270),ek=e.i(566533);function eC(e){let t=(0,ek.normalizeLibraryTag)(e);return t?t.normalize("NFKC").toLocaleLowerCase():null}function eI(e){let t=(0,ek.normalizeLibraryTag)(e);return t?`Apply â${t}â when it is a primary subject of the article. Do not apply it for a passing mention or weak connection.`:""}function eT(e){var t,r;let n,i;return!!e&&"object"==typeof e&&(t={name:e.name,classificationPrompt:e.classificationPrompt},i=eC(n=(0,ek.normalizeLibraryTag)(t.name)),(n&&i?!!{name:n,key:i,classificationPrompt:("string"!=typeof(r=t.classificationPrompt)?"":r.normalize("NFKC").trim().replace(/\s+/g," ").slice(0,500).trim())||eI(n)}:!!null)&&"string"==typeof e.key&&(null===e.createdAt||"string"==typeof e.createdAt)&&(null===e.updatedAt||"string"==typeof e.updatedAt))}function eA({definition:e,onClose:r,onSave:n,suggestClassificationPrompt:i,previewArticles:a}){let s=(0,d.useTranslations)("appSidebar"),l=(0,o.useId)(),[c,u]=(0,o.useState)(e?.name??""),[p,m]=(0,o.useState)(e?.classificationPrompt??""),[x,h]=(0,o.useState)(null),[g,b]=(0,o.useState)(!1),[v,j]=(0,o.useState)(!1),[y,w]=(0,o.useState)(null),[S,N]=(0,o.useState)(!1),[k,C]=(0,o.useState)(!1),I=(0,o.useRef)(0),T=(0,o.useRef)(!1),A=c!==(e?.name??"")||p!==(e?.classificationPrompt??""),E=()=>{T.current||(I.current++,r())},R=async()=>
1{if(!c.trim()||g||T.current)return;let e=++I.current;b(!0),N(!1),h(null);try{let t=await i(c.trim());e===I.current&&h(t)}catch{e===I.current&&N(!0)}finally{e===I.current&&b(!1)}},P=async()=>{if(!T.current){T.current=!0,j(!0),w(null),I.current++,b(!1);try{await n({name:c.trim(),classificationPrompt:p.trim()}),r()}catch(e){w(e instanceof Error?e.message:s("tagsSaveFailed"))}finally{T.current=!1,j(!1)}}};return(0,t.jsx)(ey.ResponsiveDrawer,{hideTrigger:!0,showCloseButton:!1,showMobileCloseButton:!1,title:e?s("editTag",{name:e.name}):s("newTag"),contentClassName:"bg-card shadow-hairline sm:max-w-[960px] sm:rounded-[14px] md:h-[min(680px,90dvh)]",open:!0,onOpenChange:e=>{e||T.current||(A?C(!0):E())},children:(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),P()},className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"grid min-h-0 flex-1 overflow-y-auto overscroll-contain md:grid-cols-[minmax(0,5fr)_minmax(0,6fr)] md:overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-5 md:overflow-y-auto md:p-6",children:[(0,t.jsx)("h2",{id:`${l}-title`,className:"text-lg font-medium leading-6",children:e?s("editTag",{name:e.name}):s("newTag")}),(0,t.jsx)("p",{className:"mt-1 text-sm leading-5 text-muted-foreground",children:s("tagDialogDescription")}),(0,t.jsxs)("fieldset",{"aria-labelledby":`${l}-title`,disabled:v||k,className:"mt-5 space-y-4",children:[e?null:(0,t.jsxs)("label",{htmlFor:`${l}-name`,className:"block text-sm font-medium",children:[s("tagName"),(0,t.jsx)(ew.Input,{id:`${l}-name`,nativeInput:!0,required:!0,pattern:".*\\S.*",maxLength:ek.MAX_LIBRARY_TAG_LENGTH,value:c,onChange:e=>{u(e.currentTarget.value),I.current++,b(!1),h(null),N(!1)},className:"mt-1.5 min-h-11 text-base sm:text-sm",placeholder:s("tagNamePlaceholder")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:`${l}-prompt`,className:"text-sm font-medium",children:s("classificationPrompt")}),(0,t.jsx)(eS.Textarea,{id:`${l}-prompt`,required:!0,rows:6,maxLength:500,value:p,onChange:e=>m(e.currentTarget.value),"aria-describedby":`${l}-hint`,className:"mt-1.5 min-h-36 resize-y text-base leading-6 sm:text-sm",placeholder:s("classificationPromptPlaceholder")}),(0,t.jsx)("p",{id:`${l}-hint`,className:"mt-1.5 text-xs leading-5 text-muted-foreground",children:s("tagPromptHint")}),(0,t.jsxs)("div",{className:"mt-2 flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)(f.Button,{type:"button",variant:"outline",size:"sm",className:"min-h-11 sm:min-h-8",static:!0,disabled:!c.trim()||g,onClick:()=>void R(),children:g?s("generatingClassificationPrompt"):s("generateTagPrompt")}),(0,t.jsx)("span",{className:"text-xs tabular-nums text-muted-foreground",children:s("charactersRemaining",{count:500-p.length})})]}),(0,t.jsx)("p",{role:"status",className:"sr-only",children:g?s("generatingClassificationPrompt"):x?s("tagSuggestionReady"):""}),S?(0,t.jsx)("p",{role:"alert",className:"mt-2 text-sm text-muted-foreground",children:s("classificationPromptGenerationFailed")}):null]}),x?(0,t.jsxs)("section",{"aria-label":s("tagSuggestion"),className:"rounded-[10px] bg-muted p-3",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-muted-foreground",children:s("tagSuggestion")}),(0,t.jsx)("p",{className:"mt-1.5 whitespace-pre-wrap break-words text-sm leading-6",children:x}),(0,t.jsx)(f.Button,{type:"button",variant:"outline",size:"sm",static:!0,className:"mt-2 min-h-11 sm:min-h-8",onClick:()=>{m(x),h(null)},children:s("useTagSuggestion")})]}):null]})]}),(0,t.jsx)(ej,{name:c,prompt:p,disabled:v||k,previewArticles:a})]}),y?(0,t.jsx)("p",{role:"alert",className:"px-5 pt-3 text-sm text-foreground",children:y}):null,k?(0,t.jsxs)("div",{className:"shrink-0 border-t border-border/60 px-5 py-4 md:px-6",children:[(0,t.jsx)("p",{role:"alert",className:"text-sm",children:s("discardTagDraft")}),(0,t.jsxs)("div",{className:"mt-3 flex justify-end gap-2",children:[(0,t.jsx)(f.Button,{type:"button",variant:"ghost",static:!0,onClick:E,children:s("discardTagChanges")}),(0,t.jsx)(f.Button,{variant:"default",type:"button",static:!0,autoFocus:!0,onClick:()=>C(!1),children:s("keepEditingTag")})]})]}):(0,t.jsxs)("div",{className:"flex shrink-0 justify-end gap-2 border-t border-border/60 px-5 py-4 md:px-6",children:[(0,t.jsx)(f.Button,{type:"button",variant:"ghost",static:!0,disabled:v,className:"min-h-11 sm:min-h-8",onClick:E,children:s("cancelTag")}),(0,t.jsx)(f.Button,{variant:"default",type:"submit",static:!0,loading:v,disabled:v||!c.trim()||!p.trim(),className:"min-h-11 sm:min-h-8",children:v?s("savingTag"):s("saveTag")})]})]})})}eN.z.object({matchedTagIds:eN.z.array(eN.z.string()).max(60).describe("IDs of every tag whose classification rule the article clearly satisfies.")}
1).strict(),eN.z.object({classificationPrompt:eN.z.string().min(20).max(500).describe("A concise, standalone rule describing when the tag should and should not apply.")}).strict();var eE=e.i(411091),eR=e.i(954616),eP=e.i(266027),e_=e.i(912598),eF=e.i(652749);async function eL(e,t){await e.cancelQueries({queryKey:t})}async function ez(e){let t=await e.json().catch(()=>null);return Error(t?.error||`Tag request failed (${e.status}).`)}let eM="smry:tags-section-expanded";function eO({collapsed:e,mobile:r=!1,onNavigate:n,onRequestSignIn:i}){let a=(0,d.useTranslations)("appSidebar"),l=(0,s.useSearchParams)(),{isSignedIn:c}=(0,eb.useAuth)(),{tags:u}=(0,eE.useLibraryTagCounts)({enabled:!e}),{definitions:p,createDefinition:m,updateDefinition:x,suggestClassificationPrompt:h,previewArticles:f}=function({enabled:e=!0}={}){let{getToken:t,isLoaded:r,isSignedIn:n,userId:i}=(0,eb.useAuth)(),a=(0,e_.useQueryClient)(),s=["tag-definitions",i??"anonymous"],l=(0,o.useCallback)(async(e,r={})=>{let n=await t();if(!n)throw Error("Sign in to manage tags.");return fetch((0,eF.getApiUrl)(e),{...r,headers:{...r.headers,Authorization:`Bearer ${n}`}})},[t]),c=(0,o.useCallback)(async(e,t)=>{let r=await l("/api/tags/suggest-prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e}),signal:t});if(!r.ok)throw await ez(r);return(await r.json()).classificationPrompt},[l]),d=(0,o.useCallback)(async(e,t)=>{let r=await l("/api/tags/preview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!r.ok)throw await ez(r);return await r.json()},[l]),u=(0,eP.useQuery)({queryKey:s,enabled:e&&r&&!!n,staleTime:3e4,queryFn:async({signal:e})=>{var t;let r=await l("/api/tags",{signal:e});if(!r.ok)throw await ez(r);return Array.isArray(t=(await r.json()).definitions)?t.filter(eT).slice(0,60):[]}}),p=(0,eR.useMutation)({mutationFn:async e=>{let t=await l("/api/tags",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await ez(t);return await t.json()},onMutate:async()=>{await eL(a,s)},onSuccess:({definition:e})=>{a.setQueryData(s,(t=[])=>[...(t??[]).filter(t=>t.key!==e.key),e].sort((e,t)=>e.name.localeCompare(t.name)))}}),m=(0,eR.useMutation)({mutationFn:async e=>{let t=await l(`/api/tags/${encodeURIComponent(e.key)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({classificationPrompt:e.classificationPrompt})});if(!t.ok)throw await ez(t);return await t.json()},onMutate:async()=>{await eL(a,s)},onSuccess:({definition:e})=>{a.setQueryData(s,(t=[])=>t.map(t=>t.key===e.key?e:t))}});return{...u,definitions:u.data??[],createDefinition:p.mutateAsync,updateDefinition:m.mutateAsync,suggestClassificationPrompt:c,previewArticles:d,creating:p.isPending,updating:m.isPending}}({enabled:!e}),b=(0,o.useId)(),v=(0,o.useId)(),[j,w]=(0,o.useState)(null),[S,N]=(0,o.useState)(!1),[k,C]=(0,o.useState)(!0);(0,z.useExternalSync)(()=>{try{C("0"!==window.localStorage.getItem(eM))}catch{}},[]);let I=(0,o.useMemo)(()=>{let e=new Map(u.map(e=>[e.key,e.count])),t=new Map(p.map(e=>[e.key,e]));for(let{key:e,name:r}of u)!e||t.has(e)||t.set(e,{key:e,name:r,classificationPrompt:eI(r),createdAt:null,updatedAt:null});return[...t.values()].map(t=>({...t,count:e.get(t.key)??0})).sort((e,t)=>e.name.localeCompare(t.name))},[p,u]);if(e)return null;let T=eC(l.get("tag")),A=S?I:I.slice(0,8),E=I.length-A.length,R=()=>{if(!c)return void i?.();C(!0);try{window.localStorage.setItem(eM,"1")}catch{}w({mode:"new"})};return(0,t.jsxs)("section",{className:(0,H.cn)("mt-5 w-full",r&&"mt-4"),"aria-labelledby":`${b}-heading`,children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center",children:[(0,t.jsx)("button",{"aria-controls":v,"aria-expanded":k,id:`${b}-heading`,className:(0,H.cn)("min-w-0 flex-1 shrink items-center justify-start rounded-[8px] px-1.5 text-left font-medium text-sidebar-foreground/70 transition-colors hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",r?"flex h-8 px-2 text-[11px] leading-4":"flex h-6 w-full text-[12px] leading-5"),onClick:()=>{let e=!k;C(e);try{window.localStorage.setItem(eM,e?"1":"0")}catch{}},type:"button",children:(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a("tags")})}),(0,t.jsx)("div",{className:"flex shrink-0 items-center pe-1",children:(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",className:(0,H.cn)("flex items-center justify-center rounded-[8px] text-sidebar-foreground
1/55 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",r?"size-8":"size-6"),onClick:R,"aria-label":a("newTag"),disabled:p.length>=60,children:(0,t.jsx)(g.Plus,{className:"size-3.5",strokeWidth:1.8})})}),(0,t.jsx)(y.TooltipContent,{side:"bottom",children:a("newTag")})]})})]}),(0,t.jsxs)("div",{id:v,hidden:!k,children:[(0,t.jsx)("div",{className:"flex flex-col gap-px",children:A.map(e=>{let r=e.key===T;return(0,t.jsxs)("div",{className:(0,H.cn)("group/tag-row flex h-8 min-w-0 items-center rounded-[8px]",r?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-resting-foreground hover:bg-sidebar-accent/70"),children:[(0,t.jsxs)($.Link,{href:`/dashboard?tag=${encodeURIComponent(e.name)}`,className:"flex h-full min-w-0 flex-1 items-center gap-1.5 rounded-[8px] px-1.5 text-[13px] leading-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring","aria-current":r?"page":void 0,onClick:n,children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"flex size-5 shrink-0 items-center justify-center text-sidebar-supporting-foreground",children:(0,t.jsx)(g.Tag,{className:"size-3.5",strokeWidth:1.65})}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.name}),e.count>0?(0,t.jsx)("span",{className:"shrink-0 text-[11px] tabular-nums text-sidebar-metadata-foreground",children:e.count}):null]}),(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",className:"mr-0.5 flex size-7 shrink-0 items-center justify-center rounded-[7px] text-sidebar-supporting-foreground opacity-0 pointer-coarse:opacity-100 transition-[opacity,color,background-color] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring group-hover/tag-row:opacity-100",onClick:()=>{!c?i?.():w({mode:"edit",definition:e})},"aria-label":a("editTag",{name:e.name}),children:(0,t.jsx)(g.Pencil,{className:"size-3",strokeWidth:1.8})})}),(0,t.jsx)(y.TooltipContent,{side:"bottom",children:a("editTag",{name:e.name})})]})]},e.key)})}),E>0?(0,t.jsx)("button",{type:"button",className:"mt-0.5 h-7 rounded-[7px] px-1.5 text-left text-[11px] text-sidebar-supporting-foreground hover:bg-sidebar-accent/70 hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",onClick:()=>N(!0),children:a("showMoreTags",{count:E})}):S&&I.length>8?(0,t.jsx)("button",{type:"button",className:"mt-0.5 h-7 rounded-[7px] px-1.5 text-left text-[11px] text-sidebar-supporting-foreground hover:bg-sidebar-accent/70 hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",onClick:()=>N(!1),children:a("showFewerTags")}):null,0===I.length?(0,t.jsxs)("button",{type:"button",onClick:R,className:"flex h-8 w-full items-center gap-1.5 rounded-[8px] px-1.5 text-left text-[13px] text-sidebar-supporting-foreground hover:bg-sidebar-accent/70 hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",children:[(0,t.jsx)(g.Plus,{className:"size-3.5",strokeWidth:1.8}),a("newTag")]}):null]}),j?(0,t.jsx)(eA,{definition:"edit"===j.mode?j.definition:void 0,onClose:()=>w(null),suggestClassificationPrompt:h,previewArticles:f,onSave:async e=>{"new"===j.mode?await m(e):await x({key:j.definition.key,classificationPrompt:e.classificationPrompt})}}):null]})}var eD=e.i(994179),eB=e.i(59377),eU=e.i(471435),eH=e.i(740339),e$=e.i(82061);function eW({variant:e,collapsed:r=!1,compact:n=!1,onNavigate:i,triggerClassName:a}){let s=(0,d.useTranslations)("changelogInbox"),l=(0,d.useTranslations)("changelogEntries"),[u,p]=o.useState(!1),[m,x,h]=(0,e$.default)("smry-changelog-last-seen",null),[f,b]=o.useState(null),v="mobileSidebar"===e,j=(0,eH.getRecentEntries)(6),y=h?(0,eH.countEntriesNewerThan)(m):0,w=u?(0,eH.countEntriesNewerThan)(f):y,N=()=>{p(!1),i?.()};return(0,t.jsxs)(eB.Popover,{open:u,onOpenChange:e=>{p(e),e&&(b(m),x(eH.LATEST_CHANGELOG_ENTRY_KEY))},children:[(0,t.jsx)(eB.PopoverTrigger,{render:e=>{let{key:i,className:o,...l}=e,c=(0,t.jsxs)("button",{...l,type:"button","data-sidebar-changelog-trigger":!0,"data-sidebar-collapsed-center":!0,"aria-label":y>0?`${s("title")} â ${s("unread")}`:s("title"),className:(0,H.cn)(o,S.APP_SIDEBAR_NAV_ROW_CLASS,"touch-manipulation text-sidebar-foreground
1/72 transition-[background-color,color] hover:bg-sidebar-accent/35 hover:text-sidebar-accent-foreground",r?(0,H.cn)("shrink-0 justify-center [@media(pointer:coarse)]:size-11",n?"size-6 rounded-[6px]":"size-8"):"w-full min-w-0 gap-2 px-2",v&&"h-11 gap-2 rounded-[8px] px-2.5 text-[12.5px] active:bg-sidebar-accent/55",u&&"bg-sidebar-accent/35 text-sidebar-accent-foreground",a),children:[(0,t.jsx)("span",{className:"flex size-4 shrink-0 items-center justify-center",children:(0,t.jsx)(g.MessageCircle,{strokeWidth:1.75,className:(0,H.cn)("shrink-0 transition-colors",v?"size-[15px]":"size-4"),"aria-hidden":"true"})}),r?null:(0,t.jsx)("span",{className:"min-w-0 truncate leading-none",children:s("title")})]});return(0,t.jsx)(S.AppSidebarIconTooltip,{collapsed:r,label:s("title"),children:c},i)}}),(0,t.jsxs)(eB.PopoverPopup,{side:n||v?"bottom":"right",align:n||v?"start":"end",sideOffset:n||v?8:10,className:(0,H.cn)("w-[344px] max-w-[calc(100vw-24px)] overflow-hidden rounded-[14px] border-transparent bg-popover shadow-hairline","motion-reduce:transition-none"),contentClassName:"p-0",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border/55 px-4 py-3",children:[(0,t.jsx)(eB.PopoverTitle,{className:"text-[13px] font-semibold leading-5 text-foreground",children:s("title")}),(0,t.jsxs)($.Link,{href:"/changelog",onClick:N,className:"group -mr-1 inline-flex min-h-6 items-center gap-1 rounded-[6px] px-1.5 text-[12px] font-medium text-muted-foreground transition-colors hover:bg-muted/55 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsx)("span",{children:s("viewChangelog")}),(0,t.jsx)(g.ArrowUpRight,{className:"size-3 shrink-0 opacity-55 transition-opacity group-hover:opacity-85","aria-hidden":"true"})]})]}),(0,t.jsx)(eU.ScrollArea,{className:"max-h-[min(400px,calc(100dvh-10rem))]",viewportClassName:"max-h-[inherit] overscroll-contain",children:(0,t.jsx)("ul",{className:"divide-y divide-border/40",children:j.map((e,r)=>
1{let[n,...i]=e.changes;return n?(0,t.jsx)("li",{children:(0,t.jsxs)($.Link,{href:"/changelog",onClick:N,className:(0,H.cn)("changelog-inbox-item group flex gap-3 px-4 py-3 transition-colors","hover:bg-muted/50 focus-visible:outline-none focus-visible:bg-muted/50 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"),style:{animationDelay:`${Math.min(25*r,150)}ms`},children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("p",{className:"flex items-center gap-1.5 text-[13px] font-medium leading-5 text-foreground",children:[r<w?(0,t.jsx)("span",{className:"size-1.5 shrink-0 rounded-full bg-info","aria-hidden":"true"}):null,(0,t.jsx)("span",{className:"min-w-0 truncate",children:l(n.textKey)}),n.premium?(0,t.jsx)(eD.Badge,{size:"sm",variant:"pro",children:"Pro"}):null,(0,t.jsx)(g.ArrowUpRight,{className:"size-3 shrink-0 -translate-x-0.5 opacity-0 transition-[opacity,translate] duration-100 ease-out group-hover:translate-x-0 group-hover:opacity-60 motion-reduce:translate-x-0","aria-hidden":"true"})]}),n.detailKey?(0,t.jsx)("p",{className:"mt-0.5 line-clamp-2 text-[12px] leading-[18px] text-muted-foreground",children:l(n.detailKey)}):null,(0,t.jsxs)("p",{className:"mt-1.5 flex items-center gap-1.5 text-[11px] leading-4 text-muted-foreground/70",children:[(0,t.jsx)("time",{children:l(e.dateKey)}),i.length>0?(0,t.jsxs)("span",{children:["· ",s("moreChanges",{count:i.length})]}):null]})]}),e.image?(0,t.jsx)(c.default,{src:e.image.src,alt:e.image.alt,width:e.image.width,height:e.image.height,loading:"lazy",className:"h-14 w-20 shrink-0 self-start rounded-[8px] object-cover ring-1 ring-border/50"}):null]})},e.dateKey):null})})})]})]})}var eK=e.i(809700),eV=e.i(539942),eq=e.i(802822),eY=e.i(715614);function eG({collapsed:e=!1,compact:r=!1,mobile:n=!1,onNavigate:i,triggerClassName:a}){let s=(0,d.useTranslations)("appSidebar"),l=(0,d.useTranslations)("footer"),{trackViaBeacon:u}=(0,eq.useAnalytics)(),p=(0,o.useRef)(null),m=(0,eY.useCurrentExtensionBrowser)(),x=m?eV.EXTENSION_BROWSER_DETAILS[m]:null,h=()=>{if(p.current?.close(),i?.(),!m)return;let e=(0,eV.getExtensionInstallAnalytics)(m);u(e.event,{...e.properties,surface:n?"mobile_sidebar":"app_sidebar"})};return(0,t.jsx)("div",{"data-sidebar-apps-hover-card":!0,className:e?r?"w-6":"w-8":"w-full",children:(0,t.jsxs)(eK.Popover.Root,{actionsRef:p,children:[(0,t.jsxs)(eK.Popover.Trigger,{openOnHover:!n,delay:0,closeDelay:120,"data-sidebar-collapsed-center":!0,render:(0,t.jsx)("button",{type:"button","aria-label":e?s(n?"appsTitle":"appsAndExtensions"):void 0,className:(0,H.cn)("group flex items-center rounded-[7px] text-sidebar-foreground/72 outline-none transition-[background-color,color] hover:bg-sidebar-accent/35 hover:text-sidebar-accent-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring data-popup-open:bg-sidebar-accent/35 data-popup-open:text-sidebar-accent-foreground",e?r?"size-6 justify-center rounded-[6px]":"size-8 justify-center":n?"h-11 w-full min-w-0 gap-2 rounded-[8px] px-2.5 text-left text-[12.5px] font-medium":"h-9 w-full min-w-0 gap-2 px-2 text-left text-[13px] font-medium",a)}),children:[(0,t.jsx)(R.FigmaSidebarIcon,{className:(0,H.cn)("shrink-0 transition-colors",n?"size-[15px]":"size-4"),name:"apps"}),e?null:(0,t.jsx)("span",{className:"min-w-0 truncate leading-none",children:s(n?"appsTitle":"appsAndExtensions")})]}),(0,t.jsx)(eK.Popover.Portal,{keepMounted:!0,children:(0,t.jsx)(eK.Popover.Positioner,{side:r||n?"bottom":"right",align:r||n?"start":"end",sideOffset:r||n?8:10,positionMethod:"fixed",collisionPadding:12,collisionAvoidance:{side:"flip",align:"shift",fallbackAxisSide:"end"},className:"z-100",children:(0,t.jsx)(eK.Popover.Popup,{"data-sidebar-apps-popup":!0,className:"max-h-(--available-height) w-[min(320px,calc(100vw-24px))] origin-(--transform-origin) overflow-y-auto rounded-[14px] bg-card p-2 text-card-foreground shadow-hairline outline-none transition-[opacity,scale] duration-100 data-ending-style:scale-98 data-ending-style:opacity-0 data-starting-style:scale-98 data-starting-style:opacity-0 motion-reduce:transition-none",children:(0,t.jsxs)("div",{className:"px-1 pb-1 pt-2",children:[(0,t.jsx)(eK.Popover.Title,{className:"text-base font-medium leading-6 text-foreground",children:s("appsTitle")}),n?null:(0,t.jsx)(eK.Popover.Description,{className:"mt-1 text-sm leading-5 text-muted-foreground",children:s("appsDescription")}),(0,t.jsxs)("div",{className:"mt-4 grid gap-2",children:[!n&&x?(0,t.jsxs)(f.Button,{variant:"default",size:"xl",className:"w-full",nativeButton:!1,render:(0,t.jsx)("a",{href:x.url,target:"_blank",rel:"noopener noreferrer",onClick:h}),children:[(0,t.jsx)(c.default,{src:x.logoSrc,alt:"","aria-hidden":"true",width:16,height:16,unoptimized:!0,className:"size-4 shrink-0 object-contain"}),l("browserExtensionFor",{browser:x.name})]}):n?null:(0,t.jsxs)(f.Button,{variant:"default",size:"xl",className:"w-full",nativeButton:!1,render:(0,t.jsx)($.Link,{href:"/download",onClick:h}),children:[(0,t.jsx)(g.Globe,{"aria-hidden":"true"}),l("browserExtension")]}),(0,t.jsxs)(f.Button,{variant:"outline",size:"xl",className:"w-full",nativeButton:!1,render:(0,t.jsx)($.Link,{href:"/ios-shortcut",onClick:()=>{p.current?.close(),i?.()}}),children:[(0,t.jsx)(g.Smartphone,{"aria-hidden":"true"}),l("iosShortcut")]})]})]})})})})]})})}e.i(25755);var eX=e.i(604392),eJ=e.i(852917),eQ=e.i(618703),eZ=e.i(438847);let e0=(0,eZ.parseAsStringLiteral)(es).withOptions({history:"push",shallow:!0,scroll:!1});function e1(e){let[t,r]=(0,eZ.useQueryState)("sidebar",e0),n=ec[e]??null,i=(0,o.useSyncExternalStore)(ex,eh,eg),{track:a}=(0,eq.useAnalytics)(),s=t??n??i;(0,o.useLayoutEffect)(()=>
1{if(em!==s){em=s;try{window.localStorage.setItem(el,s)}catch{}for(let e of ep)e()}},[s]);let l=(0,o.useCallback)(t=>{t!==s&&(r(t),a("sidebar_tab_changed",{from:s,to:t,surface:e}))},[s,r,e,a]);return{activeTab:s,selectTab:l}}var e5=e.i(317366),e2=e.i(822841),e3=e.i(340830),e6=e.i(971723),e8=e.i(705538),e4=e.i(256203),e7=e.i(159354),e9=e.i(108286),te=e.i(826534);e.i(624017);var tt=e.i(640777),tr=e.i(247167);function tn(e){return"1"===e||"true"===e}let ti=tn("0");tn(tr.default.env.NEWSLETTER_FOLLOWING_REVIEW_ENABLED);var ta=e.i(323514);let ts={article:g.Newspaper,website:g.Globe,book:g.BookOpen,email:g.MailOpen,pdf:g.FileVerified,social_post:g.MessageSquare,video:g.Play,podcast_episode:g.Headphones,document:g.FileText,unknown:g.FileText};function to({label:e,side:r="right",children:n}){return(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{render:n}),(0,t.jsxs)(y.TooltipContent,{side:r,className:"flex items-center gap-2",children:[(0,t.jsx)("span",{children:e}),(0,t.jsx)(w.Kbd,{className:w.tooltipKbdClassName,children:"["})]})]})}let tl=D.APP_SIDEBAR_WIDTH_KEY,tc=D.APP_SIDEBAR_COLLAPSED_KEY,td=D.DEFAULT_APP_SIDEBAR_WIDTH;function tu({active:e=!1}){return(0,t.jsx)("span",{className:(0,H.cn)("relative flex shrink-0 items-center justify-center transition-opacity","size-5",e?"opacity-100":"opacity-85 group-hover/home:opacity-100"),"aria-hidden":"true",children:(0,t.jsx)(c.default,{alt:"","aria-hidden":"true",className:"size-5 object-contain",height:20,src:"/brand/smry-logo-mark-256.png",width:20})})}function tp({active:e=!1,collapsed:r=!1,mobile:n=!1,onNavigate:i}){let a=(0,d.useTranslations)("appSidebar");return(0,t.jsx)(S.AppSidebarIconTooltip,{collapsed:r,label:a("home"),children:(0,t.jsx)($.Link,{href:"/home",prefetch:!0,onClick:i,"data-sidebar-collapsed-center":!0,className:(0,H.cn)("group/home flex min-w-0 items-center rounded-[8px] text-sidebar-foreground transition-[background-color,color] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",r?"size-8 justify-center":n?"size-9 justify-center":"size-8 justify-center",e?"text-sidebar-accent-foreground":"text-sidebar-foreground/90 hover:text-sidebar-accent-foreground"),"aria-label":a("openHome"),"aria-current":e?"page":void 0,children:(0,t.jsx)(tu,{active:e})})})}function tm(e){return(0,D.clampAppSidebarWidth)(e)}function tx({activeKey:e,active:r,collapsed:n,selectedKind:i,contentKindsExpanded:a,contentKindNavigation:s,contentKindsId:o,onToggleContentKinds:l,mobile:c=!1,onNavigate:u}){let p=(0,d.useTranslations)("appSidebar");return(0,t.jsxs)("nav",{className:(0,H.cn)("flex flex-col gap-[2px]",n&&"items-center"),"aria-label":p("appNavigation"),children:[(0,t.jsxs)("div",{className:"relative w-full",children:[(0,t.jsx)(S.AppSidebarNavRow,{href:"/dashboard",icon:(0,t.jsx)(g.Bookmark,{className:"size-4"}),label:p("saved"),collapsed:n,mobile:c,active:r,onClick:u,trailing:n?void 0:(0,t.jsx)("span",{className:"size-6 shrink-0","aria-hidden":"true"})}),n?null:(0,t.jsx)("button",{type:"button","aria-controls":o,"aria-expanded":a,"aria-label":p(a?"collapseSaved":"expandSaved"),onClick:l,className:"absolute end-1 top-1 z-10 flex size-6 items-center justify-center rounded-[6px] text-sidebar-resting-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",children:(0,t.jsx)(g.ChevronDown,{className:(0,H.cn)("size-3.5 transition-transform motion-reduce:transition-none",a&&"rotate-180"),"aria-hidden":"true"})})]}),a&&!n?(0,t.jsx)("div",{id:o,role:"group","aria-label":p("libraryContentTypes"),className:"ms-3 flex flex-col gap-[2px] border-s border-sidebar-border/70 ps-2",children:e3.LIBRARY_CONTENT_KINDS.map(r=>{let n=ts[r],a=i===r,o=s[r],l=new URLSearchParams;return"history"!==e&&l.set("status",o.status),l.set("kind",r),(0,t.jsx)(S.AppSidebarNavRow,{href:`${"history"===e?"/history":"/dashboard"}?${l.toString()}`,icon:(0,t.jsx)(n,{className:"size-3.5"}),label:p(`contentKinds.${r}`),collapsed:!1,mobile:c,active:a,onClick:u,hierarchy:"secondary",trailing:(0,t.jsx)(S.AppSidebarCount,{ariaLabel:p("savedItemsCount",{count:o.count}),count:o.count,mobile:c}
1)},r)})}):null]})}function th(e){let r=(0,s.useSearchParams)();return(0,t.jsx)(tx,{...e,selectedKind:e.active?r.get("kind"):null})}function tg(e){let[r,n]=(0,o.useState)(!1),i=(0,o.useId)(),a=(0,eE.useLibraryAggregates)({enabled:!e.collapsed}),{history:s}=(0,e5.useHistory)({enabled:!e.collapsed&&"history"===e.activeKey}),l=(0,o.useMemo)(()=>s.map(e=>e.url),[s]),{items:c}=(0,eE.useLibraryItemsByUrls)(l,{enabled:!e.collapsed&&"history"===e.activeKey}),d=(0,o.useMemo)(()=>{if("history"===e.activeKey){let e=function(e,t){let r=Object.fromEntries(e3.LIBRARY_CONTENT_KINDS.map(e=>[e,0])),n=new Map(t.map(e=>[e.url,e]));for(let t of e){let e=n.get(t.url),i=e?(0,e2.getLibraryContentKind)(e):"article";r[i]+=1}return r}(s,c),t=(0,e2.getLibraryContentKindNavigation)([]);return Object.fromEntries(e3.LIBRARY_CONTENT_KINDS.map(r=>[r,{...t[r],count:e[r]}]))}return(0,e2.getLibraryContentKindNavigationFromCounts)(a.contentKindCounts,(0,e2.isLibraryTriageStatus)(e.activeKey)?e.activeKey:void 0)},[a.contentKindCounts,s,c,e.activeKey]),u={...e,contentKindsExpanded:r,contentKindNavigation:d,contentKindsId:i,onToggleContentKinds:()=>n(e=>!e)};return(0,t.jsx)(o.Suspense,{fallback:(0,t.jsx)(tx,{...u,selectedKind:null}),children:(0,t.jsx)(th,{...u})})}function tf({active:e=!1,collapsed:r=!1,mobile:n=!1,onNavigate:i}){let a=(0,d.useTranslations)("appSidebar");return(0,t.jsx)(S.AppSidebarNavRow,{active:e,collapsed:r,href:"/sources",icon:(0,t.jsx)(g.LinkChain,{className:"size-[16px] shrink-0",strokeWidth:1.75,"aria-hidden":"true"}),label:a("sources"),mobile:n,onClick:i})}function tb({active:e,collapsed:r,mobile:n=!1,onNavigate:i}){let a=(0,d.useTranslations)("appSidebar"),s=function(){let{data:e}=(0,eX.useQuery)("SELECT COUNT(*) AS n FROM highlights",[]);return e[0]?.n??0}(),o=s>0,l=s>99?"99+":String(s);return(0,t.jsx)(S.AppSidebarNavRow,{href:"/dashboard/highlights",icon:(0,t.jsx)(g.Highlighter,{className:"size-[16px] shrink-0",strokeWidth:1.75,"aria-hidden":"true"}),label:a("highlights"),ariaLabel:o?a("highlightsWithCount",{count:s}):a("highlights"),collapsed:r,mobile:n,active:e,onClick:i,trailing:o?(0,t.jsx)("span",{"data-sidebar-collapsed-hide":!0,className:"min-w-5 shrink-0 rounded-full bg-sidebar px-1.5 text-center text-[11px] font-medium leading-5 text-sidebar-foreground/70 tabular-nums shadow-[inset_0_0_0_1px_var(--sidebar-border)]",children:l}):null,collapsedBadge:o?(0,t.jsx)("span",{className:"absolute -right-1 -top-1 min-w-4 rounded-full bg-sidebar px-1 text-center text-[9px] font-medium leading-4 text-sidebar-foreground/70 tabular-nums shadow-[inset_0_0_0_1px_var(--sidebar-border)]",children:l}):null})}function tv({active:e,collapsed:r,mobile:n=!1,onNavigate:i}){return ti?(0,t.jsx)(S.AppSidebarNavRow,{href:"/newsletters",icon:(0,t.jsx)(g.MailOpen,{className:"size-4",strokeWidth:1.75,"aria-hidden":"true"}),label:"Newsletters",collapsed:r,mobile:n,active:e,onClick:i}):null}function tj({allFeedsActive:e,activeFeedId:r,activeCollectionId:n,collapsed:s,mobile:l=!1,onNavigate:c,onRequestSignIn:p,unreadOnly:m}){let x=(0,d.useTranslations)("appSidebar"),h=(0,d.useTranslations)("feeds"),g=(0,o.useId)(),b=(0,a.useOpmlImport)(),j=(0,o.useRef)(null),[w,N]=(0,o.useState)(!0),{isSignedIn:k,subscriptions:C}=(0,M.useFeedSubscriptions)(),I=!k||w,T=(0,M.useFeedMarkRead)(),{exportOpml:A,isExportingOpml:E}=(0,M.useFeedOpmlTransfer)();(0,z.useExternalSync)(()=>{try{N("0"!==window.localStorage.getItem("smry:feed-subscriptions-expanded"))}catch{}},[]),(0,z.useExternalSync)(()=>{let e=e=>{let t=e.detail;if((0,B.isRssSubscriptionRevealDetail)(t)){N(!0),(0,O.rememberFeedCollectionCollapsed)(t.folderId,!1);try{window.localStorage.setItem("smry:feed-subscriptions-expanded","1")}catch{}}};return window.addEventListener(B.RSS_SUBSCRIPTION_REVEAL_EVENT,e),()=>window.removeEventListener(B.RSS_SUBSCRIPTION_REVEAL_EVENT,e)},[]);let P=(0,t.jsx)(S.AppSidebarNavRow,{href:(0,F.buildFeedsHref)({unreadOnly:m}),icon:(0,t.jsx)(R.FigmaSidebarIcon,{name:"smry-mark"}),label:x("feeds"),collapsed:s,mobile:l,active:e&&!r,onClick:c,trailing:(0,t.jsx)("span",{"aria-hidden":"true",className:"w-[3.25rem] shrink-0"})});return s?P:(0,t.jsxs)("section",{"aria-label":x("feeds"),className:"flex w-full flex-col gap-[2px]",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center",children:[(0,t.jsx)("button",{"aria-controls":g,"aria-expanded":I,className:(0,H.cn)("min-w-0 flex-1 shrink items-center justify-start rounded-[8px] px-1.5 text-left font-medium text-sidebar-foreground
1/70 transition-colors hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",l?"flex h-8 px-2 text-[11px] leading-4":"flex h-6 w-full text-[12px] leading-5"),disabled:!k,onClick:()=>{let e=!w;N(e);try{window.localStorage.setItem("smry:feed-subscriptions-expanded",e?"1":"0")}catch{}},type:"button",children:(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:x("feeds")})}),(0,t.jsx)("div",{className:"flex shrink-0 items-center pe-1",children:(0,t.jsxs)(v.Menu,{children:[(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{render:(0,t.jsx)(v.MenuTrigger,{render:(0,t.jsx)(f.Button,{"aria-label":x("feedsOptions"),className:(0,H.cn)("text-sidebar-foreground/55 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground data-popup-open:bg-sidebar-accent data-popup-open:text-sidebar-accent-foreground",l?"size-8 rounded-[8px]":"size-6 rounded-[8px]"),size:"icon-xs",variant:"ghost",children:(0,t.jsx)(R.FigmaSidebarIcon,{name:"plus"})})})}),(0,t.jsx)(y.TooltipContent,{side:"bottom",children:x("feedsOptions")})]}),(0,t.jsxs)(v.MenuPopup,{align:"end",className:"w-[200px]",sideOffset:6,children:[(0,t.jsxs)(v.MenuItem,{render:(0,t.jsx)($.Link,{href:"/feeds/discover",prefetch:!0,onClick:c}),children:[(0,t.jsx)(R.FigmaSidebarIcon,{name:"follow-source"}),x("followSource")]}),(0,t.jsxs)(v.MenuItem,{render:(0,t.jsx)($.Link,{href:(0,F.buildFeedsHref)({manage:"create",unreadOnly:m}),prefetch:!0,onClick:c}),children:[(0,t.jsx)(R.FigmaSidebarIcon,{name:"folder"}),x("newFolder")]}),(0,t.jsx)(v.MenuSeparator,{}),(0,t.jsxs)(v.MenuItem,{disabled:!k||0===C.length,onClick:()=>{let e=C.reduce((e,t)=>e+t.unreadCount,0);T({}).then(()=>{e>0&&u.toast.success(h("markReadSuccess",{count:e}))}).catch(()=>{u.toast.error(h("markReadFailure"))})},children:[(0,t.jsx)(R.FigmaSidebarIcon,{name:"mark-all-read"}),x("markAllAsRead")]}),(0,t.jsx)(v.MenuSeparator,{}),k?(0,t.jsxs)(v.MenuItem,{disabled:b.open,onClick:()=>j.current?.click(),children:[(0,t.jsx)(R.FigmaSidebarIcon,{name:"import-opml"}),x("importOpml")]}):(0,t.jsxs)(v.MenuItem,{render:(0,t.jsx)($.Link,{href:"/settings/integrations?tab=import",prefetch:!0,onClick:()=>{(0,e9.storeWorkspaceReturnUrl)(),c?.()}}),children:[(0,t.jsx)(R.FigmaSidebarIcon,{name:"import-opml"}),x("importOpml")]}),k?(0,t.jsxs)(v.MenuItem,{disabled:E,onClick:()=>{A().catch(e=>{u.toast.error(e instanceof Error?e.message:h("opml.exportFailure"))})},children:[(0,t.jsx)(R.FigmaSidebarIcon,{name:"export-opml"}),x("exportOpml")]}):(0,t.jsxs)(v.MenuItem,{render:(0,t.jsx)($.Link,{href:"/settings/integrations?tab=export",prefetch:!0,onClick:()=>{(0,e9.storeWorkspaceReturnUrl)(),c?.()}}),children:[(0,t.jsx)(R.FigmaSidebarIcon,{name:"export-opml"}),x("exportOpml")]})]})]})})]}),b.open&&(0,t.jsx)(i.OpmlImportDialog,{importer:b}),(0,t.jsx)("input",{ref:j,accept:".opml,.xml,application/xml,text/xml","aria-hidden":"true",className:"sr-only",onChange:e=>{let t=e.currentTarget.files?.[0];e.currentTarget.value="",t&&b.load(t)},tabIndex:-1,type:"file"}),I?(0,t.jsx)(ea,{allFeedsActive:e&&!r,id:g,mobile:l,onFeedsPage:e,onNavigate:c,onRequestSignIn:p,selectedCollectionId:e?n:void 0,selectedFeedId:e?r:void 0,unreadOnly:m}):null]})}function ty(e){let r=(0,s.useSearchParams)(),n=(0,F.parseUnreadFeedParam)(r.get("unread"));return(0,t.jsx)(tj,{...e,unreadOnly:n})}function tw(e){return(0,t.jsx)(o.Suspense,{fallback:(0,t.jsx)(tj,{...e,unreadOnly:!1}),children:(0,t.jsx)(ty,{...e})})}function tS({active:e=!1,collapsed:r=!1,mobile:n=!1,onNavigate:i}){let a=(0,d.useTranslations)("appSidebar");return(0,t.jsx)(S.AppSidebarNavRow,{active:e,collapsed:r,href:"/feeds/discover",icon:(0,t.jsx)(R.FigmaSidebarIcon,{name:"follow-source"}),label:a("follow"),mobile:n,onClick:i})}function tN({active:e=!1,collapsed:r=!1,mobile:n=!1,onNavigate:i}){let a=(0,d.useTranslations)("appSidebar");return(0,t.jsx)(S.AppSidebarNavRow,{active:e,collapsed:r,href:"/monitors",icon:(0,t.jsx)(g.Monitor,{className:"size-4"}),label:a("monitors"),mobile:n,onClick:i})}function tk({active:e=!1,collapsed:r=!1,mobile:n=!1,onNavigate:i}){let a=(0,d.useTranslations)("appSidebar");return(0,t.jsx)(S.AppSidebarNavRow,{active:e,collapsed:r,href:"/books",icon:(0,t.jsx)(g.BookOpen,{className:"size-[16
1px] shrink-0",strokeWidth:1.75,"aria-hidden":"true"}),label:a("books"),mobile:n,onClick:i})}function tC({active:e=!1,collapsed:r=!1,mobile:n=!1,onNavigate:i}){let a=(0,d.useTranslations)("appSidebar");return(0,t.jsx)(S.AppSidebarNavRow,{href:"/home",icon:(0,t.jsx)(g.Home,{"aria-hidden":"true",className:"size-[16px] shrink-0",strokeWidth:1.75}),label:a("home"),collapsed:r,mobile:n,active:e,ariaLabel:a("home"),onClick:i})}function tI({collapsed:e=!1,mobile:r=!1,onNavigate:n,onRequestSearch:i}){let a=(0,d.useTranslations)("appSidebar");return(0,t.jsx)(S.AppSidebarIconTooltip,{collapsed:e,label:a("searchArticles"),children:(0,t.jsxs)("button",{type:"button",onClick:()=>{i?i():(n?.(),(0,e6.openArticleCommandPalette)())},"aria-label":e?a("searchArticles"):void 0,"aria-keyshortcuts":"Meta+K Control+K","data-sidebar-collapsed-center":!0,"data-sidebar-search-field":e?void 0:"",className:(0,H.cn)(S.APP_SIDEBAR_NAV_ROW_CLASS,e?"w-8 justify-center text-sidebar-resting-foreground hover:bg-sidebar-accent/70 hover:text-sidebar-accent-foreground":(0,H.cn)("w-full gap-[6px] rounded-[8px] border-[0.5px] border-sidebar-border bg-sidebar-accent p-[6px] text-[12px] leading-5 tracking-[-0.06px] text-sidebar-metadata-foreground transition-[border-color,color] hover:border-sidebar-ring/45 hover:text-sidebar-accent-foreground",r&&(0,H.cn)("h-8",S.MOBILE_APP_SIDEBAR_LABEL_CLASS)),r&&"active:bg-sidebar-accent active:text-sidebar-accent-foreground"),children:[(0,t.jsx)(R.FigmaSidebarIcon,{name:"search"}),e?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"data-sidebar-collapsed-hide":!0,className:"min-w-0 flex-1 truncate text-left",children:a("search")}),r?null:(0,t.jsx)(w.Kbd,{"aria-hidden":"true",className:"h-5 min-w-5 rounded-[6px] border-[0.5px] border-sidebar-border/70 bg-sidebar px-1.5 font-sans text-[12px] font-medium leading-[18px] tracking-[-0.06px] text-sidebar-supporting-foreground shadow-none",children:"âK"})]})]})})}function tT({active:e,collapsed:r=!1,mobile:n=!1,onNavigate:i}){let a=(0,d.useTranslations)("appSidebar"),s=(0,o.useCallback)(()=>{(0,ta.publishRemyChatPathname)("/chat"),i?.()},[i]);return(0,t.jsx)(S.AppSidebarNavRow,{href:"/chat",icon:(0,t.jsx)(j.RemyIcon,{className:"size-[16px] shrink-0","aria-hidden":"true"}),label:a("aiChat"),ariaLabel:`${a("aiChat")}, alpha`,collapsed:r,mobile:n,active:e,trailing:(0,t.jsx)("span",{className:(0,H.cn)("ms-2 shrink-0 font-semibold leading-none tracking-[0.08em]",n?"text-[9px]":"text-[10px]",e?"text-sidebar-accent-foreground":"text-sidebar-supporting-foreground group-hover:text-sidebar-accent-foreground"),children:"ALPHA"}),onNavigate:s})}function tA({active:e,collapsed:r=!1,mobile:n=!1,onNavigate:i}){let a=(0,d.useTranslations)("appSidebar"),s=(0,o.useCallback)(()=>{(0,e9.storeWorkspaceReturnUrl)(),i?.()},[i]);return(0,t.jsx)(S.AppSidebarNavRow,{href:"/mcp-api-cli?view=mcp",icon:(0,t.jsx)(R.FigmaSidebarIcon,{name:"connect-agent"}),label:a("connectMyAgent"),collapsed:r,mobile:n,active:e,onClick:s})}function tE({compact:e=!1,mobile:r=!1,onNavigate:n,vertical:i=!1}){return(0,t.jsxs)("div",{className:(0,H.cn)("flex shrink-0 items-center",e?"gap-0":"gap-1",i&&"flex-col",r&&"[&_[data-sidebar-apps-hover-card]]:w-11"),children:[(0,t.jsx)(eW,{variant:r?"mobileSidebar":"appSidebar",collapsed:!0,compact:e,onNavigate:n,triggerClassName:r?"!size-11":void 0}),(0,t.jsx)(eG,{collapsed:!0,compact:e,mobile:r,onNavigate:n,triggerClassName:r?"!size-11":void 0})]})}function tR({article:e,collapsed:i,mobile:a=!1,reserveSpace:s=!1,className:o}){var l;let c=(0,d.useTranslations)("appSidebar"),u=(0,n.useSavedItemsReminder)(),{isLoaded:m,isSignedIn:x}=(0,r.useUser)();if(i)return null;if(!a&&m&&!x&&u)return(0,t.jsx)(k.SidebarSavedItemsReminder,{});if(!e?.url)return s?(0,t.jsxs)("section",{"aria-hidden":"true",className:(0,H.cn)("min-h-[132px] rounded-[10px] bg-sidebar-accent/30 p-3",o),"data-sidebar-current-article-placeholder":!0,children:[(0,t.jsx)("div",{className:"h-4 w-16 rounded bg-sidebar-foreground/[0.07]"}),(0,t.jsxs)("div",{className:"mt-2 flex gap-2.5",children:[(0,t.jsx)("div",{className:"size-5 shrink-0 rounded-[4px] bg-sidebar-foreground
1/[0.07]"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"h-3 w-4/5 rounded bg-sidebar-foreground/[0.07]"}),(0,t.jsx)("div",{className:"mt-2 h-3 w-2/5 rounded bg-sidebar-foreground/[0.055]"})]})]})]}):null;let h=e.domain||(0,H.extractHostname)(e.url),g=e.sourceLabel||h,f=e.title||h||c("currentArticle"),b=e.status?(l=e.status,c(`status.${l}`)):null;return(0,t.jsxs)("section",{"data-sidebar-current-article":!0,className:(0,H.cn)("bg-sidebar-accent/45 shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]","min-h-[132px] rounded-[10px] p-3",o),children:[(0,t.jsx)("p",{className:(0,H.cn)("truncate whitespace-nowrap px-0.5 font-medium text-sidebar-supporting-foreground",a?"mb-2 text-[10.5px] leading-4":"mb-2 h-4 text-[11px] leading-4"),children:e.label||c("thisArticle")}),(0,t.jsxs)("div",{className:(0,H.cn)("flex min-w-0",a?"gap-2":"gap-2.5"),children:[(0,t.jsx)(p.FaviconImage,{className:(0,H.cn)("mt-0.5 shrink-0",a?"size-4 rounded-[3px]":"size-5 rounded-[4px]"),domain:h,loading:"eager"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:(0,H.cn)("line-clamp-2 font-medium text-sidebar-foreground",a?"min-h-9 text-[12.5px] leading-[18px]":"h-9 text-[13px] leading-[18px]"),children:f}),(0,t.jsx)("p",{className:(0,H.cn)("mt-1 truncate text-sidebar-supporting-foreground",a?"text-[11px] leading-4":"h-4 text-[12px] leading-4"),children:g})]})]}),(0,t.jsx)("div",{className:(0,H.cn)("flex items-center gap-2 overflow-hidden text-sidebar-supporting-foreground",a?"mt-2.5 min-h-4 text-[10.5px] leading-4":"mt-3 h-4 text-[11px] leading-4"),children:b||e.progress?(0,t.jsxs)(t.Fragment,{children:[b?(0,t.jsx)("span",{children:b}):null,b&&e.progress?(0,t.jsx)("span",{"aria-hidden":"true",children:"·"}):null,e.progress?(0,t.jsx)("span",{className:"tabular-nums",children:c("progressRead",{progress:e.progress})}):null]}):null})]})}function tP({currentUrl:e,currentArticle:r,collapsed:n,entrySurface:i,mobile:a=!1,onNavigate:s,className:l}){let c=(0,d.useTranslations)("appSidebar"),{trackArticleViaBeacon:p}=(0,eq.useAnalytics)(),{history:h,isLoaded:f,removeFromHistory:j,setHistoryPinned:w}=(0,e5.useHistory)({enabled:!n,limit:24}),S=(0,e_.useQueryClient)(),N=(0,o.useMemo)(()=>[...h].sort((e,t)=>Number(!!t.pinned)-Number(!!e.pinned)),[h]),k=(0,o.useMemo)(()=>N.slice(0,6),[N,6]),C=(0,o.useMemo)(()=>k.map(e=>e.url),[k]),{items:I}=(0,eE.useLibraryItemsByUrls)(C,{enabled:!n}),T=(0,o.useMemo)(()=>new Map(I.map(e=>[e.url,e])),[I]),A=e?(0,tt.normalizeCacheUrl)(e):null,E=(0,o.useRef)(null),R=(0,o.useCallback)(e=>{let t=!e.pinned;w(e.id,t).then(()=>{p("library_history_pin_toggled",e.url,{surface:"app_sidebar_recent",entry_surface:i,pinned:t})}).catch(e=>{console.warn("[app-sidebar] failed to toggle recent pin:",e),u.toast.error(c("recentPinFailed"))})},[i,w,c,p]),P=(0,o.useCallback)(e=>j({id:e.id,url:e.url}).then(({removedItems:t,undo:r})=>{if(0===t.length)throw Error("history_record_missing");return p("library_history_removed",e.url,{surface:"app_sidebar_recent",entry_surface:i}),(0,u.toast)(c("recentRemoved"),{action:{label:c("undo"),onClick:()=>{r().catch(e=>{console.warn("[app-sidebar] failed to restore recent article:",e),u.toast.error(c("recentRestoreFailed"))})}}}),!0}).catch(e=>(console.warn("[app-sidebar] failed to remove recent article:",e),u.toast.error(c("recentRemoveFailed")),!1)),[i,j,c,p]);return n?null:(0,t.jsxs)("div",{className:(0,H.cn)("shrink-0",a?"py-3":"py-8",l),children:[(0,t.jsxs)("div",{className:(0,H.cn)("flex items-center justify-between",a?"mb-0.5 min-h-8 px-2":"mb-1 px-2"),children:[(0,t.jsx)("p",{className:(0,H.cn)("font-semibold text-sidebar-supporting-foreground",a?"text-[11px] leading-4":"text-[11px]"),children:c("recent")}),(0,t.jsx)($.Link,{href:"/history",prefetch:!0,onClick:e=>{(0,e4.isPlainPrimaryArticleNavigationClick)(e)&&s?.()},className:(0,H.cn)("font-medium text-sidebar-supporting-foreground transition-colors hover:text-sidebar-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",a?"-me-1 inline-flex min-h-8 touch-manipulation items-center rounded-[8px] px-2 text-[11px] active:bg-sidebar-accent":"text-[11px] underline decoration-sidebar-foreground
1/30 underline-offset-2 hover:decoration-sidebar-foreground/60"),children:c("viewAll")})]}),(0,t.jsx)(x.SidebarRecentArticlePreviewGroup,{entrySurface:i,children:(0,t.jsx)("div",{ref:E,onKeyDown:function(e){if("Backspace"!==e.key||!(e.metaKey||e.ctrlKey))return;let t=E.current;if(!t)return;let r=Array.from(t.querySelectorAll("[data-recent-id]")),n=r.findIndex(e=>e===document.activeElement),i=-1===n?void 0:k[n];if(!i)return;e.preventDefault();let a=(r[n+1]??r[n-1])?.dataset.recentId;P(i).then(e=>{e&&a&&window.requestAnimationFrame(()=>{t.querySelector(`[data-recent-id="${CSS.escape(a)}"]`)?.focus()})})},className:"flex min-h-[202px] flex-col gap-[2px]",children:k.length>0?k.map((e,n)=>{let o=A===e.url,l=o&&r?.title?r.title:e.title||e.domain||c("untitled"),d=T.get(e.url)??e;return(0,t.jsxs)("div",{className:(0,H.cn)("group/recent relative flex touch-manipulation items-center transition-colors",a?"rounded-[8px]":"rounded-[7px]",o?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-foreground/90 hover:bg-sidebar-accent/70 hover:text-sidebar-accent-foreground"),children:[(0,t.jsx)(x.SidebarRecentArticlePreview,{disabled:a,identity:d,item:e,trigger:(0,t.jsxs)($.Link,{"data-recent-id":e.id,href:(0,te.getArticlePath)(e.url,{from:i}),scroll:!1,ref:t=>{t&&(0,e7.prewarmReader)(S,e.url)},onPointerEnter:()=>void(0,e7.prewarmReader)(S,e.url),onPointerDown:()=>void(0,e7.prewarmReader)(S,e.url),onFocus:()=>void(0,e7.prewarmReader)(S,e.url),onClick:t=>{let r,a=(0,e4.isPlainPrimaryArticleNavigationClick)(t);p("library_article_opened",e.url,{surface:"app_sidebar_recent",active_view:"history"===i?"history":"library",entry_surface:i,open_method:"sidebar_recent",result_position:n+1,shown_count:k.length,total_count:N.length,history_item_age_hours:Number.isFinite(r=Date.parse(e.savedAt))?Math.max(0,Math.round((Date.now()-r)/36e5)):null,is_current_article:o}),(0,e8.handleReaderArticleNavigationClick)(t,{url:e.url,from:i}),a&&s?.()},"aria-current":o?"page":void 0,className:(0,H.cn)("group flex min-w-0 flex-1 items-center rounded-[inherit] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring data-popup-open:bg-sidebar-accent/70 data-popup-open:text-sidebar-accent-foreground",a?"min-h-8 gap-2 py-0 ps-2 pe-1 text-[13px] leading-5 active:bg-sidebar-accent active:text-sidebar-accent-foreground":"min-h-8 gap-2 px-2 text-[13px]"),children:[(0,t.jsx)(m.LibraryItemArtwork,{className:(0,H.cn)("shrink-0 opacity-90 group-hover:opacity-100",a?"size-[15px]":"size-4"),coverClassName:"h-7 w-[19px] rounded-[3px]",faviconClassName:"rounded-[3px]",fileClassName:"text-sidebar-supporting-foreground",item:{...d,url:e.url},loading:"eager"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:l}),(0,t.jsx)("span",{className:(0,H.cn)("flex shrink-0 items-center justify-end text-end text-sidebar-supporting-foreground tabular-nums",a?"w-8 text-[10.5px]":"w-8 text-[11px]"),children:e.pinned?(0,t.jsx)(g.Pin,{"aria-label":c("pinned"),className:"size-3 shrink-0"}):(0,eQ.formatRelativeTime)(e.savedAt)})]})}),a?(0,t.jsxs)(v.Menu,{children:[(0,t.jsx)(v.MenuTrigger,{"aria-label":`${c("recent")}: ${l}`,className:"flex size-8 shrink-0 items-center justify-center rounded-[8px] text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",children:(0,t.jsx)(g.MoreHorizontal,{className:"size-[15px]","aria-hidden":"true"})}),(0,t.jsxs)(v.MenuPopup,{align:"end",sideOffset:4,children:[(0,t.jsxs)(v.MenuItem,{onClick:()=>R(e),children:[e.pinned?(0,t.jsx)(g.PinOff,{className:"size-4","aria-hidden":"true"}):(0,t.jsx)(g.Pin,{className:"size-4","aria-hidden":"true"}),e.pinned?c("unpinArticle",{title:l}):c("pinArticle",{title:l})]}),(0,t.jsxs)(v.MenuItem,{onClick:()=>void P(e),variant:"destructive",children:[(0,t.jsx)(g.Trash,{className:"size-4","aria-hidden":"true"}),c("removeArticle",{title:l})]})]})]}):(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-y-0 end-0 flex translate-x-1 items-center gap-0.5 rounded-[inherit] bg-linear-to-l from-sidebar-accent from-55% to-transparent pe-1 ps-8 opacity-0 transition-[opacity,translate] duration-150 ease-out group-hover/recent:pointer-events-auto group-hover/recent:translate-x-0 group-hover/recent:opacity-100 group-focus-within/recent:pointer-events-auto group-focus-within/recent:translate-x-0 group-focus-within/recent:opacity-100 [@media(pointer:coarse)]:pointer-events-auto [@media(pointer:coarse)]:translate-x-0 [@media(pointer:coarse)]:opacity-100",children:[(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button","aria-label":e.pinned?c("unpinArticle",{title:l}):c("pinArticle",{title:l}),"aria-pressed":!!e.pinned,onClick:()=>R(e),className:"grid size-6 shrink-0 place-items-center rounded-[6px] text-sidebar-foreground
1/60 transition-[background-color,color,scale] duration-100 hover:bg-sidebar-foreground/10 hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring active:scale-90",children:e.pinned?(0,t.jsx)(g.PinOff,{className:"size-3.5"}):(0,t.jsx)(g.Pin,{className:"size-3.5"})})}),(0,t.jsx)(y.TooltipContent,{side:"bottom",children:e.pinned?c("unpinAction"):c("pinAction")})]}),(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button","aria-label":c("removeArticle",{title:l}),onClick:()=>void P(e),className:"grid size-6 shrink-0 place-items-center rounded-[6px] text-sidebar-foreground/60 transition-[background-color,color,scale] duration-100 hover:bg-destructive/10 hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring active:scale-90",children:(0,t.jsx)(g.Trash,{className:"size-3.5"})})}),(0,t.jsx)(y.TooltipContent,{side:"bottom",children:c("removeAction")})]})]})]},e.id)}):f?(0,t.jsx)("p",{className:(0,H.cn)("text-sidebar-supporting-foreground",a?"min-h-8 rounded-[8px] px-2 py-[7px] text-[12px] leading-[18px]":"rounded-[7px] px-2 py-2 text-[12px] leading-[17px]"),children:c("recentEmpty")}):(0,t.jsxs)("div",{className:(0,H.cn)("flex min-h-8 items-center gap-2 px-2 text-sidebar-supporting-foreground",a?"rounded-[8px] text-[12px]":"rounded-[7px] text-[12px]"),role:"status",children:[(0,t.jsx)(b.Ring,{"aria-hidden":"true",className:"size-3.5"}),(0,t.jsx)("span",{children:c("recentLoading")})]})})})]})}function t_({collapsed:e,width:r,onResizePreview:n,onResize:i,onToggleCollapsed:a,onResizingChange:s}){let l=(0,d.useTranslations)("appSidebar"),c=(0,o.useRef)(null),u=(0,o.useCallback)(e=>{0!==e.button||c.current||(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),c.current={startX:e.clientX,startWidth:r,latestWidth:r,moved:!1,animationFrame:null},s(!0))},[r,s]),p=(0,o.useCallback)(t=>{let r=c.current;if(!r||e)return;let i=t.clientX-r.startX;Math.abs(i)>3&&(r.moved=!0),r.latestWidth=tm(r.startWidth+i),null===r.animationFrame&&(r.animationFrame=window.requestAnimationFrame(()=>{let e=c.current;e&&(e.animationFrame=null,n(e.latestWidth))}))},[e,n]),m=(0,o.useCallback)((e,t)=>{let r=c.current;r&&(c.current=null,null!==r.animationFrame&&window.cancelAnimationFrame(r.animationFrame),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),r.moved&&(n(r.latestWidth),i(r.latestWidth)),s(!1),!r.moved&&t&&a())},[i,n,s,a]),x=(0,o.useCallback)(e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),a())},[a]);return e?null:(0,t.jsx)("button",{type:"button","aria-label":l("resizeOrCollapseSidebar"),className:"group absolute bottom-0 right-[-5px] top-0 z-20 hidden w-[9px] touch-none cursor-col-resize items-stretch justify-center focus-visible:outline-none md:flex",onKeyDown:x,onPointerDown:u,onPointerMove:p,onPointerUp:e=>m(e,!0),onPointerCancel:e=>m(e,!1),onLostPointerCapture:e=>m(e,!1),children:(0,t.jsx)("span",{className:"my-3 block w-px rounded-full bg-muted-foreground/35 opacity-0 transition-[background-color,opacity] group-hover:opacity-100 group-focus-visible:bg-sidebar-ring group-focus-visible:opacity-100"})})}function tF(){let e=(0,d.useTranslations)("appSidebar");return(0,o.useMemo)(()=>[{id:"library",label:e("library"),icon:(0,t.jsx)(g.Library,{"aria-hidden":"true",className:"size-4",strokeWidth:1.75})},{id:"feeds",label:e("feeds"),icon:(0,t.jsx)(g.Rss,{"aria-hidden":"true",className:"size-4",strokeWidth:1.75})},{id:"chat",label:e("chat"),icon:(0,t.jsx)(j.RemyIcon,{"aria-hidden":"true",className:"size-4"})}],[e])}function tL({surface:e,activeKey:r,article:n,currentUrl:i,collapsed:a,mobile:s=!1,onNavigate:l,onRequestSignIn:c}){let d=r??("history"===e?"history":void 0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-sidebar-primary-nav":!0,className:(0,H.cn)("flex w-full flex-col gap-[2px]",a&&"items-center gap-3"),children:[(0,t.jsx)(tC,{active:"home"===e,collapsed:a,mobile:s,onNavigate:l}),(0,t.jsx)(tg,{activeKey:d,active:"dashboard"===e&&"highlights"!==d,collapsed:a,mobile:s,onNavigate:l}),(0,t.jsx)(tb,{active:"highlights"===e||"highlights"===d,collapsed:a,mobile:s,onNavigate:l}),(0,t.jsx)(tf,{active:"sources"===e,collapsed:a,mobile:s,onNavigate:l}),(0,t.jsx)(tk,{active:"books"===e,collapsed:a,mobile:s,onNavigate:l})]}),(0,t.jsx)(o.Suspense,{fallback:null,children:(0,t.jsx)(eO,{collapsed:a,mobile:s,onNavigate:l,onRequestSignIn:c})}),(0,t.jsx)(tP,{currentUrl:i,currentArticle:n,collapsed:a,entrySurface:"history"===e?"history":"library",mobile:s,onNavigate:l,className:s?void 0:"sidebar-collapsed-hide"})]})}function tz({surface:e,activeFeedId:r,activeCollectionId:n,collapsed:i,mobile:a=!1,onNavigate:s,onRequestSignIn:o}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:(0,H.cn)("flex w-full flex-col gap-[2px]",i&&"items-center gap-3"),children:[(0,t.jsx)(tS,{active:"feedsDiscover"===e,collapsed:i,mobile:a,onNavigate:s}),(0,t.jsx)(tN,{active:"monitors"===e,collapsed:i,mobile:a,onNavigate:s}),(0,t.jsx)(tv,{active:"newsletters"===e,collapsed:i,mobile:a,onNavigate:s})]}),(0,t.jsx)("div",{className:(0,H.cn)("mt-6 flex w-full flex-col gap-[2px]",i&&"mt-0 items-center gap-3"),children:(0,t.jsx)(tw,{allFeedsActive:"feeds"===e,activeCollectionId:n,activeFeedId:r,collapsed:i,mobile:a,onNavigate:s,onRequestSignIn:o})})]})}function tM({surface:e,collapsed:r,mobile:n=!1,onNavigate:i}){return(0,t.jsxs)(t.Fragment,{children:[r?(0,t.jsx)(tT,{active:"chat"===e,collapsed:!0,mobile:n,onNavigate:i}):null,(0,t.jsx)(I.AppSidebarChatThreads,{collapsed:r,mobile:n,onNavigate:i})]})}function tO({activeTab:e,tabsId:r,...n}){return(0,t.jsx)("div",{role:"tabpanel",id:eu(r,e),"aria-labelledby":ed(r,e),"data-sidebar-tab-panel":e,className:(0,H.cn)("flex w-full flex-col","chat"===e&&!n.collapsed&&"min-h-32 flex-1",n.collapsed&&"items-center gap-3"),children:"library"===e?(0,t.jsx)(tL,{...n}):"feeds"===e?(0,t.jsx)(tz,{...n}):(0,t.jsx)(tM,{...n})})}function tD({surface:e,activeKey:r,article:n,currentUrl:i,activeFeedId:a,activeCollectionId:s,onNavigate:l,onOpenSearch:c,onOpenSignIn:u,onRequestSavedItemsSignIn:p}){let m=(0,d.useTranslations)("appSidebar"),{activeTab:x,selectTab:h}=e1(e),f=tF(),b=(0,o.useId)();return(0,t.jsxs)("div",{className:"flex h-full min-h-0 flex-col [font-family:var(--font-inter)]",style:R.FIGMA_SIDEBAR_FONT_STYLE,children:[(0,t.jsxs)("div",{"data-sidebar-mobile-header":!0,className:"flex min-h-11 shrink-0 items-center px-2",children:[(0,t.jsx)(tp,{active:"home"===e,mobile:!0,onNavigate:l}),(0,t.jsx)("div",{"data-sidebar-mobile-header-actions":!0,className:"ms-auto flex shrink-0 items-center gap-1",children:(0,t.jsxs)(eJ.SheetClose,{className:"flex size-9 shrink-0 items-center justify-center rounded-[8px] text-sidebar-foreground
1/72 transition-[background-color,color] hover:bg-sidebar-accent/35 hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",children:[(0,t.jsx)(g.XIcon,{className:"size-[15px]",strokeWidth:1.75}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})})]}),(0,t.jsxs)("div",{"data-sidebar-tabs-lane":!0,className:"flex shrink-0 flex-col gap-2 px-2 pt-2",children:[(0,t.jsx)(tI,{mobile:!0,onNavigate:l,onRequestSearch:c}),(0,t.jsx)(ef,{baseId:b,label:m("sidebarTabs"),mobile:!0,onValueChange:h,tabs:f,value:x})]}),(0,t.jsxs)("div",{"data-sidebar-mobile-scroll":!0,className:"flex min-h-0 flex-1 flex-col overflow-y-auto overscroll-contain px-2 pb-2 pt-3",children:[(0,t.jsx)(tO,{activeTab:x,tabsId:b,surface:e,activeKey:r,article:n,currentUrl:i,activeFeedId:a,activeCollectionId:s,collapsed:!1,mobile:!0,onNavigate:l,onRequestSignIn:u}),(0,t.jsx)("div",{className:"mt-auto w-full shrink-0 pt-2",children:(0,t.jsx)(tR,{article:n,collapsed:!1,mobile:!0,reserveSpace:"reader"===e||"story"===e})})]}),(0,t.jsxs)("div",{"data-sidebar-footer":!0,className:"flex shrink-0 flex-col gap-[2px] px-2 pb-1 pt-1.5",children:[(0,t.jsx)(tA,{active:"mcpApiCli"===e,mobile:!0,onNavigate:l}),(0,t.jsx)(k.SidebarSavedItemsReminder,{onRequestSignIn:p}),(0,t.jsxs)("div",{"data-sidebar-account-row":!0,className:"flex min-w-0 items-center gap-1",children:[(0,t.jsx)(C.SidebarAccountStatus,{className:"min-w-0 flex-1",mobile:!0,onNavigate:l,onOpenSignIn:u}),(0,t.jsx)(tE,{mobile:!0,onNavigate:l})]})]})]})}e.s(["AppMenuButton",0,function({surface:e,activeKey:r,article:n,currentUrl:i,activeFeedId:a,activeCollectionId:s,className:l}){let c=(0,d.useTranslations)("appSidebar"),[u,p]=(0,o.useState)(!1),m=(0,h.useOpenSignInModal)(),x=(0,o.useRef)(null),f=(0,o.useRef)(null),b=(0,o.useRef)(!0),v=(0,o.useCallback)(()=>{let e=f.current;f.current=null,"function"==typeof e?e():"search"===e?(0,e6.openArticleCommandPalette)():"sign-in"===e&&m()},[m]),j=(0,o.useCallback)(e=>{(f.current=e,b.current)?"function"==typeof globalThis.requestAnimationFrame?globalThis.requestAnimationFrame(v):globalThis.setTimeout(v,0):p(!1)},[v]),y=(0,o.useCallback)(e=>{e&&(b.current=!1),p(e)},[]),w=(0,o.useCallback)(e=>{b.current=!e,!e&&f.current&&v()},[v]);return(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-1 md:hidden","data-app-mobile-actions":!0,children:(0,t.jsxs)(eJ.Sheet,{open:u,onOpenChange:y,onOpenChangeComplete:w,children:[(0,t.jsx)(eJ.SheetTrigger,{render:(0,t.jsx)("button",{ref:x,type:"button",className:(0,H.cn)("flex touch-manipulation items-center justify-center rounded-full text-foreground/80 transition-colors duration-150 ease-out hover:bg-accent hover:text-foreground active:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",l,"!size-11 !min-h-11 !min-w-11"),"aria-label":c("openAppMenu"),children:(0,t.jsx)(g.SidebarToggle,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})}),(0,t.jsxs)(eJ.SheetContent,{side:"left",showCloseButton:!1,className:"flex w-[min(18rem,calc(100vw-0.75rem))] max-w-none flex-col gap-0 overflow-hidden bg-sidebar px-0 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-[max(0.5rem,env(safe-area-inset-top))] text-sidebar-foreground",style:R.FIGMA_SIDEBAR_SURFACE_STYLE,children:[(0,t.jsx)(eJ.SheetTitle,{className:"sr-only",children:c("appMenu")}),(0,t.jsx)(tD,{surface:e,activeKey:r,article:n,currentUrl:i,activeFeedId:a,activeCollectionId:s,onNavigate:()=>y(!1),onOpenSearch:()=>j("search"),onOpenSignIn:()=>j("sign-in"),onRequestSavedItemsSignIn:j})]})]})})},"AppSidebar",0,function({surface:e,activeKey:r,article:n,currentUrl:i,activeFeedId:a,activeCollectionId:s,className:c}){let u=(0,d.useTranslations)("appSidebar"),{width:p,collapsed:m,preferencesRestored:x,setWidth:g,setCollapsed:f}=function(){let[e,t]=(0,o.useState)(td),[r,n]=(0,o.useState)(!1),[i,a]=(0,o.useState)(!1),s=(0,o.useRef)(td);return(0,o.useLayoutEffect)(()=>{let e=function(){try{let e=window.localStorage.getItem(tl),t=e?Number.parseInt(e,10):td;return Number.isFinite(t)?tm(t):td}catch{return td}}(),r=function(){try{return"1"===window.localStorage.getItem(tc)}catch{return!1}}();s.current=e,t(e),(0,D.syncAppSidebarCollapsedState)(r,e),n(r),a(!0)},[]),{width:e,collapsed:r,preferencesRestored:i,setWidth:(0,o.useCallback)(e=>{let r=tm(e);s.current=r,t(r),(0,D.setAppSidebarWidthCssVariable)(r);try{window.localStorage.setItem(tl,String(r))}catch{}},[]),setCollapsed:(0,o.useCallback)(e=>{n(e),(0,D.syncAppSidebarCollapsedState)(e,s.current);try{window.localStorage.setItem(tc,e?"1":"0")}catch{}},[])}}(),{activeTab:b,selectTab:v}=e1(e),j=tF(),y=(0,o.useId)(),w=(0,o.useRef)(null),S=(0,h.useOpenSignInModal)(),k=(0,o.useCallback)(e=>{w.current&&(w.current.style.width=`${tm(e)}px`)},[]),I=(0,o.useCallback)(e=>{w.current&&(w.current.style.transition=e?"none":"")},[]),T=(0,o.useCallback)(e=>{if(!m||e.defaultPrevented)return;let t=e.target;t instanceof Element&&(t.closest("a, button, input, textarea, select, [role='button'], [role='link'], [contenteditable='true']")||f(!1))},[m,f]);return(0,l.useHotkey)("[",()=>f(!m),{ignoreInputs:!0,preventDefault:!0,stopPropagation:!0,conflictBehavior:"allow"}),(0,t.jsxs)("aside",{ref:w,className:(0,H.cn)("group/sidebar relative hidden h-dvh shrink-0 flex-col bg-sidebar text-sidebar-foreground [font-family:var(--font-inter)] md:sticky md:top-0 md:flex",m&&"cursor-pointer",x?(0,H.cn)("transition-[width] ease-[cubic-bezier(0.32,0.72,0,1)]",m?"duration-[260ms]":"duration-200"):"transition-none",c),onClick:T,style:{...R.FIGMA_SIDEBAR_SURFACE_STYLE,width:m?56:x?p:D.APP_SIDEBAR_WIDTH_STYLE_VALUE},"aria-label":u("appSidebarLabel"),"data-app-sidebar":!0,"data-collapsed":m?"true":"false","data-app-sidebar-restored":x?"true":"false",children:[(0,t.jsxs)("div",{"data-sidebar-header":!0,className:(0,H.cn)("group/sidebar-header flex h-12 shrink-0 items-start px-2 pt-2",m&&"justify-center"),children:[(0,t.jsxs)("div",{"data-sidebar-home":!0,className:(0,H.cn)("group/home-toggle relative",m?"size-8":"flex min-w-0 flex-1 items-center"),children:[(0,t.jsx)("div",{className:(0,H.cn)(m&&"transition-[opacity,scale] duration-150 ease-out group-hover/sidebar:scale-[0.25] group-hover/sidebar:opacity-0 group-focus-within/home-toggle:scale-[0.25] group-focus-within/home-toggle:opacity-0"),children:(0,t.jsx)(tp,{active:"home"===e,collapsed:m})}),m?(0,t.jsx)(to,{label:u("openSidebar"),side:"right",children:(0,t.jsx)("button",{type:"button",onClick:()=>f(!1),className:"pointer-events-none absolute inset-0 flex size-8 scale-[0.25] items-center justify-center rounded-[8px] text-sidebar-foreground
1/55 opacity-0 transition-[background-color,color,opacity,scale] duration-150 ease-out hover:bg-sidebar-accent hover:text-sidebar-accent-foreground group-hover/sidebar:pointer-events-auto group-hover/sidebar:scale-100 group-hover/sidebar:opacity-100 group-focus-within/home-toggle:pointer-events-auto group-focus-within/home-toggle:scale-100 group-focus-within/home-toggle:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring","aria-label":u("openSidebar"),children:(0,t.jsx)(R.FigmaSidebarIcon,{name:"panel"})})}):null]}),m?null:(0,t.jsxs)("div",{"data-sidebar-collapsed-hide":!0,className:"ml-auto flex h-8 items-center gap-0.5",children:[(0,t.jsx)(N.AppSidebarCaptureButton,{header:!0}),(0,t.jsx)(to,{label:u("collapseSidebar"),side:"bottom",children:(0,t.jsx)("button",{type:"button",onClick:()=>f(!0),className:"flex size-6 items-center justify-center rounded-[6px] text-sidebar-foreground/55 transition-[background-color,color] hover:bg-sidebar-accent/55 hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring","aria-label":u("collapseSidebar"),children:(0,t.jsx)(R.FigmaSidebarIcon,{name:"panel"})})})]})]}),(0,t.jsxs)("div",{"data-sidebar-tabs-lane":!0,className:(0,H.cn)("flex shrink-0 flex-col gap-2 px-2 pt-4",m&&"items-center gap-3 pt-2"),children:[m?(0,t.jsx)(N.AppSidebarCaptureButton,{collapsed:!0}):null,(0,t.jsx)(tI,{collapsed:m}),(0,t.jsx)(ef,{baseId:y,collapsed:m,label:u("sidebarTabs"),onValueChange:v,tabs:j,value:b})]}),(0,t.jsxs)("div",{"data-sidebar-scroll":!0,className:(0,H.cn)("flex min-h-0 flex-1 flex-col overflow-y-auto overscroll-none px-2 pb-2 pt-3",m&&"items-center gap-3 py-2"),children:[(0,t.jsx)(tO,{activeTab:b,tabsId:y,surface:e,activeKey:r,article:n,currentUrl:i,activeFeedId:a,activeCollectionId:s,collapsed:m,onRequestSignIn:S}),(0,t.jsx)("div",{className:"mt-auto w-full shrink-0",children:(0,t.jsx)(tR,{article:n,collapsed:m,reserveSpace:"reader"===e||"story"===e,className:"sidebar-collapsed-hide"})})]}),(0,t.jsxs)("div",{"data-sidebar-footer":!0,className:(0,H.cn)("flex shrink-0 flex-col gap-[2px] p-2",m&&"items-center"),children:[(0,t.jsx)(tA,{active:"mcpApiCli"===e,collapsed:m}),m?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,t.jsx)(tE,{vertical:!0}),(0,t.jsx)(C.SidebarAccountStatus,{collapsed:!0})]}):(0,t.jsxs)("div",{"data-sidebar-account-row":!0,className:"flex min-w-0 items-center gap-0.5",children:[(0,t.jsx)(C.SidebarAccountStatus,{className:"min-w-0 flex-1"}),(0,t.jsx)(tE,{compact:!0})]})]}),(0,t.jsx)(t_,{collapsed:m,width:p,onResizePreview:k,onResize:g,onToggleCollapsed:()=>f(!m),onResizingChange:I})]})}],613176)},155146,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(613176),i=e.i(479336),a=e.i(916107),s=e.i(647163);let o=!1;function l({host:e,surface:n,activeKey:i,article:a,currentUrl:s,activeFeedId:o,activeCollectionId:c,className:d}){let[u]=(0,r.useState)(()=>Symbol("app-workbench-shell")),p=(0,r.useRef)(null),m=null!=a,x=a?.label,h=a?.sourceLabel,g=a?.title,f=a?.domain,b=a?.url,v=a?.status,j=a?.progress;return(0,r.useLayoutEffect)(()=>{let t=p.current;t&&e.attach({owner:u,frame:t,props:{surface:n,activeKey:i,currentUrl:s,activeFeedId:o,activeCollectionId:c,className:d,article:m?{label:x,sourceLabel:h,title:g,domain:f,url:b,status:v,progress:j}:void 0}})},[e,u,n,i,s,o,c,d,m,x,h,g,f,b,v,j]),(0,r.useLayoutEffect)(()=>()=>e.detach(u),[e,u]),(0,t.jsx)("div",{ref:p,style:{display:"contents"}})}let c="md:rounded-[12px] md:border-[0.5px] md:border-solid md:border-sidebar-border md:shadow-workbench dark:md:shadow-linear-frame",d=(0,r.forwardRef)(function({surface:e,activeKey:d,article:u,currentUrl:p,activeFeedId:m,activeCollectionId:x,children:h,sidebar:g,mode:f="fixed",sidebarClassName:b,contentProps:v,workbenchProps:j,hideSidebar:y=!1,sidebarComponent:w=n.AppSidebar,className:S,...N},k){let{className:C,...I}=v??{},{className:T,...A}=j??{},E="fixed"===f;(0,a.useBodyScrollLock)(E);let R=(0,i.useAppSidebarHost)(),[P,_]=(0,r.useState)(()=>o&&null!==R);return(0,r.useLayoutEffect)(()=>
1{if(o=!0,!R)return;let e=!1;return queueMicrotask(()=>{e||_(!0)}),()=>{e=!0}},[R]),(0,t.jsx)("div",{ref:k,"data-app-frame":"","data-app-frame-mode":f,className:(0,s.cn)(E?"flex h-[100dvh] w-full overflow-hidden overscroll-none bg-workbench text-foreground outline-none md:bg-sidebar":"min-h-dvh bg-workbench text-foreground md:bg-sidebar",S),...N,children:(0,t.jsxs)("div",{className:(0,s.cn)("flex w-full",E?"h-full overflow-hidden overscroll-none":"min-h-dvh"),children:[y?null:g??(P&&R?(0,t.jsx)(l,{host:R,surface:e,activeKey:d,article:u,currentUrl:p,activeFeedId:m,activeCollectionId:x,className:b}):(0,t.jsx)(w,{surface:e,activeKey:d,article:u,currentUrl:p,activeFeedId:m,activeCollectionId:x,className:b})),(0,t.jsx)("div",{className:(0,s.cn)(E?"flex min-h-0 min-w-0 flex-1 overflow-hidden overscroll-none bg-workbench md:bg-sidebar md:p-2 md:pl-0":"min-w-0 flex-1 md:bg-sidebar md:p-2 md:pl-0",C),...I,children:(0,t.jsx)("div",{"data-remy-workbench":"",className:(0,s.cn)(E?"flex min-h-0 min-w-0 flex-1 overflow-hidden overscroll-none bg-workbench":"min-h-dvh overflow-hidden bg-workbench md:min-h-[calc(100dvh-1rem)]",c,T),...A,children:h})})]})})});e.s(["AppWorkbenchShell",0,d,"frameClassName",0,c])},990218,209920,e=>{"use strict";var t=e.i(843476),r=e.i(657688),n=e.i(271645),i=e.i(280211),a=e.i(340222),s=e.i(916107),o=e.i(624017),l=e.i(640777),c=e.i(647163);async function d(e,t){let r=await (0,o.getCachedArticle)(e).catch(()=>void 0);if("book"!==(0,a.getLibraryFileIconKind)(t))return null;let n=r?.response?.article?.image?.trim();if(!n)return null;try{let e=new URL(n);return"https:"===e.protocol?e.toString():null}catch{return null}}e.s(["LibraryItemArtwork",0,function({item:e,className:u,coverClassName:p,faviconClassName:m,fileClassName:x,loading:h="lazy"}){let g=(0,n.useMemo)(()=>({captureMethod:e.captureMethod,contentKind:e.contentKind,domain:e.domain,fileName:e.fileName,format:e.format,mimeType:e.mimeType}),[e.captureMethod,e.contentKind,e.domain,e.fileName,e.format,e.mimeType]),f="book"===(0,a.getLibraryFileIconKind)(g),b=function(e){try{return(0,l.normalizeCacheUrl)(e)}catch{return e}}(e.url),[v,j]=(0,n.useState)(null),[y,w]=(0,n.useState)(null);(0,s.useExternalSync)(()=>{if(!f)return;let t=!1,r=0,n=(n=!1)=>{let i=++r;d(e.url,g).then(a=>{t||i!==r||(n&&a&&w(null),j({itemUrl:e.url,coverUrl:a}))})};n();let i=(0,o.subscribeToArticleCacheChanges)(e=>{(null===e.url||e.url===b)&&n(!0)});return()=>{t=!0,i()}},[g,f,e.url,b]);let S=v?.itemUrl===e.url?v.coverUrl:null,N=y?.itemUrl===e.url&&y.coverUrl===S;return f?(0,t.jsx)("span",{"aria-hidden":"true",className:(0,c.cn)("relative flex shrink-0 items-center justify-center overflow-hidden bg-muted outline outline-1 -outline-offset-1 outline-black/10 dark:outline-white/10",p),"data-book-artwork":"",children:S&&!N?(0,t.jsx)(r.default,{alt:"",className:"object-cover","data-book-cover":"",fill:!0,loading:h,onError:()=>w({itemUrl:e.url,coverUrl:S}),sizes:"32px",src:S,unoptimized:!0}):(0,t.jsx)(i.LibraryItemIdentityIcon,{className:u,fileClassName:x,item:g,loading:h})}):(0,t.jsx)(i.LibraryItemIdentityIcon,{className:u,faviconClassName:m,fileClassName:x,item:e,loading:h})}],990218),e.s([],550146),e.i(550146);var u=e.i(896499),p=e.i(146376),m=e.i(17989),x=e.i(46420),h=e.i(733332);let g=n.createContext(void 0);function f(e){let t=n.useContext(g);if(void 0===t&&!e)throw Error((0,h.default)(50));return t}var b=e.i(675606),v=e.i(56434),j=e.i(301252),y=e.i(264111),w=e.i(116786),S=e.i(990627),N=e.i(229315);function k(e,t,r,n){return{left:e,top:t,right:r,bottom:n,x:e,y:t,width:r-e,height:n-t}}function C(e){let t,r=[],n=1/0,i=1/0,a=-1/0,s=-1/0;for(let o of Array.from(e).sort((e,t)=>e.top-t.top)){if(n=Math.min(n,o.left),i=Math.min(i,o.top),a=Math.max(a,o.right),s=Math.max(s,o.bottom),!t||o.top-t.top>t.height/2)r.push({left:o.left,top:o.top,right:o.right,bottom:o.bottom,width:o.width,height:o.height});else{let e=r[r.length-1];e.left=Math.min(e.left,o.left),e.right=Math.max(e.right,o.right),e.bottom=Math.max(e.bottom,o.bottom),e.width=e.right-e.left,e.height=e.bottom-e.top}t=o}return{lines:r,fallback:k(n,i,a,s)}}function I(e,t,r){return e.findIndex(e=>t>e.left-2&&t<e.right+2&&r>e.top-2&&r<e.bottom+2)}function T(e){return k(e.left,e.top,e.right,e.bottom)}function A(e,t,r,n){let i=function(e,t,r){let{lines:n}=C(e.getClientRects());if(n.length<2)return;let i=I(n,t,r);return{x:t,y:r,lineIndex:-1===i?void 0:i,element:e}}(t,r,n);return e.current=i,i}var E=e.i(18478);let R={...w.popupStoreSelectors,instantType:e=>e.instantType,adaptiveOrigin:e=>e.adaptiveOrigin,closeDelay:e=>e.closeDelay};class P extends j.ReactStore{constructor(e,t,r){const n=new S.PopupTriggerMap;super(_(e,n,t,r),F(n),R)}setOpen=(e,t)=>{let{inlineRectCoordsRef:r}=this.context;(0,y.applyPopupOpenChange)(this,e,t,{onBeforeDispatch(){let n=t.event;e&&t.reason===v.REASONS.triggerHover&&t.trigger&&"clientX"in n&&"clientY"in n&&r.current?.element!==t.trigger&&A(r,t.trigger,n.clientX,n.clientY)}})}}function _(e,t,r,n=!1){let i={...(0,w.createInitialPopupStoreState)(),instantType:void 0,adaptiveOrigin:void 0,closeDelay:300,...e};return i.floatingRootContext=(0,w.createPopupFloatingRootContext)(t,r,n),i}function F(e){return{popupRef:n.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e,inlineRectCoordsRef:{current:void 0}}}function L(e){let{open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:s,actionsRef:o,handle:l,triggerId:c,defaultTr
1iggerId:d=null,children:u}=e,m=(0,y.usePopupRootStore)((e,t)=>new P({open:i,openProp:r,activeTriggerId:d,triggerIdProp:c},e,t));m.useControlledProp("openProp",r),m.useControlledProp("triggerIdProp",c),m.useContextCallback("onOpenChange",a),m.useContextCallback("onOpenChangeComplete",s);let x=m.useState("open"),h=m.useState("activeTriggerId"),f=m.useState("mounted"),j=m.useState("payload");(0,y.useImplicitActiveTrigger)(m,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:w}=(0,y.useOpenStateTransitions)(x,m,()=>{m.context.inlineRectCoordsRef.current=void 0});(0,p.useIsoLayoutEffect)(()=>{x&&null==h&&m.set("payload",void 0)},[m,h,x]),n.useImperativeHandle(o,()=>({unmount:w,close:()=>m.setOpen(!1,(0,b.createChangeEventDetails)(v.REASONS.imperativeAction))}),[w,m]);let S=x||f;return(0,t.jsxs)(g.Provider,{value:m,children:[l&&(0,t.jsx)(y.PopupHandleAttachment,{handle:l,store:m}),S&&(0,t.jsx)(z,{store:m}),"function"==typeof u?u({payload:j}):u]})}function z({store:e}){let t=e.useState("floatingRootContext"),r=(0,m.useDismiss)(t);return(0,y.usePopupInteractionProps)(e,{activeTriggerProps:r.reference,inactiveTriggerProps:r.trigger,popupProps:r.floating}),null}let M=(0,u.fastComponent)(function(e){return f(!0)?(0,t.jsx)(L,{...e}):(0,t.jsx)(x.FloatingTree,{children:(0,t.jsx)(L,{...e})})}),O=n.createContext(void 0);var D=e.i(378680);let B=n.forwardRef(function(e,r){let{keepMounted:n=!1,...i}=e;return f().useState("mounted")||n?(0,t.jsx)(O.Provider,{value:n,children:(0,t.jsx)(D.FloatingPortalLite,{ref:r,...i})}):null});var U=e.i(405005),H=e.i(552245),$=e.i(788015),W=e.i(459636),K=e.i(650316),V=e.i(413082),q=e.i(872135);let Y=(0,u.fastComponentRef)(function(e,t){let{render:r,className:i,delay:a,closeDelay:s,id:o,payload:l,handle:c,style:d,...u}=e,p=f(!0),m=(0,W.usePopupHandleStore)(c)??p;if(!m)throw Error((0,h.default)(89));let x=(0,$.useBaseUiId)(o),g=m.useState("isTriggerActive",x),b=m.useState("isOpenedByTrigger",x),v=m.useState("floatingRootContext"),j=m.context.
1inlineRectCoordsRef,w=n.useRef(null),S=a??600,N=s??300,{registerTrigger:k,isMountedByThisTrigger:C}=(0,y.useTriggerDataForwarding)(x,w,m,{payload:l,closeDelay:N}),I=(0,q.useHoverReferenceInteraction)(v,{mouseOnly:!0,move:!1,handleClose:(0,K.safePolygon)(),delay:()=>({open:S,close:N}),triggerElementRef:w,isActiveTrigger:g,isClosing:()=>"ending"===m.select("transitionStatus")}),T=(0,V.useFocus)(v,{delay:S}),E=m.useState("triggerProps",C),R=function(e,t){function r(r){t||A(e,r.currentTarget,r.clientX,r.clientY)}return{onFocus(){e.current=void 0},onMouseEnter:r,onMouseMove:r}}(j,b);return(0,H.useRenderElement)("a",e,{state:{open:b},ref:[t,k,w],props:[I,T.reference,E,R,{id:x},u],stateAttributesMapping:U.triggerOpenStateMapping})}),G=n.createContext(void 0);function X(){let e=n.useContext(G);if(void 0===e)throw Error((0,h.default)(49));return e}var J=e.i(923706),Q=e.i(638396),Z=e.i(789579);let ee=n.forwardRef(function(e,r){let{render:i,className:a,anchor:s,positionMethod:o="absolute",side:l="bottom",align:c="center",sideOffset:d=0,alignOffset:u=0,collisionBoundary:m="clipping-ancestors",collisionPadding:g=5,arrowPadding:b=5,sticky:v=!1,disableAnchorTracking:j=!1,collisionAvoidance:y=Q.POPUP_COLLISION_AVOIDANCE,style:w,...S}=e,A=f(),E=function(){let e=n.useContext(O);if(void 0===e)throw Error((0,h.default)(48));return e}(),R=(0,x.useFloatingNodeId)(),P=A.useState("open"),_=A.useState("mounted"),F=A.useState("floatingRootContext"),L=A.useState("instantType"),z=A.useState("transitionStatus"),M=A.useState("adaptiveOrigin"),D=A.context.inlineRectCoordsRef,B=(0,J.useAnchorPositioning)({anchor:s,floatingRootContext:F,positionMethod:o,mounted:_,side:l,sideOffset:d,align:c,alignOffset:u,arrowPadding:b,collisionBoundary:m,collisionPadding:g,sticky:v,disableAnchorTracking:j,keepMounted:E,nodeId:R,collisionAvoidance:y,adaptiveOrigin:M,inline:{name:"inline",async fn(e){let t=e.elements.reference;if("function"!=typeof t?.getClientRects)return{};let r="contextElement"in t&&t.contextElement?t.contextElement:(0,N.isElement)(t)?t:void 0,n=D.current,i=n?.element===t||n?.element===r?n:void 0,a=function(e,t,r){let{lines:n,fallback:i}=C(e.getClientRects());if(n.length<2)return null;let a=r?.x,s=r?.y,o=t[0];if(r?.lineIndex!=null&&n[r.lineIndex])return T(n[r.lineIndex]);if(null!=a&&null!=s){let e=I(n,a,s);if(-1!==e)return T(n[e])}if(2===n.length&&n[0].left>n[1].right&&null!=a&&null!=s)return i;if("t"===o||"b"===o){let e=n[0],t=n[n.length-1],r="t"===o?e:t;return k(r.left,e.top,r.right,t.bottom)}let l="l"===o,c=n[0].left,d=n[0].right,u=l?1/0:-1/0,p=n[0],m=n[0];for(let e of n){c=Math.min(c,e.left),d=Math.max(d,e.right);let t=l?e.left:e.right;l&&t<u||!l&&t>u?(u=t,p=e,m=e):t===u&&(m=e)}return k(c,p.top,d,m.bottom)}(t,e.placement,i);if(!a||"function"!=typeof e.platform.getElementRects)return{};let s=await e.platform.getElementRects({reference:{contextElement:r,getBoundingClientRect:()=>a},floating:e.elements.floating,strategy:e.strategy});return e.rects.reference.x===s.reference.x&&e.rects.reference.y===s.reference.y&&e.rects.reference.width===s.reference.width&&e.rects.reference.height===s.reference.height?{}:{reset:{rects:s}}}}}),U=B.update;(0,p.useIsoLayoutEffect)(()=>{P&&_&&U()},[P,_,U]);let H={open:P,side:B.side,align:B.align,anchorHidden:B.anchorHidden,instant:L},$=(0,Z.usePositioner)(e,H,{styles:B.positionerStyles,transitionStatus:z,props:S,refs:[r,A.useStateSetter("positionerElement")],hidden:!_,inert:!P});return(0,t.jsx)(G.Provider,{value:B,children:(0,t.jsx)(x.FloatingNode,{id:R,children:$})})});var et=e.i(137584),er=e.i(253984),en=e.i(431157);let ei=n.forwardRef(function(e,t){let{className:r,render:n,style:i,...a}=e,s=f(),{side:o,align:l}=X(),c=s.useState("open"),d=s.useState("instantType"),u=s.useState("transitionStatus"),p=s.useState("popupProps"),m=s.useState("floatingRootContext"),x=s.useState("closeDelay");return(0,et.useOpenChangeComplete)({open:c,ref:s.context.popupRef,onComplete(){c&&s.context.onOpenChangeComplete?.(!0)}}),(0,en.useHoverFloatingInteraction)(m,{closeDelay:x}),(0,H.useRenderElement)("div",e,{state:{open:c,side:o,align:l,instant:d,transitionStatus:u},ref:[t,s.context.popupRef,s.useStateSetter("popupElement")],props:[y.FOCUSABLE_POPUP_PROPS,p,(0,er.getDisabledMountTransitionStyles)(u),a],stateAttributesMapping:U.popupTransitionStateMapping})}),ea=n.forwardRef(function(e,t){let{render:r,className:n,style:i,...a}=e,s=f(),{arrowRef:o,side:l,align:c,arrowUncentered:d,arrowStyles:u}=X(),p=s.useState("open");return(0,H.useRenderElement)("div",e,{state:{open:p,side:l,align:c,uncentered:d},ref:[o,t],props:[{style:u,"aria-hidden":!0},a],stateAttributesMapping:U.popupStateMapping})}),es=n.forwardRef(function(e,t){let{render:r,className:n,style:i,...a}=e,s=f(),o=s.useState("open"),l=s.useState("mounted"),c=s.useState("transitionStatus");return(0,H.useRenderElement)("div",e,{state:{open:o,transitionStatus:c},ref:[t],props:[{role:"presentation",hidden:!l,style:{pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none"}},a],stateAttributesMapping:U.popupTransitionStateMapping})});var eo=e.i(818390);let el=n.forwardRef(function(e,t){let{render:r,className:n,style:i,children:a,...s}
1=e,o=f(),l=X(),c=o.useState("instantType"),{children:d,state:u}=(0,eo.usePopupViewport)({store:o,side:l.side,children:a}),p={activationDirection:u.activationDirection,transitioning:u.transitioning,instant:c};return(0,H.useRenderElement)("div",e,{state:p,ref:t,props:[s,{children:d}],stateAttributesMapping:eo.popupViewportStateMapping})});var ec=e.i(564170);class ed extends ec.BasePopupHandle{constructor(){super(function(){let e=new S.PopupTriggerMap;return new E.NullStore(Object.freeze(_(void 0,e)),Object.freeze(F(e)),R)}(),"PreviewCard")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}e.s(["Arrow",0,ea,"Backdrop",0,es,"Handle",0,ed,"Popup",0,ei,"Portal",0,B,"Positioner",0,ee,"Root",0,M,"Trigger",0,Y,"Viewport",0,el,"createHandle",0,function(){return new ed}],37379);var eu=e.i(37379);e.s(["PreviewCard",0,eu],209920)},397733,692605,87865,503432,323514,588077,803618,877279,189130,e=>{"use strict";let t;var r=e.i(843476),n=e.i(209920),i=e.i(115057),a=e.i(101048),s=e.i(983123),o=e.i(948148),l=e.i(522016),c=e.i(271645),d=e.i(280211),u=e.i(200093),p=e.i(802822),m=e.i(916107),x=e.i(756733),h=e.i(987368),g=e.i(826534),f=e.i(624017),b=e.i(647163);let v=1200/630;function j(){return(0,r.jsxs)("div",{className:"mt-3 space-y-2","aria-hidden":"true",children:[(0,r.jsx)("div",{className:"h-2 w-full rounded-full bg-foreground
1/10"}),(0,r.jsx)("div",{className:"h-2 w-[94%] rounded-full bg-foreground/10"}),(0,r.jsx)("div",{className:"h-2 w-[88%] rounded-full bg-foreground/10"}),(0,r.jsx)("div",{className:"h-2 w-[71%] rounded-full bg-foreground/10"})]})}function y({article:e,failedImageUrl:t,footer:n,identity:i,item:a,onImageError:s}){let o=e?.title||a.title||a.domain,l=e?.siteName||a.domain,u=function(e){let t=e?.replace(/\s+/g," ").trim()??"";if(t.length<=520)return t;let r=t.slice(0,521),n=r.lastIndexOf(" ");return`${r.slice(0,n>390?n:520).trimEnd()}â¦`}(e?.textContent),p=function(e,t=null){if(!e)return null;try{let r=new URL(e);if("https:"!==r.protocol&&"http:"!==r.protocol)return null;let n=r.toString();return n===t?null:n}catch{return null}}(e?.image,t),[m,x]=(0,c.useState)(null),h=(e,t)=>{var r,n;let i=(r=t.naturalWidth,n=t.naturalHeight,!Number.isFinite(r)||!Number.isFinite(n)||r<=0||n<=0?v:Math.min(2.4,Math.max(1.6,r/n)));x(t=>t?.url===e&&t.aspect===i?t:{url:e,aspect:i})},g=p&&m?.url===p?m.aspect:v;return(0,r.jsxs)("article",{"data-sidebar-article-preview":!0,dir:e?.dir||"ltr",className:"flex max-h-[min(560px,var(--available-height))] w-[min(320px,var(--available-width))] flex-col overflow-hidden rounded-[14px] bg-card text-card-foreground shadow-hairline",children:[p?(0,r.jsx)("div",{"data-sidebar-preview-media":!0,style:{aspectRatio:g},className:"min-h-0 w-full shrink overflow-hidden bg-muted/40",children:(0,r.jsx)("img",{src:p,alt:"",referrerPolicy:"no-referrer",decoding:"async",ref:e=>{e?.complete&&e.naturalWidth>0&&h(p,e)},onLoad:e=>h(p,e.currentTarget),onError:()=>s(p),className:"h-full w-full object-cover outline -outline-offset-1 outline-black/10 dark:outline-white/10"})}):null,(0,r.jsxs)("div",{className:"min-w-0 shrink-0 px-4 pb-4 pt-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground",children:[(0,r.jsx)(d.LibraryItemIdentityIcon,{item:i??a,className:"size-3.5 shrink-0",faviconClassName:"rounded-[3px]",fileClassName:"text-muted-foreground"}),(0,r.jsx)("span",{className:"min-w-0 truncate",children:l})]}),(0,r.jsx)("h2",{className:"mt-2.5 line-clamp-2 text-balance text-[15px] font-semibold leading-snug tracking-[-0.01em] text-foreground",children:o}),void 0===e?(0,r.jsx)(j,{}):u?(0,r.jsx)("p",{className:"mt-2 line-clamp-5 text-pretty text-[13px] leading-[1.55] text-muted-foreground",children:u}):(0,r.jsxs)("div",{className:"mt-3 space-y-2","aria-hidden":"true",children:[(0,r.jsx)("div",{className:"h-2 w-full rounded-full bg-foreground
1/10"}),(0,r.jsx)("div",{className:"h-2 w-[91%] rounded-full bg-foreground/10"}),(0,r.jsx)("div",{className:"h-2 w-[76%] rounded-full bg-foreground/10"})]})]}),n]})}let w="flex w-full items-center gap-2.5 px-4 py-3 text-[13px] leading-none";function S({entrySurface:e,item:t}){let n=(0,o.useTranslations)("appSidebar"),{trackArticleViaBeacon:a}=(0,p.useAnalytics)();return(0,r.jsxs)(l.default,{href:(0,g.getArticlePath)(t.url,{from:e,sidebar:!0}),onClick:()=>{a("library_article_opened",t.url,{surface:"app_sidebar_recent_preview",entry_surface:e,open_method:"sidebar_preview_ask_remy"})},className:`${w} group/remyrow text-foreground/80 transition-colors hover:bg-muted/50 hover:text-foreground`,children:[(0,r.jsx)(u.RemyIcon,{className:"size-4 shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate text-start",children:n("previewAskRemy")}),(0,r.jsx)(i.ArrowUpRight,{className:"size-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/remyrow:opacity-100"})]})}function N({item:e}){var t,n;let c,d=(0,o.useTranslations)("appSidebar"),{subscriptions:u,isLoading:p,isSignedIn:m}=(0,x.useFeedSubscriptions)();if(!m&&!p)return null;if(p)return(0,r.jsxs)("div",{className:w,"aria-hidden":"true",children:[(0,r.jsx)(s.Rss,{className:"size-4 shrink-0 text-muted-foreground opacity-40"}),(0,r.jsx)("div",{className:"h-2 w-28 rounded-full bg-foreground
1/10"})]});let h=(t=e.url,n=e.domain,(c=(0,b.extractHostname)(t,n.replace(/^www\./,"")))?u.find(e=>(0,b.extractHostname)(e.siteUrl??e.feedUrl)===c)??null:null);return h?(0,r.jsxs)(l.default,{href:`/feeds?feed=${h.feedId}`,className:`${w} group/feedrow text-foreground/80 transition-colors hover:bg-muted/50 hover:text-foreground`,children:[(0,r.jsx)(a.CircleCheck,{className:"size-4 shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate text-start",children:d("previewInYourFeeds")}),h.unreadCount>0?(0,r.jsx)("span",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground",children:d("previewUnreadCount",{count:h.unreadCount})}):null,(0,r.jsx)(i.ArrowUpRight,{className:"size-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/feedrow:opacity-100"})]}):(0,r.jsxs)(l.default,{href:`/feeds/discover?q=${encodeURIComponent(function(e){try{return new URL(e).origin}catch{return e}}(e.url))}`,className:`${w} text-foreground/80 transition-colors hover:bg-muted/50 hover:text-foreground`,children:[(0,r.jsx)(s.Rss,{className:"size-4 shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate text-start",children:d("previewSubscribeFeed")}),(0,r.jsx)(i.ArrowUpRight,{className:"size-3.5 shrink-0 text-muted-foreground"})]})}function k({entrySurface:e,item:t}){return(0,r.jsxs)("div",{className:"shrink-0 divide-y divide-border/60 border-t border-border/60",children:[(0,r.jsx)(S,{entrySurface:e,item:t}),(0,r.jsx)(N,{item:t})]})}let C=(0,c.createContext)(null);e.s(["SidebarRecentArticlePreview",0,function({disabled:e=!1,identity:t,item:r,trigger:n}){let i=(0,c.useContext)(C),a=(0,c.useRef)(null),s=(0,h.useLatestRef)(r),o=(0,h.useLatestRef)(t??r),l=(0,h.useLatestRef)(i),d=(0,h.useLatestRef)(n.props.ref),u=(0,c.useCallback)(e=>{var t;a.current=e,t=d.current,"function"==typeof t?t(e):t&&(t.current=e)},[d]),p=(0,c.useCallback)(()=>{let e=l.current;e&&a.current&&e.onTriggerEnter(s.current,o.current,a.current)},[l,o,s]),x=(0,c.useCallback)(()=>{l.current?.onTriggerLeave()},[l]);if((0,m.useExternalSync)(()=>()=>{l.current?.onTriggerUnmount(s.current.url)},[l,s]),e||!i)return n;let g=n.props,f=i.activeUrl===r.url,b=(e,t)=>r=>{let n=g[e];"function"==typeof n&&n(r),t()};return(0,c.cloneElement)(n,{ref:u,onPointerEnter:b("onPointerEnter",p),onPointerLeave:b("onPointerLeave",x),onFocus:b("onFocus",p),onBlur:b("onBlur",x),...f?{"data-popup-open":""}:null})},"SidebarRecentArticlePreviewGroup",0,function({children:e,entrySurface:t}){let[i,a]=(0,c.useState)(null),[s,o]=(0,c.useState)(!1),[l,d]=(0,c.useState)(!1),[u,p]=(0,c.useState)(null),[x]=(0,c.useState)(()=>{let e,t,r,n,i;return e=0,t=!1,r=null,n=new Set,i=e=>{if(t!==e)for(let r of(t=e,n))r()},{subscribe:e=>(n.add(e),()=>{n.delete(e)}),isWarm:()=>t,markOpened(){e+=1,r&&(clearTimeout(r),r=null),i(!0)},markClosed(){(e=Math.max(0,e-1))>0||(r&&clearTimeout(r),r=setTimeout(()=>{r=null,i(!1)},800))}}}),[h,g]=(0,c.useState)(()=>new Map),v=(0,c.useRef)(new Set),j=(0,c.useRef)(null),w=(0,c.useRef)(!1),S=(0,c.useRef)(null),N=(0,c.useRef)(null),I=(0,c.useRef)(null),T=(0,c.useCallback)(e=>{v.current.has(e)||(v.current.add(e),(0,f.getCachedArticle)(e).then(t=>{g(r=>new Map(r).set(e,t?.response?.article??null))}).catch(()=>{g(t=>new Map(t).set(e,null))}))},[]),A=(0,c.useCallback)(()=>{S.current&&(clearTimeout(S.current),S.current=null)},[]),E=(0,c.useCallback)(()=>{N.current&&(clearTimeout(N.current),N.current=null)},[]),R=(0,c.useCallback)(()=>{A(),E(),w.current&&(w.current=!1,o(!1),x.markClosed())},[E,A,x]),P=(0,c.useCallback)((e,t,r)=>{if(E(),w.current){A(),S.current=setTimeout(()=>{S.current=null,T(e.url),I.current&&clearTimeout(I.current),d(!0),I.current=setTimeout(()=>{I.current=null,d(!1)},300),j.current={anchor:r,identity:t,item:e},a({anchor:r,identity:t,item:e})},60);return}A(),S.current=setTimeout(()=>{S.current=null,T(e.url),j.current={anchor:r,identity:t,item:e},a({anchor:r,identity:t,item:e}),w.current=!0,o(!0),x.markOpened()},x.isWarm()?60:450)},[E,A,T,x]),_=(0,c.useCallback)(()=>{A(),E(),w.current&&(N.current=setTimeout(()=>{N.current=null,R()},400))},[E,A,R]),F=(0,c.useCallback)(e=>{w.current&&j.current?.item.url===e&&R()},[R]);(0,m.useExternalSync)(()=>()=>{S.current&&clearTimeout(S.current),N.current&&clearTimeout(N.current),I.current&&clearTimeout(I.current)},[]);let L=(0,c.useMemo)(()=>({activeUrl:s&&i?i.item.url:null,open:s,onTriggerEnter:P,onTriggerLeave:_,onTriggerUnmount:F}),[i,P,F,s,_]);return(0,r.jsxs)(C.Provider,{value:L,children:[e,i?(0,r.jsx)(n.PreviewCard.Root,{open:s,onOpenChange:e=>{e||R()},children:(0,r.jsx)(n.PreviewCard.Portal,{children:(0,r.jsx)(n.PreviewCard.Positioner,{anchor:i.anch
1or,side:"right",align:"center",sideOffset:10,positionMethod:"fixed",collisionPadding:12,collisionAvoidance:{side:"none",align:"shift",fallbackAxisSide:"none"},className:(0,b.cn)("z-100",l&&"transition-transform duration-[250ms] ease-in-out motion-reduce:transition-none"),children:(0,r.jsx)(n.PreviewCard.Popup,{"data-sidebar-article-preview-popup":!0,onPointerEnter:E,onPointerLeave:_,className:"origin-(--transform-origin) outline-none transition-[opacity,scale] duration-150 ease-out data-ending-style:scale-[0.985] data-ending-style:opacity-0 data-starting-style:scale-[0.985] data-starting-style:opacity-0 motion-reduce:transition-opacity motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100",children:(0,r.jsx)(y,{article:h.get(i.item.url),failedImageUrl:u,identity:i.identity,item:i.item,onImageError:p,footer:(0,r.jsx)(k,{entrySurface:t,item:i.item},i.item.url)})})})})}):null]})}],397733);var I=e.i(728231);let T=[{min:1e6,label:"1M+"},{min:1e5,label:"100K+"},{min:1e4,label:"10K+"},{min:1e3,label:"1K+"}];e.i(404948);var A=e.i(853651);let E="group relative flex h-8 shrink-0 items-center rounded-[8px] text-left text-[14px] font-sidebar-label leading-5 tracking-[-0.07px] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",R="text-[13px] font-sidebar-label leading-5 tracking-[-0.065px]";function P({collapsed:e,label:t,children:n}){return e?(0,r.jsxs)(I.Tooltip,{children:[(0,r.jsx)(I.TooltipTrigger,{render:n}),(0,r.jsx)(I.TooltipContent,{side:"right",children:t})]}):n}e.s(["APP_SIDEBAR_NAV_ROW_CLASS",0,E,"AppSidebarCount",0,function({ariaLabel:e,count:t,mobile:n=!1}){return t<=0?null:(0,r.jsx)("span",{"aria-label":e,className:(0,b.cn)("flex h-5 min-w-5 shrink-0 items-center justify-center px-0.5 text-center font-medium tabular-nums text-sidebar-metadata-foreground",n?"text-[11px] leading-4 tracking-[-0.055px]":"text-[12px] leading-[18px] tracking-[-0.06px]"),children:function(e){if(!Number.isFinite(e)||e<=0)return"";let t=Math.floor(e);for(let e of T)if(t>=e.min)return e.label;return String(t)}(t)})},"AppSidebarIconTooltip",0,P,"AppSidebarNavRow",0,function({href:e,icon:t,label:n,collapsed:i,mobile:a=!1,active:s=!1,onClick:o,onNavigate:l,ariaLabel:c,trailing:d,collapsedBadge:u,hierarchy:p="primary"}){let m=c??n;return(0,r.jsx)(P,{collapsed:i,label:m,children:(0,r.jsxs)(A.Link,{href:e,prefetch:"auto",onClick:o,onNavigate:l,"aria-label":c??(i?m:void 0),"aria-current":s?"page":void 0,"data-sidebar-collapsed-center":!0,className:(0,b.cn)(E,i?"w-8 justify-center":a?(0,b.cn)("h-8 w-full gap-[6px] rounded-[8px] px-2",R):(0,b.cn)("w-full gap-[6px] px-1.5","secondary"===p&&"text-[13px] leading-5"),s?"bg-sidebar-accent text-sidebar-accent-foreground":(0,b.cn)("text-sidebar-resting-foreground hover:bg-sidebar-accent/70 hover:text-sidebar-accent-foreground",a&&"active:bg-sidebar-accent active:text-sidebar-accent-foreground")),children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"flex size-5 shrink-0 items-center justify-center",children:t}),i?u:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{"data-sidebar-collapsed-hide":!0,className:"min-w-0 flex-1 truncate",children:n}),d]})]})})},"MOBILE_APP_SIDEBAR_LABEL_CLASS",0,R],692605);var _=e.i(305487),F=e.i(846696),L=e.i(873372),z=e.i(798975),M=e.i(102321),O=e.i(463415),D=e.i(371532),B=e.i(618566),U=e.i(571841),H=e.i(447329),$=e.i(645326);e.s(["AppSidebarCaptureButton",0,function({collapsed:t=!1,header:n=!1,mobile:i=!1,mobileIconOnly:a=!1,className:s,onNavigate:l}){let d=(0,o.useTranslations)("mobileAdd"),u=(0,o.useTranslations)("import"),p=(0,B.useRouter)(),m=(0,c.useRef)(!1),x=(0,c.useRef)(null),h=d("title"),g=e=>{m.current=!0,(0,U.requestCaptureIntent)(e)||p.push("/new"),l?.()},f=i?(0,r.jsxs)(M.Button,{variant:"ghost",size:"lg",onClick:()=>{(0,H.openMobileAddDrawer)("menu")||(0,U.requestCaptureIntent)("link")||p.push("/new"),l?.()},"aria-label":`${h}, ${L.NEW_ARTICLE_HOTKEY_LABEL}`,className:(0,b.cn)("h-11 min-w-0 max-w-28 touch-manipulation gap-1.5 rounded-full px-2.5 text-sm leading-none text-muted-foreground hover:bg-accent/35 hover:text-foreground",a&&"size-11 px-0",s),children:[(0,r.jsx)(z.FigmaSidebarIcon,{name:"plus"}),(0,r.jsx)("span",{className:(0,b.cn)("min-w-0 truncate",a&&"sr-only"),children:h})]}):n?(0,r.jsxs)(M.Button,{variant:"ghost",size:"sm","aria-label":`${h}, ${L.NEW_ARTICLE_HOTKEY_LABEL}`,className:(0,b.cn)("h-8 min-w-0 gap-1.5 rounded-[7px] border-transparent px-2 text-[12.5px] text-sidebar-foreground
1/72 shadow-none transition-[background-color,color] hover:bg-sidebar-accent/55 hover:text-sidebar-accent-foreground focus-visible:ring-sidebar-ring focus-visible:ring-offset-0 sm:h-8 motion-reduce:transition-none",s),children:[(0,r.jsx)(z.FigmaSidebarIcon,{className:"size-4 shrink-0",name:"plus"}),(0,r.jsx)("span",{className:"truncate leading-none",children:h})]}):(0,r.jsxs)("button",{type:"button","aria-label":t?`${h}, ${L.NEW_ARTICLE_HOTKEY_LABEL}`:void 0,"data-sidebar-collapsed-center":t?"":void 0,className:(0,b.cn)(E,t?"w-8 justify-center":"w-full gap-[6px] px-1.5","text-sidebar-resting-foreground hover:bg-sidebar-accent/70 hover:text-sidebar-accent-foreground",s),children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"flex size-5 shrink-0 items-center justify-center",children:(0,r.jsx)(z.FigmaSidebarIcon,{name:"plus"})}),t?null:(0,r.jsx)("span",{"data-sidebar-collapsed-hide":!0,className:"min-w-0 flex-1 truncate text-start",children:h})]});return i?f:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(O.DropdownMenu,{onOpenChange:e=>{e&&(m.current=!1)},children:[(0,r.jsx)(P,{collapsed:t&&!n,label:h,children:(0,r.jsx)(O.DropdownMenuTrigger,{render:f})}),(0,r.jsxs)(O.DropdownMenuContent,{align:"start",side:t&&!n?"right":"bottom",className:"w-56",finalFocus:()=>!m.current,children:[(0,r.jsxs)(O.DropdownMenuItem,{onClick:()=>g("upload"),children:[(0,r.jsx)(D.Upload,{"aria-hidden":"true"}),d("uploadFile")]}),(0,r.jsxs)(O.DropdownMenuItem,{onClick:()=>g("link"),children:[(0,r.jsx)(D.LinkChain,{"aria-hidden":"true"}),d("pasteLink")]}),(0,r.jsxs)(O.DropdownMenuItem,{onClick:()=>g("text"),children:[(0,r.jsx)(D.TextFont,{"aria-hidden":"true"}),d("typeText")]}),(0,r.jsxs)(O.DropdownMenuItem,{onClick:()=>{x.current?.click(),l?.()},children:[(0,r.jsx)(_.ScanText,{"aria-hidden":"true"}),d("scanText")]})]})]}),(0,r.jsx)("input",{ref:x,type:"file",className:"hidden",tabIndex:-1,"aria-label":d("scanText"),accept:"image/*",capture:"environment",onChange:t=>{let r=t.currentTarget.files?.[0];t.currentTarget.value="",r&&(async()=>{let t=F.toast.loading(u("readingPhoto"));try{let{createScannedDocument:t}=await e.A(533674),n=await t(r);(0,$.queueClipboardCapture)({kind:"files",files:[n],initialView:"markdown"})}catch{F.toast.error(u("scanError"))}finally{F.toast.dismiss(t)}})()}})]})}],87865);var W=e.i(87947),K=e.i(86575),V=e.i(657688),q=e.i(939914),Y=e.i(23084);e.i(914771);var G=e.i(121356),X=e.i(299382),J=e.i(108286),Q=e.i(95244);let Z="min-h-12 bg-accent/50 text-start data-highlighted:bg-accent";function ee({menu:e=!1,size:t=36}){return(0,r.jsx)("span",{"aria-hidden":"true",className:(0,b.cn)("relative shrink-0 overflow-hidden rounded-full ring-1",e?"bg-muted ring-border":"bg-sidebar-accent ring-sidebar-border",28===t?"size-7":32===t?"size-8":"size-9"),children:(0,r.jsx)(V.default,{alt:"",className:"size-full object-cover [image-rendering:pixelated]",height:t,src:"/avatars/smry-guest.png",width:t})})}function et({email:e,imageUrl:t,menu:n=!1,name:i,size:a=36}){let[s,o]=c.useState(!1);return(0,r.jsx)("span",{"aria-hidden":"true",className:(0,b.cn)("flex shrink-0 select-none items-center justify-center overflow-hidden rounded-full font-medium ring-1",n?"bg-muted text-popover-foreground ring-border":"bg-sidebar-accent text-sidebar-foreground ring-sidebar-border",28===a?"size-7 text-[11px]":32===a?"size-8 text-xs":"size-9 text-xs"),children:t&&!s?(0,r.jsx)("img",{alt:"",className:"size-full object-cover",onError:()=>o(!0),src:t}):(i.trim().split(/\s+/).slice(0,2).map(e=>e[0]).join("")||e?.trim()[0]||"?").toUpperCase()})}function er({compact:e=!1,displayName:t,menu:n=!1,planLabel:i,planLoading:a}){return(0,r.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,r.jsx)("span",{className:(0,b.cn)("block truncate font-medium tracking-[-0.06px]",n?"text-sidebar-popup-strong-foreground":"text-sidebar-identity-foreground",e?"text-xs leading-4":"text-xs leading-[18px]"),children:t}),(0,r.jsx)("span",{className:(0,b.cn)("flex items-center truncate font-normal tracking-[-0.06px]",n?"text-sidebar-popup-detail-foreground":"text-sidebar-detail-foreground",e?"h-4 text-[11px] leading-4":"h-[18px] text-xs leading-[18px]"),children:a?(0,r.jsx)("span",{"aria-hidden":"true",className:(0,b.cn)("h-2 w-8 animate-pulse rounded-full motion-reduce:animate-none",n?"bg-muted-foreground
1/25":"bg-sidebar-accent")}):i})]})}function en({collapsed:e,mobile:t}){let n=(0,o.useTranslations)("appSidebar");return e?(0,r.jsx)("div",{"aria-label":n("accountLoading"),className:"size-9 animate-pulse rounded-full bg-sidebar-accent/70 motion-reduce:animate-none",role:"status"}):(0,r.jsxs)("div",{"aria-label":n("accountLoading"),className:(0,b.cn)("flex min-w-0 items-center gap-1.5 rounded-[8px] p-[6px] [font-family:var(--font-inter)]",t?"h-11":"h-12"),role:"status",children:[(0,r.jsx)("span",{className:(0,b.cn)("shrink-0 animate-pulse rounded-full bg-sidebar-accent/70 motion-reduce:animate-none",t?"size-8":"size-9")}),(0,r.jsxs)("span",{className:"min-w-0 flex-1 space-y-1.5",children:[(0,r.jsx)("span",{className:"block h-3 w-20 animate-pulse rounded-full bg-sidebar-accent/70 motion-reduce:animate-none"}),(0,r.jsx)("span",{className:"block h-2.5 w-12 animate-pulse rounded-full bg-sidebar-accent/55 motion-reduce:animate-none"})]})]})}function ei({children:e,name:t}){return(0,r.jsx)("span",{"aria-hidden":"true",className:"flex h-5 w-7 shrink-0 items-center justify-center text-sidebar-popup-strong-foreground [&>svg]:size-4","data-account-menu-icon":t,children:e})}function ea({collapsed:n,isAccountLoaded:i,isPremium:a,isPremiumLoading:s,isSignedIn:l,planTier:d,mobile:u,onNavigate:m,onRequestOverlay:x,onSignOutFailed:h,onSignOutStarted:g,shouldCloseParentForSignIn:f}){let v=(0,o.useTranslations)("appSidebar"),j=(0,o.useTranslations)("settings"),{signOut:y}=(0,W.useClerk)(),{trackViaBeacon:w}=(0,p.useAnalytics)(),{user:S}=(0,K.useUser)(),[N,k]=c.useState(!1),[C,I]=c.useState(!1),T=c.useRef(null),E=S?.primaryEmailAddress?.emailAddress??null,R=l?S?.fullName||S?.firstName||E||v("signedIn"):v("guestName"),_=v(l?"pro"===d?"proPlan":"premium"===d?"patronPlan":"basicPlan":"guestSubtitle"),F=l&&s,L=l&&S?.hasImage?S.imageUrl:null,z=F?R:`${R}, ${_}`,M=c.useCallback(()=>{t??=e.A(973020).then(()=>void 0,()=>{t=void 0})},[]),B=c.useCallback(()=>{(0,J.storeWorkspaceReturnUrl)(),m?.()},[m]),U=c.useCallback(e=>{T.current=e,k(!1)},[]),H=c.useCallback(e=>{if(e)return;let t=T.current;if(T.current=null,!t)return;"sign-in"===t&&f&&m?.();let r=()=>{x(t)};"function"==typeof globalThis.requestAnimationFrame?globalThis.requestAnimationFrame(r):globalThis.setTimeout(r,0)},[m,x,f]);if(!i)return(0,r.jsx)(en,{collapsed:n,mobile:u});let $=n?(0,r.jsx)("button",{"aria-label":`${v("openAccountMenu")}: ${z}`,className:"flex size-9 items-center justify-center rounded-full transition-[background-color,scale] hover:bg-sidebar-accent active:scale-[0.96] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring motion-reduce:transition-none pointer-coarse:size-11",type:"button",children:l?(0,r.jsx)(et,{email:E,imageUrl:L,name:R,size:36}):(0,r.jsx)(ee,{size:36})}):(0,r.jsxs)("button",{"aria-label":`${v("openAccountMenu")}: ${z}`,className:(0,b.cn)("group flex w-full min-w-0 items-center gap-1.5 rounded-[8px] p-[6px] text-start [font-family:var(--font-inter)] transition-colors hover:bg-sidebar-accent/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring data-popup-open:bg-sidebar-accent/55 motion-reduce:transition-none",u?"h-11":"h-12"),type:"button",children:[l?(0,r.jsx)(et,{email:E,imageUrl:L,name:R,size:u?32:36}):(0,r.jsx)(ee,{size:u?32:36}),(0,r.jsx)(er,{compact:u,displayName:R,planLabel:_,planLoading:F})]});return(0,r.jsxs)(O.Menu,{open:N,onOpenChange:e=>{k(e),e&&M()},onOpenChangeComplete:H,children:[(0,r.jsx)(P,{collapsed:n,label:R,children:(0,r.jsx)(O.MenuTrigger,{render:$})}),(0,r.jsxs)(O.MenuPopup,{"aria-label":`${v("openAccountMenu")}: ${z}`,align:n?"end":"start",className:"w-[216px]",positionerClassName:"z-[60]",side:n?"right":"top",sideOffset:8,children:[n&&!l&&(0,r.jsx)("div",{className:"px-2",children:(0,r.jsx)(q.SidebarSavedItemsReminder,{onRequestSignIn:U})}),l?(0,r.jsxs)(O.MenuItem,{"aria-label":`${v("manageAccount")}: ${z}`,className:Z,render:(0,r.jsx)(A.Link,{href:"/settings/account",prefetch:!0,onClick:B,onFocus:M,onPointerEnter:M}),children:[(0,r.jsx)(et,{email:E,imageUrl:L,menu:!0,name:R,size:28}),(0,r.jsx)(er,{displayName:R,menu:!0,planLabel:_,planLoading:F})]}):(0,r.jsxs)("div",{className:(0,b.cn)(Q.dropdownItemClassName,Z),"data-account-summary":"guest",children:[(0,r.jsx)(ee,{menu:!0,size:28}),(0,r.jsx)(er,{displayName:R,menu:!0,planLabel:_,planLoading:!1})]}),(0,r.jsxs)(O.MenuItem,{render:(0,r.jsx)("a",{"aria-label":v("joinDiscord"),href:G.DISCORD_INVITE_URL,target:"_blank",rel:"noopener noreferrer",onClick:()=>{w("discord_cta_clicked",{destination:"discord",surface:"app_sidebar",url:G.DISCORD_INVITE_URL}),m?.()}}),children:[(0,r.jsx)(ei,{name:"discord",children:(0,r.jsx)(D.Discord,{})}),v("joinDiscord")]}),s||a?null:(0,r.jsxs)(O.MenuItem,{render:(0,r.jsx)(A.Link,{href:"/pricing",onClick:m}),children:[(0,r.jsx)(ei,{name:"upgrade",children:(0,r.jsx)(D.Crown,{strokeWidth:1.5})}),j("viewPlans")]}),(0,r.jsx)(O.MenuSeparator,{}),l?(0,r.jsxs)(O.MenuItem,{render:(0,r.jsx)(A.Link,{href:"/profile",onClick:m}),children:[(0,r.jsx)(ei,{name:"profile",children:(0,r.jsx)(D.User,{strokeWidth:1.5})}),v("publicProfile")]}):null,(0,r.jsxs)(O.MenuItem,{render:(0,r.jsx)("a",{"aria-label":"Docs",href:"https://smry.ai/docs",target:"_blank",rel:"noopener noreferrer",onClick:m}),children:[(0,r.jsx)(ei,{name:"docs",children:(0,r.jsx)(D.BookOpen,{strokeWidth:1.5})}
1),"Docs",(0,r.jsx)(D.ExternalLink,{"aria-hidden":"true",className:"ms-auto size-3.5 text-muted-foreground"})]}),(0,r.jsxs)(O.MenuItem,{render:(0,r.jsx)(A.Link,{href:"/settings/support",prefetch:!0,onClick:B,onFocus:M,onPointerEnter:M}),children:[(0,r.jsx)(ei,{name:"help",children:(0,r.jsx)(D.HelpCircle,{strokeWidth:1.5})}),v("help")]}),(0,r.jsxs)(O.MenuItem,{render:(0,r.jsx)(A.Link,{href:"/settings",prefetch:!0,onClick:B,onFocus:M,onPointerEnter:M}),children:[(0,r.jsx)(ei,{name:"settings",children:(0,r.jsx)(D.Settings,{strokeWidth:1.5})}),v("settings")]}),(0,r.jsxs)(O.MenuItem,{render:(0,r.jsx)(A.Link,{href:"/settings/general",prefetch:!0,onClick:B,onFocus:M,onPointerEnter:M}),children:[(0,r.jsx)(ei,{name:"appearance",children:(0,r.jsx)(D.Sun,{strokeWidth:1.5})}),v("appearance")]}),l?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(O.MenuSeparator,{}),(0,r.jsxs)(O.MenuItem,{disabled:C,onClick:()=>{I(!0),g(),m?.(),y({redirectUrl:"/"}).catch(()=>{I(!1),h()})},children:[(0,r.jsx)(ei,{name:"log-out",children:(0,r.jsx)(D.LogOut,{strokeWidth:1.5})}),v("logOut")]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(O.MenuSeparator,{}),(0,r.jsxs)(O.MenuItem,{"aria-label":`${v("signInOrCreateAccount")}: ${z}`,onClick:()=>U("sign-in"),children:[(0,r.jsx)(ei,{name:"log-in",children:(0,r.jsx)(D.LogIn,{strokeWidth:1.5})}),v("signInOrCreateAccount")]})]})]})]})}e.s(["SidebarAccountStatus",0,function({className:e,collapsed:t=!1,mobile:n=!1,onNavigate:i,onOpenSignIn:a}){let{isLoaded:s,isSignedIn:o}=(0,K.useUser)(),[l,d]=c.useState(!1),{isLoading:u,isPremium:p,tier:m}=(0,X.useBillingPlanTier)(),x=(0,Y.useOpenSignInModal)(),h=s||l,g=s&&!!o;return(0,r.jsx)("div",{className:(0,b.cn)("min-w-0",t&&"flex justify-center",e),"data-sidebar-account":!0,"data-sidebar-account-state":h?g?"signed-in":"anonymous":"loading",children:(0,r.jsx)(ea,{collapsed:t,isAccountLoaded:h,isPremium:p,isPremiumLoading:u,isSignedIn:g,mobile:n,planTier:m,onNavigate:i,onRequestOverlay:e=>{"function"==typeof e?e():"sign-in"===e&&(a?a():x())},onSignOutFailed:()=>d(!1),onSignOutStarted:()=>d(!0),shouldCloseParentForSignIn:!!a})})}],503432);var es=e.i(174080);let eo=(0,e.i(475254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var el=e.i(471435),ec=e.i(706501),ed=e.i(618703);let eu="smry:remy-new-chat";function ep(){window.dispatchEvent(new Event(eu))}let em="smry:remy-chat-pathname";function ex(e){window.dispatchEvent(new CustomEvent(em,{detail:{pathname:e}}))}function eh(e){let t=e.match(/(?:^|\/)chat(?:\/([^/]+))?\/?$/);if(!t)return null;let r=t[1];return r?{kind:"saved",threadId:function(e){try{return decodeURIComponent(e)}catch{return e}}(r)}:{kind:"new"}}e.s(["REMY_CHAT_PATHNAME_EVENT",0,em,"REMY_NEW_CHAT_EVENT",0,eu,"publishRemyChatPathname",0,ex,"remyChatRouteFromPathname",0,eh,"requestNewRemyChat",0,ep],323514);var eg=e.i(422285);let ef=(0,c.memo)(function({thread:e,active:t,mobile:n,onNavigate:i}){let a=(0,o.useTranslations)("appSidebar"),s=`/chat/${encodeURIComponent(e.id)}`,l=e.title||a("untitled"),c=(0,ed.formatRelativeTime)(e.updatedAt);return(0,r.jsxs)(A.Link,{href:s,prefetch:"auto","aria-current":t?"page":void 0,"data-sidebar-chat-thread":e.id,onClick:i,onNavigate:()=>ex(s),className:(0,b.cn)("group flex h-8 w-full min-w-0 shrink-0 items-center gap-2 rounded-[8px] px-2 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-sidebar-ring",n?R:"text-[13px] font-sidebar-label leading-5 tracking-[-0.065px]",t?"bg-sidebar-accent text-sidebar-accent-foreground":(0,b.cn)("text-sidebar-resting-foreground hover:bg-sidebar-accent/70 hover:text-sidebar-accent-foreground",n&&"active:bg-sidebar-accent active:text-sidebar-accent-foreground")),children:[(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:l}),c?(0,r.jsx)("span",{className:(0,b.cn)("shrink-0 tabular-nums text-sidebar-metadata-foreground","text-[11px] leading-4"),children:c}):null]})});function eb({activeThreadId:e,mobile:t,onNavigate:n}){let i=(0,o.useTranslations)("appSidebar"),[a,s]=(0,c.useState)(""),[l,d]=(0,c.useState)(12),u=(0,c.useRef)(null),p=(0,c.useId)(),{threads:m,isLoading:x}=(0,eg.useChatSidebarSnapshot)(),h=(0,c.useMemo)(()=>{let e=a.trim().toLowerCase();return e?m.filter(t=>t.title.toLowerCase().includes(e)):m},[m,a]),g=h.slice(0,l),f=h.length>l;return(0,r.jsxs)("section",{"aria-label":i("chats"),"data-sidebar-chat-threads":!0,className:"mt-2 flex min-h-0 w-full flex-1 flex-col",children:[(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5 pb-2",children:[(0,r.jsx)("label",{htmlFor:p,className:"sr-only",children:i("searchChats")}),(0,r.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-sidebar-metadata-foreground",children:(0,r.jsx)(z.FigmaSidebarIcon,{name:"search"})}),(0,r.jsx)("input",{id:p,type:"search",value:a,onChange:e=>{s(e.target.value),d(e.target.value.trim()?50:12)},onKeyDown:e=>{"Escape"===e.key&&a&&(e.preventDefault(),e.stopPropagation(),s(""),d(12))},placeholder:i("searchChats"),className:(0,b.cn)("w-full min-w-0 rounded-[8px] border border-sidebar-foreground
1/20 bg-transparent pl-7 pr-2 text-base md:text-[12px] leading-5 tracking-[-0.06px] text-sidebar-foreground placeholder:text-sidebar-metadata-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring [@media(pointer:coarse)]:h-11 [@media(pointer:coarse)]:text-base",t?"h-11 md:text-base":"h-8")})]}),(0,r.jsxs)(I.Tooltip,{children:[(0,r.jsx)(I.TooltipTrigger,{render:(0,r.jsx)(A.Link,{href:"/chat","aria-label":i("newChat"),onClick:n,onNavigate:()=>{s(""),d(12),ep(),ex("/chat")},className:(0,b.cn)("flex shrink-0 items-center justify-center rounded-[8px] text-sidebar-resting-foreground transition-colors hover:bg-sidebar-accent/70 hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring [@media(pointer:coarse)]:size-11",t?"size-11":"size-8"),children:(0,r.jsx)(eo,{"aria-hidden":"true",className:"size-4"})})}),(0,r.jsx)(I.TooltipContent,{side:"right",children:i("newChat")})]})]}),(0,r.jsx)("span",{role:"status",className:"sr-only",children:a.trim()&&!x?i("chatSearchResults",{count:g.length}):""}),(0,r.jsx)(el.ScrollArea,{ref:u,className:"mt-1 min-h-0 flex-1",viewportClassName:"overscroll-contain [overflow-anchor:none]",children:(0,r.jsxs)(ec.ScrollArea.Content,{"aria-busy":x,style:{minWidth:0},className:"flex flex-col gap-px pe-2",children:[x?null:g.length>0?g.map(i=>(0,r.jsx)(ef,{thread:i,active:i.id===e,mobile:t,onNavigate:n},i.id)):(0,r.jsx)("p",{className:(0,b.cn)("rounded-[7px] px-2 py-2 text-[12px] leading-[17px] text-sidebar-supporting-foreground",t&&"min-h-8 py-[7px] leading-[18px]"),children:i(a.trim()?"chatsNoResults":"chatsEmpty")}),f&&!x?(0,r.jsx)("button",{type:"button",onClick:function(){let e=g.length;(0,es.flushSync)(()=>d(e=>e+50));let t=u.current,r=t?.querySelectorAll("[data-sidebar-chat-thread]")[e];t&&r&&(r.focus({preventScroll:!0}),r.scrollIntoView({block:"nearest",inline:"nearest",behavior:"instant"}))},className:"min-h-8 shrink-0 rounded-[8px] px-2 text-left text-xs text-sidebar-supporting-foreground hover:bg-sidebar-accent/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-sidebar-ring [@media(pointer:coarse)]:min-h-11",children:i("showMoreChats")}):null]})})]})}function ev(e){let t=eh((0,B.usePathname)());return(0,r.jsx)(eb,{...e,activeThreadId:t?.kind==="saved"?t.threadId:null})}e.s(["AppSidebarChatThreads",0,function({collapsed:e,mobile:t=!1,onNavigate:n}){return e?null:(0,r.jsx)(c.Suspense,{fallback:(0,r.jsx)(eb,{activeThreadId:null,mobile:t,onNavigate:n}),children:(0,r.jsx)(ev,{mobile:t,onNavigate:n})})}],588077),e.s(["collectionFeedCount",0,function(e,t){if(!e)return 0;let r=new Set(t.map(e=>e.feedId));return e.feedIds.filter(e=>r.has(e)).length},"collectionUnreadCount",0,function(e,t){if(!e)return 0;let r=new Set(e.feedIds);return t.reduce((e,t)=>r.has(t.feedId)?e+t.unreadCount:e,0)},"findCollection",0,function(e,t){return t?e.find(e=>e.id===t)??null:null},"groupSubscriptions",0,function(e,t){let r=[...e].sort((e,t)=>e.kind!==t.kind?"unsorted"===e.kind?1:-1:e.name.localeCompare(t.name)),n=new Map(r.map(e=>[e.id,[]])),i=r.find(e=>"unsorted"===e.kind);for(let e of t){let t=n.get(e.folderId);t?t.push(e):i&&n.get(i.id)?.push(e)}return{grouped:r.map(e=>{let t=n.get(e.id)??[];return{collection:e,subscriptions:t,unreadCount:t.reduce((e,t)=>e+t.unreadCount,0)}})}}],803618);var ej=e.i(76590);let ey=[];function ew(e){if(!e)return ey;try{let t=JSON.parse(e);if(!Array.isArray(t))return ey;return[...new Set(t.filter(e=>Number.isSafeInteger(e)&&e>0))]}catch{return ey}}function eS(e,t){let r,n=ey;return{getServerSnapshot:()=>ey,getSnapshot(){let t;try{t=window.localStorage.getItem(e)}catch{t=null}return t===r?n:(r=t,n=ew(t))},read:t=>ew(t.getItem(e)),subscribe(r){let n=t=>{t.key===e&&r()};return window.addEventListener(t,r),window.addEventListener("storage",n),()=>{window.removeEventListener(t,r),window.removeEventListener("storage",n)}},write(i,a){let s=ew(JSON.stringify(a)),o=JSON.stringify(s);try{i.setItem(e,o),i===window.localStorage&&(r=o,n=s,window.dispatchEvent(new Event(t)))}catch{}return s}}}let eN=eS("smry:feed-sidebar-order:v1","smry:feed-sidebar-order:changed"),ek=eS("smry:collection-sidebar-order:v1","smry:collection-sidebar-order:changed"),eC=eN.read,eI=eN.write,eT=eN.subscribe,eA=eN.getSnapshot,eE=eN.getServerSnapshot;ek.read;let eR=ek.write,eP=ek.subscribe,e_=ek.getSnapshot,eF=ek.getServerSnapshot;e.s(["getCollectionSidebarOrderServerSnapshot",0,eF,"getCollectionSidebarOrderSnapshot",0,e_,"getFeedSidebarOrderServerSnapshot",0,eE,"getFeedSidebarOrderSnapshot",0,eA,"getVisibleFeedIdsForCollection",0,function(e,t){return e.find(e=>e.collection.id===t)?.subscriptions.map(e=>e.id)??[]},"moveSidebarPreferenceBefore",0,function(e,t,r,n){if(r===n||!t.includes(r)||!t.includes(n))return e;let i=new Set(e),a=[...e,...t.filter(e=>!i.has(e))].filter(e=>e!==r),s=a.indexOf(n);return s<0?e:[...a.slice(0,s),r,...a.slice(s)]},"orderSidebarItemsByPreference",0,function(e,t,r){let n=new Map(t.map((e,t)=>[e,t]));return e.map((e,t)=>({item:e,index:t})).sort((e,t)=>
1{let i=n.get(r(e.item)),a=n.get(r(t.item));return void 0===i&&void 0===a?e.index-t.index:void 0===i?1:void 0===a?-1:i-a}).map(({item:e})=>e)},"readFeedSidebarOrder",0,eC,"reorderSidebarPreference",0,function(e,t,r,n){let i=t.indexOf(r),a=t.indexOf(n);if(i<0||a<0||i===a)return e;let s=(0,ej.arrayMove)([...t],i,a),o=new Set(e),l=[...e,...t.filter(e=>!o.has(e))],c=new Set(t),d=0;return l.map(e=>c.has(e)?s[d++]:e)},"subscribeCollectionSidebarOrder",0,eP,"subscribeFeedSidebarOrder",0,eT,"writeCollectionSidebarOrder",0,eR,"writeFeedSidebarOrder",0,eI],877279);let eL=e.i(438847).parseAsBoolean.withDefault(!1);e.s(["buildFeedsHref",0,function({feedId:e,collectionId:t,manage:r,unreadOnly:n=!1}={}){let i=new URLSearchParams;e?i.set("feed",String(e)):t&&i.set("collection",String(t)),n&&i.set("unread","true"),r&&i.set("manage",r);let a=i.toString();return a?`/feeds?${a}`:"/feeds"},"parseUnreadFeedParam",0,function(e){return null===e?eL.defaultValue:eL.parse(e)??eL.defaultValue},"unreadFeedParamParser",0,eL],189130)},939914,422285,e=>{"use strict";var t=e.i(843476),r=e.i(86575),n=e.i(720565),i=e.i(23084),a=e.i(420256),s=e.i(102321),o=e.i(371532),l=e.i(413607);e.s(["SidebarSavedItemsReminder",0,function({onRequestSignIn:e,mobile:c=!1}){let{isLoaded:d,isSignedIn:u}=(0,r.useUser)(),p=(0,a.useSavedItemsReminder)(),m=(0,a.useSetSavedItemsReminder)(),x=(0,n.usePostHog)(),h=(0,i.useOpenSignInModal)({preserveClientState:!0});if(!d||u||!p)return null;let g="retained"===p.kind,f=g?"Finish moving your items":p.itemCount>0?`${p.itemCount.toLocaleString()} ${1===p.itemCount?"item":"items"} on this device`:"Reading data on this device";return(0,t.jsxs)("section",{"aria-label":"Saved items on this device",className:c?"fixed inset-x-3 bottom-[calc(4rem+env(safe-area-inset-bottom,0px))] z-40 flex items-center gap-1 rounded-xl bg-card px-3 py-2 shadow-hairline md:hidden [body:has([role=dialog][data-open])_&]:hidden":"relative rounded-[10px] bg-sidebar-accent/45 p-3 shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]","data-slot":c?"mobile-saved-items-reminder":"sidebar-saved-items-reminder",children:[(0,t.jsxs)("div",{className:c?"min-w-0 flex-1":"min-w-0 pe-5",children:[(0,t.jsx)("p",{className:"text-xs font-medium leading-5 text-foreground",children:f}),(0,t.jsx)("p",{className:"text-xs leading-5 text-muted-foreground",children:g?"Sign in to the account you used.":"Sign in to keep them with you."})]}),(0,t.jsxs)("div",{className:c?"flex shrink-0 items-center":"mt-3 flex items-center",children:[(0,t.jsx)(s.Button,{onClick:t=>{if("legacy"===p.kind){try{localStorage.setItem(l.LEGACY_RESCUE_STARTED_KEY,JSON.stringify({startedAt:Math.round(performance.timeOrigin+t.timeStamp),rowCount:p.rowCount}))}catch{}x.capture("anonymous_rescue_started",{row_count:p.rowCount})}else x.capture("retained_claim_sign_in_prompted");e?e(h):h()},size:"sm",variant:"outline",children:"Sign in"}),(0,t.jsx)(s.Button,{"aria-label":"Dismiss saved items reminder",className:c?"shrink-0 text-muted-foreground":"absolute end-1 top-1 text-muted-foreground",onClick:()=>{m(null);try{window.sessionStorage.setItem(g?"smry.retainedClaim.dismissedForTab":"smry.anonymousRescue.dismissedForTab","true")}catch{}},size:"icon-sm",variant:"ghost",children:(0,t.jsx)(o.XIcon,{"aria-hidden":"true",className:"size-3.5"})})]})]})}],939914);var c=e.i(271645);e.i(25755);var d=e.i(604392),u=e.i(43014),p=e.i(21139),m=e.i(542272),x=e.i(101616),h=e.i(504778);let g=`SELECT id, title, article_title, updated_at 2 FROM chat_threads WHERE user_id = ? ORDER BY updated_at DESC, id ASC`,f=[],b={threads:f,isLoading:!0},v=(0,c.createContext)(b),j={reportFetching:!1,rowComparator:{keyBy:e=>e.id,compareBy:e=>JSON.stringify([e.title,e.article_title,e.updated_at])}};function y({ownerUserId:e,children:r}){let n=null!==(0,m.usePowerSyncOptional)()&&null!==e,{data:i,isLoading:a}=(0,d.useQuery)(n?g:m.DISABLED_QUERY,n?[e]:[],j),[s,o]=(0,c.useState)({source:null,threads:f});n&&!a&&i!==s.source&&o({source:i,threads:function(e,t){let r=new Map(t.map(e=>[e.id,e])),n=[],i=e=>({id:e.id,title:e.title?.trim()||e.article_title?.trim()||"",updatedAt:e.updated_at});for(let t of e){let e=r.get(t.id);if(!e)continue;let a=i(e);n.push(a.title===t.title&&a.updatedAt===t.updatedAt?t:a),r.delete(t.id)}for(let e of r.values())n.push(i(e));return n.length===e.length&&n.every((t,r)=>t===e[r])?e:n}(s.threads,i)});let l=null!==s.source,u=(0,c.useMemo)(()=>n?{threads:s.threads,isLoading:!l}:b,[n,s.threads,l]);return(0,t.jsxs)(v,{value:u,children:[(0,t.jsx)(x.StreamSubscriptionGate,{options:(0,h.chatIndexStream)()}),r]})}e.s(["ChatSidebarProvider",0,function({children:e}
2){let{ownerKey:r}=(0,u.useLibraryOwner)();return(0,t.jsx)(y,{ownerUserId:r?(0,p.getLibraryOwnerUserId)(r)??"":null,children:e},r??"unresolved")},"useChatSidebarSnapshot",0,function(){return(0,c.useContext)(v)}],422285)},65195,e=>{"use strict";let t="--smry-app-sidebar-width",r=`var(${t}, 232px)`,n="--smry-app-sidebar-feed-tree-height",i="--smry-mobile-app-sidebar-feed-tree-height",a=`var(${n}, 134px)`,s=`var(${i}, 134px)`;function o(e){return Math.min(340,Math.max(224,e))}e.s(["APP_SIDEBAR_COLLAPSED_KEY",0,"smry-app-sidebar-collapsed","APP_SIDEBAR_FEED_TREE_HEIGHT_STYLE_VALUE",0,a,"APP_SIDEBAR_WIDTH_CSS_VAR",0,t,"APP_SIDEBAR_WIDTH_KEY",0,"smry-app-sidebar-width","APP_SIDEBAR_WIDTH_STYLE_VALUE",0,r,"DEFAULT_APP_SIDEBAR_FEED_TREE_HEIGHT",0,134,"DEFAULT_APP_SIDEBAR_WIDTH",0,232,"DEFAULT_MOBILE_APP_SIDEBAR_FEED_TREE_HEIGHT",0,134,"MIN_APP_SIDEBAR_WIDTH",0,224,"MOBILE_APP_SIDEBAR_FEED_TREE_HEIGHT_STYLE_VALUE",0,s,"clampAppSidebarWidth",0,o,"rememberAppSidebarFeedTreeHeight",0,function(e,t=!1){if("u"<typeof document)return;let r=Math.round(e);if(r<64||r>1200)return;let a=t?i:n;document.documentElement.style.setProperty(a,`${r}px`);try{window.localStorage.setItem(t?"smry-mobile-app-sidebar-feed-tree-height-v2":"smry-app-sidebar-feed-tree-height",String(r))}catch{}},"setAppSidebarWidthCssVariable",0,function(e){"u">typeof document&&document.documentElement.style.setProperty(t,`${o(e)}px`)},"syncAppSidebarCollapsedState",0,function(e,r){if("u"<typeof document)return;let n=document.documentElement;n.style.setProperty(t,`${e?56:o(r)}px`),n.classList.toggle("smry-app-sidebar-collapsed",e)}])},330389,e=>{"use strict";function t(e){return"articleUrl"in e}function r(e){return"timeline-chat"===e.kind||"article-chat"===e.kind||"reader-chat"===e.kind}function n(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>0?{entryId:e}:{}}function i(e){if(!e)return null;try{let t=new URL(e);return"https:"===t.protocol||"http:"===t.protocol?e:null}catch{return null}}e.s(["feedWorkspaceDefault",0,function(e){return/^\/(?:[a-z]{2}(?:-[A-Za-z]{2})?\/)?home(?:\/|$)/.test(e)?"timeline-chat":"home"},"hasWorkspaceSidebar",0,r,"isWorkspaceArticle",0,t,"parseFeedWorkspace",0,function(e,t="home"){let r=i(e.article);switch(e.view){case"home":return{kind:"home"};case"timeline-chat":return{kind:"timeline-chat"};case"article":case"article-chat":case"reader":case"reader-chat":return r?{kind:e.view,articleUrl:r,...n(e.entry)}:{kind:t};default:return{kind:t}}},"reduceFeedWorkspace",0,function(e,a){switch(a.type){case"preview-article":return i(a.url)?{kind:"article",articleUrl:a.url,...n(a.entryId)}:e;case"open-article":if(!i(a.url))return e;return{kind:t(e)?e.kind:r(e)?"article-chat":"article",articleUrl:a.url,...n(a.entryId)};case"open-chat":switch(e.kind){case"home":return{kind:"timeline-chat"};case"article":return{...e,kind:"article-chat"};case"reader":return{...e,kind:"reader-chat"};default:return e}case"close-chat":switch(e.kind){case"timeline-chat":return{kind:"home"};case"article-chat":return{...e,kind:"article"};case"reader-chat":return{...e,kind:"reader"};default:return e}case"close-article":case"change-feed":return{kind:r(e)?"timeline-chat":"home"};case"expand-article":switch(e.kind){case"article":return{...e,kind:"reader"};case"article-chat":return{...e,kind:"reader-chat"};default:return e}case"show-timeline":switch(e.kind){case"reader":return{...e,kind:"article"};case"reader-chat":return{...e,kind:"article-chat"};default:return e}default:return a}},"serializeFeedWorkspace",0,function(e,r="home"){return{view:e.kind===r?null:e.kind,article:t(e)?e.articleUrl:null,entry:t(e)?e.entryId??null:null}}])},101616,e=>{"use strict";var t=e.i(843476),r=e.i(192875);e.i(25755);var n=e.i(796715),i=e.i(353177),a=e.i(172213),s=e.i(239329),o=e.i(542272);function l({options:e}){return(0,n.useSyncStream)(e),null}e.s(["StreamSubscriptionGate",0,function({options:e}){let n=(0,o.usePowerSyncOptional)(),{isLoaded:c,isSignedIn:d}=(0,r.useAuth)(),u=(0,a.useSyncSchemaReady)();return(0,i.canSubscribeToAccountStreams)({authLoaded:c,isSignedIn:!!d,hasDatabase:null!==n,schemaReady:u,syncConfigured:!!(0,s.powersyncUrl)()})?(0,t.jsx)(l,{options:e}):null}])},115057,e=>{"use strict";let t=(0,e.i(475254).default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);e.s(["ArrowUpRight",0,t],115057)},101048,e=>{"use strict";let t=(0,e.i(475254).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["CircleCheck",0,t],101048)}]); 3 4//# chunkId=ab4e441f-3c49-5ace-90d7-33b5dd39e16a
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.