PageSourceSearch

https://twelveearths.com/assets/chunks/chunk-704406a5.js

js twelveearths.com collected 2026-10-06 16:18:55 UTC 2,469 bytes, 1 lines download raw bytes

1import{z as B,A as J,r as l,B as X,D as Y,E as $,G as v,H as p,J as Q,K as Z,L as M,U as W,M as ee,j as te}from"./chunk-7c95c149.js";const ae=t=>M(t?t(0,null):null)[0],L=Promise.resolve(),se=t=>(c,S,r)=>{const E=l.useRef(!1),{cache:s,initialSize:f=1,revalidateAll:b=!1,persistSize:C=!1,revalidateFirstPage:O=!0,revalidateOnMount:T=!1,parallel:_=!1}=r,[,,,I]=X.get(Y);let e;try{e=ae(c),e&&(e=$+e)}catch{}const[y,D,j]=v(s,e),k=l.useCallback(()=>p(y()._l)?f:y()._l,[s,e,f]);Q.useSyncExternalStore(l.useCallback(a=>e?j(e,()=>{a()}):()=>{},[s,e]),k,k);const m=l.useCallback(()=>{const a=y()._l;return p(a)?f:a},[e,f]),F=l.useRef(m());Z(()=>{if(!E.current){E.current=!0;return}e&&D({_l:C?F.current:m()})},[e,s]);const q=T&&!E.current,P=t(e,async a=>{const g=y()._i,n=[],d=m(),[x]=v(s,a),h=x().data,R=[];let z=null;for(let i=0;i<d;++i){const[o,A]=M(c(i,_?null:z));if(!o)break;const[G,H]=v(s,o);let u=G().data;const K=b||g||p(u)||O&&!i&&!p(h)||q||h&&!p(h[i])&&!r.compare(h[i],u);if(S&&K){const N=async()=>{if(!(o in I))u=await S(A);else{const V=I[o];delete I[o],u=await V}H({data:u,_k:A}),n[i]=u};_?R.push(N):await N()}else n[i]=u;_||(z=u)}return _&&await Promise.all(R.map(i=>i())),D({_i:W}),n},r),w=l.useCallback(function(a,g){const n=typeof g=="boolean"?{revalidate:g}:g||{},d=n.revalidate!==!1;return e?(d&&(p(a)?D({_i:!0}):D({_i:!1})),arguments.length?P.mutate(a,{...n,revalidate:d}):P.mutate()):L},[e,s]),U=l.useCallback(a=>
1{if(!e)return L;const[,g]=v(s,e);let n;if(ee(a)?n=a(m()):typeof a=="number"&&(n=a),typeof n!="number")return L;g({_l:n}),F.current=n;const d=[],[x]=v(s,e);let h=null;for(let R=0;R<n;++R){const[z]=M(c(R,h)),[i]=v(s,z),o=z?i().data:W;if(p(o))return w(x().data);d.push(o),h=o}return w(d)},[e,s,w,m]);return{size:m(),setSize:U,mutate:w,get data(){return P.data},get error(){return P.error},get isValidating(){return P.isValidating},get isLoading(){return P.isLoading}}},re=B(J,se);function oe({data:t,size:c,isLoading:S}){var f,b,C;const r=((f=t==null?void 0:t[0])==null?void 0:f.children.data.length)===0,E=!r&&(S||!!(c>0&&t&&typeof t[c-1]>"u")),s=!r&&!(t&&((b=t[t.length-1])==null?void 0:b.children.pagination.page)===((C=t[t.length-1])==null?void 0:C.children.pagination.pages));return{isEmpty:r,isLoadingMore:E,hasNextPage:s}}function le({delay:t=500}){const[c,S]=l.useState(!1);return l.useEffect(()=>{const r=setTimeout(()=>{S(!0)},t);return()=>{clearTimeout(r)}},[t]),c?te.jsx("p",{children:"Loading..."}):null}export{le as D,oe as a,re as u};

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.