1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2959],{14341:(e,t,r)=>{"use strict";r.d(t,{SearchPostResults:()=>c});var s=r(95155),n=r(52619),a=r.n(n),l=r(48314),i=r(35299),o=r(61306);function c(e){let{query:t,initialItems:r,initialNextCursor:n}=e,c=(0,o.k)({initialItems:r,initialNextCursor:n,sessionKey:"anicircle:search-posts:".concat(t.trim().toLowerCase()||"all"),getPageUrl:e=>{let r=new URLSearchParams({limit:"12"});return t.trim()&&r.set("q",t.trim()),e&&r.set("cursor",e),"/api/search/posts?".concat(r.toString())}});return(0,s.jsxs)("div",{className:"grid gap-3",children:[c.items.map(e=>(0,s.jsxs)(a(),{href:"/threads/".concat(e.id),className:"rounded-[18px] border border-[var(--app-border)] bg-[var(--app-surface-soft)] p-4",children:[(0,s.jsx)("h3",{className:"font-black text-[var(--app-text)]",children:e.subject||e.body.slice(0,90)}),(0,s.jsx)("p",{className:"mt-2 line-clamp-2 text-sm font-medium text-[var(--app-text-muted)]",children:e.body}),(0,s.jsxs)("p",{className:"mt-3 text-xs font-semibold text-[var(--app-text-faint)]",children:[e.author," - ",e.replies," replies"]})]},e.id)),c.items.length?null:(0,s.jsx)("p",{className:"mt-3 text-sm font-medium text-[var(--app-text-muted)]",children:"No posts matched this search yet"}),c.error?(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-[18px] border border-berry/25 bg-berry/10 p-4",children:[(0,s.jsx)("p",{className:"text-sm font-black text-berry",children:"Could not load more posts"}),(0,s.jsxs)("button",{type:"button",onClick:c.retry,className:"focus-ring wire-button wire-button-secondary",children:[(0,s.jsx)(l.A,{size:15}),"Retry"]})]}):null,c.isFetchingNextPage?(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 py-3 text-sm font-black text-[var(--app-text-muted)]",children:[(0,s.jsx)(i.A,{size:16,className:"animate-spin"}),"Loading more"]}):null,!c.hasNextPage&&c.items.length?(0,s.jsx)("p",{className:"py-3 text-center text-sm font-black text-[var(--app-text-muted)]",children:"You are all caught up"}):null,(0,s.jsx)(o.A,{disabled:!c.hasNextPage||c.isFetchingNextPage||!!c.error,onVisible:()=>void c.fetchNextPage()})]})}},48314:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(71847).A)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},61306:(e,t,r)=>{"use strict";r.d(t,{A:()=>i,k:()=>l});var s=r(95155),n=r(12115);function a(e){let t=new Set,r=[];for(let s of e)t.has(s.id)||(t.add(s.id),r.push(s));return r}function l(e){let{initialItems:t,initialNextCursor:r,getPageUrl:s,sessionKey:l,newItemsPollMs:i}=e,o=(0,n.useRef)(!1),c=(0,n.useRef)(l),u=(0,n.useRef)(t),[d,m]=(0,n.use
1State)(t),[f,h]=(0,n.useState)(r),[p,x]=(0,n.useState)(!1),[w,b]=(0,n.useState)(!1),[v,g]=(0,n.useState)(!1),[y,N]=(0,n.useState)(null),[j,k]=(0,n.useState)(null),E=!!f,S=!!(null==y?void 0:y.items.length);(0,n.useEffect)(()=>{c.current!==l&&(c.current=l,o.current=!1,m(t),h(r),N(null),k(null))},[t,r,l]),(0,n.useEffect)(()=>{u.current=d},[d]),(0,n.useEffect)(()=>{if(!l||o.current)return;o.current=!0;let e=window.sessionStorage.getItem(l);if(e)try{let r=JSON.parse(e);if(Array.isArray(r.items)){var t;m(a(r.items)),u.current=a(r.items),h(null!=(t=r.nextCursor)?t:null),window.requestAnimationFrame(()=>{var e;return window.scrollTo({top:null!=(e=r.scrollY)?e:0})})}}catch(e){}},[l]),(0,n.useEffect)(()=>{if(!l)return;let e=()=>{let e={items:d,nextCursor:f,scrollY:window.scrollY};window.sessionStorage.setItem(l,JSON.stringify(e))};return e(),window.addEventListener("pagehide",e),()=>window.removeEventListener("pagehide",e)},[d,f,l]);let C=(0,n.useCallback)(async()=>{if(f&&!w){b(!0),k(null);try{let e=await fetch(s(f),{cache:"no-store"});if(!e.ok)throw Error("Could not load more");let t=await e.json();m(e=>{let r=a([...e,...t.items]);return u.current=r,r}),h(t.nextCursor)}catch(e){k(e instanceof Error?e:Error("Could not load more"))}finally{b(!1),x(!1)}}},[s,w,f]),P=(0,n.useCallback)(()=>{C()},[C]),A=(0,n.useCallback)(async()=>{if(!v){g(!0);try{let e=await fetch(s(null),{cache:"no-store"});if(!e.ok)return;let t=await e.json(),r=new Set(u.current.map(e=>e.id)),n=t.items.filter(e=>!r.has(e.id));N(n.length?{...t,items:n}:null)}finally{g(!1)}}},[s,v]),R=(0,n.useCallback)(()=>{y&&(m(e=>{let t=a([...y.items,...e]);return u.current=t,t}),N(null))},[y]);return(0,n.useEffect)(()=>{if(!i||i<1e3)return;let e=window.setInterval(()=>{A()},i),t=()=>void A();return window.addEventListener("focus",t),()=>{window.clearInterval(e),window.removeEventListener("focus",t)}},[A,i]),(0,n.useMemo)(()=>({items:d,setItems:m,fetchNextPage:C,checkForNewItems:A,showNewItems:R,hasNextPage:E,hasNewItems:S,isInitialLoading:p,isFetchingNextPage:w,isCheckingForNewItems:v,error:j,retry:P}),[A,j,C,S,E,v,w,p,d,P,R])}function i(e){let{disabled:t,onVisible:r,className:a="h-8"}=e,l=(0,n.useRef)(null),i=(0,n.useRef)(r);return i.current=r,(0,n.useEffect)(()=>{let e=l.current;if(!e||t)return;let r=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&i.current()},{rootMargin:"420px 0px"});return r.observe(e),()=>r.disconnect()},[t]),(0,s.jsx)("div",{ref:l,className:a,"aria-hidden":"true"})}},94076:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,52619,23)),Promise.resolve().then(r.bind(r,22987)),Promise.resolve().then(r.bind(r,6487)),Promise.resolve().then(r.bind(r,89157)),Promise.resolve().then(r.bind(r,14341))}},e=>{e.O(0,[2619,3019,4850,8441,8229,3284,7358],()=>e(e.s=94076)),_N_E=e.O()}]);
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.