@alook/app 0.1.34 → 0.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/web/.open-next/.build/durable-objects/queue.js +5 -5
- package/bundled/web/.open-next/assets/BUILD_ID +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0xk3goeel2v01.js +5 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0y253sbff4i0b.js +20 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/1f_v2q_s63hoh.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{3dt849e0jwtu9.js → 1qn5hcu4pid1i.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{0uwa452_gtwuc.js → 2sds_4pfwxfef.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{3qq-56a5hmhjv.js → 30ia458y2m-z9.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{2eysjnlp6hn65.js → 3gbp8j1j9xqt5.js} +1 -1
- package/bundled/web/.open-next/cache/{JPtCnLnN72EaJMxDUPROm → cF14NSMWpDLveF91ebqUj}/_global-error.cache +1 -1
- package/bundled/web/.open-next/cache/{JPtCnLnN72EaJMxDUPROm → cF14NSMWpDLveF91ebqUj}/_not-found.cache +1 -1
- package/bundled/web/.open-next/cache/{JPtCnLnN72EaJMxDUPROm → cF14NSMWpDLveF91ebqUj}/c/me/bots.cache +1 -1
- package/bundled/web/.open-next/cache/{JPtCnLnN72EaJMxDUPROm → cF14NSMWpDLveF91ebqUj}/c/me/friends.cache +1 -1
- package/bundled/web/.open-next/cache/{JPtCnLnN72EaJMxDUPROm → cF14NSMWpDLveF91ebqUj}/c/me/machines.cache +1 -1
- package/bundled/web/.open-next/cache/{JPtCnLnN72EaJMxDUPROm → cF14NSMWpDLveF91ebqUj}/c/me.cache +1 -1
- package/bundled/web/.open-next/cache/{JPtCnLnN72EaJMxDUPROm → cF14NSMWpDLveF91ebqUj}/c/onboarding-preview.cache +1 -1
- package/bundled/web/.open-next/cache/{JPtCnLnN72EaJMxDUPROm → cF14NSMWpDLveF91ebqUj}/c.cache +1 -1
- package/bundled/web/.open-next/cache/{JPtCnLnN72EaJMxDUPROm → cF14NSMWpDLveF91ebqUj}/device.cache +1 -1
- package/bundled/web/.open-next/cache/{JPtCnLnN72EaJMxDUPROm → cF14NSMWpDLveF91ebqUj}/onboarding-preview.cache +1 -1
- package/bundled/web/.open-next/cache/{JPtCnLnN72EaJMxDUPROm → cF14NSMWpDLveF91ebqUj}/privacy.cache +1 -1
- package/bundled/web/.open-next/cloudflare/cache-assets-manifest.sql +1 -1
- package/bundled/web/.open-next/cloudflare/init.js +1 -1
- package/bundled/web/.open-next/dynamodb-provider/dynamodb-cache.json +1 -1
- package/bundled/web/.open-next/middleware/handler.mjs +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/BUILD_ID +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/build-manifest.json +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/prerender-manifest.json +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/required-server-files.json +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/invite/[token]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/studio/new/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/activity/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/chat/[convId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/chat/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/email/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/files/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/meetings/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/new/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/calendar/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/flags/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/help/email-setup/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/home/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/issues/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/runtimes/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/settings/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/traces/[traceId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/traces/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/unread/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/workspaces/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(auth)/sign-in/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/channels/[serverId]/[channelId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/channels/[serverId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/channels/[serverId]/settings/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/invite/[token]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/me/[dmId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/me/bots/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/me/friends/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/me/machines/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/me/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/onboarding-preview/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__1exc8lx._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_06ly4t9._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1dpddg5._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1n-91sn._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_0-2rpii._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_0tk6041._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_settings_0ag2edj._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-build-manifest.js +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-manifest.json +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.json +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs +9 -9
- package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs.meta.json +37 -37
- package/bundled/web/.open-next/server-functions/default/src/web/index.mjs +4 -4
- package/package.json +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0mu9kud4850o1.js +0 -5
- package/bundled/web/.open-next/assets/_next/static/chunks/2tl7jjpykd3mi.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/41xwnd9igyovr.js +0 -20
- /package/bundled/web/.open-next/assets/_next/static/{JPtCnLnN72EaJMxDUPROm → cF14NSMWpDLveF91ebqUj}/_buildManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{JPtCnLnN72EaJMxDUPROm → cF14NSMWpDLveF91ebqUj}/_clientMiddlewareManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{JPtCnLnN72EaJMxDUPROm → cF14NSMWpDLveF91ebqUj}/_ssgManifest.js +0 -0
- /package/bundled/web/.open-next/cache/{JPtCnLnN72EaJMxDUPROm → cF14NSMWpDLveF91ebqUj}/favicon.ico.cache +0 -0
- /package/bundled/web/.open-next/cache/{JPtCnLnN72EaJMxDUPROm → cF14NSMWpDLveF91ebqUj}/robots.txt.cache +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[474840,585786,a=>{"use strict";let b="col-start-1 row-start-2 flex min-w-0 items-center gap-1 px-2 thin-scrollbar sm:row-span-2 sm:row-start-1 sm:w-44 sm:flex-col sm:items-stretch sm:gap-2 sm:overflow-y-auto sm:p-4",c="h-11 min-w-0 flex-1 flex-row justify-start gap-1 overflow-hidden p-0 group-data-horizontal/tabs:h-11 sm:h-auto sm:w-full sm:flex-none sm:flex-col",d="size-11 justify-center gap-2 px-0 sm:h-9 sm:w-full sm:justify-start sm:px-2",e="sr-only sm:not-sr-only sm:min-w-0 sm:truncate sm:px-2 sm:pt-1 sm:text-xs sm:font-medium sm:text-muted-foreground",f="flex shrink-0 gap-1 sm:mt-auto sm:w-full sm:flex-col sm:border-t sm:border-border/60 sm:pt-2";a.s(["SETTINGS_LOGOUT_CLASS",0,"size-11 shrink-0 justify-center text-destructive hover:text-destructive sm:h-9 sm:w-full sm:justify-start","SETTINGS_NAV_CLASS",0,b,"SETTINGS_NAV_FOOTER_CLASS",0,f,"SETTINGS_NAV_LABEL_CLASS",0,e,"SETTINGS_TABS_LIST_CLASS",0,c,"SETTINGS_TAB_CLASS",0,d],474840);var g=a.i(341306),h=a.i(69776),i=a.i(732254),j=a.i(654461),k=a.i(586220),l=a.i(692);a.s(["SettingsShell",0,function({value:a,onValueChange:m,label:n,title:o,tabs:p,onClose:q,navFooter:r,disabled:s=!1,children:t}){let u=(0,k.useBreakpoint)();return(0,g.jsxs)(j.Tabs,{orientation:"mobile"===u?"horizontal":"vertical",value:a,onValueChange:a=>m(a),className:"grid min-h-0 flex-1 grid-cols-1 grid-rows-[4rem_auto_minmax(0,1fr)] gap-0 sm:grid-cols-[11rem_minmax(0,1fr)] sm:grid-rows-[4rem_minmax(0,1fr)]","data-testid":l.tid.settingsShell,children:[(0,g.jsxs)("header",{className:"col-start-1 row-start-1 flex h-16 min-w-0 items-center px-4 sm:col-start-2 sm:px-8",children:[(0,g.jsx)("h1",{className:"min-w-0 flex-1 truncate text-lg font-medium tracking-tight",children:o}),(0,g.jsx)(i.Button,{variant:"ghost",size:"icon-sm",className:"size-11 sm:size-8",onClick:q,disabled:s,"aria-label":"Close settings","data-testid":l.tid.settingsClose,children:(0,g.jsx)(h.X,{className:"size-4"})})]}),(0,g.jsxs)("nav",{className:b,style:{background:"var(--d-rail)"},"data-testid":l.tid.settingsNav,children:[(0,g.jsx)("div",{className:e,"data-testid":l.tid.settingsLabel,children:n}),(0,g.jsx)(j.TabsList,{variant:"line",className:c,children:p.map(({value:a,label:b,icon:c})=>(0,g.jsxs)(j.TabsTrigger,{value:a,disabled:s,className:d,"data-testid":l.tid.settingsTab(a),children:[(0,g.jsx)(c,{className:"size-4"}),(0,g.jsx)("span",{className:"sr-only sm:not-sr-only",children:b})]},a))}),r?(0,g.jsx)("div",{className:f,children:r}):null]}),(0,g.jsx)("div",{className:"col-start-1 row-start-3 min-h-0 min-w-0 overflow-y-auto bg-background px-4 pt-2 pb-4 thin-scrollbar sm:col-start-2 sm:row-start-2 sm:p-8 sm:pt-4","data-testid":l.tid.settingsContent,children:t})]})},"SettingsShellPanel",0,function(a){return(0,g.jsx)(j.TabsContent,{...a,keepMounted:!0})}],585786)},588745,a=>{"use strict";var b=a.i(341306),c=a.i(156854),d=a.i(47564),e=a.i(684589),f=a.i(71414),g=a.i(490228),h=a.i(747686),i=a.i(432340),j=a.i(94701),k=a.i(990061),l=a.i(487154),m=a.i(767401),n=a.i(987644),o=a.i(994514);let p=(0,o.default)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);var q=a.i(353393),r=a.i(748103),s=a.i(97641);let t=(0,o.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var u=a.i(278566),v=a.i(533337),w=a.i(319890),x=a.i(732254),y=a.i(27647),z=a.i(22902),A=a.i(75118);let B="May 22, 2026",C="underline decoration-foreground/30 underline-offset-3 transition-colors hover:decoration-foreground/60";function D({className:a}){return(0,b.jsxs)("div",{className:(0,A.cn)(a),"data-privacy-policy":B,children:[(0,b.jsxs)("p",{className:"mb-12 text-sm text-muted-foreground",children:["Last updated: ",B]}),(0,b.jsxs)("div",{className:"prose prose-neutral max-w-none space-y-8 text-[1.0625rem] leading-relaxed dark:prose-invert",children:[(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Interpretation and Definitions"}),(0,b.jsxs)("p",{className:"text-foreground/80",children:['In this Privacy Policy, "Company" (referred to as "We", "Us", or "Our") refers to Alook AI. "Service" refers to the Alook platform accessible at'," ",(0,b.jsx)("a",{href:"https://alook.ai",className:C,children:"alook.ai"}),'. "You" means the individual accessing or using our Service. "Personal Data" is any information that relates to an identified or identifiable individual.']})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Collecting and Using Your Personal Data"}),(0,b.jsx)("h3",{className:"mt-8 mb-3 text-lg font-medium",children:"Types of Data Collected"}),(0,b.jsx)("h4",{className:"mt-6 mb-2 text-base font-medium",children:"Personal Data"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"While using Our Service, We may ask You to provide Us with certain personally identifiable information that can be used to contact or identify You, including but not limited to:"}),(0,b.jsxs)("ul",{className:"mt-3 list-disc space-y-2 pl-6 text-foreground/80",children:[(0,b.jsx)("li",{children:"Email address"}),(0,b.jsx)("li",{children:"Name"}),(0,b.jsx)("li",{children:"Usage data"})]}),(0,b.jsx)("h4",{className:"mt-6 mb-2 text-base font-medium",children:"Usage Data"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"Usage Data is collected automatically when using the Service. It may include information such as Your device's IP address, browser type, browser version, the pages of our Service that You visit, the time and date of Your visit, the time spent on those pages, and other diagnostic data."}),(0,b.jsx)("h4",{className:"mt-6 mb-2 text-base font-medium",children:"Information from Third-Party Social Login"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"Alook allows You to create an account and log in through third-party services including Google and GitHub. If You decide to register through or grant us access to a third-party service, We may collect Personal Data already associated with Your account, such as Your name and email address."}),(0,b.jsx)("h4",{className:"mt-6 mb-2 text-base font-medium",children:"Tracking Technologies and Cookies"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"We use cookies and similar tracking technologies to track activity on Our Service and store certain information. These are used to analyze trends, administer the site, and gather demographic information. You can instruct Your browser to refuse all cookies or to indicate when a cookie is being sent."})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Use of Your Personal Data"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"We may use Your Personal Data for the following purposes:"}),(0,b.jsxs)("ul",{className:"mt-3 list-disc space-y-2 pl-6 text-foreground/80",children:[(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"To provide and maintain our Service"}),", including processing and delivering AI agent tasks on your behalf."]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"To manage Your Account"})," and provide You with access to functionalities of the Service available to registered users."]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"To contact You"})," by email or other equivalent forms of electronic communication regarding updates or informative communications related to the Service."]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"To manage Your requests"})," and attend to any requests You make to Us."]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"For business transfers"})," in connection with any merger, sale of company assets, financing, or acquisition of all or a portion of Our business."]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"For other purposes"})," such as data analysis, identifying usage trends, and improving our Service."]})]})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Sharing Your Personal Data"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"We may share Your personal information in the following situations:"}),(0,b.jsxs)("ul",{className:"mt-3 list-disc space-y-2 pl-6 text-foreground/80",children:[(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"With Service Providers:"})," We share data with third-party AI model providers to power agent capabilities. Data sent to these providers is governed by their respective privacy policies. We minimize the data shared and only send what is necessary to fulfill Your requests."]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"For business transfers:"})," In connection with a merger, acquisition, or asset sale, Your Personal Data may be transferred."]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"With Your consent:"})," We may disclose Your personal information for any other purpose with Your consent."]})]}),(0,b.jsx)("p",{className:"mt-4 text-foreground/80",children:"We do not sell Your Personal Data to third parties."})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Retention of Your Personal Data"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"We will retain Your Personal Data only for as long as is necessary for the purposes set out in this Privacy Policy. We will retain and use Your data to the extent necessary to comply with our legal obligations, resolve disputes, and enforce our agreements."}),(0,b.jsx)("p",{className:"mt-4 text-foreground/80",children:"Usage Data is generally retained for a shorter period of time, except when it is used to strengthen security or improve the functionality of Our Service."})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Security of Your Personal Data"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"The security of Your Personal Data is important to Us. Your data is stored securely using industry-standard encryption. Agent workspaces are isolated per user. However, no method of transmission over the Internet or method of electronic storage is 100% secure. While We strive to use commercially acceptable means to protect Your Personal Data, We cannot guarantee its absolute security."})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Children's Privacy"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"Our Service does not address anyone under the age of 13. We do not knowingly collect personally identifiable information from anyone under the age of 13. If You are a parent or guardian and You are aware that Your child has provided Us with Personal Data, please contact Us. If We become aware that We have collected Personal Data from anyone under the age of 13 without verification of parental consent, We will take steps to remove that information."})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Your Data Rights"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"You have the right to access, update, or delete Your Personal Data at any time. You can manage certain information through Your Account settings, or contact Us directly to request assistance with these actions."})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Changes to This Privacy Policy"}),(0,b.jsx)("p",{className:"text-foreground/80",children:'We may update Our Privacy Policy from time to time. We will notify You of any changes by posting the new Privacy Policy on this page and updating the "Last updated" date at the top. You are advised to review this Privacy Policy periodically for any changes.'})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Contact Us"}),(0,b.jsxs)("p",{className:"text-foreground/80",children:["If you have any questions about this Privacy Policy, You can contact us at"," ",(0,b.jsx)("a",{href:"mailto:support@alook.ai",className:C,children:"support@alook.ai"}),"."]})]})]})]})}var E=a.i(9777),F=a.i(692),G=a.i(131033);function H({label:a,children:c}){return(0,b.jsxs)("fieldset",{className:"min-w-0",children:[(0,b.jsx)("legend",{className:"mb-1.5 text-xs text-muted-foreground",children:a}),c]})}var I=a.i(230977),J=a.i(190601),K=a.i(474840),L=a.i(585786);let M=(0,o.default)("mail-warning",[["path",{d:"M22 10.5V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h12.5",key:"e61zoh"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"M20 14v4",key:"1hm744"}],["path",{d:"M20 22v.01",key:"12bgn6"}]]);var N=a.i(442491),O=a.i(949831),P=a.i(610566);async function Q(a){try{switch((await a.json()).error){case"INVALID_OTP":return"That code is incorrect. Try again.";case"OTP_EXPIRED":return"That code expired. Send a new code.";case"TOO_MANY_ATTEMPTS":return"Too many incorrect attempts. Send a new code.";case"RATE_LIMITED":return"Too many requests. Try again when the timer ends.";case"CODE_SEND_FAILED":return"We couldn’t send the code. Try again.";case"ACCOUNT_DELETION_FAILED":return"Your account wasn’t deleted. Try again."}}catch{}return"Something went wrong. Try again."}function R({email:a,onCancel:c,onDeleted:d}){let[e,f]=(0,j.useState)("notice"),[g,h]=(0,j.useState)(""),[i,k]=(0,j.useState)(!1),[m,n]=(0,j.useState)(!1),[o,p]=(0,j.useState)(0),[q,r]=(0,j.useState)(""),s=(0,j.useRef)(null),t=(0,j.useRef)(null),u=(0,j.useRef)(null);(0,j.useEffect)(()=>{"code"===e?t.current?.focus():s.current?.focus()},[e]),(0,j.useEffect)(()=>{q&&("code"===e?t.current?.focus():u.current?.focus())},[q,e]),(0,j.useEffect)(()=>{if(o<=0)return;let a=window.setTimeout(()=>{p(a=>Math.max(0,a-1))},1e3);return()=>window.clearTimeout(a)},[o]);let v=async()=>{k(!0),r("");try{let a=await fetch("/api/community/users/me/account-deletion/code",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:"{}"});if(!a.ok){let b=429===a.status?(0,P.parseRetryAfterSeconds)(a.headers):null;b&&p(b),r(await Q(a));return}let b=await a.json();h(""),p(b.resend_after),f("code")}catch{r("We couldn’t send the code. Check your connection and try again.")}finally{k(!1)}},w=async()=>{let a;if(/^\d{6}$/u.test(g)){n(!0),r(""),(0,l.beginAccountDeletionAuthTransition)();try{a=await fetch("/api/community/users/me/account-deletion",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({otp:g})})}catch{(0,l.cancelAccountDeletionAuthTransition)(),h(""),r("Your account wasn’t deleted. Check your connection and try again."),n(!1);return}if(!a.ok){(0,l.cancelAccountDeletionAuthTransition)(),h(""),r(await Q(a)),n(!1);return}try{await d()}catch{globalThis.location.replace(l.ACCOUNT_DELETED_SIGN_IN_PATH)}}};return(0,b.jsx)("div",{className:"mx-auto w-full max-w-md animate-in fade-in duration-150 motion-reduce:animate-none","data-testid":F.tid.accountDeletionFlow,children:"notice"===e?(0,b.jsxs)("section",{className:"space-y-8",children:[(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("span",{className:"flex size-10 items-center justify-center rounded-full bg-destructive/10 text-destructive",children:(0,b.jsx)(N.Trash2,{className:"size-5"})}),(0,b.jsx)("h2",{ref:s,tabIndex:-1,className:"text-xl font-medium tracking-tight outline-none",children:"Delete your account?"}),(0,b.jsx)("p",{className:"text-sm leading-6 text-muted-foreground",children:"Your profile, messages, agents, and account data will be permanently removed."}),(0,b.jsx)("p",{className:"text-sm font-medium",children:"This can’t be undone."})]}),(0,b.jsxs)("div",{className:"rounded-xl bg-muted/60 p-4",children:[(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:"Deletion code will be sent to"}),(0,b.jsx)("div",{className:"mt-1 break-all text-sm font-medium",children:a})]}),q?(0,b.jsx)("p",{ref:u,tabIndex:-1,role:"alert",className:"text-sm text-destructive outline-none",children:q}):null,(0,b.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:[(0,b.jsx)(x.Button,{variant:"ghost",className:"h-11 sm:h-9",onClick:c,disabled:i,children:"Cancel"}),(0,b.jsx)(x.Button,{className:"h-11 sm:h-9",onClick:v,disabled:i||o>0,"data-testid":F.tid.accountDeletionSendCode,children:i?"Sending code…":o>0?`Send deletion code in ${o}s`:"Send deletion code"})]})]}):(0,b.jsxs)("section",{className:"space-y-8",children:[(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("span",{className:"flex size-10 items-center justify-center rounded-full bg-destructive/10 text-destructive",children:(0,b.jsx)(M,{className:"size-5"})}),(0,b.jsx)("h2",{ref:s,tabIndex:-1,className:"text-xl font-medium tracking-tight outline-none",children:"Enter deletion code"}),(0,b.jsxs)("p",{className:"text-sm leading-6 text-muted-foreground",children:["We sent a 6-digit code to ",(0,b.jsx)("span",{className:"font-medium text-foreground",children:a}),"."]})]}),(0,b.jsx)(O.InputOTP,{ref:t,value:g,onChange:a=>{h(a),r("")},maxLength:6,autoFocus:!0,disabled:m,"aria-label":"Deletion code","aria-invalid":!!q,containerClassName:"justify-center sm:justify-start","data-testid":F.tid.accountDeletionOtp,children:(0,b.jsx)(O.InputOTPGroup,{children:Array.from({length:6},(a,c)=>(0,b.jsx)(O.InputOTPSlot,{index:c,className:"size-11 text-base"},c))})}),q?(0,b.jsx)("p",{ref:u,tabIndex:-1,role:"alert",className:"text-sm text-destructive outline-none",children:q}):null,(0,b.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,b.jsxs)("div",{className:"flex flex-col gap-1 sm:flex-row",children:[(0,b.jsx)(x.Button,{variant:"ghost",className:"h-11 sm:h-9",onClick:()=>{r(""),f("notice")},disabled:m,children:"Back"}),(0,b.jsx)(x.Button,{variant:"ghost",className:"h-11 sm:h-9",onClick:v,disabled:m||i||o>0,children:i?"Sending…":o>0?`Resend code in ${o}s`:"Resend code"})]}),(0,b.jsx)(x.Button,{variant:"destructive",className:"h-11 sm:h-9",onClick:w,disabled:m||6!==g.length,"data-testid":F.tid.accountDeletionSubmit,children:m?"Deleting account…":"Delete account"})]})]})})}let S=[{value:"light",label:"Light",icon:q.Sun},{value:"dark",label:"Dark",icon:r.Moon},{value:"system",label:"System",icon:s.Monitor}],T=[{value:"profile",label:"My Profile",icon:m.User},{value:"appearance",label:"Appearance",icon:p},{value:"advanced",label:"Advanced",icon:t},{value:"privacy",label:"Privacy",icon:v.Shield}];function U(){let{theme:a,setTheme:c}=(0,w.useTheme)(),[d,e]=(0,j.useState)(!1);(0,j.useEffect)(()=>e(!0),[]);let f=d?a??"system":void 0;return(0,b.jsx)("div",{className:"mx-auto w-full max-w-md space-y-4",children:(0,b.jsx)(H,{label:"Theme",children:(0,b.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-xl bg-muted/60 p-1",children:S.map(({value:a,label:d,icon:e})=>{let g=f===a;return(0,b.jsxs)("button",{onClick:()=>c(a),"aria-pressed":g,className:["flex min-h-16 flex-col items-center justify-center gap-2 rounded-lg px-2 text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",g?"bg-background text-foreground shadow-(--e1)":"text-muted-foreground hover:bg-background/60 hover:text-foreground"].join(" "),children:[(0,b.jsx)(e,{className:"size-5"}),d]},a)})})})})}function V({userId:a}){let[c,d]=(0,j.useState)(!1),[e,f]=(0,j.useState)(!1);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(z.ConfirmDialog,{open:c,onOpenChange:a=>{a||d(!1)},title:"Clear local cache?",description:"This removes the locally persisted messages and read-state for your account. The next channel or DM you open will refetch from the server. Your unread state on the server is unaffected.",confirmLabel:"Clear cache",loadingLabel:"Clearing...",loading:e,onConfirm:async()=>{f(!0);try{await (0,E.clearPersistedCache)(a),(0,k.toast)("Local cache cleared — reloading"),window.location.reload()}catch(a){(0,l.toastApiError)(a,"Failed to clear cache"),f(!1),d(!1)}}}),(0,b.jsxs)("div",{className:"mx-auto flex min-h-full w-full max-w-md flex-col",children:[(0,b.jsxs)("section",{className:"space-y-2",children:[(0,b.jsx)("h2",{className:"text-base font-medium tracking-tight",children:"Clear local cache"}),(0,b.jsx)("p",{className:"max-w-[65ch] text-sm leading-6 text-muted-foreground",children:"Removes the locally persisted message history and read-state stored in this browser. The next channel or DM you open will refetch from the server. Nothing on the server is deleted."}),(0,b.jsx)(x.Button,{variant:"destructive",size:"sm",className:"mt-2 h-11 sm:h-8",onClick:()=>d(!0),children:"Clear local cache"})]}),(0,b.jsxs)("footer",{"data-testid":F.tid.settingsWebVersion,className:"mt-auto pt-8 font-mono text-xs tabular-nums text-muted-foreground",children:["Web v","0.1.34"]})]})]})}function W({onClose:a,userId:c,userName:d,userEmail:e,aboutMe:f,avatar:g,statusEmoji:h,statusText:i,onSave:k,onLogout:l,onAccountDeleted:m,onUploadAvatar:o}){let[p,q]=(0,j.useState)(d),[r,s]=(0,j.useState)(f),[t,v]=(0,j.useState)({emoji:h??null,text:i??null}),[w,z]=(0,j.useState)({name:d,aboutMe:f,emoji:h??null,text:i??null}),[A,B]=(0,j.useState)("profile"),[C,E]=(0,j.useState)(!1),H=p!==w.name||r!==w.aboutMe||t.emoji!==w.emoji||t.text!==w.text;return(0,b.jsx)(L.SettingsShell,{value:A,onValueChange:B,label:"User Settings",title:C?"Delete account":"appearance"===A?"Appearance":"advanced"===A?"Advanced":"privacy"===A?"Privacy Policy":"My Profile",tabs:T,onClose:a,disabled:C,navFooter:(0,b.jsxs)(x.Button,{variant:"ghost",className:K.SETTINGS_LOGOUT_CLASS,size:"sm",onClick:l,"aria-label":"Log out",disabled:C,children:[(0,b.jsx)(n.LogOut,{className:"size-4"})," ",(0,b.jsx)("span",{className:"sr-only sm:not-sr-only",children:"Log Out"})]}),children:C?(0,b.jsx)(R,{email:e,onCancel:()=>E(!1),onDeleted:m}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(L.SettingsShellPanel,{value:"profile",children:(0,b.jsxs)("div",{className:"mx-auto w-full max-w-md space-y-8",children:[(0,b.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,b.jsx)("span",{className:"block size-24 overflow-hidden rounded-full ring-1 ring-border/50",children:(0,b.jsx)(G.Avatar,{label:g,seed:c??void 0,size:96})}),(0,b.jsxs)("button",{type:"button",onClick:o,className:"flex min-h-11 items-center gap-2 rounded-full border border-border/50 px-3 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:min-h-8",children:[(0,b.jsx)(u.Camera,{className:"size-3.5"})," Change photo"]})]}),(0,b.jsx)("input",{value:p,onChange:a=>q(a.target.value),placeholder:"Your name","aria-label":"Display name",className:"min-h-11 w-full rounded-sm border-0 bg-transparent px-0 py-1 text-xl font-medium leading-[1.2] tracking-tight shadow-none outline-none placeholder:font-normal placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-4 focus-visible:ring-offset-background sm:text-2xl"}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:"About"}),(0,b.jsx)(y.AutoResizeTextarea,{value:r,onChange:a=>s(a.target.value),placeholder:"Add a bit about yourself…",className:"min-h-11 w-full rounded-sm border-0 bg-transparent px-0 py-1 text-sm leading-6 text-foreground shadow-none outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-4 focus-visible:ring-offset-background"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:"Status"}),(0,b.jsx)(I.StatusEditor,{emoji:t.emoji,text:t.text,onChange:(a,b)=>v({emoji:a,text:b}),children:(0,b.jsx)("button",{className:"inline-flex min-h-11 items-center gap-2 rounded-full border border-border/50 px-3 text-sm transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:min-h-8",children:(0,J.hasStatus)(t.emoji,t.text)?(0,b.jsxs)("span",{children:[t.emoji," ",t.text]}):(0,b.jsx)("span",{className:"text-muted-foreground",children:"Set a status"})})})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[(0,b.jsx)(x.Button,{variant:"ghost",size:"sm",className:"h-11 shrink-0 px-3 text-destructive hover:text-destructive sm:h-8",onClick:()=>E(!0),"aria-label":"Delete account","data-testid":F.tid.accountDeletionOpen,children:"Delete account"}),(0,b.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[(0,b.jsx)(x.Button,{variant:"ghost",size:"sm",className:"h-11 sm:h-8",onClick:()=>{q(w.name),s(w.aboutMe),v({emoji:w.emoji,text:w.text})},disabled:!H,children:"Cancel"}),(0,b.jsx)(x.Button,{size:"sm",className:"h-11 sm:h-8",onClick:()=>{if(!H)return;let a=p.trim(),b=r.trim();k({name:a,aboutMe:b,statusEmoji:t.emoji,statusText:t.text}),z({name:a,aboutMe:b,emoji:t.emoji,text:t.text}),q(a),s(b)},disabled:!H,children:"Save changes"})]})]})]})}),(0,b.jsx)(L.SettingsShellPanel,{value:"appearance",children:(0,b.jsx)(U,{})}),(0,b.jsx)(L.SettingsShellPanel,{value:"advanced",className:"h-full",children:(0,b.jsx)(V,{userId:c})}),(0,b.jsx)(L.SettingsShellPanel,{value:"privacy",children:(0,b.jsx)("div",{className:"mx-auto w-full max-w-2xl pb-8",children:(0,b.jsx)(D,{})})})]})})}var X=a.i(609398);function Y(a){return Number(a.toFixed(6)).toString()}function Z(a,b){if(void 0!==a&&void 0!==b&&Number.isFinite(a)&&Number.isFinite(b)&&!(a<=0)&&!(b<=0))return{width:a,height:b}}var $=a.i(642155);function _({image:a}){let c=(0,j.useMemo)(()=>Z(a.width,a.height),[a.height,a.width]),[d,e]=(0,j.useState)(c),[f,g]=(0,j.useState)(null),[h,i,,k,l,m]=(0,$.useRemoteImageAttempt)({eligible:!!a.thumbnailUrl}),[n,o,p,q,r,s,t]=(0,$.useRemoteImageAttempt)(),u=function(a){if(!a)return{width:"min(200px, 90vw, 85vh)",aspectRatio:"1 / 1"};let b=85*(a.width/a.height);return{width:`min(${Y(a.width)}px, 90vw, ${Y(b)}vh)`,aspectRatio:`${Y(a.width)} / ${Y(a.height)}`}}(d),v=!!a.thumbnailUrl&&"ready"===h,w=!a.thumbnailUrl||"pending"!==h,x="ready"===n&&f===o;return(0,j.useEffect)(()=>{if("ready"!==n||!p||!w)return;let a=Z(p.naturalWidth,p.naturalHeight),b=()=>{e(c??a),g(o)};if("function"!=typeof requestAnimationFrame)return void b();let d=requestAnimationFrame(b);return()=>cancelAnimationFrame(d)},[c,o,p,n,w]),(0,b.jsxs)("div",{className:"relative w-fit",children:[(0,b.jsxs)("div",{"data-testid":F.tid.imageLightbox,"data-native-context-menu":"true",className:"relative overflow-hidden rounded-lg bg-background",style:u,children:[a.thumbnailUrl&&(0,b.jsx)("img",{ref:k,"data-testid":F.tid.imageLightboxThumbnail,"data-remote-image-kind":"content","data-remote-image-state":h,src:a.thumbnailUrl,alt:a.name,onLoad:l,onError:m,className:`absolute inset-0 size-full rounded-lg object-contain transition-opacity duration-150 ease-out motion-reduce:transition-none ${v&&!x?"pointer-events-auto opacity-100":"pointer-events-none opacity-0"}`},`thumbnail-${i}`),!v&&!x&&"pending"===n&&(0,b.jsx)("div",{"data-testid":F.tid.imageLightboxLoading,role:"status",className:"absolute inset-0 flex animate-pulse items-center justify-center bg-muted/70 px-4 text-sm text-muted-foreground motion-reduce:animate-none",children:"Loading original image"}),"error"!==n&&(0,b.jsx)("img",{ref:q,"data-testid":F.tid.imageLightboxOriginal,"data-remote-image-kind":"content","data-remote-image-state":n,src:a.originalUrl,alt:a.name,onLoad:r,onError:s,className:`absolute inset-0 size-full rounded-lg object-contain transition-opacity duration-150 ease-out motion-reduce:transition-none ${x?"pointer-events-auto opacity-100":"pointer-events-none opacity-0"}`},`original-${o}`)]}),"error"===n&&(0,b.jsxs)("div",{"data-testid":F.tid.imageLightboxError,role:"status",className:"absolute bottom-3 left-1/2 z-10 flex min-h-11 w-max max-w-[min(90vw,24rem)] -translate-x-1/2 items-center justify-between gap-2 rounded-md border border-border bg-background px-3 py-2 text-sm shadow-sm",children:[(0,b.jsx)("span",{children:"Failed to load original image"}),(0,b.jsx)("button",{type:"button","data-testid":F.tid.imageLightboxRetry,onClick:t,className:"h-12 min-w-12 rounded-md px-3 font-medium text-foreground transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:h-9 sm:min-w-0",children:"Retry"})]})]})}function aa({image:a,onClose:c}){return(0,b.jsx)(i.Dialog,{open:!0,onOpenChange:a=>{a||c()},children:(0,b.jsx)(i.DialogContent,{className:"flex max-h-[90vh] w-auto items-center justify-center border-none bg-transparent p-0 shadow-none sm:max-w-none",showCloseButton:!1,children:(0,b.jsx)(_,{image:a},`${a.originalUrl}\u0000${a.thumbnailUrl??""}\u0000${a.width??""}\u0000${a.height??""}`)})})}var ab=a.i(79003),ac=a.i(153365),ad=a.i(650174),ae=a.i(779121),af=a.i(728851),ag=a.i(151971),ah=a.i(803896),ai=a.i(201623),aj=a.i(822160);let ak=(0,ab.default)(async()=>{},{loadableGenerated:{modules:[145142]},ssr:!1,loading:()=>(0,b.jsxs)("div",{"data-testid":F.tid.codePreview,role:"status",className:"flex min-h-40 items-center justify-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(ae.Loader2,{className:"size-4 animate-spin"}),"Loading syntax highlighter…"]})}),al=(0,ab.default)(async()=>{},{loadableGenerated:{modules:[144402]},ssr:!1,loading:()=>(0,b.jsxs)("div",{"data-testid":F.tid.pdfPreviewStatus,role:"status",className:"flex min-h-40 items-center justify-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(ae.Loader2,{className:"size-4 animate-spin motion-reduce:animate-none"}),"Loading PDF renderer…"]})}),am={status:"idle",content:null,error:null};function an({attachment:a}){let c=(0,aj.useAttachmentDownload)(a),d=(0,aj.attachmentDownloadStatusText)(c.state),e="downloading"===c.state.status?ae.Loader2:"success"===c.state.status?ac.CircleCheck:"error"===c.state.status?af.RefreshCw:ad.Download;return(0,b.jsxs)("button",{type:"button","data-testid":F.tid.attachmentPreviewDownload,onClick:()=>void c.start(),disabled:"downloading"===c.state.status,"aria-busy":"downloading"===c.state.status,className:(0,x.buttonVariants)({variant:"outline",size:"sm",className:"h-11 disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground sm:h-7"}),children:[(0,b.jsx)(e,{className:`size-3.5 ${"downloading"===c.state.status?"animate-spin motion-reduce:animate-none":""}`}),d??"Download"]})}async function ao(a,b=ai.MAX_TEXT_ATTACHMENT_PREVIEW_BYTES,c){return new TextDecoder().decode(await ap(a,b,c))}async function ap(a,b,c){if(!a.ok)throw Error(`Couldn’t load this attachment (${a.status})`);let d=Number(a.headers.get("content-length"));if(Number.isFinite(d)&&d>b)throw Error("This file is too large to preview");if(!a.body){let c=new Uint8Array(await a.arrayBuffer());if(c.byteLength>b)throw Error("This file is too large to preview");return c}let e=a.body.getReader(),f=0,g=[];try{for(;;){if(c?.aborted)throw new DOMException("Aborted","AbortError");let{done:a,value:d}=await e.read();if(a)break;if((f+=d.byteLength)>b)throw await e.cancel(),Error("This file is too large to preview");g.push(d)}let a=new Uint8Array(f),d=0;for(let b of g)a.set(b,d),d+=b.byteLength;return a}finally{e.releaseLock()}}function aq({attachment:a,open:c,onOpenChange:d}){let[e,f]=(0,j.useState)(a),[g,h]=(0,j.useState)(am);(0,j.useEffect)(()=>{a&&f(a)},[a]),(0,j.useEffect)(()=>{if(!c||!e)return void h(am);let a=(0,ai.resolveAttachmentPresentation)(e.name,e.contentType);if(!a.previewKind)return void h({status:"error",content:null,error:"This file type can’t be previewed"});let b="pdf"===a.previewKind?ai.MAX_PDF_ATTACHMENT_PREVIEW_BYTES:ai.MAX_TEXT_ATTACHMENT_PREVIEW_BYTES;if(void 0!==e.sizeBytes&&e.sizeBytes>b)return void h({status:"error",content:null,error:"This file is too large to preview"});let d=new AbortController,f=!0;return h({status:"loading",content:null,error:null}),fetch(e.url,{credentials:"same-origin",signal:d.signal}).then(async c=>"pdf"===a.previewKind?{status:"ready",kind:"pdf",content:await ap(c,b,d.signal),error:null}:{status:"ready",kind:"text",content:await ao(c,b,d.signal),error:null}).then(a=>{f&&h(a)}).catch(a=>{f&&!d.signal.aborted&&h({status:"error",content:null,error:a instanceof Error?a.message:"Couldn’t load this attachment"})}),()=>{f=!1,d.abort()}},[c,e]);let i=e?(0,ai.resolveAttachmentPresentation)(e.name,e.contentType):null,k=e?(0,ai.formatAttachmentSize)(e.sizeBytes)||e.size:"";return(0,b.jsxs)(ag.CommunitySheet,{open:c,onOpenChange:d,title:e?.name??"Attachment",description:[e?.contentType||i?.category,k].filter(Boolean).join(" · "),footer:e&&(0,b.jsx)(an,{attachment:e}),resizable:!0,closeLabel:"Close attachment preview",contentTestId:F.tid.attachmentPreviewSheet,bodyTestId:F.tid.attachmentPreviewContent,bodyClassName:(0,A.cn)("flex min-h-0 flex-col",i?.previewKind==="pdf"&&"overflow-hidden",(i?.previewKind==="code"||i?.previewKind==="text"||i?.previewKind==="pdf")&&"p-0 sm:p-0"),children:["loading"===g.status&&(0,b.jsxs)("div",{className:"flex items-center justify-center gap-2 py-8 text-sm text-muted-foreground",children:[(0,b.jsx)(ae.Loader2,{className:"size-4 animate-spin"}),"Loading preview…"]}),"error"===g.status&&(0,b.jsxs)("div",{className:"flex min-h-40 flex-col items-center justify-center gap-2 text-center",children:[(0,b.jsx)("p",{className:"text-sm font-medium",children:"Preview unavailable"}),(0,b.jsx)("p",{className:"max-w-72 text-sm text-muted-foreground",children:g.error})]}),"ready"===g.status&&"text"===g.kind&&i?.previewKind==="markdown"&&(0,b.jsx)(ah.MessageBody,{text:g.content}),"ready"===g.status&&"text"===g.kind&&i?.previewKind!=="markdown"&&(0,b.jsx)(ak,{content:g.content,language:i?.shikiLanguage??null}),"ready"===g.status&&"pdf"===g.kind&&(0,b.jsx)(al,{data:g.content})]})}var ar=a.i(131731);function as({controller:a,breakpoint:c,extraDialogs:d}){let{profile:e,currentUser:f}=a,g=a.pendingAvatarCrop;return(0,b.jsxs)(b.Fragment,{children:[e&&(0,b.jsx)(X.ProfileCard,{data:e.data,x:e.x,y:e.y,bp:c,onClose:a.closeProfile,onMessage:a.profileMessage,isSelf:!!e.data.userId&&e.data.userId===f.id,onUpdateStatus:a.updateOwnStatus,onOpenOwnerProfile:a.openOwnerProfile,onOpenBotAudit:a.openBotAudit},`${e.data.userId??e.data.name}:${e.x}:${e.y}`),a.preview&&(0,b.jsx)(aa,{image:a.preview,onClose:a.closePreview}),(0,b.jsx)(aq,{attachment:a.attachmentPreview,open:!!a.attachmentPreview,onOpenChange:a.onAttachmentPreviewOpenChange}),(0,b.jsx)(i.Dialog,{open:a.editingProfile,onOpenChange:a.onUserSettingsOpenChange,children:(0,b.jsx)(i.DialogContent,{className:"flex h-dvh max-h-dvh w-screen max-w-none flex-col gap-0 overflow-hidden rounded-none p-0 sm:h-[calc(100vh-4rem)] sm:max-h-180 sm:w-[calc(100vw-4rem)] sm:max-w-4xl sm:rounded-xl",showCloseButton:!1,children:(0,b.jsx)(W,{...a.userSettingsProps})})}),g&&(0,b.jsx)(ar.ImageCropDialog,{...g,maskShape:"circle"}),d]})}var at=a.i(216581);a.s(["ShellFrameView",0,function({breakpoint:a,checkpoint:i,sidebar:j,children:k,extraDialogs:l,cancelPendingNavigation:m,rail:n,profile:o,inbox:p}){let{surface:q}=i,r=(0,b.jsx)(h.InboxPopover,{...p.popoverProps,surface:"mobile"===a?"mobile":"desktop"}),s={id:o.currentUser.id,name:o.currentUser.name,avatar:o.currentUser.avatar},t="unknown"===a;return(0,b.jsx)(at.CommunityShellLayout,{breakpoint:a,surface:q,onNavigationIntent:m,transition:{mode:i.mode,targetHref:i.targetHref},rail:(0,b.jsx)(f.ServerRail,{...n.railProps,bottomInset:60}),sidebar:"server-skeleton"===i.sidebar.kind?(0,b.jsx)(c.ChannelSidebarSkeleton,{targetServerId:i.sidebar.serverId}):"me-skeleton"===i.sidebar.kind?(0,b.jsx)(d.DmSidebarSkeleton,{}):"desktop"===a?j():j({noHeader:!1}),main:"target-skeleton"===i.main.kind||t?(0,b.jsx)(e.CommunityPendingFrame,{href:i.targetHref,reserveBackSlot:"detail"===q}):k,userBar:(0,b.jsx)(g.UserBar,{breakpoint:a,user:s,onOpenProfile:o.openProfile,onEditProfile:o.openUserSettings,inbox:r,hasUnread:p.hasUnread,inboxOpen:p.open,onInboxOpenChange:p.onOpenChange}),overlays:!t&&(0,b.jsx)(as,{controller:o,breakpoint:a,extraDialogs:l})})}],588745)},476042,a=>{"use strict";var b=a.i(94701),c=a.i(306533),d=a.i(823417),e=a.i(23745);function f(a){a.revision+=1}async function g(a,b,c){let d=++a.revision,e=await b();return d===a.revision&&(c(e),!0)}var h=a.i(979031),i=a.i(764081);a.s(["useCommunityNavigationController",0,function(a){let j=(0,d.useRouter)(),k=(0,d.usePathname)(),l=(0,d.useSearchParams)().toString(),m=l?`${k}?${l}`:k,n=(0,e.useQueryClient)(),o=(0,b.useRef)({revision:0}),p=(0,b.useRef)(a.revision),q=(0,b.useRef)(a.leafKey),[r,s]=(0,b.useState)(!1),[t,u]=(0,b.useState)(null),v=(0,b.useCallback)(()=>{f(o.current),(0,i.cancelActiveConversationNavigationProof)(n),s(!1),u(null)},[n]);(0,b.useEffect)(()=>{null===t||((0,h.normalizeCommunityHref)(t).leafKey===q.current?(0,h.isPublishedNonStructuralCommit)(a,m,t):(0,h.isStructuralFrameCommit)({committedFrame:a,targetHref:t,baselineRevision:p.current}))&&(f(o.current),s(!1),u(null))},[a,t,m]),(0,b.useEffect)(()=>{},[v]);let w=(0,b.useCallback)(b=>{b!==m&&(f(o.current),(0,i.cancelActiveConversationNavigationProof)(n),p.current=a.revision,q.current=a.leafKey,s(!0),u(b),j.push(b))},[a.leafKey,a.revision,m,n,j]),x=(0,b.useCallback)(b=>{b!==m&&(f(o.current),p.current=a.revision,q.current=a.leafKey,(0,c.flushSync)(()=>{s(!0),u(b)}),j.push(b))},[a.leafKey,a.revision,m,j]),y=(0,b.useCallback)(b=>{b!==m&&(f(o.current),(0,i.cancelActiveConversationNavigationProof)(n),p.current=a.revision,q.current=a.leafKey,s(!0),u(b),j.replace(b))},[a.leafKey,a.revision,m,n,j]),z=(0,b.useCallback)(async b=>{(0,i.cancelActiveConversationNavigationProof)(n),p.current=a.revision,q.current=a.leafKey,s(!0),u(null);try{return await g(o.current,b,a=>{if(a===m){s(!1),u(null);return}u(a),j.push(a)})}catch(a){throw s(!1),u(null),a}},[a.leafKey,a.revision,m,n,j]);return{publishedHref:m,navigationPending:r,pendingHref:t,push:w,pushImmediate:x,replace:y,prefetch:j.prefetch,resolveAndPush:z,cancelPendingNavigation:v}}],476042)},215119,a=>a.a(async(b,c)=>{try{var d=a.i(341306),e=a.i(94701),f=a.i(23745),g=a.i(586220),h=a.i(411731),i=a.i(979031),j=a.i(586889),k=a.i(437253),l=a.i(606617),m=a.i(669991),n=a.i(588745),o=a.i(833895),p=a.i(435605),q=a.i(725931),r=a.i(476042),s=a.i(797692),t=b([p]);[p]=t.then?(await t)():t,a.s(["ShellFrame",0,function(a){let{view:b,activeServerId:c,frameHref:t,sidebar:u,children:v,extraDialogs:w,onOpenActiveServerSettings:x,onOpenActiveServerInvite:y}=a,z=(0,f.useQueryClient)(),A=(0,m.useCurrentUser)(),B=(0,s.useStructuralSnapshot)(A.id,z),C=(0,l.useCommunityWsStore)(a=>a.accessEpoch),D=(0,g.useBreakpoint)(),E=(0,h.useCommunityOnboarding)(),F={...(0,i.normalizeCommunityHref)(t),revision:0},G=(0,e.useRef)(F),[H,I]=(0,e.useState)(F),J=(0,e.useCallback)(a=>{let b=G.current,c=(0,i.advanceCommunityCommittedFrame)(b,a);c!==b&&(G.current=c,I(c))},[]);(0,e.useLayoutEffect)(()=>J(t),[J,t]);let K=(0,r.useCommunityNavigationController)(H),L=K.replace,M=(0,i.resolveCommunityRoute)(H.pathname),N=K.pendingHref?(0,i.normalizeCommunityHref)(K.pendingHref):null,O=N?.scope.kind==="server"?N.scope.serverId:null,P=O?B?.servers.find(a=>a.id===O):null,Q=O?void 0!==z.getQueryData(j.communityKeys.server(O))||!!(P&&(P.categories.length>0||P.channels.length>0)):N?.scope.kind==="me"&&void 0!==z.getQueryData(j.communityKeys.dms()),R=(0,i.resolveCommunityCheckpointPlan)({committedFrame:H,targetHref:K.pendingHref,pending:K.navigationPending,targetReady:Q}),S="target"===R.rail.kind?R.rail.view:b,T="target"===R.rail.kind?R.rail.activeServerId:c,U=(0,o.useShellRailController)({navigation:K,queryClient:z,breakpoint:D,view:b,activeServerId:c,projectedView:S,projectedActiveServerId:T,onOpenActiveServerSettings:x,onOpenActiveServerInvite:y,accountId:A.id}),V=(0,p.useShellProfileController)({router:K,queryClient:z,cancelPendingNavigation:K.cancelPendingNavigation,view:b,activeServerId:c}),W=(0,q.useShellInboxController)({router:K,queryClient:z,cancelPendingNavigation:K.cancelPendingNavigation,publishedHref:K.publishedHref,navigationPending:K.navigationPending,pendingHref:K.pendingHref,viewerId:A.id,accessEpoch:C}),X=(0,e.useCallback)(()=>{M.parentPath&&K.replace(M.parentPath)},[K,M.parentPath]);return(0,e.useEffect)(()=>{"mobile"===D&&E?.status==="active"&&"server"===E.stage&&"detail"===M.surface&&M.parentPath&&L(M.parentPath)},[D,E,L,M.parentPath,M.surface]),(0,e.useEffect)(()=>{k.useCommunityStore.getState().registerUiHandlers({previewImage:V.previewImage,previewAttachment:V.previewAttachment,openProfile:V.openProfile,goBackMobile:X,navigatePath:K.push,replacePath:K.replace,navigate:U.navigate,cancelPendingNavigation:K.cancelPendingNavigation})},[X,V.openProfile,V.previewAttachment,V.previewImage,U.navigate,K.cancelPendingNavigation,K.push,K.replace]),(0,d.jsx)(n.ShellFrameView,{breakpoint:D,checkpoint:R,sidebar:u,extraDialogs:w,cancelPendingNavigation:K.cancelPendingNavigation,rail:U,profile:V,inbox:W,children:v})}]),c()}catch(a){c(a)}},!1),725931,a=>{"use strict";var b=a.i(94701),c=a.i(586889),d=a.i(979031),e=a.i(991847),f=a.i(311785),g=a.i(730926),h=a.i(947820);a.i(735042);var i=a.i(412118),j=a.i(300036),k=a.i(487154),l=a.i(446827),m=a.i(333552),n=a.i(208847),o=a.i(178835),p=a.i(764081);function q(a,b,d,e=0){let{epoch:f,signal:g}=(0,p.beginConversationNavigationProof)(a,b,d,e);(0,p.registerConversationNavigationRecovery)(a,f,(c,d)=>{q(a,b,c,d)});let h=b.anchorMessageId?{mode:"anchor",anchor:b.anchorMessageId}:{mode:"newest"},i="dm"===b.scopeKind?c.communityKeys.dmMessages(b.channelId):c.communityKeys.channelMessages(b.channelId),j="dm"===b.scopeKind?(0,m.dmMessagesQueryFn)(b.channelId,{onSurfaceReceipt:b=>{(0,p.recordConversationNavigationReceipt)(a,b,d,f)}}):(0,m.channelMessagesQueryFn)(b.channelId,null,{onSurfaceReceipt:b=>{(0,p.recordConversationNavigationReceipt)(a,b,d,f)}});a.fetchInfiniteQuery({queryKey:i,queryFn:j,initialPageParam:h,staleTime:0}).then(()=>{(0,p.isCurrentConversationNavigation)(a,f,d)&&(0,p.commitConversationNavigationProof)(a,b.channelId,d)}).catch(e=>{let h,i;if(g.aborted)return;let j=e instanceof l.ApiError&&(403===e.status||404===e.status);j&&(h="dm"===b.scopeKind?c.communityKeys.dmMessages(b.channelId):c.communityKeys.channelMessages(b.channelId),i="dm"===b.scopeKind?c.communityKeys.dmReadStateSnapshot(b.channelId):c.communityKeys.channelReadStateSnapshot(b.channelId),a.removeQueries({queryKey:h}),a.removeQueries({queryKey:i}),b.serverId?a.removeQueries({queryKey:c.communityKeys.channelMeta(b.serverId,b.channelId)}):a.removeQueries({queryKey:c.communityKeys.dmRouteVerification(b.channelId)}),o.useMessageStreamStore.getState().removeScope("dm"===b.scopeKind?{kind:"dm",id:b.channelId}:{kind:"channel",id:b.channelId,serverId:b.serverId})),(0,p.failConversationNavigationProof)(a,f,d,j)});let r="dm"===b.scopeKind?c.communityKeys.dmReadStateSnapshot(b.channelId):c.communityKeys.channelReadStateSnapshot(b.channelId);return(0,k.apiFetch)(`/api/community/channels/${b.channelId}/read-state`,{signal:g}).then(b=>{(0,p.isCurrentConversationNavigation)(a,f,d)&&a.setQueryData(r,b)}).catch(()=>void 0),b.serverId&&(0,n.serverProjectedQueryFn)(a,b.serverId,g)().then(e=>{(0,p.isCurrentConversationNavigation)(a,f,d)&&a.setQueryData(c.communityKeys.server(b.serverId),e)}).catch(()=>void 0),f}a.s(["useShellInboxController",0,function({router:a,queryClient:k,cancelPendingNavigation:l,publishedHref:m,navigationPending:n,pendingHref:o,viewerId:r,accessEpoch:s}){let t=(0,b.useCallback)(b=>{a.pushImmediate?a.pushImmediate(b):a.push(b)},[a]),u=(0,e.useInboxUnreads)(),v=(0,e.useInboxMentions)(),w=u.servers,x=u.dms,y=v.mentions,z=u.isLoading||v.isLoading,[A,B]=(0,b.useState)(!1),[C,D]=(0,b.useState)("unreads"),E=(0,b.useRef)({unreads:0,mentions:0,marked:0}),F=(0,e.useInboxMarked)(A),{mutate:G}=(0,i.useUnmarkMessage)(),H=(0,i.useMarkAllInboxRead)(),I=(0,i.useDeleteMention)(),J=(0,g.useInboxAutoCollapse)({queryClient:k,publishedHref:m,navigationPending:n,pendingHref:o}),K=(0,b.useCallback)(a=>{D(a),"marked"===a&&B(!0)},[]),L=(0,b.useCallback)(a=>E.current[a],[]),M=(0,b.useCallback)((a,b)=>{E.current[a]=b},[]),N=(0,b.useCallback)((a,b,c,d,e)=>{let f=J.beginProjection(a,b);l(),(0,j.clearThreadOpenerReadHandoff)(k);let g=q(k,{...c,href:b,viewerId:r},s),i=b;try{i=d?.()??b,t(i),J.markProjectionSubmitted(f)&&e?.()}catch(b){(0,p.cancelConversationNavigationProof)(k,g);let a=new URLSearchParams(i.split("?")[1]??"").get("inboxThreadOpener");throw a&&(0,h.terminateThreadOpenerReservationHandoff)(k,a),J.isLatestProjection(f)&&(l(),J.rollbackProjection(f,!0)),b}},[s,l,J,t,k,r]),O=(0,b.useCallback)((a,b,c)=>{let e=(0,d.channelHref)(a.serverId,b.channelId),f=c?(0,h.inboxChannelRowTarget)(a,b):null;if(!f){let c=J.closeWithoutProjection();l(),(0,j.clearThreadOpenerReadHandoff)(k);let d=q(k,{href:e,viewerId:r,channelId:b.channelId,serverId:a.serverId,scopeKind:"channel",expectedSurfaceKind:"forum"===b.type?"forum":"channel"},s);try{t(e)}catch(a){throw(0,p.cancelConversationNavigationProof)(k,d),l(),J.onOpenChange(c),a}return}N(f,e,{channelId:b.channelId,serverId:a.serverId,scopeKind:"channel",expectedSurfaceKind:"forum"===b.type?"forum":"channel"})},[s,l,J,t,N,k,r]),P=(0,b.useCallback)((a,b,c)=>{let e=(0,h.inboxThreadRowTarget)(a,b,c),f=(0,d.channelHref)(a.serverId,c.channelId);N(e,f,{channelId:c.channelId,serverId:a.serverId,scopeKind:"channel",expectedSurfaceKind:"thread"},()=>c.openerMessageId&&!0===c.openerUnread&&void 0!==c.openerSeq?(0,j.armThreadOpenerReadHandoff)(k,{serverId:a.serverId,parentChannelId:c.parentChannelId??b.channelId,childChannelId:c.channelId,openerMessageId:c.openerMessageId,openerSeq:c.openerSeq}):f)},[N,k]),Q=(0,b.useCallback)(a=>{let b=J.closeWithoutProjection();l(),(0,j.clearThreadOpenerReadHandoff)(k);let c=null!=a.m.seq?`?seq=${a.m.seq}`:"",e=a.serverId?`${(0,d.channelHref)(a.serverId,a.channelId)}${c}`:`/c/me/${a.channelId}${c}`,f=q(k,{href:e,viewerId:r,channelId:a.channelId,...a.serverId?{serverId:a.serverId}:{},scopeKind:a.serverId?"channel":"dm",...a.serverId?{anchorMessageId:a.m.id}:{},...!a.serverId?{expectedSurfaceKind:"dm"}:{}},s);try{t(e)}catch(a){throw(0,p.cancelConversationNavigationProof)(k,f),l(),J.onOpenChange(b),a}},[s,l,J,t,k,r]),R=(0,b.useCallback)(a=>{let b=a.channelId;N((0,h.inboxDmRowTarget)(a),`/c/me/${b}`,{channelId:b,scopeKind:"dm",expectedSurfaceKind:"dm"},()=>{k.setQueryData(c.communityKeys.dms(),b=>{var c=b,d={id:a.channelId,userId:a.otherUserId,name:a.otherUserName,discriminator:a.otherUserDiscriminator,avatar:a.otherUserAvatar,avatarVersion:a.otherUserAvatarVersion,status:"offline",preview:"",unread:!1};if(!c)return{conversations:[d]};let e=c.conversations.findIndex(a=>a.id===d.id);return e<0?{...c,conversations:[d,...c.conversations]}:{...c,conversations:c.conversations.map((a,b)=>b===e?{...a,...d,status:a.status,preview:a.preview}:a)}})},()=>{(0,f.startDmRouteVerification)(k,b).catch(()=>void 0)})},[N,k]),S=(0,b.useCallback)(a=>{let b=(0,h.inboxMentionRowTarget)(a);b&&a.serverId&&a.channelId&&N(b,`${(0,d.channelHref)(a.serverId,a.channelId)}?msg=${a.m.id}`,{channelId:a.channelId,serverId:a.serverId,scopeKind:"channel",anchorMessageId:a.m.id})},[N]);return{popoverProps:{unreads:w,unreadDms:x,mentions:y,marked:F.marked,markedLoading:F.isLoading,loading:z,hasProjectedUnreads:u.hasProjectedUnread,hasProjectedMentions:v.hasProjectedMention,onOpenChannel:O,onOpenThread:P,onOpenDm:R,onOpenMention:S,onOpenMarked:Q,activeTab:C,onActiveTabChange:K,onMarkedTabSelected:()=>B(!0),getScrollOffset:L,onScrollOffsetChange:M,onMarkAllRead:()=>{H.mutate()},onDeleteMention:a=>I.mutate({mentionId:a}),onUnmark:a=>G({messageId:a}),isProjected:J.isProjected},hasUnread:u.hasProjectedUnread||v.hasProjectedMention,open:J.open,onOpenChange:J.onOpenChange}}],725931)},435605,a=>a.a(async(b,c)=>{try{var d=a.i(94701);a.i(974936);var e=a.i(448305),f=a.i(990061),g=a.i(487154),h=a.i(586889),i=a.i(129645),j=a.i(166281),k=a.i(145723),l=a.i(454607),m=a.i(9777),n=a.i(530479),o=a.i(869102),p=a.i(437253),q=a.i(606617),r=a.i(178835),s=a.i(669991),t=a.i(836595),u=a.i(258365);a.i(735042);var v=a.i(84610),w=a.i(282054),x=a.i(473767),y=b([l]);function z(a,b){q.useCommunityWsStore.getState().commitProfiles(a,[{id:b.id,identityAbout:{name:b.name,discriminator:b.discriminator,aboutMe:b.aboutMe,bannerColor:b.bannerColor},avatar:{avatar:b.avatar,avatarVersion:b.avatarVersion},status:{statusEmoji:b.statusEmoji,statusText:b.statusText}}])}[l]=y.then?(await y)():y,a.s(["useShellProfileController",0,function({router:a,queryClient:b,cancelPendingNavigation:c,view:y,activeServerId:A}){let B=(0,s.useCurrentUser)(),{friends:C}=(0,t.useFriends)(),D=(0,k.resolveProfileServerId)(y,A),{members:E}=(0,u.useServerMembers)(D),F=(0,v.useCreateOrGetDm)(),{accept:G}=(0,x.useDmMessageSender)(),H=(0,w.useUpdateProfile)(),I=(0,w.useUploadUserAvatar)(),[J,K]=(0,d.useState)(!1),[L,M]=(0,d.useState)(null),[N,O]=(0,d.useState)(null),[P,Q]=(0,d.useState)(null),[R,S]=(0,d.useState)(null),T=(0,d.useCallback)((a,c,d,e,f)=>{if(f&&f===B.id){let a=D?E.find(a=>a.userId===B.id):void 0;M({data:{userId:B.id,contextLabel:(0,k.resolveProfileContextLabel)(D,a),mutual:0,identity:{kind:"human"}},x:c,y:d});return}let j=(0,k.resolveProfileTarget)(E,C,{name:a,discriminator:e,userId:f}),l=(0,k.resolveProfileUserId)(j,f);M({data:{...l?{userId:l}:{name:a,discriminator:e},contextLabel:(0,k.resolveProfileContextLabel)(D,j),mutual:0},x:c,y:d}),l&&b.fetchQuery({queryKey:h.communityKeys.profile(l),queryFn:(0,i.userProfileQueryFn)(l),staleTime:i.PROFILE_STALE_TIME_MS}).then(a=>{M(b=>b?.data.userId===a.id?{...b,data:{...b.data,mutual:a.mutualServers??0,identity:"bot"===a.kind?{kind:"bot",ownerProfile:a.ownerProfile,ownedByViewer:a.ownedByViewer}:{kind:"human"}}}:b)}).catch(a=>(0,g.toastApiError)(a,"Failed to load profile"))},[B,C,E,D,b]),U=(0,d.useCallback)((a,b,c,d)=>{T(a,b.clientX,b.clientY,c,d)},[T]),V=(0,d.useCallback)(a=>{if(!L)return;let b=(0,e.parseNameAndTag)(a.handle);b&&T(b.name,L.x,L.y,b.discriminator,a.id)},[T,L]),W=(0,d.useCallback)(b=>{c(),a.push(`/c/me/bots?audit=${encodeURIComponent(b)}`),M(null)},[c,a]),X=(0,d.useCallback)(a=>O(a),[]),Y=(0,d.useCallback)(a=>Q(a),[]),Z=async(a,b)=>{try{let c=q.useCommunityWsStore.getState().beginProfileSnapshot(),d=await H.mutateAsync({statusEmoji:a,statusText:b});z(c,d)}catch(a){(0,g.toastApiError)(a,"Failed to update status")}},$=async(b,d)=>{let e;if(!b)return void(0,f.toast)("Could not find user");try{e=(await F.mutateAsync({userId:b})).conversation.id}catch(a){(0,g.toastApiError)(a,"Failed to open DM");return}let h=d.trim();if(h){let a=G({dmId:e,content:h,author:{id:B.id,name:B.name,avatar:B.avatar}});if(!a.accepted)return void(0,f.toast)("Failed to send message");a.committed}c(),a.push(`/c/me/${e}`)},_=async a=>{try{let b=q.useCommunityWsStore.getState().beginProfileSnapshot(),c=await H.mutateAsync(a);z(b,c)}catch(a){(0,g.toastApiError)(a,"Failed to save profile")}},aa=()=>{c(),p.useCommunityStore.getState().reset(),q.useCommunityWsStore.getState().reset(),r.useMessageStreamStore.getState().resetAll(),(0,o.disposeReadCoordinator)(b),(0,n.disposeAccountReadStateReconciliation)(b),b.clear()},ab=async()=>{aa(),await (0,l.signOut)(),await (0,m.clearPersistedCache)(B.id).catch(()=>{}),a.push("/sign-in")},ac=async()=>{aa(),await (0,m.clearPersistedCache)(B.id).catch(()=>{}),K(!1),globalThis.location.replace(g.ACCOUNT_DELETED_SIGN_IN_PATH)},ad={onClose:()=>K(!1),userId:B.id,userName:B.name,userEmail:B.email,aboutMe:B.aboutMe??"",avatar:B.avatar,statusEmoji:B.statusEmoji,statusText:B.statusText,onUploadAvatar:()=>{let a=document.createElement("input");a.type="file",a.accept="image/png,image/jpeg,image/webp",a.onchange=()=>{let b=a.files?.[0];if(!b)return;let c=(0,j.validateIconSourceFile)(b);c.ok?S({src:URL.createObjectURL(b),fileName:b.name}):(0,f.toast)(c.error)},a.click()},onSave:_,onLogout:ab,onAccountDeleted:ac},ae=null;return R&&(ae={imageSrc:R.src,originalFileName:R.fileName,onCropped:a=>{I.mutate({file:a},{onSuccess:a=>{let b=q.useCommunityWsStore.getState();b.patchProfiles(b.beginProfileSnapshot(),[{id:B.id,avatar:{avatar:a.url,avatarVersion:a.avatarVersion}}]),(0,f.toast)("Avatar updated")},onError:a=>(0,g.toastApiError)(a,"Failed to upload avatar")}),URL.revokeObjectURL(R.src),S(null)},onCancel:()=>{URL.revokeObjectURL(R.src),S(null)}}),{currentUser:B,openProfile:U,openOwnerProfile:V,openBotAudit:W,previewImage:X,previewAttachment:Y,profile:L,closeProfile:()=>M(null),profileMessage:$,updateOwnStatus:Z,preview:N,closePreview:()=>O(null),attachmentPreview:P,onAttachmentPreviewOpenChange:a=>{a||Q(null)},editingProfile:J,openUserSettings:()=>K(!0),onUserSettingsOpenChange:a=>{a||K(!1)},userSettingsProps:ad,pendingAvatarCrop:ae}}]),c()}catch(a){c(a)}},!1),833895,a=>{"use strict";var b=a.i(94701),c=a.i(990061),d=a.i(487154),e=a.i(586889),f=a.i(652457),g=a.i(504125),h=a.i(208847),i=a.i(808747),j=a.i(66957),k=a.i(606617);let l=Object.freeze([]),m=async()=>{let a=k.useCommunityWsStore.getState(),b={viewerId:a.profileViewerId,accountEpoch:a.profileAccountEpoch,accessEpoch:a.accessEpoch},c=await (0,d.apiFetch)("/api/community/users/me/server-folders"),e=k.useCommunityWsStore.getState();if(e.profileViewerId!==b.viewerId||e.profileAccountEpoch!==b.accountEpoch||e.accessEpoch!==b.accessEpoch)throw new DOMException("Stale structural query","AbortError");return{folders:c.folders.map(a=>({id:a.id,name:a.name,position:a.position??0,servers:a.servers.map(a=>({id:a.id,name:a.name,initial:(0,j.avatarInitial)(a.name),icon:a.icon??null}))}))}};a.i(735042);var n=a.i(91883),o=a.i(47363),p=a.i(206375),q=a.i(437253);function r({targetServerId:a,activeServerId:b,overlay:c,hasActiveOpener:d}){return a===b&&d?{kind:"open-active"}:{kind:"navigate",href:`/c/channels/${a}?${c}=1`}}var s=a.i(797692),t=a.i(664789);a.s(["useShellRailController",0,function({navigation:a,queryClient:j,breakpoint:k,view:u,projectedView:v=u,activeServerId:w,projectedActiveServerId:x,onOpenActiveServerSettings:y,onOpenActiveServerInvite:z,accountId:A}){let B,C=(0,s.useStructuralSnapshot)(A??null,j),D=(0,h.useServers)(),E={...B=(0,i.useQuery)({queryKey:e.communityKeys.folders(),queryFn:m}),folders:B.data?.folders??l},F=void 0!==D.data||!A,G=F?D.servers:(0,t.structuralSnapshotServers)(C),H=E.data?.folders??(A?(0,t.structuralSnapshotFolders)(C):E.folders),I=(0,q.useCommunityStore)(a=>a.currentServerId),{mutateAsync:J}=(0,n.useCreateServer)(),{mutate:K}=(0,n.useLeaveServer)(),{mutate:L}=(0,n.useUploadServerIcon)(),M=(0,b.useMemo)(()=>G.map(a=>({...a,active:a.id===x})),[x,G]),N=(0,b.useCallback)(a=>{let b=j.getQueryData(e.communityKeys.server(a)),c=b?.categories.flatMap(a=>a.channels.filter(a=>!a.pending).map(a=>a.id))??C?.servers.find(b=>b.id===a)?.channels.map(a=>a.id)??[];return(0,o.pickServerLandingHref)(a,c,(0,o.getLastChannel)(a))},[j,C]),O=(0,b.useCallback)(async a=>{let b=`/c/channels/${a}`,c=N(a);if(c!==b)return c;try{await j.fetchQuery({queryKey:e.communityKeys.server(a),queryFn:(0,h.serverProjectedQueryFn)(j,a),staleTime:1/0})}catch{return b}return N(a)},[j,N]),P=(0,b.useCallback)(b=>{(0,f.markSwitch)("server",b),a.push(`/c/channels/${b}`)},[a]),Q=(0,b.useCallback)(()=>"desktop"===k?(0,p.pickMeLandingLocation)((0,p.getLastMeLeaf)()):p.ME_ROOT,[k]),R=(0,b.useCallback)(()=>{a.push(Q())},[Q,a]),S=(0,b.useCallback)(b=>{O(b).then(b=>a.prefetch(b))},[a,O]),T=(0,b.useCallback)(()=>a.prefetch(Q()),[Q,a]),U=(0,b.useCallback)(async(b,e)=>{try{let f=(await J({name:b})).server.id;(0,c.toast)(`Server "${b}" created`),e&&L({serverId:f,file:e},{onError:a=>(0,d.toastApiError)(a,"Server created, but the icon failed to upload")}),a.push(`/c/channels/${f}`)}catch(a){(0,d.toastApiError)(a,"Failed to create server")}},[J,a,L]),V=(0,b.useCallback)(b=>{(0,g.markVoluntaryLeave)(b),K({serverId:b},{onSuccess:()=>{(0,c.toast)("Left server"),I===b&&a.replace((0,g.pickPostEjectDestination)(G,b))},onError:a=>(0,d.toastApiError)(a,"Failed to leave server")})},[I,K,a,G]),W=(0,b.useCallback)(b=>{if(!b)return;let c=r({targetServerId:b,activeServerId:w,overlay:"settings",hasActiveOpener:!!y});"open-active"===c.kind?y?.():a.push(c.href)},[w,a,y]),X=(0,b.useCallback)(b=>{if(!b)return;let c=r({targetServerId:b,activeServerId:w,overlay:"invite",hasActiveOpener:!!z});"open-active"===c.kind?z?.():a.push(c.href)},[w,a,z]),Y=(0,b.useCallback)((b,c)=>{((0,f.markSwitch)(c?"channel":"server",c??b),c)?a.push(`/c/channels/${b}/${c}`):a.push(N(b))},[a,N]);return{railProps:{servers:M,folders:H,activeServerId:x,serversLoading:D.isPending&&!C,view:v,onHome:R,onHomePrefetch:T,onServerNavigate:P,onServerPrefetch:S,onCreateServer:U,onLeaveServer:F?V:void 0,onOpenSettings:F?W:void 0,onOpenInvitePopover:F?X:void 0},navigate:Y}}],833895)},145723,a=>{"use strict";a.s(["resolveProfileContextLabel",0,function(a,b){if(a&&b&&"role"in b)return b.role.charAt(0).toUpperCase()+b.role.slice(1)},"resolveProfileServerId",0,function(a,b){return"server"===a?b??null:null},"resolveProfileTarget",0,function(a,b,c){let{name:d,discriminator:e,userId:f}=c;return(f?(a??[]).find(a=>a.userId===f)??(b??[]).find(a=>a.userId===f):void 0)??(e?(a??[]).find(a=>a.name===d&&a.discriminator===e)??(b??[]).find(a=>a.name===d&&a.discriminator===e):void 0)??(a??[]).find(a=>a.name===d)??(b??[]).find(a=>a.name===d)},"resolveProfileUserId",0,function(a,b){return a?.userId??b}])},300036,a=>{"use strict";var b=a.i(94701),c=a.i(823417),d=a.i(23745),e=a.i(669991),f=a.i(979031),g=a.i(869102),h=a.i(947820);let i="inboxThreadOpener",j=0;a.s(["THREAD_OPENER_HANDOFF_PARAM",0,i,"armThreadOpenerReadHandoff",0,function(a,b){let c="u">typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():(j+=1,`opener-${j}`);(0,h.armThreadOpenerReservationHandoff)(a,{...b,nonce:c});let d=(0,f.channelHref)(b.serverId,b.childChannelId);return`${d}?${i}=${encodeURIComponent(c)}`},"clearThreadOpenerReadHandoff",0,function(a){(0,h.clearThreadOpenerReservationHandoff)(a)},"useClaimThreadOpenerReadHandoff",0,function(a){let j=(0,d.useQueryClient)(),k=(0,e.useCurrentUser)(),l=(0,c.useRouter)(),m=(0,c.useSearchParams)(),n=(0,b.useRef)(null),o=(0,b.useRef)(null),p=(0,b.useRef)(0);(0,b.useLayoutEffect)(()=>{if(!a||o.current===a.nonce)return;n.current&&((0,g.releaseReadSurface)(n.current),n.current=null,o.current=null);let b=(0,h.getThreadOpenerReservationHandoff)(j,a.nonce);if(!b||b.serverId!==a.serverId||b.parentChannelId!==a.parentChannelId||b.childChannelId!==a.childChannelId||b.openerMessageId!==a.openerMessageId||b.openerSeq!==a.openerSeq)return void(0,h.terminateThreadOpenerReservationHandoff)(j,a.nonce);let c=(0,g.registerReadSurface)(j,k.id,{kind:"timeline",channelId:b.parentChannelId},0,"cancel-uncommitted"),d=(0,g.submitReadIntentGeneration)(c,{kind:"timeline",channelId:b.parentChannelId,messageId:b.openerMessageId,seq:b.openerSeq});if(null===d){(0,g.releaseReadSurface)(c),(0,h.terminateThreadOpenerReservationHandoff)(j,b.nonce);return}n.current=c,o.current=b.nonce,(0,h.completeThreadOpenerReservationHandoff)(j,b.nonce,d);let e=m.toString(),p=`${(0,f.channelHref)(b.serverId,b.childChannelId)}${e?`?${e}`:""}`;l.replace((0,f.removeCommunityParam)(p,i),{scroll:!1})},[k.id,j,l,m,a]),(0,b.useLayoutEffect)(()=>(p.current+=1,()=>{let a=++p.current,b=n.current;b&&queueMicrotask(()=>{p.current===a&&n.current===b&&(n.current=null,o.current=null,(0,g.releaseReadSurface)(b))})}),[j])},"useThreadOpenerRouteGate",0,function({serverId:a,childChannelId:e,parentChannelId:g,openerMessageId:j,lifecycle:k}){let l=(0,d.useQueryClient)(),m=(0,c.useRouter)(),n=(0,c.usePathname)(),o=(0,c.useSearchParams)(),p=o.get(i),q=p?(0,h.getThreadOpenerReservationHandoff)(l,p):null,r=(0,b.useCallback)(()=>{if(!p)return;let b=o.toString(),c=`${(0,f.channelHref)(a,e)}${b?`?${b}`:""}`;m.replace((0,f.removeCommunityParam)(c,i),{scroll:!1})},[e,p,m,o,a]),s=!!q&&q.serverId===a&&q.childChannelId===e,t=n===(0,f.channelHref)(a,e),u=s&&"ready"===k&&q.parentChannelId===g&&q.openerMessageId===j;return(0,b.useLayoutEffect)(()=>{if(!p||!t)return;let b=(0,h.registerThreadOpenerRouteLease)(l,p,a,e);return()=>(0,h.releaseThreadOpenerRouteLease)(b)},[e,p,l,t,a]),(0,b.useLayoutEffect)(()=>{if(p&&t&&(!s||"terminal-error"===k||"ready"===k&&!u)){(0,h.terminateThreadOpenerReservationHandoff)(l,p),r();return}},[u,r,k,p,l,t,s]),t&&u&&q?q:null}])},311785,a=>{"use strict";var b=a.i(94701),c=a.i(808747),d=a.i(23745),e=a.i(487154),f=a.i(586889);function g(a,b){return{queryKey:f.communityKeys.dmRouteVerification(b),queryFn:()=>(0,e.apiFetch)("/api/community/users/me/dms",{headers:{"X-Alook-DM-Route-Verification":"1"}}).then(c=>(a.setQueryData(f.communityKeys.dms(),c),c.conversations.some(a=>a.id===b)?"present":"missing"),a=>{let b;if("denied"==(403===(b="object"==typeof a&&null!==a&&"status"in a?a.status:void 0)||404===b?"denied":"error"))return"denied";throw a}),retry:!1,refetchOnReconnect:!1,refetchOnWindowFocus:!1,retryOnMount:!1}}a.s(["startDmRouteVerification",0,function(a,b){let c=a.getQueryData(f.communityKeys.dms());return c?.conversations.some(a=>a.id===b)?Promise.resolve("present"):a.fetchQuery({...g(a,b),staleTime:0})},"useDmRouteVerification",0,function(a,e,h){let i=(0,d.useQueryClient)(),j=i.getQueryData(f.communityKeys.dms()),k=!!a&&(e.some(b=>b.id===a)||j?.conversations.some(b=>b.id===a)===!0),l=g(i,a??"__none__"),m=i.getQueryState(l.queryKey),n=void 0!==m&&("fetching"===m.fetchStatus||m.dataUpdatedAt>0||m.errorUpdatedAt>0),o=(0,c.useQuery)({...l,enabled:!!a&&!k&&(!h||n),staleTime:1/0}),p=(0,b.useCallback)(()=>{a&&"fetching"!==o.fetchStatus&&o.refetch()},[a,o]);(0,b.useEffect)(()=>{if(a)return()=>{let b=f.communityKeys.dmRouteVerification(a);queueMicrotask(()=>{let a=i.getQueryCache().find({queryKey:b,exact:!0});a?.getObserversCount()===0&&i.removeQueries({queryKey:b,exact:!0})})}},[a,i]);let q="pending";return a?k||"present"===o.data?q="present":"missing"===o.data||"denied"===o.data?q="missing":o.isError&&(q="error"):q="idle",{status:q,retry:p,retrying:"fetching"===o.fetchStatus}}])},504125,a=>{"use strict";var b=a.i(446827),c=a.i(82299);let d=new Set;function e(a,b){let c=a.filter(a=>a.id!==b);return 0===c.length?"/c/me":`/c/channels/${c[0].id}`}a.s(["consumeVoluntaryLeave",0,function(a){return d.delete(a)},"isDefinitiveChildMetaFailure",0,function(a){return a instanceof b.ApiError&&(403===a.status||404===a.status)},"markVoluntaryLeave",0,function(a){d.add(a)},"pickPostEjectDestination",0,e,"runAuthoritativeServerEject",0,function(a){if(!a.isSuccess||a.isFetching||a.servers.some(b=>b.id===a.serverId))return!1;a.clearLastChannel(a.serverId),a.consumeVoluntaryLeave(a.serverId)||a.toast("You're no longer in this server");let b=!!a.accountId&&!!a.routeHref&&(0,c.consumeCommunityColdEntryFailure)(a.accountId,a.routeHref);return a.replace(b?c.COMMUNITY_COLD_ENTRY_FALLBACK:e(a.servers,a.serverId)),!0}])},652457,a=>{"use strict";var b=a.i(994188);a.s(["markSwitch",0,function(a,c){(0,b.perfTraceEnabled)()}])}];
|
|
1
|
+
module.exports=[474840,585786,a=>{"use strict";let b="col-start-1 row-start-2 flex min-w-0 items-center gap-1 px-2 thin-scrollbar sm:row-span-2 sm:row-start-1 sm:w-44 sm:flex-col sm:items-stretch sm:gap-2 sm:overflow-y-auto sm:p-4",c="h-11 min-w-0 flex-1 flex-row justify-start gap-1 overflow-hidden p-0 group-data-horizontal/tabs:h-11 sm:h-auto sm:w-full sm:flex-none sm:flex-col",d="size-11 justify-center gap-2 px-0 sm:h-9 sm:w-full sm:justify-start sm:px-2",e="sr-only sm:not-sr-only sm:min-w-0 sm:truncate sm:px-2 sm:pt-1 sm:text-xs sm:font-medium sm:text-muted-foreground",f="flex shrink-0 gap-1 sm:mt-auto sm:w-full sm:flex-col sm:border-t sm:border-border/60 sm:pt-2";a.s(["SETTINGS_LOGOUT_CLASS",0,"size-11 shrink-0 justify-center text-destructive hover:text-destructive sm:h-9 sm:w-full sm:justify-start","SETTINGS_NAV_CLASS",0,b,"SETTINGS_NAV_FOOTER_CLASS",0,f,"SETTINGS_NAV_LABEL_CLASS",0,e,"SETTINGS_TABS_LIST_CLASS",0,c,"SETTINGS_TAB_CLASS",0,d],474840);var g=a.i(341306),h=a.i(69776),i=a.i(732254),j=a.i(654461),k=a.i(586220),l=a.i(692);a.s(["SettingsShell",0,function({value:a,onValueChange:m,label:n,title:o,tabs:p,onClose:q,navFooter:r,disabled:s=!1,children:t}){let u=(0,k.useBreakpoint)();return(0,g.jsxs)(j.Tabs,{orientation:"mobile"===u?"horizontal":"vertical",value:a,onValueChange:a=>m(a),className:"grid min-h-0 flex-1 grid-cols-1 grid-rows-[4rem_auto_minmax(0,1fr)] gap-0 sm:grid-cols-[11rem_minmax(0,1fr)] sm:grid-rows-[4rem_minmax(0,1fr)]","data-testid":l.tid.settingsShell,children:[(0,g.jsxs)("header",{className:"col-start-1 row-start-1 flex h-16 min-w-0 items-center px-4 sm:col-start-2 sm:px-8",children:[(0,g.jsx)("h1",{className:"min-w-0 flex-1 truncate text-lg font-medium tracking-tight",children:o}),(0,g.jsx)(i.Button,{variant:"ghost",size:"icon-sm",className:"size-11 sm:size-8",onClick:q,disabled:s,"aria-label":"Close settings","data-testid":l.tid.settingsClose,children:(0,g.jsx)(h.X,{className:"size-4"})})]}),(0,g.jsxs)("nav",{className:b,style:{background:"var(--d-rail)"},"data-testid":l.tid.settingsNav,children:[(0,g.jsx)("div",{className:e,"data-testid":l.tid.settingsLabel,children:n}),(0,g.jsx)(j.TabsList,{variant:"line",className:c,children:p.map(({value:a,label:b,icon:c})=>(0,g.jsxs)(j.TabsTrigger,{value:a,disabled:s,className:d,"data-testid":l.tid.settingsTab(a),children:[(0,g.jsx)(c,{className:"size-4"}),(0,g.jsx)("span",{className:"sr-only sm:not-sr-only",children:b})]},a))}),r?(0,g.jsx)("div",{className:f,children:r}):null]}),(0,g.jsx)("div",{className:"col-start-1 row-start-3 min-h-0 min-w-0 overflow-y-auto bg-background px-4 pt-2 pb-4 thin-scrollbar sm:col-start-2 sm:row-start-2 sm:p-8 sm:pt-4","data-testid":l.tid.settingsContent,children:t})]})},"SettingsShellPanel",0,function(a){return(0,g.jsx)(j.TabsContent,{...a,keepMounted:!0})}],585786)},588745,a=>{"use strict";var b=a.i(341306),c=a.i(156854),d=a.i(47564),e=a.i(684589),f=a.i(71414),g=a.i(490228),h=a.i(747686),i=a.i(432340),j=a.i(94701),k=a.i(990061),l=a.i(487154),m=a.i(767401),n=a.i(987644),o=a.i(994514);let p=(0,o.default)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);var q=a.i(353393),r=a.i(748103),s=a.i(97641);let t=(0,o.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var u=a.i(278566),v=a.i(533337),w=a.i(319890),x=a.i(732254),y=a.i(27647),z=a.i(22902),A=a.i(75118);let B="May 22, 2026",C="underline decoration-foreground/30 underline-offset-3 transition-colors hover:decoration-foreground/60";function D({className:a}){return(0,b.jsxs)("div",{className:(0,A.cn)(a),"data-privacy-policy":B,children:[(0,b.jsxs)("p",{className:"mb-12 text-sm text-muted-foreground",children:["Last updated: ",B]}),(0,b.jsxs)("div",{className:"prose prose-neutral max-w-none space-y-8 text-[1.0625rem] leading-relaxed dark:prose-invert",children:[(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Interpretation and Definitions"}),(0,b.jsxs)("p",{className:"text-foreground/80",children:['In this Privacy Policy, "Company" (referred to as "We", "Us", or "Our") refers to Alook AI. "Service" refers to the Alook platform accessible at'," ",(0,b.jsx)("a",{href:"https://alook.ai",className:C,children:"alook.ai"}),'. "You" means the individual accessing or using our Service. "Personal Data" is any information that relates to an identified or identifiable individual.']})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Collecting and Using Your Personal Data"}),(0,b.jsx)("h3",{className:"mt-8 mb-3 text-lg font-medium",children:"Types of Data Collected"}),(0,b.jsx)("h4",{className:"mt-6 mb-2 text-base font-medium",children:"Personal Data"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"While using Our Service, We may ask You to provide Us with certain personally identifiable information that can be used to contact or identify You, including but not limited to:"}),(0,b.jsxs)("ul",{className:"mt-3 list-disc space-y-2 pl-6 text-foreground/80",children:[(0,b.jsx)("li",{children:"Email address"}),(0,b.jsx)("li",{children:"Name"}),(0,b.jsx)("li",{children:"Usage data"})]}),(0,b.jsx)("h4",{className:"mt-6 mb-2 text-base font-medium",children:"Usage Data"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"Usage Data is collected automatically when using the Service. It may include information such as Your device's IP address, browser type, browser version, the pages of our Service that You visit, the time and date of Your visit, the time spent on those pages, and other diagnostic data."}),(0,b.jsx)("h4",{className:"mt-6 mb-2 text-base font-medium",children:"Information from Third-Party Social Login"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"Alook allows You to create an account and log in through third-party services including Google and GitHub. If You decide to register through or grant us access to a third-party service, We may collect Personal Data already associated with Your account, such as Your name and email address."}),(0,b.jsx)("h4",{className:"mt-6 mb-2 text-base font-medium",children:"Tracking Technologies and Cookies"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"We use cookies and similar tracking technologies to track activity on Our Service and store certain information. These are used to analyze trends, administer the site, and gather demographic information. You can instruct Your browser to refuse all cookies or to indicate when a cookie is being sent."})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Use of Your Personal Data"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"We may use Your Personal Data for the following purposes:"}),(0,b.jsxs)("ul",{className:"mt-3 list-disc space-y-2 pl-6 text-foreground/80",children:[(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"To provide and maintain our Service"}),", including processing and delivering AI agent tasks on your behalf."]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"To manage Your Account"})," and provide You with access to functionalities of the Service available to registered users."]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"To contact You"})," by email or other equivalent forms of electronic communication regarding updates or informative communications related to the Service."]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"To manage Your requests"})," and attend to any requests You make to Us."]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"For business transfers"})," in connection with any merger, sale of company assets, financing, or acquisition of all or a portion of Our business."]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"For other purposes"})," such as data analysis, identifying usage trends, and improving our Service."]})]})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Sharing Your Personal Data"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"We may share Your personal information in the following situations:"}),(0,b.jsxs)("ul",{className:"mt-3 list-disc space-y-2 pl-6 text-foreground/80",children:[(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"With Service Providers:"})," We share data with third-party AI model providers to power agent capabilities. Data sent to these providers is governed by their respective privacy policies. We minimize the data shared and only send what is necessary to fulfill Your requests."]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"For business transfers:"})," In connection with a merger, acquisition, or asset sale, Your Personal Data may be transferred."]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{children:"With Your consent:"})," We may disclose Your personal information for any other purpose with Your consent."]})]}),(0,b.jsx)("p",{className:"mt-4 text-foreground/80",children:"We do not sell Your Personal Data to third parties."})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Retention of Your Personal Data"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"We will retain Your Personal Data only for as long as is necessary for the purposes set out in this Privacy Policy. We will retain and use Your data to the extent necessary to comply with our legal obligations, resolve disputes, and enforce our agreements."}),(0,b.jsx)("p",{className:"mt-4 text-foreground/80",children:"Usage Data is generally retained for a shorter period of time, except when it is used to strengthen security or improve the functionality of Our Service."})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Security of Your Personal Data"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"The security of Your Personal Data is important to Us. Your data is stored securely using industry-standard encryption. Agent workspaces are isolated per user. However, no method of transmission over the Internet or method of electronic storage is 100% secure. While We strive to use commercially acceptable means to protect Your Personal Data, We cannot guarantee its absolute security."})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Children's Privacy"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"Our Service does not address anyone under the age of 13. We do not knowingly collect personally identifiable information from anyone under the age of 13. If You are a parent or guardian and You are aware that Your child has provided Us with Personal Data, please contact Us. If We become aware that We have collected Personal Data from anyone under the age of 13 without verification of parental consent, We will take steps to remove that information."})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Your Data Rights"}),(0,b.jsx)("p",{className:"text-foreground/80",children:"You have the right to access, update, or delete Your Personal Data at any time. You can manage certain information through Your Account settings, or contact Us directly to request assistance with these actions."})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Changes to This Privacy Policy"}),(0,b.jsx)("p",{className:"text-foreground/80",children:'We may update Our Privacy Policy from time to time. We will notify You of any changes by posting the new Privacy Policy on this page and updating the "Last updated" date at the top. You are advised to review this Privacy Policy periodically for any changes.'})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Contact Us"}),(0,b.jsxs)("p",{className:"text-foreground/80",children:["If you have any questions about this Privacy Policy, You can contact us at"," ",(0,b.jsx)("a",{href:"mailto:support@alook.ai",className:C,children:"support@alook.ai"}),"."]})]})]})]})}var E=a.i(9777),F=a.i(692),G=a.i(131033);function H({label:a,children:c}){return(0,b.jsxs)("fieldset",{className:"min-w-0",children:[(0,b.jsx)("legend",{className:"mb-1.5 text-xs text-muted-foreground",children:a}),c]})}var I=a.i(230977),J=a.i(190601),K=a.i(474840),L=a.i(585786);let M=(0,o.default)("mail-warning",[["path",{d:"M22 10.5V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h12.5",key:"e61zoh"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"M20 14v4",key:"1hm744"}],["path",{d:"M20 22v.01",key:"12bgn6"}]]);var N=a.i(442491),O=a.i(949831),P=a.i(610566);async function Q(a){try{switch((await a.json()).error){case"INVALID_OTP":return"That code is incorrect. Try again.";case"OTP_EXPIRED":return"That code expired. Send a new code.";case"TOO_MANY_ATTEMPTS":return"Too many incorrect attempts. Send a new code.";case"RATE_LIMITED":return"Too many requests. Try again when the timer ends.";case"CODE_SEND_FAILED":return"We couldn’t send the code. Try again.";case"ACCOUNT_DELETION_FAILED":return"Your account wasn’t deleted. Try again."}}catch{}return"Something went wrong. Try again."}function R({email:a,onCancel:c,onDeleted:d}){let[e,f]=(0,j.useState)("notice"),[g,h]=(0,j.useState)(""),[i,k]=(0,j.useState)(!1),[m,n]=(0,j.useState)(!1),[o,p]=(0,j.useState)(0),[q,r]=(0,j.useState)(""),s=(0,j.useRef)(null),t=(0,j.useRef)(null),u=(0,j.useRef)(null);(0,j.useEffect)(()=>{"code"===e?t.current?.focus():s.current?.focus()},[e]),(0,j.useEffect)(()=>{q&&("code"===e?t.current?.focus():u.current?.focus())},[q,e]),(0,j.useEffect)(()=>{if(o<=0)return;let a=window.setTimeout(()=>{p(a=>Math.max(0,a-1))},1e3);return()=>window.clearTimeout(a)},[o]);let v=async()=>{k(!0),r("");try{let a=await fetch("/api/community/users/me/account-deletion/code",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:"{}"});if(!a.ok){let b=429===a.status?(0,P.parseRetryAfterSeconds)(a.headers):null;b&&p(b),r(await Q(a));return}let b=await a.json();h(""),p(b.resend_after),f("code")}catch{r("We couldn’t send the code. Check your connection and try again.")}finally{k(!1)}},w=async()=>{let a;if(/^\d{6}$/u.test(g)){n(!0),r(""),(0,l.beginAccountDeletionAuthTransition)();try{a=await fetch("/api/community/users/me/account-deletion",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({otp:g})})}catch{(0,l.cancelAccountDeletionAuthTransition)(),h(""),r("Your account wasn’t deleted. Check your connection and try again."),n(!1);return}if(!a.ok){(0,l.cancelAccountDeletionAuthTransition)(),h(""),r(await Q(a)),n(!1);return}try{await d()}catch{globalThis.location.replace(l.ACCOUNT_DELETED_SIGN_IN_PATH)}}};return(0,b.jsx)("div",{className:"mx-auto w-full max-w-md animate-in fade-in duration-150 motion-reduce:animate-none","data-testid":F.tid.accountDeletionFlow,children:"notice"===e?(0,b.jsxs)("section",{className:"space-y-8",children:[(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("span",{className:"flex size-10 items-center justify-center rounded-full bg-destructive/10 text-destructive",children:(0,b.jsx)(N.Trash2,{className:"size-5"})}),(0,b.jsx)("h2",{ref:s,tabIndex:-1,className:"text-xl font-medium tracking-tight outline-none",children:"Delete your account?"}),(0,b.jsx)("p",{className:"text-sm leading-6 text-muted-foreground",children:"Your profile, messages, agents, and account data will be permanently removed."}),(0,b.jsx)("p",{className:"text-sm font-medium",children:"This can’t be undone."})]}),(0,b.jsxs)("div",{className:"rounded-xl bg-muted/60 p-4",children:[(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:"Deletion code will be sent to"}),(0,b.jsx)("div",{className:"mt-1 break-all text-sm font-medium",children:a})]}),q?(0,b.jsx)("p",{ref:u,tabIndex:-1,role:"alert",className:"text-sm text-destructive outline-none",children:q}):null,(0,b.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:[(0,b.jsx)(x.Button,{variant:"ghost",className:"h-11 sm:h-9",onClick:c,disabled:i,children:"Cancel"}),(0,b.jsx)(x.Button,{className:"h-11 sm:h-9",onClick:v,disabled:i||o>0,"data-testid":F.tid.accountDeletionSendCode,children:i?"Sending code…":o>0?`Send deletion code in ${o}s`:"Send deletion code"})]})]}):(0,b.jsxs)("section",{className:"space-y-8",children:[(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("span",{className:"flex size-10 items-center justify-center rounded-full bg-destructive/10 text-destructive",children:(0,b.jsx)(M,{className:"size-5"})}),(0,b.jsx)("h2",{ref:s,tabIndex:-1,className:"text-xl font-medium tracking-tight outline-none",children:"Enter deletion code"}),(0,b.jsxs)("p",{className:"text-sm leading-6 text-muted-foreground",children:["We sent a 6-digit code to ",(0,b.jsx)("span",{className:"font-medium text-foreground",children:a}),"."]})]}),(0,b.jsx)(O.InputOTP,{ref:t,value:g,onChange:a=>{h(a),r("")},maxLength:6,autoFocus:!0,disabled:m,"aria-label":"Deletion code","aria-invalid":!!q,containerClassName:"justify-center sm:justify-start","data-testid":F.tid.accountDeletionOtp,children:(0,b.jsx)(O.InputOTPGroup,{children:Array.from({length:6},(a,c)=>(0,b.jsx)(O.InputOTPSlot,{index:c,className:"size-11 text-base"},c))})}),q?(0,b.jsx)("p",{ref:u,tabIndex:-1,role:"alert",className:"text-sm text-destructive outline-none",children:q}):null,(0,b.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,b.jsxs)("div",{className:"flex flex-col gap-1 sm:flex-row",children:[(0,b.jsx)(x.Button,{variant:"ghost",className:"h-11 sm:h-9",onClick:()=>{r(""),f("notice")},disabled:m,children:"Back"}),(0,b.jsx)(x.Button,{variant:"ghost",className:"h-11 sm:h-9",onClick:v,disabled:m||i||o>0,children:i?"Sending…":o>0?`Resend code in ${o}s`:"Resend code"})]}),(0,b.jsx)(x.Button,{variant:"destructive",className:"h-11 sm:h-9",onClick:w,disabled:m||6!==g.length,"data-testid":F.tid.accountDeletionSubmit,children:m?"Deleting account…":"Delete account"})]})]})})}let S=[{value:"light",label:"Light",icon:q.Sun},{value:"dark",label:"Dark",icon:r.Moon},{value:"system",label:"System",icon:s.Monitor}],T=[{value:"profile",label:"My Profile",icon:m.User},{value:"appearance",label:"Appearance",icon:p},{value:"advanced",label:"Advanced",icon:t},{value:"privacy",label:"Privacy",icon:v.Shield}];function U(){let{theme:a,setTheme:c}=(0,w.useTheme)(),[d,e]=(0,j.useState)(!1);(0,j.useEffect)(()=>e(!0),[]);let f=d?a??"system":void 0;return(0,b.jsx)("div",{className:"mx-auto w-full max-w-md space-y-4",children:(0,b.jsx)(H,{label:"Theme",children:(0,b.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-xl bg-muted/60 p-1",children:S.map(({value:a,label:d,icon:e})=>{let g=f===a;return(0,b.jsxs)("button",{onClick:()=>c(a),"aria-pressed":g,className:["flex min-h-16 flex-col items-center justify-center gap-2 rounded-lg px-2 text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",g?"bg-background text-foreground shadow-(--e1)":"text-muted-foreground hover:bg-background/60 hover:text-foreground"].join(" "),children:[(0,b.jsx)(e,{className:"size-5"}),d]},a)})})})})}function V({userId:a}){let[c,d]=(0,j.useState)(!1),[e,f]=(0,j.useState)(!1);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(z.ConfirmDialog,{open:c,onOpenChange:a=>{a||d(!1)},title:"Clear local cache?",description:"This removes the locally persisted messages and read-state for your account. The next channel or DM you open will refetch from the server. Your unread state on the server is unaffected.",confirmLabel:"Clear cache",loadingLabel:"Clearing...",loading:e,onConfirm:async()=>{f(!0);try{await (0,E.clearPersistedCache)(a),(0,k.toast)("Local cache cleared — reloading"),window.location.reload()}catch(a){(0,l.toastApiError)(a,"Failed to clear cache"),f(!1),d(!1)}}}),(0,b.jsxs)("div",{className:"mx-auto flex min-h-full w-full max-w-md flex-col",children:[(0,b.jsxs)("section",{className:"space-y-2",children:[(0,b.jsx)("h2",{className:"text-base font-medium tracking-tight",children:"Clear local cache"}),(0,b.jsx)("p",{className:"max-w-[65ch] text-sm leading-6 text-muted-foreground",children:"Removes the locally persisted message history and read-state stored in this browser. The next channel or DM you open will refetch from the server. Nothing on the server is deleted."}),(0,b.jsx)(x.Button,{variant:"destructive",size:"sm",className:"mt-2 h-11 sm:h-8",onClick:()=>d(!0),children:"Clear local cache"})]}),(0,b.jsxs)("footer",{"data-testid":F.tid.settingsWebVersion,className:"mt-auto pt-8 font-mono text-xs tabular-nums text-muted-foreground",children:["Web v","0.1.35"]})]})]})}function W({onClose:a,userId:c,userName:d,userEmail:e,aboutMe:f,avatar:g,statusEmoji:h,statusText:i,onSave:k,onLogout:l,onAccountDeleted:m,onUploadAvatar:o}){let[p,q]=(0,j.useState)(d),[r,s]=(0,j.useState)(f),[t,v]=(0,j.useState)({emoji:h??null,text:i??null}),[w,z]=(0,j.useState)({name:d,aboutMe:f,emoji:h??null,text:i??null}),[A,B]=(0,j.useState)("profile"),[C,E]=(0,j.useState)(!1),H=p!==w.name||r!==w.aboutMe||t.emoji!==w.emoji||t.text!==w.text;return(0,b.jsx)(L.SettingsShell,{value:A,onValueChange:B,label:"User Settings",title:C?"Delete account":"appearance"===A?"Appearance":"advanced"===A?"Advanced":"privacy"===A?"Privacy Policy":"My Profile",tabs:T,onClose:a,disabled:C,navFooter:(0,b.jsxs)(x.Button,{variant:"ghost",className:K.SETTINGS_LOGOUT_CLASS,size:"sm",onClick:l,"aria-label":"Log out",disabled:C,children:[(0,b.jsx)(n.LogOut,{className:"size-4"})," ",(0,b.jsx)("span",{className:"sr-only sm:not-sr-only",children:"Log Out"})]}),children:C?(0,b.jsx)(R,{email:e,onCancel:()=>E(!1),onDeleted:m}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(L.SettingsShellPanel,{value:"profile",children:(0,b.jsxs)("div",{className:"mx-auto w-full max-w-md space-y-8",children:[(0,b.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,b.jsx)("span",{className:"block size-24 overflow-hidden rounded-full ring-1 ring-border/50",children:(0,b.jsx)(G.Avatar,{label:g,seed:c??void 0,size:96})}),(0,b.jsxs)("button",{type:"button",onClick:o,className:"flex min-h-11 items-center gap-2 rounded-full border border-border/50 px-3 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:min-h-8",children:[(0,b.jsx)(u.Camera,{className:"size-3.5"})," Change photo"]})]}),(0,b.jsx)("input",{value:p,onChange:a=>q(a.target.value),placeholder:"Your name","aria-label":"Display name",className:"min-h-11 w-full rounded-sm border-0 bg-transparent px-0 py-1 text-xl font-medium leading-[1.2] tracking-tight shadow-none outline-none placeholder:font-normal placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-4 focus-visible:ring-offset-background sm:text-2xl"}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:"About"}),(0,b.jsx)(y.AutoResizeTextarea,{value:r,onChange:a=>s(a.target.value),placeholder:"Add a bit about yourself…",className:"min-h-11 w-full rounded-sm border-0 bg-transparent px-0 py-1 text-sm leading-6 text-foreground shadow-none outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-4 focus-visible:ring-offset-background"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:"Status"}),(0,b.jsx)(I.StatusEditor,{emoji:t.emoji,text:t.text,onChange:(a,b)=>v({emoji:a,text:b}),children:(0,b.jsx)("button",{className:"inline-flex min-h-11 items-center gap-2 rounded-full border border-border/50 px-3 text-sm transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:min-h-8",children:(0,J.hasStatus)(t.emoji,t.text)?(0,b.jsxs)("span",{children:[t.emoji," ",t.text]}):(0,b.jsx)("span",{className:"text-muted-foreground",children:"Set a status"})})})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[(0,b.jsx)(x.Button,{variant:"ghost",size:"sm",className:"h-11 shrink-0 px-3 text-destructive hover:text-destructive sm:h-8",onClick:()=>E(!0),"aria-label":"Delete account","data-testid":F.tid.accountDeletionOpen,children:"Delete account"}),(0,b.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[(0,b.jsx)(x.Button,{variant:"ghost",size:"sm",className:"h-11 sm:h-8",onClick:()=>{q(w.name),s(w.aboutMe),v({emoji:w.emoji,text:w.text})},disabled:!H,children:"Cancel"}),(0,b.jsx)(x.Button,{size:"sm",className:"h-11 sm:h-8",onClick:()=>{if(!H)return;let a=p.trim(),b=r.trim();k({name:a,aboutMe:b,statusEmoji:t.emoji,statusText:t.text}),z({name:a,aboutMe:b,emoji:t.emoji,text:t.text}),q(a),s(b)},disabled:!H,children:"Save changes"})]})]})]})}),(0,b.jsx)(L.SettingsShellPanel,{value:"appearance",children:(0,b.jsx)(U,{})}),(0,b.jsx)(L.SettingsShellPanel,{value:"advanced",className:"h-full",children:(0,b.jsx)(V,{userId:c})}),(0,b.jsx)(L.SettingsShellPanel,{value:"privacy",children:(0,b.jsx)("div",{className:"mx-auto w-full max-w-2xl pb-8",children:(0,b.jsx)(D,{})})})]})})}var X=a.i(609398);function Y(a){return Number(a.toFixed(6)).toString()}function Z(a,b){if(void 0!==a&&void 0!==b&&Number.isFinite(a)&&Number.isFinite(b)&&!(a<=0)&&!(b<=0))return{width:a,height:b}}var $=a.i(642155);function _({image:a}){let c=(0,j.useMemo)(()=>Z(a.width,a.height),[a.height,a.width]),[d,e]=(0,j.useState)(c),[f,g]=(0,j.useState)(null),[h,i,,k,l,m]=(0,$.useRemoteImageAttempt)({eligible:!!a.thumbnailUrl}),[n,o,p,q,r,s,t]=(0,$.useRemoteImageAttempt)(),u=function(a){if(!a)return{width:"min(200px, 90vw, 85vh)",aspectRatio:"1 / 1"};let b=85*(a.width/a.height);return{width:`min(${Y(a.width)}px, 90vw, ${Y(b)}vh)`,aspectRatio:`${Y(a.width)} / ${Y(a.height)}`}}(d),v=!!a.thumbnailUrl&&"ready"===h,w=!a.thumbnailUrl||"pending"!==h,x="ready"===n&&f===o;return(0,j.useEffect)(()=>{if("ready"!==n||!p||!w)return;let a=Z(p.naturalWidth,p.naturalHeight),b=()=>{e(c??a),g(o)};if("function"!=typeof requestAnimationFrame)return void b();let d=requestAnimationFrame(b);return()=>cancelAnimationFrame(d)},[c,o,p,n,w]),(0,b.jsxs)("div",{className:"relative w-fit",children:[(0,b.jsxs)("div",{"data-testid":F.tid.imageLightbox,"data-native-context-menu":"true",className:"relative overflow-hidden rounded-lg bg-background",style:u,children:[a.thumbnailUrl&&(0,b.jsx)("img",{ref:k,"data-testid":F.tid.imageLightboxThumbnail,"data-remote-image-kind":"content","data-remote-image-state":h,src:a.thumbnailUrl,alt:a.name,onLoad:l,onError:m,className:`absolute inset-0 size-full rounded-lg object-contain transition-opacity duration-150 ease-out motion-reduce:transition-none ${v&&!x?"pointer-events-auto opacity-100":"pointer-events-none opacity-0"}`},`thumbnail-${i}`),!v&&!x&&"pending"===n&&(0,b.jsx)("div",{"data-testid":F.tid.imageLightboxLoading,role:"status",className:"absolute inset-0 flex animate-pulse items-center justify-center bg-muted/70 px-4 text-sm text-muted-foreground motion-reduce:animate-none",children:"Loading original image"}),"error"!==n&&(0,b.jsx)("img",{ref:q,"data-testid":F.tid.imageLightboxOriginal,"data-remote-image-kind":"content","data-remote-image-state":n,src:a.originalUrl,alt:a.name,onLoad:r,onError:s,className:`absolute inset-0 size-full rounded-lg object-contain transition-opacity duration-150 ease-out motion-reduce:transition-none ${x?"pointer-events-auto opacity-100":"pointer-events-none opacity-0"}`},`original-${o}`)]}),"error"===n&&(0,b.jsxs)("div",{"data-testid":F.tid.imageLightboxError,role:"status",className:"absolute bottom-3 left-1/2 z-10 flex min-h-11 w-max max-w-[min(90vw,24rem)] -translate-x-1/2 items-center justify-between gap-2 rounded-md border border-border bg-background px-3 py-2 text-sm shadow-sm",children:[(0,b.jsx)("span",{children:"Failed to load original image"}),(0,b.jsx)("button",{type:"button","data-testid":F.tid.imageLightboxRetry,onClick:t,className:"h-12 min-w-12 rounded-md px-3 font-medium text-foreground transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:h-9 sm:min-w-0",children:"Retry"})]})]})}function aa({image:a,onClose:c}){return(0,b.jsx)(i.Dialog,{open:!0,onOpenChange:a=>{a||c()},children:(0,b.jsx)(i.DialogContent,{className:"flex max-h-[90vh] w-auto items-center justify-center border-none bg-transparent p-0 shadow-none sm:max-w-none",showCloseButton:!1,children:(0,b.jsx)(_,{image:a},`${a.originalUrl}\u0000${a.thumbnailUrl??""}\u0000${a.width??""}\u0000${a.height??""}`)})})}var ab=a.i(79003),ac=a.i(153365),ad=a.i(650174),ae=a.i(779121),af=a.i(728851),ag=a.i(151971),ah=a.i(803896),ai=a.i(201623),aj=a.i(822160);let ak=(0,ab.default)(async()=>{},{loadableGenerated:{modules:[145142]},ssr:!1,loading:()=>(0,b.jsxs)("div",{"data-testid":F.tid.codePreview,role:"status",className:"flex min-h-40 items-center justify-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(ae.Loader2,{className:"size-4 animate-spin"}),"Loading syntax highlighter…"]})}),al=(0,ab.default)(async()=>{},{loadableGenerated:{modules:[144402]},ssr:!1,loading:()=>(0,b.jsxs)("div",{"data-testid":F.tid.pdfPreviewStatus,role:"status",className:"flex min-h-40 items-center justify-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(ae.Loader2,{className:"size-4 animate-spin motion-reduce:animate-none"}),"Loading PDF renderer…"]})}),am={status:"idle",content:null,error:null};function an({attachment:a}){let c=(0,aj.useAttachmentDownload)(a),d=(0,aj.attachmentDownloadStatusText)(c.state),e="downloading"===c.state.status?ae.Loader2:"success"===c.state.status?ac.CircleCheck:"error"===c.state.status?af.RefreshCw:ad.Download;return(0,b.jsxs)("button",{type:"button","data-testid":F.tid.attachmentPreviewDownload,onClick:()=>void c.start(),disabled:"downloading"===c.state.status,"aria-busy":"downloading"===c.state.status,className:(0,x.buttonVariants)({variant:"outline",size:"sm",className:"h-11 disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground sm:h-7"}),children:[(0,b.jsx)(e,{className:`size-3.5 ${"downloading"===c.state.status?"animate-spin motion-reduce:animate-none":""}`}),d??"Download"]})}async function ao(a,b=ai.MAX_TEXT_ATTACHMENT_PREVIEW_BYTES,c){return new TextDecoder().decode(await ap(a,b,c))}async function ap(a,b,c){if(!a.ok)throw Error(`Couldn’t load this attachment (${a.status})`);let d=Number(a.headers.get("content-length"));if(Number.isFinite(d)&&d>b)throw Error("This file is too large to preview");if(!a.body){let c=new Uint8Array(await a.arrayBuffer());if(c.byteLength>b)throw Error("This file is too large to preview");return c}let e=a.body.getReader(),f=0,g=[];try{for(;;){if(c?.aborted)throw new DOMException("Aborted","AbortError");let{done:a,value:d}=await e.read();if(a)break;if((f+=d.byteLength)>b)throw await e.cancel(),Error("This file is too large to preview");g.push(d)}let a=new Uint8Array(f),d=0;for(let b of g)a.set(b,d),d+=b.byteLength;return a}finally{e.releaseLock()}}function aq({attachment:a,open:c,onOpenChange:d}){let[e,f]=(0,j.useState)(a),[g,h]=(0,j.useState)(am);(0,j.useEffect)(()=>{a&&f(a)},[a]),(0,j.useEffect)(()=>{if(!c||!e)return void h(am);let a=(0,ai.resolveAttachmentPresentation)(e.name,e.contentType);if(!a.previewKind)return void h({status:"error",content:null,error:"This file type can’t be previewed"});let b="pdf"===a.previewKind?ai.MAX_PDF_ATTACHMENT_PREVIEW_BYTES:ai.MAX_TEXT_ATTACHMENT_PREVIEW_BYTES;if(void 0!==e.sizeBytes&&e.sizeBytes>b)return void h({status:"error",content:null,error:"This file is too large to preview"});let d=new AbortController,f=!0;return h({status:"loading",content:null,error:null}),fetch(e.url,{credentials:"same-origin",signal:d.signal}).then(async c=>"pdf"===a.previewKind?{status:"ready",kind:"pdf",content:await ap(c,b,d.signal),error:null}:{status:"ready",kind:"text",content:await ao(c,b,d.signal),error:null}).then(a=>{f&&h(a)}).catch(a=>{f&&!d.signal.aborted&&h({status:"error",content:null,error:a instanceof Error?a.message:"Couldn’t load this attachment"})}),()=>{f=!1,d.abort()}},[c,e]);let i=e?(0,ai.resolveAttachmentPresentation)(e.name,e.contentType):null,k=e?(0,ai.formatAttachmentSize)(e.sizeBytes)||e.size:"";return(0,b.jsxs)(ag.CommunitySheet,{open:c,onOpenChange:d,title:e?.name??"Attachment",description:[e?.contentType||i?.category,k].filter(Boolean).join(" · "),footer:e&&(0,b.jsx)(an,{attachment:e}),resizable:!0,closeLabel:"Close attachment preview",contentTestId:F.tid.attachmentPreviewSheet,bodyTestId:F.tid.attachmentPreviewContent,bodyClassName:(0,A.cn)("flex min-h-0 flex-col",i?.previewKind==="pdf"&&"overflow-hidden",(i?.previewKind==="code"||i?.previewKind==="text"||i?.previewKind==="pdf")&&"p-0 sm:p-0"),children:["loading"===g.status&&(0,b.jsxs)("div",{className:"flex items-center justify-center gap-2 py-8 text-sm text-muted-foreground",children:[(0,b.jsx)(ae.Loader2,{className:"size-4 animate-spin"}),"Loading preview…"]}),"error"===g.status&&(0,b.jsxs)("div",{className:"flex min-h-40 flex-col items-center justify-center gap-2 text-center",children:[(0,b.jsx)("p",{className:"text-sm font-medium",children:"Preview unavailable"}),(0,b.jsx)("p",{className:"max-w-72 text-sm text-muted-foreground",children:g.error})]}),"ready"===g.status&&"text"===g.kind&&i?.previewKind==="markdown"&&(0,b.jsx)(ah.MessageBody,{text:g.content}),"ready"===g.status&&"text"===g.kind&&i?.previewKind!=="markdown"&&(0,b.jsx)(ak,{content:g.content,language:i?.shikiLanguage??null}),"ready"===g.status&&"pdf"===g.kind&&(0,b.jsx)(al,{data:g.content})]})}var ar=a.i(131731);function as({controller:a,breakpoint:c,extraDialogs:d}){let{profile:e,currentUser:f}=a,g=a.pendingAvatarCrop;return(0,b.jsxs)(b.Fragment,{children:[e&&(0,b.jsx)(X.ProfileCard,{data:e.data,x:e.x,y:e.y,bp:c,onClose:a.closeProfile,onMessage:a.profileMessage,isSelf:!!e.data.userId&&e.data.userId===f.id,onUpdateStatus:a.updateOwnStatus,onOpenOwnerProfile:a.openOwnerProfile,onOpenBotAudit:a.openBotAudit},`${e.data.userId??e.data.name}:${e.x}:${e.y}`),a.preview&&(0,b.jsx)(aa,{image:a.preview,onClose:a.closePreview}),(0,b.jsx)(aq,{attachment:a.attachmentPreview,open:!!a.attachmentPreview,onOpenChange:a.onAttachmentPreviewOpenChange}),(0,b.jsx)(i.Dialog,{open:a.editingProfile,onOpenChange:a.onUserSettingsOpenChange,children:(0,b.jsx)(i.DialogContent,{className:"flex h-dvh max-h-dvh w-screen max-w-none flex-col gap-0 overflow-hidden rounded-none p-0 sm:h-[calc(100vh-4rem)] sm:max-h-180 sm:w-[calc(100vw-4rem)] sm:max-w-4xl sm:rounded-xl",showCloseButton:!1,children:(0,b.jsx)(W,{...a.userSettingsProps})})}),g&&(0,b.jsx)(ar.ImageCropDialog,{...g,maskShape:"circle"}),d]})}var at=a.i(216581);a.s(["ShellFrameView",0,function({breakpoint:a,checkpoint:i,sidebar:j,children:k,extraDialogs:l,cancelPendingNavigation:m,rail:n,profile:o,inbox:p}){let{surface:q}=i,r=(0,b.jsx)(h.InboxPopover,{...p.popoverProps,surface:"mobile"===a?"mobile":"desktop"}),s={id:o.currentUser.id,name:o.currentUser.name,avatar:o.currentUser.avatar},t="unknown"===a;return(0,b.jsx)(at.CommunityShellLayout,{breakpoint:a,surface:q,onNavigationIntent:m,transition:{mode:i.mode,targetHref:i.targetHref},rail:(0,b.jsx)(f.ServerRail,{...n.railProps,bottomInset:60}),sidebar:"server-skeleton"===i.sidebar.kind?(0,b.jsx)(c.ChannelSidebarSkeleton,{targetServerId:i.sidebar.serverId}):"me-skeleton"===i.sidebar.kind?(0,b.jsx)(d.DmSidebarSkeleton,{}):"desktop"===a?j():j({noHeader:!1}),main:"target-skeleton"===i.main.kind||t?(0,b.jsx)(e.CommunityPendingFrame,{href:i.targetHref,reserveBackSlot:"detail"===q}):k,userBar:(0,b.jsx)(g.UserBar,{breakpoint:a,user:s,onOpenProfile:o.openProfile,onEditProfile:o.openUserSettings,inbox:r,hasUnread:p.hasUnread,inboxOpen:p.open,onInboxOpenChange:p.onOpenChange}),overlays:!t&&(0,b.jsx)(as,{controller:o,breakpoint:a,extraDialogs:l})})}],588745)},476042,a=>{"use strict";var b=a.i(94701),c=a.i(306533),d=a.i(823417),e=a.i(23745);function f(a){a.revision+=1}async function g(a,b,c){let d=++a.revision,e=await b();return d===a.revision&&(c(e),!0)}var h=a.i(979031),i=a.i(764081);a.s(["useCommunityNavigationController",0,function(a){let j=(0,d.useRouter)(),k=(0,d.usePathname)(),l=(0,d.useSearchParams)().toString(),m=l?`${k}?${l}`:k,n=(0,e.useQueryClient)(),o=(0,b.useRef)({revision:0}),p=(0,b.useRef)(a.revision),q=(0,b.useRef)(a.leafKey),[r,s]=(0,b.useState)(!1),[t,u]=(0,b.useState)(null),v=(0,b.useCallback)(()=>{f(o.current),(0,i.cancelActiveConversationNavigationProof)(n),s(!1),u(null)},[n]);(0,b.useEffect)(()=>{null===t||((0,h.normalizeCommunityHref)(t).leafKey===q.current?(0,h.isPublishedNonStructuralCommit)(a,m,t):(0,h.isStructuralFrameCommit)({committedFrame:a,targetHref:t,baselineRevision:p.current}))&&(f(o.current),s(!1),u(null))},[a,t,m]),(0,b.useEffect)(()=>{},[v]);let w=(0,b.useCallback)(b=>{b!==m&&(f(o.current),(0,i.cancelActiveConversationNavigationProof)(n),p.current=a.revision,q.current=a.leafKey,s(!0),u(b),j.push(b))},[a.leafKey,a.revision,m,n,j]),x=(0,b.useCallback)(b=>{b!==m&&(f(o.current),p.current=a.revision,q.current=a.leafKey,(0,c.flushSync)(()=>{s(!0),u(b)}),j.push(b))},[a.leafKey,a.revision,m,j]),y=(0,b.useCallback)(b=>{b!==m&&(f(o.current),(0,i.cancelActiveConversationNavigationProof)(n),p.current=a.revision,q.current=a.leafKey,s(!0),u(b),j.replace(b))},[a.leafKey,a.revision,m,n,j]),z=(0,b.useCallback)(async b=>{(0,i.cancelActiveConversationNavigationProof)(n),p.current=a.revision,q.current=a.leafKey,s(!0),u(null);try{return await g(o.current,b,a=>{if(a===m){s(!1),u(null);return}u(a),j.push(a)})}catch(a){throw s(!1),u(null),a}},[a.leafKey,a.revision,m,n,j]);return{publishedHref:m,navigationPending:r,pendingHref:t,push:w,pushImmediate:x,replace:y,prefetch:j.prefetch,resolveAndPush:z,cancelPendingNavigation:v}}],476042)},215119,a=>a.a(async(b,c)=>{try{var d=a.i(341306),e=a.i(94701),f=a.i(23745),g=a.i(586220),h=a.i(411731),i=a.i(979031),j=a.i(586889),k=a.i(437253),l=a.i(606617),m=a.i(669991),n=a.i(588745),o=a.i(833895),p=a.i(435605),q=a.i(725931),r=a.i(476042),s=a.i(797692),t=b([p]);[p]=t.then?(await t)():t,a.s(["ShellFrame",0,function(a){let{view:b,activeServerId:c,frameHref:t,sidebar:u,children:v,extraDialogs:w,onOpenActiveServerSettings:x,onOpenActiveServerInvite:y}=a,z=(0,f.useQueryClient)(),A=(0,m.useCurrentUser)(),B=(0,s.useStructuralSnapshot)(A.id,z),C=(0,l.useCommunityWsStore)(a=>a.accessEpoch),D=(0,g.useBreakpoint)(),E=(0,h.useCommunityOnboarding)(),F={...(0,i.normalizeCommunityHref)(t),revision:0},G=(0,e.useRef)(F),[H,I]=(0,e.useState)(F),J=(0,e.useCallback)(a=>{let b=G.current,c=(0,i.advanceCommunityCommittedFrame)(b,a);c!==b&&(G.current=c,I(c))},[]);(0,e.useLayoutEffect)(()=>J(t),[J,t]);let K=(0,r.useCommunityNavigationController)(H),L=K.replace,M=(0,i.resolveCommunityRoute)(H.pathname),N=K.pendingHref?(0,i.normalizeCommunityHref)(K.pendingHref):null,O=N?.scope.kind==="server"?N.scope.serverId:null,P=O?B?.servers.find(a=>a.id===O):null,Q=O?void 0!==z.getQueryData(j.communityKeys.server(O))||!!(P&&(P.categories.length>0||P.channels.length>0)):N?.scope.kind==="me"&&void 0!==z.getQueryData(j.communityKeys.dms()),R=(0,i.resolveCommunityCheckpointPlan)({committedFrame:H,targetHref:K.pendingHref,pending:K.navigationPending,targetReady:Q}),S="target"===R.rail.kind?R.rail.view:b,T="target"===R.rail.kind?R.rail.activeServerId:c,U=(0,o.useShellRailController)({navigation:K,queryClient:z,breakpoint:D,view:b,activeServerId:c,projectedView:S,projectedActiveServerId:T,onOpenActiveServerSettings:x,onOpenActiveServerInvite:y,accountId:A.id}),V=(0,p.useShellProfileController)({router:K,queryClient:z,cancelPendingNavigation:K.cancelPendingNavigation,view:b,activeServerId:c}),W=(0,q.useShellInboxController)({router:K,queryClient:z,cancelPendingNavigation:K.cancelPendingNavigation,publishedHref:K.publishedHref,navigationPending:K.navigationPending,pendingHref:K.pendingHref,viewerId:A.id,accessEpoch:C}),X=(0,e.useCallback)(()=>{M.parentPath&&K.replace(M.parentPath)},[K,M.parentPath]);return(0,e.useEffect)(()=>{"mobile"===D&&E?.status==="active"&&"server"===E.stage&&"detail"===M.surface&&M.parentPath&&L(M.parentPath)},[D,E,L,M.parentPath,M.surface]),(0,e.useEffect)(()=>{k.useCommunityStore.getState().registerUiHandlers({previewImage:V.previewImage,previewAttachment:V.previewAttachment,openProfile:V.openProfile,goBackMobile:X,navigatePath:K.push,replacePath:K.replace,navigate:U.navigate,cancelPendingNavigation:K.cancelPendingNavigation})},[X,V.openProfile,V.previewAttachment,V.previewImage,U.navigate,K.cancelPendingNavigation,K.push,K.replace]),(0,d.jsx)(n.ShellFrameView,{breakpoint:D,checkpoint:R,sidebar:u,extraDialogs:w,cancelPendingNavigation:K.cancelPendingNavigation,rail:U,profile:V,inbox:W,children:v})}]),c()}catch(a){c(a)}},!1),725931,a=>{"use strict";var b=a.i(94701),c=a.i(586889),d=a.i(979031),e=a.i(991847),f=a.i(311785),g=a.i(730926),h=a.i(947820);a.i(735042);var i=a.i(412118),j=a.i(300036),k=a.i(487154),l=a.i(446827),m=a.i(333552),n=a.i(208847),o=a.i(178835),p=a.i(764081);function q(a,b,d,e=0){let{epoch:f,signal:g}=(0,p.beginConversationNavigationProof)(a,b,d,e);(0,p.registerConversationNavigationRecovery)(a,f,(c,d)=>{q(a,b,c,d)});let h=b.anchorMessageId?{mode:"anchor",anchor:b.anchorMessageId}:{mode:"newest"},i="dm"===b.scopeKind?c.communityKeys.dmMessages(b.channelId):c.communityKeys.channelMessages(b.channelId),j="dm"===b.scopeKind?(0,m.dmMessagesQueryFn)(b.channelId,{onSurfaceReceipt:b=>{(0,p.recordConversationNavigationReceipt)(a,b,d,f)}}):(0,m.channelMessagesQueryFn)(b.channelId,null,{onSurfaceReceipt:b=>{(0,p.recordConversationNavigationReceipt)(a,b,d,f)}});a.fetchInfiniteQuery({queryKey:i,queryFn:j,initialPageParam:h,staleTime:0}).then(()=>{(0,p.isCurrentConversationNavigation)(a,f,d)&&(0,p.commitConversationNavigationProof)(a,b.channelId,d)}).catch(e=>{let h,i;if(g.aborted)return;let j=e instanceof l.ApiError&&(403===e.status||404===e.status);j&&(h="dm"===b.scopeKind?c.communityKeys.dmMessages(b.channelId):c.communityKeys.channelMessages(b.channelId),i="dm"===b.scopeKind?c.communityKeys.dmReadStateSnapshot(b.channelId):c.communityKeys.channelReadStateSnapshot(b.channelId),a.removeQueries({queryKey:h}),a.removeQueries({queryKey:i}),b.serverId?a.removeQueries({queryKey:c.communityKeys.channelMeta(b.serverId,b.channelId)}):a.removeQueries({queryKey:c.communityKeys.dmRouteVerification(b.channelId)}),o.useMessageStreamStore.getState().removeScope("dm"===b.scopeKind?{kind:"dm",id:b.channelId}:{kind:"channel",id:b.channelId,serverId:b.serverId})),(0,p.failConversationNavigationProof)(a,f,d,j)});let r="dm"===b.scopeKind?c.communityKeys.dmReadStateSnapshot(b.channelId):c.communityKeys.channelReadStateSnapshot(b.channelId);return(0,k.apiFetch)(`/api/community/channels/${b.channelId}/read-state`,{signal:g}).then(b=>{(0,p.isCurrentConversationNavigation)(a,f,d)&&a.setQueryData(r,b)}).catch(()=>void 0),b.serverId&&(0,n.serverProjectedQueryFn)(a,b.serverId,g)().then(e=>{(0,p.isCurrentConversationNavigation)(a,f,d)&&a.setQueryData(c.communityKeys.server(b.serverId),e)}).catch(()=>void 0),f}a.s(["useShellInboxController",0,function({router:a,queryClient:k,cancelPendingNavigation:l,publishedHref:m,navigationPending:n,pendingHref:o,viewerId:r,accessEpoch:s}){let t=(0,b.useCallback)(b=>{a.pushImmediate?a.pushImmediate(b):a.push(b)},[a]),u=(0,e.useInboxUnreads)(),v=(0,e.useInboxMentions)(),w=u.servers,x=u.dms,y=v.mentions,z=u.isLoading||v.isLoading,[A,B]=(0,b.useState)(!1),[C,D]=(0,b.useState)("unreads"),E=(0,b.useRef)({unreads:0,mentions:0,marked:0}),F=(0,e.useInboxMarked)(A),{mutate:G}=(0,i.useUnmarkMessage)(),H=(0,i.useMarkAllInboxRead)(),I=(0,i.useDeleteMention)(),J=(0,g.useInboxAutoCollapse)({queryClient:k,publishedHref:m,navigationPending:n,pendingHref:o}),K=(0,b.useCallback)(a=>{D(a),"marked"===a&&B(!0)},[]),L=(0,b.useCallback)(a=>E.current[a],[]),M=(0,b.useCallback)((a,b)=>{E.current[a]=b},[]),N=(0,b.useCallback)((a,b,c,d,e)=>{let f=J.beginProjection(a,b);l(),(0,j.clearThreadOpenerReadHandoff)(k);let g=q(k,{...c,href:b,viewerId:r},s),i=b;try{i=d?.()??b,t(i),J.markProjectionSubmitted(f)&&e?.()}catch(b){(0,p.cancelConversationNavigationProof)(k,g);let a=new URLSearchParams(i.split("?")[1]??"").get("inboxThreadOpener");throw a&&(0,h.terminateThreadOpenerReservationHandoff)(k,a),J.isLatestProjection(f)&&(l(),J.rollbackProjection(f,!0)),b}},[s,l,J,t,k,r]),O=(0,b.useCallback)((a,b,c)=>{let e=(0,d.channelHref)(a.serverId,b.channelId),f=c?(0,h.inboxChannelRowTarget)(a,b):null;if(!f){let c=J.closeWithoutProjection();l(),(0,j.clearThreadOpenerReadHandoff)(k);let d=q(k,{href:e,viewerId:r,channelId:b.channelId,serverId:a.serverId,scopeKind:"channel",expectedSurfaceKind:"forum"===b.type?"forum":"channel"},s);try{t(e)}catch(a){throw(0,p.cancelConversationNavigationProof)(k,d),l(),J.onOpenChange(c),a}return}N(f,e,{channelId:b.channelId,serverId:a.serverId,scopeKind:"channel",expectedSurfaceKind:"forum"===b.type?"forum":"channel"})},[s,l,J,t,N,k,r]),P=(0,b.useCallback)((a,b,c)=>{let e=(0,h.inboxThreadRowTarget)(a,b,c),f=(0,d.channelHref)(a.serverId,c.channelId);N(e,f,{channelId:c.channelId,serverId:a.serverId,scopeKind:"channel",expectedSurfaceKind:"thread"},()=>c.openerMessageId&&!0===c.openerUnread&&void 0!==c.openerSeq?(0,j.armThreadOpenerReadHandoff)(k,{serverId:a.serverId,parentChannelId:c.parentChannelId??b.channelId,childChannelId:c.channelId,openerMessageId:c.openerMessageId,openerSeq:c.openerSeq}):f)},[N,k]),Q=(0,b.useCallback)(a=>{let b=J.closeWithoutProjection();l(),(0,j.clearThreadOpenerReadHandoff)(k);let c=null!=a.m.seq?`?seq=${a.m.seq}`:"",e=a.serverId?`${(0,d.channelHref)(a.serverId,a.channelId)}${c}`:`/c/me/${a.channelId}${c}`,f=q(k,{href:e,viewerId:r,channelId:a.channelId,...a.serverId?{serverId:a.serverId}:{},scopeKind:a.serverId?"channel":"dm",...a.serverId?{anchorMessageId:a.m.id}:{},...!a.serverId?{expectedSurfaceKind:"dm"}:{}},s);try{t(e)}catch(a){throw(0,p.cancelConversationNavigationProof)(k,f),l(),J.onOpenChange(b),a}},[s,l,J,t,k,r]),R=(0,b.useCallback)(a=>{let b=a.channelId;N((0,h.inboxDmRowTarget)(a),`/c/me/${b}`,{channelId:b,scopeKind:"dm",expectedSurfaceKind:"dm"},()=>{k.setQueryData(c.communityKeys.dms(),b=>{var c=b,d={id:a.channelId,userId:a.otherUserId,name:a.otherUserName,discriminator:a.otherUserDiscriminator,avatar:a.otherUserAvatar,avatarVersion:a.otherUserAvatarVersion,status:"offline",preview:"",unread:!1};if(!c)return{conversations:[d]};let e=c.conversations.findIndex(a=>a.id===d.id);return e<0?{...c,conversations:[d,...c.conversations]}:{...c,conversations:c.conversations.map((a,b)=>b===e?{...a,...d,status:a.status,preview:a.preview}:a)}})},()=>{(0,f.startDmRouteVerification)(k,b).catch(()=>void 0)})},[N,k]),S=(0,b.useCallback)(a=>{let b=(0,h.inboxMentionRowTarget)(a);b&&a.serverId&&a.channelId&&N(b,`${(0,d.channelHref)(a.serverId,a.channelId)}?msg=${a.m.id}`,{channelId:a.channelId,serverId:a.serverId,scopeKind:"channel",anchorMessageId:a.m.id})},[N]);return{popoverProps:{unreads:w,unreadDms:x,mentions:y,marked:F.marked,markedLoading:F.isLoading,loading:z,hasProjectedUnreads:u.hasProjectedUnread,hasProjectedMentions:v.hasProjectedMention,onOpenChannel:O,onOpenThread:P,onOpenDm:R,onOpenMention:S,onOpenMarked:Q,activeTab:C,onActiveTabChange:K,onMarkedTabSelected:()=>B(!0),getScrollOffset:L,onScrollOffsetChange:M,onMarkAllRead:()=>{H.mutate()},onDeleteMention:a=>I.mutate({mentionId:a}),onUnmark:a=>G({messageId:a}),isProjected:J.isProjected},hasUnread:u.hasProjectedUnread||v.hasProjectedMention,open:J.open,onOpenChange:J.onOpenChange}}],725931)},435605,a=>a.a(async(b,c)=>{try{var d=a.i(94701);a.i(974936);var e=a.i(448305),f=a.i(990061),g=a.i(487154),h=a.i(586889),i=a.i(129645),j=a.i(166281),k=a.i(145723),l=a.i(454607),m=a.i(9777),n=a.i(530479),o=a.i(869102),p=a.i(437253),q=a.i(606617),r=a.i(178835),s=a.i(669991),t=a.i(836595),u=a.i(258365);a.i(735042);var v=a.i(84610),w=a.i(282054),x=a.i(473767),y=b([l]);function z(a,b){q.useCommunityWsStore.getState().commitProfiles(a,[{id:b.id,identityAbout:{name:b.name,discriminator:b.discriminator,aboutMe:b.aboutMe,bannerColor:b.bannerColor},avatar:{avatar:b.avatar,avatarVersion:b.avatarVersion},status:{statusEmoji:b.statusEmoji,statusText:b.statusText}}])}[l]=y.then?(await y)():y,a.s(["useShellProfileController",0,function({router:a,queryClient:b,cancelPendingNavigation:c,view:y,activeServerId:A}){let B=(0,s.useCurrentUser)(),{friends:C}=(0,t.useFriends)(),D=(0,k.resolveProfileServerId)(y,A),{members:E}=(0,u.useServerMembers)(D),F=(0,v.useCreateOrGetDm)(),{accept:G}=(0,x.useDmMessageSender)(),H=(0,w.useUpdateProfile)(),I=(0,w.useUploadUserAvatar)(),[J,K]=(0,d.useState)(!1),[L,M]=(0,d.useState)(null),[N,O]=(0,d.useState)(null),[P,Q]=(0,d.useState)(null),[R,S]=(0,d.useState)(null),T=(0,d.useCallback)((a,c,d,e,f)=>{if(f&&f===B.id){let a=D?E.find(a=>a.userId===B.id):void 0;M({data:{userId:B.id,contextLabel:(0,k.resolveProfileContextLabel)(D,a),mutual:0,identity:{kind:"human"}},x:c,y:d});return}let j=(0,k.resolveProfileTarget)(E,C,{name:a,discriminator:e,userId:f}),l=(0,k.resolveProfileUserId)(j,f);M({data:{...l?{userId:l}:{name:a,discriminator:e},contextLabel:(0,k.resolveProfileContextLabel)(D,j),mutual:0},x:c,y:d}),l&&b.fetchQuery({queryKey:h.communityKeys.profile(l),queryFn:(0,i.userProfileQueryFn)(l),staleTime:i.PROFILE_STALE_TIME_MS}).then(a=>{M(b=>b?.data.userId===a.id?{...b,data:{...b.data,mutual:a.mutualServers??0,identity:"bot"===a.kind?{kind:"bot",ownerProfile:a.ownerProfile,ownedByViewer:a.ownedByViewer}:{kind:"human"}}}:b)}).catch(a=>(0,g.toastApiError)(a,"Failed to load profile"))},[B,C,E,D,b]),U=(0,d.useCallback)((a,b,c,d)=>{T(a,b.clientX,b.clientY,c,d)},[T]),V=(0,d.useCallback)(a=>{if(!L)return;let b=(0,e.parseNameAndTag)(a.handle);b&&T(b.name,L.x,L.y,b.discriminator,a.id)},[T,L]),W=(0,d.useCallback)(b=>{c(),a.push(`/c/me/bots?audit=${encodeURIComponent(b)}`),M(null)},[c,a]),X=(0,d.useCallback)(a=>O(a),[]),Y=(0,d.useCallback)(a=>Q(a),[]),Z=async(a,b)=>{try{let c=q.useCommunityWsStore.getState().beginProfileSnapshot(),d=await H.mutateAsync({statusEmoji:a,statusText:b});z(c,d)}catch(a){(0,g.toastApiError)(a,"Failed to update status")}},$=async(b,d)=>{let e;if(!b)return void(0,f.toast)("Could not find user");try{e=(await F.mutateAsync({userId:b})).conversation.id}catch(a){(0,g.toastApiError)(a,"Failed to open DM");return}let h=d.trim();if(h){let a=G({dmId:e,content:h,author:{id:B.id,name:B.name,avatar:B.avatar}});if(!a.accepted)return void(0,f.toast)("Failed to send message");a.committed}c(),a.push(`/c/me/${e}`)},_=async a=>{try{let b=q.useCommunityWsStore.getState().beginProfileSnapshot(),c=await H.mutateAsync(a);z(b,c)}catch(a){(0,g.toastApiError)(a,"Failed to save profile")}},aa=()=>{c(),p.useCommunityStore.getState().reset(),q.useCommunityWsStore.getState().reset(),r.useMessageStreamStore.getState().resetAll(),(0,o.disposeReadCoordinator)(b),(0,n.disposeAccountReadStateReconciliation)(b),b.clear()},ab=async()=>{aa(),await (0,l.signOut)(),await (0,m.clearPersistedCache)(B.id).catch(()=>{}),a.push("/sign-in")},ac=async()=>{aa(),await (0,m.clearPersistedCache)(B.id).catch(()=>{}),K(!1),globalThis.location.replace(g.ACCOUNT_DELETED_SIGN_IN_PATH)},ad={onClose:()=>K(!1),userId:B.id,userName:B.name,userEmail:B.email,aboutMe:B.aboutMe??"",avatar:B.avatar,statusEmoji:B.statusEmoji,statusText:B.statusText,onUploadAvatar:()=>{let a=document.createElement("input");a.type="file",a.accept="image/png,image/jpeg,image/webp",a.onchange=()=>{let b=a.files?.[0];if(!b)return;let c=(0,j.validateIconSourceFile)(b);c.ok?S({src:URL.createObjectURL(b),fileName:b.name}):(0,f.toast)(c.error)},a.click()},onSave:_,onLogout:ab,onAccountDeleted:ac},ae=null;return R&&(ae={imageSrc:R.src,originalFileName:R.fileName,onCropped:a=>{I.mutate({file:a},{onSuccess:a=>{let b=q.useCommunityWsStore.getState();b.patchProfiles(b.beginProfileSnapshot(),[{id:B.id,avatar:{avatar:a.url,avatarVersion:a.avatarVersion}}]),(0,f.toast)("Avatar updated")},onError:a=>(0,g.toastApiError)(a,"Failed to upload avatar")}),URL.revokeObjectURL(R.src),S(null)},onCancel:()=>{URL.revokeObjectURL(R.src),S(null)}}),{currentUser:B,openProfile:U,openOwnerProfile:V,openBotAudit:W,previewImage:X,previewAttachment:Y,profile:L,closeProfile:()=>M(null),profileMessage:$,updateOwnStatus:Z,preview:N,closePreview:()=>O(null),attachmentPreview:P,onAttachmentPreviewOpenChange:a=>{a||Q(null)},editingProfile:J,openUserSettings:()=>K(!0),onUserSettingsOpenChange:a=>{a||K(!1)},userSettingsProps:ad,pendingAvatarCrop:ae}}]),c()}catch(a){c(a)}},!1),833895,a=>{"use strict";var b=a.i(94701),c=a.i(990061),d=a.i(487154),e=a.i(586889),f=a.i(652457),g=a.i(504125),h=a.i(208847),i=a.i(808747),j=a.i(66957),k=a.i(606617);let l=Object.freeze([]),m=async()=>{let a=k.useCommunityWsStore.getState(),b={viewerId:a.profileViewerId,accountEpoch:a.profileAccountEpoch,accessEpoch:a.accessEpoch},c=await (0,d.apiFetch)("/api/community/users/me/server-folders"),e=k.useCommunityWsStore.getState();if(e.profileViewerId!==b.viewerId||e.profileAccountEpoch!==b.accountEpoch||e.accessEpoch!==b.accessEpoch)throw new DOMException("Stale structural query","AbortError");return{folders:c.folders.map(a=>({id:a.id,name:a.name,position:a.position??0,servers:a.servers.map(a=>({id:a.id,name:a.name,initial:(0,j.avatarInitial)(a.name),icon:a.icon??null}))}))}};a.i(735042);var n=a.i(91883),o=a.i(47363),p=a.i(206375),q=a.i(437253);function r({targetServerId:a,activeServerId:b,overlay:c,hasActiveOpener:d}){return a===b&&d?{kind:"open-active"}:{kind:"navigate",href:`/c/channels/${a}?${c}=1`}}var s=a.i(797692),t=a.i(664789);a.s(["useShellRailController",0,function({navigation:a,queryClient:j,breakpoint:k,view:u,projectedView:v=u,activeServerId:w,projectedActiveServerId:x,onOpenActiveServerSettings:y,onOpenActiveServerInvite:z,accountId:A}){let B,C=(0,s.useStructuralSnapshot)(A??null,j),D=(0,h.useServers)(),E={...B=(0,i.useQuery)({queryKey:e.communityKeys.folders(),queryFn:m}),folders:B.data?.folders??l},F=void 0!==D.data||!A,G=F?D.servers:(0,t.structuralSnapshotServers)(C),H=E.data?.folders??(A?(0,t.structuralSnapshotFolders)(C):E.folders),I=(0,q.useCommunityStore)(a=>a.currentServerId),{mutateAsync:J}=(0,n.useCreateServer)(),{mutate:K}=(0,n.useLeaveServer)(),{mutate:L}=(0,n.useUploadServerIcon)(),M=(0,b.useMemo)(()=>G.map(a=>({...a,active:a.id===x})),[x,G]),N=(0,b.useCallback)(a=>{let b=j.getQueryData(e.communityKeys.server(a)),c=b?.categories.flatMap(a=>a.channels.filter(a=>!a.pending).map(a=>a.id))??C?.servers.find(b=>b.id===a)?.channels.map(a=>a.id)??[];return(0,o.pickServerLandingHref)(a,c,(0,o.getLastChannel)(a))},[j,C]),O=(0,b.useCallback)(async a=>{let b=`/c/channels/${a}`,c=N(a);if(c!==b)return c;try{await j.fetchQuery({queryKey:e.communityKeys.server(a),queryFn:(0,h.serverProjectedQueryFn)(j,a),staleTime:1/0})}catch{return b}return N(a)},[j,N]),P=(0,b.useCallback)(b=>{(0,f.markSwitch)("server",b),a.push(`/c/channels/${b}`)},[a]),Q=(0,b.useCallback)(()=>"desktop"===k?(0,p.pickMeLandingLocation)((0,p.getLastMeLeaf)()):p.ME_ROOT,[k]),R=(0,b.useCallback)(()=>{a.push(Q())},[Q,a]),S=(0,b.useCallback)(b=>{O(b).then(b=>a.prefetch(b))},[a,O]),T=(0,b.useCallback)(()=>a.prefetch(Q()),[Q,a]),U=(0,b.useCallback)(async(b,e)=>{try{let f=(await J({name:b})).server.id;(0,c.toast)(`Server "${b}" created`),e&&L({serverId:f,file:e},{onError:a=>(0,d.toastApiError)(a,"Server created, but the icon failed to upload")}),a.push(`/c/channels/${f}`)}catch(a){(0,d.toastApiError)(a,"Failed to create server")}},[J,a,L]),V=(0,b.useCallback)(b=>{(0,g.markVoluntaryLeave)(b),K({serverId:b},{onSuccess:()=>{(0,c.toast)("Left server"),I===b&&a.replace((0,g.pickPostEjectDestination)(G,b))},onError:a=>(0,d.toastApiError)(a,"Failed to leave server")})},[I,K,a,G]),W=(0,b.useCallback)(b=>{if(!b)return;let c=r({targetServerId:b,activeServerId:w,overlay:"settings",hasActiveOpener:!!y});"open-active"===c.kind?y?.():a.push(c.href)},[w,a,y]),X=(0,b.useCallback)(b=>{if(!b)return;let c=r({targetServerId:b,activeServerId:w,overlay:"invite",hasActiveOpener:!!z});"open-active"===c.kind?z?.():a.push(c.href)},[w,a,z]),Y=(0,b.useCallback)((b,c)=>{((0,f.markSwitch)(c?"channel":"server",c??b),c)?a.push(`/c/channels/${b}/${c}`):a.push(N(b))},[a,N]);return{railProps:{servers:M,folders:H,activeServerId:x,serversLoading:D.isPending&&!C,view:v,onHome:R,onHomePrefetch:T,onServerNavigate:P,onServerPrefetch:S,onCreateServer:U,onLeaveServer:F?V:void 0,onOpenSettings:F?W:void 0,onOpenInvitePopover:F?X:void 0},navigate:Y}}],833895)},145723,a=>{"use strict";a.s(["resolveProfileContextLabel",0,function(a,b){if(a&&b&&"role"in b)return b.role.charAt(0).toUpperCase()+b.role.slice(1)},"resolveProfileServerId",0,function(a,b){return"server"===a?b??null:null},"resolveProfileTarget",0,function(a,b,c){let{name:d,discriminator:e,userId:f}=c;return(f?(a??[]).find(a=>a.userId===f)??(b??[]).find(a=>a.userId===f):void 0)??(e?(a??[]).find(a=>a.name===d&&a.discriminator===e)??(b??[]).find(a=>a.name===d&&a.discriminator===e):void 0)??(a??[]).find(a=>a.name===d)??(b??[]).find(a=>a.name===d)},"resolveProfileUserId",0,function(a,b){return a?.userId??b}])},300036,a=>{"use strict";var b=a.i(94701),c=a.i(823417),d=a.i(23745),e=a.i(669991),f=a.i(979031),g=a.i(869102),h=a.i(947820);let i="inboxThreadOpener",j=0;a.s(["THREAD_OPENER_HANDOFF_PARAM",0,i,"armThreadOpenerReadHandoff",0,function(a,b){let c="u">typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():(j+=1,`opener-${j}`);(0,h.armThreadOpenerReservationHandoff)(a,{...b,nonce:c});let d=(0,f.channelHref)(b.serverId,b.childChannelId);return`${d}?${i}=${encodeURIComponent(c)}`},"clearThreadOpenerReadHandoff",0,function(a){(0,h.clearThreadOpenerReservationHandoff)(a)},"useClaimThreadOpenerReadHandoff",0,function(a){let j=(0,d.useQueryClient)(),k=(0,e.useCurrentUser)(),l=(0,c.useRouter)(),m=(0,c.useSearchParams)(),n=(0,b.useRef)(null),o=(0,b.useRef)(null),p=(0,b.useRef)(0);(0,b.useLayoutEffect)(()=>{if(!a||o.current===a.nonce)return;n.current&&((0,g.releaseReadSurface)(n.current),n.current=null,o.current=null);let b=(0,h.getThreadOpenerReservationHandoff)(j,a.nonce);if(!b||b.serverId!==a.serverId||b.parentChannelId!==a.parentChannelId||b.childChannelId!==a.childChannelId||b.openerMessageId!==a.openerMessageId||b.openerSeq!==a.openerSeq)return void(0,h.terminateThreadOpenerReservationHandoff)(j,a.nonce);let c=(0,g.registerReadSurface)(j,k.id,{kind:"timeline",channelId:b.parentChannelId},0,"cancel-uncommitted"),d=(0,g.submitReadIntentGeneration)(c,{kind:"timeline",channelId:b.parentChannelId,messageId:b.openerMessageId,seq:b.openerSeq});if(null===d){(0,g.releaseReadSurface)(c),(0,h.terminateThreadOpenerReservationHandoff)(j,b.nonce);return}n.current=c,o.current=b.nonce,(0,h.completeThreadOpenerReservationHandoff)(j,b.nonce,d);let e=m.toString(),p=`${(0,f.channelHref)(b.serverId,b.childChannelId)}${e?`?${e}`:""}`;l.replace((0,f.removeCommunityParam)(p,i),{scroll:!1})},[k.id,j,l,m,a]),(0,b.useLayoutEffect)(()=>(p.current+=1,()=>{let a=++p.current,b=n.current;b&&queueMicrotask(()=>{p.current===a&&n.current===b&&(n.current=null,o.current=null,(0,g.releaseReadSurface)(b))})}),[j])},"useThreadOpenerRouteGate",0,function({serverId:a,childChannelId:e,parentChannelId:g,openerMessageId:j,lifecycle:k}){let l=(0,d.useQueryClient)(),m=(0,c.useRouter)(),n=(0,c.usePathname)(),o=(0,c.useSearchParams)(),p=o.get(i),q=p?(0,h.getThreadOpenerReservationHandoff)(l,p):null,r=(0,b.useCallback)(()=>{if(!p)return;let b=o.toString(),c=`${(0,f.channelHref)(a,e)}${b?`?${b}`:""}`;m.replace((0,f.removeCommunityParam)(c,i),{scroll:!1})},[e,p,m,o,a]),s=!!q&&q.serverId===a&&q.childChannelId===e,t=n===(0,f.channelHref)(a,e),u=s&&"ready"===k&&q.parentChannelId===g&&q.openerMessageId===j;return(0,b.useLayoutEffect)(()=>{if(!p||!t)return;let b=(0,h.registerThreadOpenerRouteLease)(l,p,a,e);return()=>(0,h.releaseThreadOpenerRouteLease)(b)},[e,p,l,t,a]),(0,b.useLayoutEffect)(()=>{if(p&&t&&(!s||"terminal-error"===k||"ready"===k&&!u)){(0,h.terminateThreadOpenerReservationHandoff)(l,p),r();return}},[u,r,k,p,l,t,s]),t&&u&&q?q:null}])},311785,a=>{"use strict";var b=a.i(94701),c=a.i(808747),d=a.i(23745),e=a.i(487154),f=a.i(586889);function g(a,b){return{queryKey:f.communityKeys.dmRouteVerification(b),queryFn:()=>(0,e.apiFetch)("/api/community/users/me/dms",{headers:{"X-Alook-DM-Route-Verification":"1"}}).then(c=>(a.setQueryData(f.communityKeys.dms(),c),c.conversations.some(a=>a.id===b)?"present":"missing"),a=>{let b;if("denied"==(403===(b="object"==typeof a&&null!==a&&"status"in a?a.status:void 0)||404===b?"denied":"error"))return"denied";throw a}),retry:!1,refetchOnReconnect:!1,refetchOnWindowFocus:!1,retryOnMount:!1}}a.s(["startDmRouteVerification",0,function(a,b){let c=a.getQueryData(f.communityKeys.dms());return c?.conversations.some(a=>a.id===b)?Promise.resolve("present"):a.fetchQuery({...g(a,b),staleTime:0})},"useDmRouteVerification",0,function(a,e,h){let i=(0,d.useQueryClient)(),j=i.getQueryData(f.communityKeys.dms()),k=!!a&&(e.some(b=>b.id===a)||j?.conversations.some(b=>b.id===a)===!0),l=g(i,a??"__none__"),m=i.getQueryState(l.queryKey),n=void 0!==m&&("fetching"===m.fetchStatus||m.dataUpdatedAt>0||m.errorUpdatedAt>0),o=(0,c.useQuery)({...l,enabled:!!a&&!k&&(!h||n),staleTime:1/0}),p=(0,b.useCallback)(()=>{a&&"fetching"!==o.fetchStatus&&o.refetch()},[a,o]);(0,b.useEffect)(()=>{if(a)return()=>{let b=f.communityKeys.dmRouteVerification(a);queueMicrotask(()=>{let a=i.getQueryCache().find({queryKey:b,exact:!0});a?.getObserversCount()===0&&i.removeQueries({queryKey:b,exact:!0})})}},[a,i]);let q="pending";return a?k||"present"===o.data?q="present":"missing"===o.data||"denied"===o.data?q="missing":o.isError&&(q="error"):q="idle",{status:q,retry:p,retrying:"fetching"===o.fetchStatus}}])},504125,a=>{"use strict";var b=a.i(446827),c=a.i(82299);let d=new Set;function e(a,b){let c=a.filter(a=>a.id!==b);return 0===c.length?"/c/me":`/c/channels/${c[0].id}`}a.s(["consumeVoluntaryLeave",0,function(a){return d.delete(a)},"isDefinitiveChildMetaFailure",0,function(a){return a instanceof b.ApiError&&(403===a.status||404===a.status)},"markVoluntaryLeave",0,function(a){d.add(a)},"pickPostEjectDestination",0,e,"runAuthoritativeServerEject",0,function(a){if(!a.isSuccess||a.isFetching||a.servers.some(b=>b.id===a.serverId))return!1;a.clearLastChannel(a.serverId),a.consumeVoluntaryLeave(a.serverId)||a.toast("You're no longer in this server");let b=!!a.accountId&&!!a.routeHref&&(0,c.consumeCommunityColdEntryFailure)(a.accountId,a.routeHref);return a.replace(b?c.COMMUNITY_COLD_ENTRY_FALLBACK:e(a.servers,a.serverId)),!0}])},652457,a=>{"use strict";var b=a.i(994188);a.s(["markSwitch",0,function(a,c){(0,b.perfTraceEnabled)()}])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_web_src_0-2rpii._.js.map
|