PageSourceSearch

https://11d9a830.blorp-6rm.pages.dev/assets/explore-screen-NZGYGLDW.js

js blorp-6rm.pages.dev collected 2026-10-03 06:37:35 UTC 7,672 bytes, 1 lines download raw bytes

1import{ax as $,r,ay as q,az as E,t as z,an as G,ao as H,j as e,P as U,I as X,a as R,T,M as Y,m as J,B as y,X as M,aD as K,U as W,c as D,bD as O,bE as ee,C as j,f as v,bZ as se,_ as w,bd as te,bC as ne,b_ as ae,S as I,b$ as ie,c0 as oe,c1 as re,a3 as le,bo as ce}from"./index-DGomepWC.js";import{b as de}from"./lemmy-sort-K2txraIi.js";import{P as me}from"./page-title-BNX8VxUJ.js";import{S as ue}from"./search-bar-TRXcUReb.js";import{S as A,M as B,V as L,a as V}from"./mousewheel-BRmJZvsE.js";/* empty css                */import{r as xe}from"./remove-md-_dnXZpEl.js";import{F as P,S as Q,E as he,a as fe}from"./explore-expanded-section-screen-C_wFfaqE.js";import"./index-lj7FE3e9.js";function pe({className:s}){return e.jsx("div",{className:v("flex flex-row flex-wrap gap-1.5 border-b py-1.5",j.mobilePadding,s),children:e.jsx(Q,{})})}function Z({swiper:s,numCols:l,hasPrev:a,hasNext:o,loading:n,children:i}){return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"absolute xl:right-full max-xl:left-0 inset-y-0 w-14 xl:bg-gradient-to-r from-background to-transparent z-10 max-md:hidden"}),a&&e.jsx(y,{size:"icon",variant:"outline",onClick:()=>s==null?void 0:s.slideTo(s.activeIndex-l),disabled:!a,className:"shadow-sm absolute top-1/2 z-10 -translate-y-1/2 left-3 disabled:opacity-0 transition-opacity max-md:hidden",children:e.jsx(ie,{})}),i,e.jsx("div",{className:"absolute xl:left-full max-xl:right-0 inset-y-0 w-14 xl:bg-gradient-to-l from-background to-transparent z-10"}),e.jsx(y,{size:"icon",variant:"outline",onClick:()=>s==null?void 0:s.slideTo(s.activeIndex+l),disabled:!o,className:"shadow-sm absolute top-1/2 z-10 -translate-y-1/2 right-3 disabled:opacity-0 transition-opacity max-md:hidden",children:!o&&n?e.jsx(oe,{className:"animate-spin"}):e.jsx(re,{})})]})}function k(){const s=z();return s.md?3:s.sm?2.05:1.05}function _(){const s=k();return e.jsx("div",{className:v("grid sm:grid-cols-2 md:grid-cols-3 gap-2",j.mobilePadding),children:Array.from({length:w.toInteger(s)*3}).fill(0).map((l,a)=>e.jsxs("div",{className:"border py-3 px-2 rounded-lg h-24 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsx(I,{className:"h-8 w-8 rounded-full"}),e.jsx(I,{className:"h-8 flex-1 rounded-md"})]}),e.jsx(I,{className:"w-full flex-1 rounded-md"})]},a))})}function ge({communityHandle:s}){const l=le(s),a=l==null?void 0:l.communityView.description;return e.jsxs(M,{className:"border py-1 px-2 rounded-lg h-24 hover:bg-accent/75",to:"/communities/c/:communityHandle",params:{communityHandle:s},children:[e.jsx(ce,{communityHandle:s,disableLink:!0}),a&&e.jsx("p",{className:"text-xs line-clamp-2 text-muted-foreground",children:xe(a)})]})}function je({sort:s,registerRefresher:l}){var f,C;const a=E(c=>c.communitiesListingType),o=ae({sort:s,type:a}),n=r.useEffectEvent(o.refetch);r.useEffect(()=>l(n),[l]);const i=r.useMemo(()=>{var c;return(c=o.data)==null?void 0:c.pages.flatMap(d=>d.communities)},[o.data]),u=k(),x=r.useRef(null),p=Math.min(3,Math.ceil(((f=i==null?void 0:i.length)!=null?f:0)/3)),h=r.useMemo(()=>w.chunk(i,p),[i,p]),[g,N]=r.useState(0),b=g>0,t=g<h.length-u,m=()=>{o.hasNextPage&&!o.isFetchingNextPage&&o.fetchNextPage()};return e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-row items-center justify-between",children:[e.jsxs("button",{className:v("font-bold capitalize",j.mobilePadding),onClick:()=>{var c;return(c=x.current)==null?void 0:c.swiper.slideTo(0)},children:[s.split(/(?=[A-Z])/).join(" ")," Communities"]}),e.jsx(y,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(M,{to:"/communities/sort/:sort",params:{sort:s},children:"Show more"})})]}),!(i!=null&&i.length)&&o.isPending?e.jsx(_,{}):e.jsx("div",{className:"relative",children:e.jsx(Z,{swiper:(C=x.current)==null?void 0:C.swiper,hasPrev:b,hasNext:t,numCols:u,loading:o.isFetchingNextPage,children:e.jsx(A,{className:v("md:-mx-14! md:px-14! py-2!",j.mobilePadding),ref:x,modules:[B,L],spaceBetween:8,slidesPerView:u,mousewheel:{enabled:!0,forceToAxis:!0},virtual:!0,onReachEnd:m,onActiveIndexChange:c=>N(c.activeIndex),children:h==null?void 0:h.map(c=>e.jsx(V,{className:"flex! flex-col gap-2",children:c.map(d=>e.jsx(ge,{communityHandle:d},d))},c[0]))})})})]})}function be({registerRefresher:s}){var f,C,c;const l=E(d=>d.communitiesListingType),a=se({type:l==="ModeratorView"?void 0:l}),o=r.useEffectEvent(a.refetch);r.useEffect(()=>s(o),[s]);const n=r.useMemo(()=>{var d;return(d=a.data)==null?void 0:d.pages.flatMap(S=>S)},[(f=a.data)==null?void 0:f.pages]),i=k(),u=r.useRef(null),x=Math.min(3,Math.ceil(((C=n==null?void 0:n.length)!=null?C:0)/3)),p=r.useMemo(()=>w.isNil(n)?[]:w.chunk(n,x),[n,x]),[h,g]=r.useState(0),N=h>0,b=a.hasNextPage||h<p.length-i,t=()=>{a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},m=te();return!ne(m)||!(n!=null&&n.length)&&!a.isPending?null:e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-row items-center justify-between",children:[e.jsx("h2",{className:v("font-bold",j.mobilePadding),children:"Multi Community Feeds"}),e.jsx(y,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(M,{to:"/communities/sort/:sort",params:{sort:P},children:"Show more"})})]}),!(n!=null&&n.length)&&a.isPending?e.jsx(_,{}):e.jsx("div",{className:"relative",children:e.jsx(Z,{swiper:(c=u.current)==null?void 0:c.swiper,hasPrev:N,hasNext:b,numC
1ols:i,loading:a.isFetchingNextPage,children:e.jsx(A,{className:v("md:-mx-14! md:px-14! py-2!",j.mobilePadding),ref:u,modules:[B,L],spaceBetween:8,slidesPerView:i,mousewheel:{enabled:!0,forceToAxis:!0},virtual:!0,onReachEnd:t,onActiveIndexChange:d=>g(d.activeIndex),children:p.map(d=>e.jsx(V,{className:"flex! flex-col gap-3",children:d.map(S=>e.jsx("div",{className:"border rounded-lg h-[88px] hover:bg-accent/75",children:e.jsx(fe,{apId:S,expand:!0,className:"p-2"})},S))},d[0]))})})})]})}const F=["TopAll",P,"New","ActiveDaily","Active"];function Ie(){const s=$(),[l,a]=r.useState(""),{communitySorts:o}=q(),n=E(t=>t.communitiesListingType),i=F==null?void 0:F.filter(t=>(o==null?void 0:o.includes(t))||t===P),u=z(),x=r.useRef(null),p=G();H({scrollToTop:r.useCallback(async()=>{var m;const t=await((m=x.current)==null?void 0:m.getScrollElement());t&&t.scrollTo({top:0,behavior:"smooth"})},[]),focused:p});const[h,g]=r.useState([]);async function N(t){const m=h.map(f=>f());await Promise.all(m),t.detail.complete()}const b=r.useCallback(t=>(g(m=>[...m,t]),()=>{g(m=>m.filter(f=>f!==t))}),[]);return e.jsxs(U,{children:[e.jsx(me,{children:"Communities"}),e.jsxs(X,{children:[e.jsxs(R,{"data-tauri-drag-region":!0,children:[e.jsxs(T,{side:"left",children:[e.jsx(Y,{}),e.jsx(de,{})]}),e.jsx(ue,{value:l,onValueChange:a,onSubmit:t=>{s.push(J("/communities/s","?q=".concat(t!=null?t:l)))}
1,type:"Communities",className:"max-md:hidden","data-testid":"explore-search-bar"}),e.jsxs(T,{side:"right",children:[e.jsx(y,{size:"icon",variant:"ghost",asChild:!0,children:e.jsx(M,{to:"/communities/s",className:"md:hidden","data-testid":"explore-search-link",children:e.jsx(K,{className:"text-muted-foreground text-2xl"})})}),e.jsx(W,{})]})]}),u.maxMd&&e.jsx(R,{children:e.jsx(T,{side:"left",children:e.jsx(Q,{})})})]}),e.jsxs(D,{ref:x,fullscreen:u.maxMd,scrollY:n!=="Subscribed"&&n!=="ModeratorView",children:[e.jsx(O,{slot:"fixed",onIonRefresh:N,children:e.jsx(ee,{})}),(n==="Subscribed"||n==="ModeratorView")&&e.jsx(he,{}),n!=="Subscribed"&&n!=="ModeratorView"&&e.jsx(j,{noMobilePadding:!0,children:e.jsxs("div",{className:"flex flex-col gap-3 md:gap-5 pb-8 max-md:pt-3",children:[e.jsx(pe,{className:"max-md:hidden"}),i==null?void 0:i.map(t=>t===P?e.jsx(be,{registerRefresher:b},t):e.jsx(je,{sort:t,registerRefresher:b},t))]})})]})]})}export{Ie as default};

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