<!-- SOLID-PLAYTIME · part 174 -->
G CROSSING REMAINS":Ft>160?"THE FAR LIGHT IS DRAWING NEARER":Ft>45?"THE ONWARD STORM IS CLOSE":"THE ONWARD MOUTH IS HERE",yt=this.x<-215&&this.z<-135?"THUNDER MESA":this.x>205&&this.z>20?"EMBER WILDS":this.x>175&&this.z<-205?"CROWN SPUR":this.x<-235&&this.z>125?"FAR LANTERN":this.z>120?"ARRIVAL ISLE":this.x<-25?"CYAN REACH":this.z>-80?"THE GUILLOCHE CAUSEWAY":"MAGENTA CROWN";this.onEvent({type:"status",status:{place:yt,route:Y,nearby:ot}})}}enterNearby(){if(this.triggered==="return")this.onEvent({type:"return"});else if(this.triggered==="onward")this.onEvent({type:"onward"});else this.onEvent({type:"message",text:"NO WORMHOLE IS WITHIN REACH"})}resize(){let t=Math.max(1,this.mount.clientWidth),e=Math.max(1,this.mount.clientHeight);this.camera.aspect=t/e,this.camera.updateProjectionMatrix(),this.renderer.setSize(t,e,!1)}dispose(){this.disposed=!0,cancelAnimationFrame(this.raf),this.resizeObserver.disconnect(),document.removeEventListener("visibilitychange",this.onVisibilityChange),this.mount.removeEventListener("pointermove",this.onTrackMove),this.mount.removeEventListener("pointerdown",this.onTapDown),this.mount.removeEventListener("pointerup",this.onTapUp),this.scene.traverse((t)=>{if(t instanceof At||t instanceof Ta||t instanceof ts){t.geometry.dispose();let e=t.material;if(Array.isArray(e))e.forEach((n)=>n.dispose());else e.dispose()}}),this.leaderboardTexture?.dispose(),this.renderer.dispose(),this.renderer.domElement.remove()}}function YM(){return typeof performance>"u"?Date.now():performance.now()}var QM=["#74f5ff","#ff4ee5","#37e6a1","#72ff9b","#ff795d","#b99cff","#56c8ff","#5f8cff"],$3={place:"ARRIVAL ISLE",route:"A LONG CROSSING REMAINS",nearby:"entrance"};function ZM(t,e){if(e)return t;let n=t.trim().toLowerCase();if(n==="#ffd66d")return"#b99cff";let i=n.match(/^#([0-9a-f]{6})$/i);if(!i)return t;let s=i[1];if(!s)return t;let a=Number.parseInt(s,16),r=(a>>16&255)/255,o=(a>>8&255)/255,l=(a&255)/255,c=Math.max(r,o,l),u=Math.min(r,o,l),f=c-u,h=c===0?0:f/c,p=0;if(f>0)if(c===r)p=60*((o-l)/f%6);else if(c===o)p=60*((l-r)/f+2);else p=60*((r-o)/f+4);if(p<0)p+=360;return p>=40&&p<=55&&h>=0.55?"#b99cff":t}function J3(){try{let s=JSON.parse(localStorage.getItem("seven-nightmares-lobby-traveler")??"null");if(s&&typeof s.id==="string"&&typeof s.color==="string"){let a=window.__travelerSeed?.isKing===!0?"#ffd66d":ZM(s.color,!1);if(a!==s.color)localStorage.setItem("seven-nightmares-lobby-traveler",JSON.stringify({id:s.id,color:a}));return{id:s.id,color:a,isKing:window.__travelerSeed?.isKing===!0,x:8,z:190}}}catch{}let e=new Uint32Array(1);crypto.getRandomValues(e);let n=e[0]??Date.now(),i={id:`traveler-${n.toString(36)}`,color:window.__travelerSeed?.isKing===!0?"#ffd66d":QM[n%QM.length]??"#74f5ff",isKing:window.__travelerSeed?.isKing===!0,x:8,z:190};return localStorage.setItem("seven-nightmares-lobby-traveler",JSON.stringify({id:i.id,color:i.color})),i}function W3(t){if(!t||typeof t!=="object"||!("leaders"in t)||!Array.isArray(t.leaders))return{status:"error",leaders:[]};return{status:"ready",leaders:t.leaders.flatMap((n)=>{if(!n||typeof n!=="object"||!("name"in n)||!("infusion"in n))return[];let i=typeof n.name==="string"?n.name.trim():"",s=typeof n.infusion==="number"?n.infusion:Number(n.infusion);if(!i||!Number.isFinite(s))return[];return[{name:i,infusion:s}]}).sort((n,i)=>i.infusion-n.infusion).slice(0,10)}}async function qM(t){try{let e=window.location.pathname.replace(/\/+$/,""),n=new URL(`${e}/actions`,window.location.origin),i=await fetch(n,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"loadProgress",args:{}})});if(i.status===200)window.location.href=t;else if(i.status===401)window.location.href=`/login?next=${t}`}catch{}}function KM(){let t=pd(J3,[]),e=Xe(null),n=Xe(null),i=Xe(null),s=Xe(null),a=Xe({x:0,y:0}),r=Xe(null),o=Xe(null),[l,c]=re($3),[u,f]=re("YOU ARRIVE BEFORE THE MISSION BEGINS"),[h,p]=re(!1),[v,y]=re(""),[U,d]=re([{who:"ISLAND SIGNAL",text:"This is the free lobby. Walk, gather, and choose when the company is ready to cross."}]),[g,m]=re({status:"loading",leaders:[]}),[x,S]=re(()=>new Set),[A,T]=re(!1),[w,b]=re(!1),M=kn((q)=>{if(f(q),o.current)window.clearTimeout(o.current);o.current=window.setTimeout(()=>f(""),2700)},[]),R=kn((q)=>{if(q.type==="status")c(q.status);if(q.type==="message")M(q.text);if(q.type==="return")qM("/solid");if(q.type==="onward")b(!0),window.setTimeout(()=>void qM("/solid/playtime/2"),620)},[M]);Ze(()=>{let q=e.current;if(!q)return;let dt=new ng(q,t,R);return n.current=dt,dt.setLeaderboard(g),()=>{dt.dispose(),n.current=null}},[R,t]),Ze(()=>{n.current?.setLeaderboard(g)},[g]),Ze(()=>{let q=e.current,dt=i.current;if(!q||!dt)return;let Ft=(Et)=>Et.preventDefault();return q.addEventListener("touchstart",Ft,{passive:!1}),dt.addEventListener("touchstart",Ft,{passive:!1}),()=>{q.removeEventListener("touchstart",Ft),dt.removeEventListener("touchstart",Ft)}},[]),Ze(()=>{let q=!