PageSourceSearch

https://twelveearths.com/assets/chunks/chunk-dd2efb3e.js

js twelveearths.com collected 2026-10-06 16:19:10 UTC 5,280 bytes, 1 lines download raw bytes

1import{r as c,ah as N,j as t,W as O}from"./chunk-7c95c149.js";import{u as $,f as R,C as K,D as q,a as W}from"./chunk-87cee1fa.js";import{M as w,a as J,S as Q,b as Z,T as ee,d as te,A as se,D as oe}from"./chunk-5e59878c.js";import{u as re,a as I}from"./chunk-c7147f70.js";import{a as B}from"./chunk-6b9675d7.js";import{l as G,u as y}from"./chunk-a256095a.js";import{P as ne}from"./chunk-aa898620.js";import{u as p,H as D,a as T,M as E,b as _}from"../entries/pages_sites_pachon-tololo.61444f60.js";import{c as ae}from"./chunk-7e6dec72.js";import{M as ie}from"./chunk-0694b596.js";import{u as C}from"./chunk-09156800.js";import{H as ce}from"./chunk-8b458796.js";import"./chunk-56865e9e.js";import"./chunk-bd799850.js";import"./chunk-ab25de1f.js";import"./chunk-cf010ec4.js";import"./chunk-c92baa57.js";import"./chunk-ab9dfbfe.js";B(ne);const k=G([3.5,7.5],[0,1]);function le({...n}){const s=y(u=>u.progress),r=y(u=>u.toAbsolute),{scene:o,animations:m,cameras:l}=$("/sites/pachon-tololo/hudf/camera.glb"),{actions:i,mixer:a}=re(m,o);I("Animation",i,a,()=>k(r(s.get())));const h=c.useRef(l[0].fov),b=3936/2624,f=R(u=>u.size),x=l[0];c.useEffect(()=>{if(x.aspect=f.width/f.height,x.aspect>b){const u=Math.tan(w.degToRad(h.current/2)),H=x.aspect/b,A=u/H;x.fov=w.radToDeg(Math.atan(A))*2}else x.fov=h.current;x.updateProjectionMatrix()},[f]);const M=R(u=>u.set);return I("Animation",i,a,()=>k(r(s.get()))),N(()=>M({camera:l[0]}),[l,M]),t.jsx(t.Fragment,{children:t.jsx("primitive",{"rotation-y":180*Math.PI/180,object:o,...n})})}const L=c.createContext({});function ue({children:n,...s}){const r=c.useMemo(()=>({RaycastMesh:new J(new Q(.03,6,6),new Z({transparent:!0,opacity:0,depthWrite:!1}))}),[]);return t.jsx(ie,{castShadow:!0,receiveShadow:!0,meshes:r,...s,children:o=>t.jsx(L.Provider,{value:o,children:n})})}const pe=G([3.5,7.5],[0,1]);function de({i:n,source:s,mask:r,tex:o,maskTex:m}){const l=c.useContext(L),i=y(e=>e.progress),a=y(e=>e.toAbsolute),h=p(e=>e.setHovered),b=p(e=>e.setActive),f=p(e=>e.active==n),x=p(e=>e.hovered==n),M=p(e=>e.setBallHovered),u=c.useRef(null);W(e=>{u.current&&(e.raycaster.setFromCamera(e.pointer,e.camera),M(e.raycaster.intersectObject(u.current).length>0))}),o.channel=0,m.channel=1;const H=s.bb[0]/D,A=s.bb[1]/T,S=(s.bb[2]-s.bb[0])/D,F=(s.bb[3]-s.bb[1])/T,z=r.frame.x/E,V=r.frame.y/_,X=r.frame.w/E,Y=r.frame.h/_,U=c.useMemo(()=>{const e=new te(S,F),P=e.attributes.uv,j=e.attributes.uv.clone();for(let d=0;d<P.count;d++){let g=P.getX(d),v=P.getY(d);g=g*S+H,v=v*F+A,P.setXY(d,g,v)}for(let d=0;d<j.count;d++){let g=j.getX(d),v=j.getY(d);g=g*X+z,v=v*Y+V,j.setXY(d,g,v)}return e.setAttribute("uv1",j),e},[]);return t.jsxs("group",{position:[H+S/2,A+F/2,-s.dc/1e3],children:[t.jsx(l.RaycastMesh,{onPointerEnter:e=>{e.stopPropagation(),e.instanceId&&h(e.instanceId)},onClick:e=>{e.stopPropagation(),e.instanceId&&b(e.instanceId)},onPointerLeave:e=>{e.stopPropagation(),h(void 0)}}),(f||x)&&t.jsxs("mesh",{ref:u,children:[t.jsx("sphereGeometry",{args:[.01,6,6]}),t.jsx("meshBasicMaterial",{transparent:!0,opacity:f?1:.2,color:f?"#00F2F2":"#ffffff",toneMapped:!1,depthWrite:!1})]}),f&&t.jsx(ce,{zIndexRange:[20,0],className:"pointer-events-none",children:t.jsxs("div",{className:"-translate-x-1/2 -translate-y-full pb-3 whitespace-nowrap text-center font-mono text-xs select-none text-[#00F2F2] [text-shadow:0_0_4px_rgba(0,0,0,0.9),0_0_8px_rgba(0,0,0,0.7)]",children:[t.jsx("div",{children:`z ${s.z.toFixed(3)}`}),t.jsx("div",{children:`${(s.dc*3.26156).toFixed(0)} light years`})]})}),t.jsx(B.mesh,{scale:i.to(e=>pe(a(e))).to([0,.15],[3,1],"clamp").to(e=>[e,e,e]),geometry:U,children:t.jsx("meshBasicMaterial",{blending:se,map:o,side:oe,alphaMap:m,transparent:!0,depthWrite:!1})})]})}function me(){const n=p(a=>a.sources),s=p(a=>a.masks),r=p(a=>a.setActive),o=p(a=>
1a.setHovered),m=c.useRef(null),l=C("/sites/pachon-tololo/hudf/hudf4k.jpg"),i=C("/sites/pachon-tololo/hudf/mask.png");return t.jsx("group",{ref:m,"rotation-y":-180*Math.PI/180,position:[.5,-.5,0],children:t.jsx(ue,{onPointerMissed:()=>{r(void 0),o(void 0)},children:Object.values(n).map((a,h)=>{const b=s[h];return t.jsx(de,{i:h,source:a,mask:b,tex:l,maskTex:i},a.id)})})})}const he="/sites/pachon-tololo/hudf/hudf4k-placeholder.jpg";function fe({ready:n}){const[s,r]=c.useState(null),o=c.useRef(null);c.useEffect(()=>{let l=!1;return new ee().load(he,i=>{l||r(i)}),()=>{l=!0}},[]);const{opacity:m}=O({opacity:n?0:1,config:{duration:700}});return W(()=>{o.current&&(o.current.opacity=m.get())}),s?t.jsx("group",{"rotation-y":-180*Math.PI/180,position:[.5,-.5,0],children:t.jsxs("mesh",{position:[.5,.5,-.01],children:[t.jsx("planeGeometry",{args:[1,1]}),t.jsx("meshBasicMaterial",{ref:o,map:s,transparent:!0,depthWrite:!1,toneMapped:!1})]})}):null}function xe({onReady:n}){return c.useEffect(n,[]),null}function ge({render:n=!0}){const s=p(i=>i.ballHovered),r=p(i=>i.sources),o=p(i=>i.masks),[m,l]=c.useState(!1);return t.jsxs(K,{dpr:1,style:{pointerEvents:"inherit"},className:s?"cursor-crosshair":void 0,children:[!n&&t.jsx(q,{}),t.jsx(fe,{ready:m}),r&&o&&t.jsxs(c.Suspense,{fallback:null,children:[t.jsx(xe,{onReady:()=>l(!0)}),t.jsx(me,{})]}),t.jsx(le,{})]})}function ke(){const n=y(o=>o.inView),r=ae(o=>o.isVisible)&&n;return t.jsx(ge,{render:r})}export{ue as Instances,ke 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.