const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomeApplicationStarter-DKoDL7uE.js","assets/ApplicationStarter-B3UMyhpE.js","assets/index-B9NJHisQ.js","assets/rolldown-runtime-9r-HBx0o.js","assets/tanstack-router-U0H7bmeq.js","assets/tanstack-query-BttgOCQn.js","assets/icons-xTj2hkG8.js","assets/shared-constants-yNCBtlN_.js","assets/index-Drgb1pa5.css","assets/useDebouncedValue-CV-ebLIG.js","assets/useDebouncer-DFwQa-3J.js","assets/event-client-CV4ssJpW.js","assets/store-Cj3QexLS.js","assets/Icons-q42Z9Dpx.js","assets/usePartnerPlacementContext-COo3TXOB.js","assets/HomeCommunitySection-DX_KgsdY.js","assets/MaintainerCard-leU6_c6k.js","assets/frameworks-Bb4VvUZg.js","assets/maintainers-CMJw1EMs.js","assets/SponsorSection-4xjJciel.js","assets/HomeSocialProofSection-HYCjq-kn.js","assets/PartnersGrid-Bl13V7Dq.js"])))=>i.map(i=>d[i]); import{$t as X,Ai as K,Ii as N,Kn as Z,Si as ee,Tr as ae,V as re,Wr as q,Zt as te,gt as le,h as se,ji as F,k as ne,or as oe,pn as ie,t as de,wi as E}from"./icons-xTj2hkG8.js";import{C as ce,p as y,u as A}from"./tanstack-router-U0H7bmeq.js";import{d as e,f as t,i as v,o as me,t as ge}from"./tanstack-query-BttgOCQn.js";import{Hr as he,Ia as D,Ji as pe,Jr as G,Ki as ue,Mo as z,Nn as xe,Pn as R,_ as W,_i as f,bo as be,do as b,fi as ye,ga as fe,gi as we,jo as m,n as Ne,qi as ke,t as L,v as Q,xo as ve,y as Se,yi as _e}from"./index-B9NJHisQ.js";import{t as Te}from"./users.functions-CeXclkLY.js";import{t as Ce}from"./Footer-DXYm8Pa-.js";import{r as $e}from"./blog.functions-C-Dso7yf.js";import{t as Ie}from"./useNpmDownloadCounter-jgTPLjDE.js";var Pe="data:image/svg+xml,%3csvg%20height='200'%20viewBox='0%200%20175%20200'%20width='175'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m154.5%200c11.3%200%2020.5%209.2%2020.5%2020.6v179.4l-21.5-19-12.1-11.2-12.8-11.9%205.3%2018.5h-113.4c-11.3%200-20.5-9.2-20.5-20.6v-135.2c0-11.4%209.2-20.6%2020.5-20.6zm-82.3%2046.599169s-13.7-.299169-28.1%2010.500831c0%200-14.4%2026.1-14.4%2058.3%200%200%208.4%2014.5%2030.5%2015.2%200%200%203.7-4.5%206.7-8.3-12.4046512-3.711628-17.2724716-11.430178-17.492173-11.787173l-.007827-.012827s1%20.7%202.8%201.7c.1.1.2.2.4.3.3.2.6.3.9.5%202.5%201.4%205%202.5%207.3%203.4%204.1%201.6%209%203.2%2014.7%204.3%207.5%201.4%2016.3%201.9%2025.9.1%204.7-.8%209.5-2.2%2014.5-4.3%203.5-1.3%207.4-3.2%2011.5-5.9%200%200-5%208.2-18.1%2011.9%203%203.8%206.6%208.1%206.6%208.1%2022.1-.7%2030.6-15.2%2030.6-15.2%200-32.2-14.4-58.3-14.4-58.3-14.4-10.8-28.1-10.500831-28.1-10.500831l-1.4%201.600831c16.653061%205.0938776%2024.573761%2012.3948355%2024.890119%2012.6907122l.009881.0092878c-10.4-5.7-20.6-8.5-30.1-9.6-7.2-.8-14.1-.6-20.2.2-.6%200-1.1.1-1.7.2-3.5.3-12%201.6-22.7%206.3-3.7%201.7-5.9%202.9-5.9%202.9s8.3-7.9%2026.3-13.1zm-2.8%2037.300831c5.7%200%2010.3%205%2010.2%2011.1%200%206.1-4.5%2011.1-10.2%2011.1-5.6%200-10.2-5-10.2-11.1s4.5-11.1%2010.2-11.1zm36.5%200c5.7%200%2010.2%205%2010.2%2011.1s-4.5%2011.1-10.2%2011.1c-5.6%200-10.2-5-10.2-11.1s4.5-11.1%2010.2-11.1z'%20fill='%23fff'/%3e%3c/svg%3e";function Ae(){return t("div",{"aria-hidden":"true",className:"min-h-[320px] overflow-hidden rounded-[1rem] border border-gray-200 bg-white dark:border-gray-800 dark:bg-gray-950 md:min-h-[360px]",children:[t("div",{className:"border-b border-gray-200 bg-gray-50/70 px-5 py-4 dark:border-gray-800 dark:bg-gray-900/50",children:[e("div",{className:"h-7 w-64 max-w-full rounded bg-gray-200 dark:bg-gray-800"}),t("div",{className:"mt-4 flex flex-wrap gap-2",children:[e("div",{className:"h-9 w-28 rounded-lg bg-gray-200 dark:bg-gray-800"}),e("div",{className:"h-9 w-32 rounded-lg bg-gray-200 dark:bg-gray-800"}),e("div",{className:"h-9 w-24 rounded-lg bg-gray-200 dark:bg-gray-800"})]})]}),t("div",{className:"relative border-b border-gray-200 dark:border-gray-800",children:[e("div",{className:"px-5 pt-4",children:e("div",{className:"h-3 w-12 rounded bg-gray-200 dark:bg-gray-800"})}),e("div",{className:"px-5 pb-4 pt-3",children:e("div",{className:"h-28 rounded-xl bg-gray-100 dark:bg-gray-900"})}),e("div",{className:"border-t border-gray-200 px-5 py-4 dark:border-gray-800",children:t("div",{className:"flex flex-wrap gap-3",children:[e("div",{className:"h-10 w-28 rounded-lg bg-gray-200 dark:bg-gray-800"}),e("div",{className:"h-10 w-36 rounded-lg bg-gray-200 dark:bg-gray-800"})]})})]})]})}var U=A(()=>D(()=>import("./HomeApplicationStarter-DKoDL7uE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])),"H0"),De=U.preload;function ze(){return e(z,{when:L({rootMargin:"180px 0px"}),prefetch:Ne({timeout:3500}),fallback:e(Ae,{}),h:"0_59712d4a1c",p:De,children:e(U,{})})}var Le=A(()=>D(()=>import("./HomeCommunitySection-DX_KgsdY.js"),__vite__mapDeps([15,2,3,4,5,6,7,8,16,17,18,19])),"H0");function je(){return e(z,{when:L({rootMargin:"25%"}),fallback:e(Me,{}),h:"0_e9b200577e",children:e(Le,{})})}function Me(){return t("div",{className:"space-y-24",children:[t("div",{className:"px-4 lg:max-w-(--breakpoint-lg) md:mx-auto",children:[e("div",{className:"h-10 w-52 rounded bg-gray-200/70 dark:bg-gray-800/70 animate-pulse mb-6"}),e("div",{className:"grid gap-6 grid-cols-2 lg:grid-cols-3",children:Array.from({length:6}).map((a,l)=>e("div",{className:"h-52 rounded-lg bg-gray-100/70 dark:bg-gray-900/60 animate-pulse"},`maintainer-skeleton-${l}`))})]}),t("div",{className:"lg:max-w-(--breakpoint-lg) px-4 mx-auto",children:[e("div",{className:"h-10 w-44 rounded bg-gray-200/70 dark:bg-gray-800/70 animate-pulse mb-8"}),e("div",{className:"aspect-square max-w-[900px] mx-auto rounded-full bg-gray-100/70 dark:bg-gray-900/60 animate-pulse"})]})]})}function He({className:a,buttonClassName:l,noteClassName:s,successClassName:o,showNote:n=!0}){const r=pe(),d=me(),{notify:i}=fe(),{openLoginModal:c}=ue(),g=r?.signupSources.includes("newsletter")??!1,{mutate:h,isPending:p}=ge({mutationFn:()=>Te({data:{source:"newsletter"}}),onSuccess:async x=>{await d.invalidateQueries(ke),i(t("div",{children:[e("div",{className:"font-medium",children:x.alreadyTagged?"Already subscribed":"You're subscribed"}),e("div",{className:"text-gray-500 dark:text-gray-400 text-xs",children:"We'll use your TanStack login email."})]}))},onError:()=>{i(t("div",{children:[e("div",{className:"font-medium",children:"Subscription failed"}),e("div",{className:"text-gray-500 dark:text-gray-400 text-xs",children:"Please try again in a moment"})]}))}}),u=ee(()=>{if(!(p||g)){if(!r){c({onSuccess:()=>h()});return}h()}},[p,g,h,c,r]);return g?t("p",{className:m("inline-flex items-center gap-1.5 text-xs font-medium text-emerald-700 dark:text-emerald-400",o),children:[e(ae,{className:"h-3.5 w-3.5"}),"You're subscribed"]}):t("div",{className:m("grid gap-2",a),children:[t(b,{type:"button",onClick:u,disabled:p,className:m("w-full",l),children:[r?e(te,{className:"h-4 w-4"}):e(X,{className:"h-4 w-4"}),p?"Subscribing...":r?"Subscribe with my login":"Log in to subscribe"]}),n?e("p",{className:m("text-xs text-gray-500 dark:text-gray-400",s),children:"We'll use your TanStack login email."}):null]})}function Fe(){return t(N,{children:[e("div",{className:"px-4 mx-auto max-w-(--breakpoint-lg) relative",children:t(G,{className:"rounded-md p-8 md:p-14",children:[t("div",{children:[e("div",{className:"relative inline-block max-w-full",children:e("h3",{id:"newsletter",className:"text-3xl font-bold scroll-mt-24",children:e("a",{href:"#newsletter",className:"hover:underline decoration-gray-400 dark:decoration-gray-600",children:"Subscribe to TanStack News"})})}),e("p",{className:"text-lg mt-1",children:"New posts, releases, and ecosystem updates from TanStack."})]}),e(He,{className:"mt-4 max-w-sm",noteClassName:"text-sm opacity-50 font-semibold italic"})]})}),e("div",{className:"h-20"}),e(Ce,{})]})}var Ee=A(()=>D(()=>import("./HomeSocialProofSection-HYCjq-kn.js"),__vite__mapDeps([20,2,3,4,5,6,7,8,21,14])),"H0");function Re({recentPosts:a}){return e(z,{when:L({rootMargin:"25%"}),fallback:e(Be,{}),h:"0_cd652248ac",children:e(Ee,{recentPosts:a})})}function Be(){return t("div",{className:"space-y-24",children:[t("div",{className:"px-4 lg:max-w-(--breakpoint-lg) md:mx-auto",children:[e("div",{className:"h-10 w-40 rounded bg-gray-200/70 dark:bg-gray-800/70 animate-pulse mb-6"}),e("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-px overflow-hidden rounded-md border border-gray-200 dark:border-gray-800",children:Array.from({length:8}).map((a,l)=>e("div",{className:"min-h-[130px] bg-gray-100/70 dark:bg-gray-900/60 animate-pulse"},`partner-skeleton-${l}`))})]}),t("div",{className:"px-4 lg:max-w-(--breakpoint-lg) md:mx-auto",children:[e("div",{className:"h-10 w-56 rounded bg-gray-200/70 dark:bg-gray-800/70 animate-pulse mb-6"}),e("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:Array.from({length:3}).map((a,l)=>t(G,{className:"overflow-hidden animate-pulse",children:[e("div",{className:"aspect-video bg-gray-100 dark:bg-gray-800"}),t("div",{className:"p-4",children:[e("div",{className:"h-5 w-5/6 rounded bg-gray-200 dark:bg-gray-700"}),e("div",{className:"mt-3 h-3 w-2/3 rounded bg-gray-200 dark:bg-gray-700"}),t("div",{className:"mt-4 space-y-2",children:[e("div",{className:"h-3 rounded bg-gray-100 dark:bg-gray-800"}),e("div",{className:"h-3 rounded bg-gray-100 dark:bg-gray-800"})]})]})]},`post-skeleton-${l}`))})]})]})}function Oe(a){return`${(a/1e9).toFixed(2)} Billion`}function Ve({ratePerDay:a,weeklyDownloads:l}){return e("span",{ref:Ie({totalDownloads:l,ratePerDay:a,updatedAt:K(Date.now()).current}),style:{fontVariantNumeric:"tabular-nums"},children:l.toLocaleString()})}function S(a){return a!=null&&!Number.isNaN(a)&&a>0&&Number.isFinite(a)}function _({placeholder:a,children:l}){return t("span",{className:"inline-grid [&>*]:col-start-1 [&>*]:row-start-1",children:[e("span",{className:"invisible","aria-hidden":!0,children:a}),e("span",{children:l})]})}function T({children:a,className:l,gradientClassName:s,href:o,search:n,to:r}){const d=`group min-w-0 rounded-r-md border-l-2 px-4 py-2 text-left transition-opacity ${l} ${s}`;return r?e(y,{to:r,search:n,className:d,children:a}):e("a",{href:o,target:"_blank",rel:"noreferrer",className:d,children:a})}function Ye({library:a}){const{data:l,isLoading:s}=v(Q({library:a})),{data:o,isLoading:n}=v({...W(),enabled:!a}),{data:r,isLoading:d}=v({...Se({library:a??xe}),enabled:!!a}),i=l?.npm,c=a?i?.totalDownloads??0:o?.totalDownloads??0,g=l?.github?.starCount??0,h=a?r?.weeklyDownloads??0:o?.weeklyDownloads??0,p=a?void 0:o?.weeklyRatePerDay,u=!(a?s:n)&&S(c),x=!s&&S(g),k=!(a?d:n)&&S(h),J=u||k||x,j=s||!l,M=a?s||!i:n||!o,H=a?d||!r:n||!o;return!j&&!M&&!H&&!J?null:t("div",{className:"mx-auto grid w-full max-w-3xl grid-cols-1 gap-4 sm:grid-cols-3",children:[M||u?e(T,{to:"/stats/npm",search:R,className:"border-emerald-500 hover:text-emerald-500",gradientClassName:"bg-linear-to-r from-transparent to-emerald-500/5",children:t("div",{className:"flex min-w-0 items-start gap-3",children:[e(Z,{className:"mt-1 size-5 shrink-0 transition-colors duration-200"}),t("div",{className:"min-w-0",children:[e("div",{className:"relative text-2xl font-black leading-none tracking-tight transition-colors duration-200",children:e(_,{placeholder:"00.00 Billion",children:u?Oe(c):null})}),e("div",{className:"mt-1 text-sm font-semibold italic text-zinc-500 transition-colors duration-200 dark:text-zinc-400",children:"NPM Downloads"})]})]})}):null,H||k?e(T,{to:"/stats/npm",search:R,className:"border-cyan-500 hover:text-cyan-500",gradientClassName:"bg-linear-to-r from-transparent to-cyan-500/5",children:t("div",{className:"flex min-w-0 items-start gap-3",children:[e(se,{className:"mt-1 size-5 shrink-0 transition-colors duration-200"}),t("div",{className:"min-w-0",children:[e("div",{className:"relative text-2xl font-black leading-none tracking-tight transition-colors duration-200",children:e(_,{placeholder:"00,000,000",children:k?e(Ve,{ratePerDay:p,weeklyDownloads:h}):null})}),e("div",{className:"mt-1 text-sm font-semibold italic text-zinc-500 transition-colors duration-200 dark:text-zinc-400",children:"Weekly Downloads"})]})]})}):null,j||x?e(T,{href:a?`https://github.com/${a.repo}`:"https://github.com/orgs/TanStack/repositories?q=sort:stars",className:"border-yellow-500 hover:text-yellow-500",gradientClassName:"bg-linear-to-r from-transparent to-yellow-500/5",children:t("div",{className:"flex min-w-0 items-start gap-3",children:[e(ne,{className:"mt-1 size-5 shrink-0 transition-colors duration-200"}),t("div",{className:"min-w-0",children:[e("div",{className:"relative text-2xl font-black leading-none tracking-tight transition-colors duration-200",children:e(_,{placeholder:"000,000",children:x?g.toLocaleString():null})}),e("div",{className:"mt-1 text-sm font-semibold italic text-zinc-500 transition-colors duration-200 dark:text-zinc-400",children:"GitHub Stars"})]})]})}):null]})}function qe(){return e(Ye,{})}function Ge(){return t(N,{children:[e(f,{src:"/images/logos/splash-light.png",width:500,height:500,quality:85,className:"absolute inset-0 block h-full w-full object-contain dark:hidden",alt:"TanStack Logo",loading:"eager",fetchPriority:"high"}),e(f,{src:"/images/logos/splash-dark.png",width:500,height:500,quality:85,className:"absolute inset-0 hidden h-full w-full object-contain dark:block",alt:"TanStack Logo",loading:"eager",fetchPriority:"high"})]})}function ca(){const{recentPosts:a}=he.useLoaderData();return e(N,{children:t("div",{className:"max-w-full z-10 space-y-24",children:[t("div",{className:"space-y-8",children:[t("div",{className:"flex flex-col items-center gap-4 xl:grid xl:grid-cols-[400px_minmax(0,44rem)] 2xl:grid-cols-[500px_minmax(0,48rem)] xl:items-center xl:justify-center xl:gap-8 xl:pt-24",children:[t("div",{className:`relative w-[300px] pt-8 xl:w-[400px] xl:pt-0 2xl:w-[500px] [--ship-x:50px] [--ship-y:1.5rem] lg:[--ship-x:50px] lg:[--ship-y:1.5rem] xl:[--ship-x:80px] xl:[--ship-y:2.5rem] 2xl:[--ship-x:90px] 2xl:[--ship-y:3rem]`,children:[t(ce,{children:[e("div",{className:"absolute left-1/3 bottom-[25%] z-0 animate-ship-peek",children:e(f,{src:"/images/ship.png",alt:"",width:240,height:240,className:"w-16 xl:w-20"})}),e(y,{to:"/explore",className:"absolute left-1/3 bottom-[25%] z-20 animate-ship-peek-clickable",title:"Explore TanStack",children:e(f,{src:"/images/ship.png",alt:"Explore TanStack",width:240,height:240,className:"w-16 xl:w-20 opacity-0"})})]}),e("div",{className:"relative z-10 aspect-square",children:e(_e,{className:"cursor-pointer relative h-full w-full",children:e(Ge,{})})})]}),t("div",{className:"flex w-full max-w-md flex-col items-center gap-6 px-4 text-center md:max-w-2xl xl:max-w-[44rem] xl:items-start xl:px-0 xl:text-left 2xl:max-w-[48rem]",children:[e("div",{className:"flex gap-2 lg:gap-4 items-center",children:e("h1",{className:`inline-block font-black text-5xl md:text-6xl lg:text-8xl`,children:e("span",{className:` inline-block text-black dark:text-white mb-2 uppercase [letter-spacing:-.02em] pr-1.5 `,children:"TanStack"})})}),t("h2",{className:`font-bold text-2xl max-w-md md:text-4xl md:max-w-2xl 2xl:text-5xl lg:max-w-2xl text-balance`,style:{fontFamily:'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"'},children:["The ",e(aa,{})," application stack for the web."]}),t("p",{className:`text opacity-90 max-w-sm lg:text-xl lg:max-w-2xl text-balance`,children:["Headless, type-safe, composable tools for building modern web applications that work naturally for ",e("strong",{children:"developers"})," ","and reliably for ",e("strong",{children:"agents"}),"."]})]})]}),e("div",{className:"mx-auto mt-8 w-full max-w-[1021px] px-4 sm:px-6 md:mt-10",children:e(qe,{})}),e("div",{className:"mx-auto mt-16 w-full max-w-[1021px] px-4 sm:px-6 md:mt-20 lg:mt-14 xl:mt-12",children:e(ze,{})})]}),t("div",{className:"px-4 lg:max-w-(--breakpoint-lg) md:mx-auto",children:[e("h3",{id:"libraries",className:"text-4xl font-light mb-2 scroll-mt-24",children:e("a",{href:"#libraries",className:"hover:underline decoration-gray-400 dark:decoration-gray-600",children:"Browse the stack"})}),e("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"Every TanStack library, organized by what it does."}),e("div",{className:"grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",children:Object.entries(be).map(([l,s])=>e(ea,{groupId:l,libraries:s},l))})]}),e("div",{className:"px-4 lg:max-w-(--breakpoint-lg) md:mx-auto mt-8 flex justify-center",children:e(b,{as:y,to:"/libraries",children:"See all libraries"})}),e(Xe,{}),e(Re,{recentPosts:a}),e(je,{}),e("div",{className:"px-4 mx-auto max-w-(--breakpoint-lg)",children:t("div",{className:` rounded-md p-4 grid gap-6 bg-discord text-white overflow-hidden relative shadow-xl shadow-indigo-700/30 sm:p-8 sm:grid-cols-3 items-center`,children:[e("div",{className:`absolute transform opacity-10 z-0 right-0 top-0 -translate-y-1/3 translate-x-1/3 sm:opacity-20`,children:e("img",{src:Pe,alt:"Discord Logo",loading:"lazy",width:300,height:300})}),t("div",{className:"sm:col-span-2",children:[e("h3",{id:"discord",className:"text-3xl font-bold scroll-mt-24",children:e("a",{href:"#discord",className:"hover:underline decoration-white/50",children:"TanStack on Discord"})}),e("p",{className:"mt-4",children:"The official TanStack community to ask questions, network and make new friends and get lightning fast news about what's coming next for TanStack!"})]}),e("div",{className:"flex items-center justify-center",children:e(b,{as:"a",href:"https://discord.com/invite/WrRKjPJ",target:"_blank",rel:"noreferrer",className:"w-full mt-4 bg-white border-white hover:bg-gray-100 text-discord justify-center shadow-lg text-sm",children:"Join TanStack Discord"})})]})}),e("div",{className:"px-4 mx-auto max-w-(--breakpoint-lg)",children:t("div",{className:` rounded-md p-4 grid gap-6 bg-linear-to-br from-red-500 to-red-700 text-white overflow-hidden relative shadow-xl shadow-red-700/30 sm:p-8 sm:grid-cols-3 items-center`,children:[e("div",{className:`absolute transform opacity-10 z-0 right-0 top-0 -translate-y-1/3 translate-x-1/3 sm:opacity-20`,children:e(we,{width:300,height:300})}),t("div",{className:"sm:col-span-2",children:[e("h3",{id:"youtube",className:"text-3xl font-bold scroll-mt-24",children:e("a",{href:"#youtube",className:"hover:underline decoration-white/50",children:"TanStack on YouTube"})}),e("p",{className:"mt-4",children:"The official TanStack YouTube channel. Tutorials, deep dives, release walkthroughs, and more — free for everyone!"})]}),e("div",{className:"flex items-center justify-center",children:t(b,{as:"a",href:"https://youtube.com/@tan_stack",target:"_blank",rel:"noreferrer",className:"w-full mt-4 bg-white border-white hover:bg-gray-100 text-red-600 justify-center shadow-lg text-sm",children:[e(le,{className:"w-4 h-4"}),"Subscribe on YouTube"]})})]})}),e("div",{className:"h-4"}),e(Fe,{})]})})}var We=[{label:"Portable core",title:"Framework Agnostic",body:"Every library starts with a provider-agnostic core. Use React, Vue, Solid, Angular, or vanilla JS—your choice.",Icon:ie,accentClassName:"from-blue-500 to-cyan-500",iconClassName:"border-cyan-200 bg-cyan-50 text-cyan-700 dark:border-cyan-900 dark:bg-cyan-950/40 dark:text-cyan-300",proof:"adapters"},{label:"Compile-time contracts",title:"Type-Safe by Design",body:"First-class TypeScript support that catches bugs at compile time and makes refactoring fearless.",Icon:oe,accentClassName:"from-emerald-500 to-teal-500",iconClassName:"border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-300",proof:"types"},{label:"Real workloads",title:"Production-Grade",body:"Battle-tested in the world's largest apps. Built for real workloads, not just happy-path demos.",Icon:de,accentClassName:"from-orange-500 to-red-500",iconClassName:"border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-900 dark:bg-orange-950/40 dark:text-orange-300",proof:"adoption"},{label:"Independent tools",title:"No Vendor Lock-in",body:"Open source and independent. No hidden agendas, no platform bias—just great tools for developers.",Icon:re,accentClassName:"from-purple-500 to-pink-500",iconClassName:"border-purple-200 bg-purple-50 text-purple-700 dark:border-purple-900 dark:bg-purple-950/40 dark:text-purple-300",proof:"portable"}],$=320,I=128,w={label:"core",x:132,y:58,width:56,height:32},P=[{label:"React",x:18,y:28,width:60,height:26},{label:"Vue",x:132,y:7,width:56,height:26},{label:"Solid",x:242,y:28,width:60,height:26},{label:"Angular",x:26,y:98,width:78,height:26},{label:"Vanilla",x:216,y:98,width:78,height:26}],B=P.map(a=>{const l=V(w,a),s=V(a,w),o=Qe(l,s,.5);return{control1:o.control1,control2:o.control2,end:s,label:a.label,path:o.path,start:l}});function O(a){return{x:a.x+a.width/2,y:a.y+a.height/2}}function V(a,l){const s=O(a),o=O(l),n=o.x-s.x,r=o.y-s.y;if(n===0&&r===0)return s;const d=n===0?Number.POSITIVE_INFINITY:a.width/2/Math.abs(n),i=r===0?Number.POSITIVE_INFINITY:a.height/2/Math.abs(r),c=Math.min(d,i);return{x:s.x+n*c,y:s.y+r*c}}function Qe(a,l,s=.5){if(Math.abs(l.y-a.y)>Math.abs(l.x-a.x)){const d=a.y+(l.y-a.y)*s,i={x:a.x,y:d},c={x:l.x,y:d};return{control1:i,control2:c,path:`M ${a.x} ${a.y} C ${i.x} ${i.y}, ${c.x} ${c.y}, ${l.x} ${l.y}`}}const o=a.x+(l.x-a.x)*s,n={x:o,y:a.y},r={x:o,y:l.y};return{control1:n,control2:r,path:`M ${a.x} ${a.y} C ${n.x} ${n.y}, ${r.x} ${r.y}, ${l.x} ${l.y}`}}function Y(a){return{height:`${a.height/I*100}%`,left:`${a.x/$*100}%`,top:`${a.y/I*100}%`,width:`${a.width/$*100}%`}}function C(a){return{left:`${a.x/$*100}%`,top:`${a.y/I*100}%`}}function Ue(a,l,s,o,n){const r=1-n;return{x:r**3*a.x+3*r**2*n*l.x+3*r*n**2*s.x+n**3*o.x,y:r**3*a.y+3*r**2*n*l.y+3*r*n**2*s.y+n**3*o.y}}function Je(a,l,s,o,n){const r=1-n,d=3*r**2*(l.x-a.x)+6*r*n*(s.x-l.x)+3*n**2*(o.x-s.x),i=3*r**2*(l.y-a.y)+6*r*n*(s.y-l.y)+3*n**2*(o.y-s.y);return Math.atan2(i,d)*180/Math.PI}function Xe(){return e("section",{className:"px-4 lg:max-w-(--breakpoint-lg) md:mx-auto",children:t("div",{className:"grid gap-8 border-y border-gray-200 py-10 dark:border-gray-800 lg:grid-cols-[minmax(0,0.72fr)_minmax(0,1.28fr)] lg:gap-12 lg:py-12",children:[t("div",{className:"max-w-xl lg:max-w-sm",children:[t("div",{className:"inline-flex items-center gap-2 text-xs font-black uppercase text-gray-500 dark:text-gray-400",children:[e("span",{className:"h-2 w-2 rounded-full bg-cyan-500 shadow-[0_0_0_4px_rgba(6,182,212,0.12)]"}),"Product principles"]}),e("h3",{className:"mt-4 text-3xl font-black leading-tight sm:text-4xl",children:"Why TanStack?"}),e("p",{className:"mt-4 text-base leading-7 text-gray-600 dark:text-gray-400",children:"Our libraries are built around real products and the developers shipping them"}),e("div",{"aria-hidden":"true",className:"mt-7 hidden h-px bg-linear-to-r from-gray-300 via-gray-200 to-transparent dark:from-gray-700 dark:via-gray-800 lg:block"}),t(b,{as:y,to:"/tenets",variant:"ghost",color:"gray",className:"mt-7 border-gray-300 bg-white/70 text-gray-950 hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-950/70 dark:text-white dark:hover:bg-gray-900",children:["Read our product tenets",e(q,{className:"h-4 w-4"})]})]}),e("ol",{className:"grid gap-3 sm:grid-cols-2",children:We.map((a,l)=>t("li",{className:"group relative flex min-h-[19rem] flex-col overflow-hidden border border-gray-200 bg-white/70 p-5 shadow-sm transition-colors hover:bg-white dark:border-gray-800 dark:bg-gray-950/50 dark:hover:bg-gray-950 sm:p-6",children:[e("div",{"aria-hidden":"true",className:m("absolute inset-x-0 top-0 h-1 bg-linear-to-r",a.accentClassName)}),t("div",{className:"relative flex items-start justify-between gap-4",children:[t("div",{children:[e("p",{className:"font-mono text-[11px] font-bold uppercase text-gray-500 dark:text-gray-500",children:a.label}),e("h4",{className:"mt-4 max-w-64 text-xl font-black leading-tight text-gray-950 dark:text-white",children:a.title})]}),e("span",{className:m("flex h-11 w-11 shrink-0 items-center justify-center rounded-lg border",a.iconClassName),children:e(a.Icon,{className:"h-5 w-5"})})]}),e("p",{className:"relative mt-4 max-w-[25rem] text-sm leading-6 text-gray-600 dark:text-gray-400",children:a.body}),e(Ze,{proof:a.proof,accentClassName:a.accentClassName}),e("span",{"aria-hidden":"true",className:"absolute bottom-3 right-5 font-mono text-5xl font-black leading-none text-gray-100 transition-colors group-hover:text-gray-200 dark:text-white/[0.04] dark:group-hover:text-white/[0.07]",children:String(l+1).padStart(2,"0")})]},a.title))})]})})}function Ke({accentClassName:a}){const[l,s]=F(0),[o,n]=F(0);return E(()=>{const r=window.setInterval(()=>{s(d=>(d+1)%P.length)},1150);return()=>window.clearInterval(r)},[]),E(()=>{if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let r=0,d=0;const i=1500,c=g=>{g-d>33&&(n(g%i/i),d=g),r=window.requestAnimationFrame(c)};return r=window.requestAnimationFrame(c),()=>window.cancelAnimationFrame(r)},[]),e("div",{"aria-hidden":"true",className:"relative mt-auto h-32 pt-5 font-mono text-[10px] font-bold",children:t("div",{className:"home-adapter-graph absolute inset-x-0 top-1 h-[7.5rem] overflow-visible",children:[P.map((r,d)=>{const i=l===d;return e("span",{"data-adapter-label":r.label,style:Y(r),className:m("absolute z-20 flex items-center justify-center rounded-md border px-2 text-center text-gray-600 shadow-sm backdrop-blur transition-colors duration-500 dark:text-gray-400",i?"border-cyan-300 bg-cyan-50 text-cyan-800 shadow-cyan-500/15 dark:border-cyan-700 dark:bg-cyan-950/40 dark:text-cyan-200":"border-gray-200 bg-white/85 dark:border-gray-800 dark:bg-black/55"),children:r.label},r.label)}),e("span",{"data-adapter-label":w.label,style:Y(w),className:m("absolute z-30 flex items-center justify-center rounded-lg bg-linear-to-r text-center text-[11px] text-white shadow-lg shadow-cyan-500/15",a),children:"core"}),B.map((r,d)=>{const i=(o-d*.13+1)%1,c=Ue(r.start,r.control1,r.control2,r.end,i),g=Je(r.start,r.control1,r.control2,r.end,i);return e("span",{"data-connection-flow":r.label,style:{...C(c),transform:`translate(-50%, -50%) rotate(${g}deg)`},className:m("home-adapter-graph-flow absolute z-50",i<.08||i>.92?"opacity-0":"opacity-100")},`flow-${r.label}`)}),B.map((r,d)=>{const i=l===d;return t(N,{children:[e("span",{"data-connection-port":`${r.label}-core`,style:C(r.start),className:m("absolute z-40 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full border border-cyan-200 bg-cyan-400 shadow-[0_0_8px_rgba(34,211,238,0.55)] transition-opacity duration-500 dark:border-cyan-900",i?"opacity-100":"opacity-55")}),e("span",{"data-connection-port":`${r.label}-adapter`,style:C(r.end),className:m("absolute z-40 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full border border-cyan-200 bg-cyan-400 shadow-[0_0_8px_rgba(34,211,238,0.55)] transition-opacity duration-500 dark:border-cyan-900",i?"opacity-100":"opacity-55")})]},`ports-${r.label}`)})]})})}function Ze({proof:a,accentClassName:l}){return a==="adapters"?e(Ke,{accentClassName:l}):a==="types"?e("div",{className:"mt-auto pt-7 font-mono text-[11px] leading-5",children:e("div",{className:"rounded-lg border border-gray-200 bg-white/70 p-3 text-gray-600 dark:border-gray-800 dark:bg-black/30 dark:text-gray-400",children:[["params.postId","string"],["query.data","Project[]"],["form.email","Field"]].map(([s,o])=>t("div",{className:"flex items-center justify-between gap-3",children:[e("span",{children:s}),e("span",{className:m("bg-linear-to-r bg-clip-text font-black text-transparent",l),children:o})]},s))})}):a==="adoption"?t("div",{className:"mt-auto pt-7",children:[t("div",{className:"mb-2 flex items-center justify-between gap-3 font-mono text-[11px] font-bold uppercase text-gray-500 dark:text-gray-500",children:[e("span",{children:"critical paths"}),e("span",{className:m("bg-linear-to-r bg-clip-text text-transparent",l),children:"used daily"})]}),e("div",{className:"grid grid-cols-2 gap-1.5 font-mono text-[11px] font-bold text-gray-600 dark:text-gray-400",children:["websites","AI tools","apps","services"].map(s=>t("span",{className:"flex items-center gap-1.5 rounded-md border border-gray-200 bg-white/70 px-2 py-1.5 dark:border-gray-800 dark:bg-black/30",children:[e("span",{className:m("h-1.5 w-1.5 rounded-full bg-linear-to-r",l)}),s]},s))})]}):t("div",{className:"mt-auto pt-7",children:[e("div",{className:"flex flex-wrap gap-1.5 font-mono text-[11px] font-bold text-gray-600 dark:text-gray-400",children:["MIT","self-host","any host","no paid products"].map(s=>e("span",{className:"rounded-md border border-gray-200 bg-white/70 px-2 py-1.5 dark:border-gray-800 dark:bg-black/30",children:s},s))}),e("div",{"aria-hidden":"true",className:m("mt-3 h-px bg-linear-to-r",l)})]})}function ea({groupId:a,libraries:l}){const s=ve[a],o=ye[a];return t(y,{to:"/stack/$category",params:{category:o},className:"group flex flex-col rounded-xl border border-gray-200 bg-white/60 p-5 transition-all hover:-translate-y-0.5 hover:border-gray-300 hover:shadow-md dark:border-gray-800 dark:bg-gray-900/40 dark:hover:border-gray-700",children:[e("h4",{className:"text-base font-bold group-hover:underline",children:s}),e("ol",{className:"mt-4 space-y-2.5",children:l.map((n,r)=>t("li",{className:"flex items-start gap-2.5",children:[e("span",{className:m("flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-linear-to-br text-[10px] font-black text-white",n.colorFrom,n.colorTo),children:r+1}),e("span",{className:"min-w-0 flex-1 text-sm font-semibold leading-snug",children:n.name.replace("TanStack ","")})]},n.id))}),t("span",{className:"mt-4 inline-flex items-center gap-1 text-xs font-semibold text-gray-600 dark:text-gray-400",children:["Browse ",s.toLowerCase(),e(q,{className:"w-3 h-3 transition-transform group-hover:translate-x-0.5"})]})]})}function aa(){return e("span",{className:"home-open-source-gradient",children:"open-source"})}var ma=async({context:{queryClient:a}})=>{const[,,l]=await Promise.all([a.ensureQueryData(Q()),a.ensureQueryData(W()),$e()]);return{recentPosts:l}};export{ca as component,ma as loader};