dsh-ccx 0.8.9 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/LICENSE +21 -21
  2. package/NOTICE +23 -23
  3. package/README.md +151 -143
  4. package/assets/icon.svg +27 -27
  5. package/cordis.patch.yml +16 -16
  6. package/lib/client.js +1481 -2244
  7. package/lib/index.js +716 -449
  8. package/lib/vendor/code-codex/ascii-tiles.js +145 -0
  9. package/lib/vendor/code-codex/aurora-ionosphere.js +7 -6
  10. package/lib/vendor/code-codex/black-hole.js +10 -7
  11. package/lib/vendor/code-codex/blinking-squares.js +6 -13
  12. package/lib/vendor/code-codex/cloud-train.js +9 -8
  13. package/lib/vendor/code-codex/galleries.json +100 -100
  14. package/lib/vendor/code-codex/glow-horizon.js +1 -1
  15. package/lib/vendor/code-codex/heavenly-cloud.js +5 -4
  16. package/lib/vendor/code-codex/milky-way.js +3 -2
  17. package/lib/vendor/code-codex/mountain.js +5 -4
  18. package/lib/vendor/code-codex/particle-image.js +435 -14
  19. package/lib/vendor/code-codex/pixel-sculpt.js +85 -5
  20. package/lib/vendor/code-codex/scene-defaults.json +94 -1
  21. package/lib/vendor/code-codex/scene-schemas.json +1008 -0
  22. package/lib/vendor/code-codex/shallow-ocean-thumbnails.json +12 -0
  23. package/lib/vendor/code-codex/shallow-ocean.js +5094 -0
  24. package/lib/vendor/code-codex/spectral-drape.js +172 -0
  25. package/package.json +70 -59
  26. package/src/client/api.ts +90 -0
  27. package/src/client/background/layer.ts +187 -0
  28. package/src/client/background/pixel-sculpt.ts +167 -0
  29. package/src/client/background/scene-runner.ts +317 -0
  30. package/src/client/background/shallow-ocean.ts +344 -0
  31. package/src/client/background/vendor-loader.ts +297 -0
  32. package/src/client/background/wallpaper.ts +87 -0
  33. package/src/client/index.ts +247 -0
  34. package/src/client/surfaces/corner-patch.ts +100 -0
  35. package/src/client/surfaces/surface-css.ts +155 -0
  36. package/src/client/ui/draft.ts +105 -0
  37. package/src/client/ui/icons.ts +47 -0
  38. package/src/client/ui/panel.ts +1524 -0
  39. package/src/client/ui/shallow-ocean-panel.ts +376 -0
  40. package/src/client/ui/styles.ts +1471 -0
  41. package/src/host/fence.ts +78 -0
  42. package/src/host/index.ts +26 -0
  43. package/src/host/routes.ts +367 -0
  44. package/src/host/storage.ts +109 -0
  45. package/src/host/window-chrome.ts +53 -0
  46. package/src/shared/constants.ts +239 -0
  47. package/src/shared/sanitize.ts +110 -0
  48. package/src/shared/types.ts +145 -0
  49. package/tsconfig.json +16 -0
@@ -257,14 +257,14 @@ Nothing in this notice limits rights granted directly by an applicable license,
257
257
 
258
258
 
259
259
  */
260
- (()=>{var fn=/(token|cookie|password|secret|credential|authorization|apikey)/i,mn=/^(content|text|body|prompt|messages|title|filename|name|raw|data|database64|commandline|sessionid|accountid|threadid|projectid)$|(?:path|url|uri)$/i;function X(r){return r.slice(0,8e3).replace(/\b[A-Za-z][A-Za-z0-9+.-]*:\/\/[^\s"'<>]+/g,o=>{try{let u=new URL(o);if(["127.0.0.1","localhost","[::1]"].includes(u.hostname)&&!u.username&&!u.password&&["/json/version","/json/list","/"].includes(u.pathname))return`${u.origin}${u.pathname}`}catch{}return"[url]"}).replace(/(?:\b[A-Za-z]:[\\/]|\\\\|\/(?:Users|home|tmp|var|etc|opt|mnt)\/|~\/)[^\r\n"'<>]*/g,"[path]").replace(/\b(?:Bearer\s+\S+|(?:authorization|password|secret|(?:access[_-]?|refresh[_-]?)?token|api[_-]?key|cookie)\s*[:=]\s*[^,;\r\n]+)/gi,"[credential]").replace(/\bsk-[A-Za-z0-9_-]{8,}|\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,"[credential]").replace(/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g,"[email]").slice(0,4e3)+(r.length>8e3?" [truncated]":"")}function Ct(r){let n=256,o=new WeakSet,u=(c,m)=>{if(--n<0||m>6)return"[truncated]";if(typeof c=="string")return X(c);if(c===null||typeof c=="boolean"||typeof c=="number")return c;if(typeof c!="object")return"[unsupported]";if(o.has(c))return"[circular]";if(o.add(c),c instanceof Error)return{name:X(c.name),message:X(c.message)};if(Array.isArray(c))return c.slice(0,128).map(e=>u(e,m+1));let fe=Object.create(null);for(let[e,Z]of Object.entries(c).slice(0,128)){let z=e.replace(/[^a-z0-9]/gi,"");fe[X(e).slice(0,160)]=fn.test(z)||mn.test(z)?"[redacted]":u(Z,m+1)}return fe};try{return u(r,0)}catch{return{redactionFailed:!0}}}var hn=Symbol.for("code-codex:runtime-events:v1"),pn=window,We=pn[hn]??={events:[],dropped:0};function Pt(r,n,o,u={}){let c={source:X(r).slice(0,160),action:X(n).slice(0,160),outcome:X(o).slice(0,160),details:{...Ct(u),observedAt:Date.now(),documentElapsedMs:Math.round(performance.now())}},m=new TextEncoder().encode(JSON.stringify(c)).length;m>7e3&&(c.details={truncated:!0,originalBytes:m,observedAt:Date.now(),documentElapsedMs:Math.round(performance.now())}),We.events.push(c),We.events.length>1e3&&(We.events.splice(0,200),We.dropped+=200)}var gn=Symbol.for("code-codex:background-startup-hold:v1");function at(){let r=window;return r[gn]??={active:!1,layers:new Set,next:-1,pending:new Map,painted:new WeakSet,openings:new WeakMap}}function vn(r){return r.closest("[data-code-codex-particle-layer]")}function yn(r,n){n.native=requestAnimationFrame(o=>{let u=at();n.native=void 0,u.pending.has(r)&&(u.active&&u.painted.has(n.layer)||(u.pending.delete(r),u.active&&(u.painted.add(n.layer),u.layers.add(n.layer),Pt("background-opening","initial frame","prepared")),n.callback(o)))})}function Ut(r,n){let o=vn(r);if(!o)return requestAnimationFrame(n);let u=at(),c=u.next--,m={layer:o,callback:n};return u.pending.set(c,m),yn(c,m),c}function Bt(r){if(r>=0){cancelAnimationFrame(r);return}let n=at(),o=n.pending.get(r);o?.native!==void 0&&cancelAnimationFrame(o.native),n.pending.delete(r)}var bn="code-codex:black-hole-background:v1";var Nt=Object.freeze({distance:24,elevation:-5.5,azimuth:0,orbitSpeed:0,roll:-20,fov:42,diskInner:3,diskOuter:15,diskThickness:.26,diskDensity:1,brightness:1,spinSpeed:.06,grain:.48,doppler:.35,hotColor:"#FFF3DE",midColor:"#FF9838",coolColor:"#8E3A0B",starBrightness:0,glow:1,exposure:.9,vignette:.28,steps:200,resolution:.4,maxDpr:1,paused:!1}),On=Object.freeze({variant:"bottom",inertialWheel:!0,openingDuration:2,wheelSensitivity:1,wheelDownIntensity:.4,wheelUpIntensity:.8,wheelTravelScale:1,wheelDownDistance:100,wheelUpDistance:20,wheelUpTrailDistance:18,wheelUpTrailStrength:1.15,wheelUpStiffness:180,wheelUpDamping:48,wheelReleaseDelay:70,wheelUpReleaseDelay:80,maxReleaseVelocity:2.4,returnStiffness:180,returnDamping:14,initialStretch:1.8,initialBlur:0,rimColor:"#FFFFFF",violetColor:"#A558FB",blueColor:"#4922E5",shadowColor:"#000000"}),Nn=Object.freeze({low:Object.freeze({steps:56,resolutionScale:.56,maxDpr:1}),medium:Object.freeze({steps:76,resolutionScale:.72,maxDpr:1.25}),high:Object.freeze({steps:100,resolutionScale:.86,maxDpr:1.5})}),Gn=Object.freeze({quality:"high",speed:.72,intensity:1.15,turbulence:1,radius:3,colorShift:0,pointerInfluence:.45,introDuration:2.2,introFeather:.22,paused:!1}),Wn=Object.freeze({low:Object.freeze({steps:32,rayScale:.72,maxDpr:1.1,minAdaptiveScale:.92,noiseAtlasSize:512}),medium:Object.freeze({steps:50,rayScale:.76,maxDpr:1.25,minAdaptiveScale:.9,noiseAtlasSize:768}),high:Object.freeze({steps:72,rayScale:.82,maxDpr:1.4,minAdaptiveScale:.9,noiseAtlasSize:1024})}),Xn=Object.freeze({hue:0,saturation:1,quality:"medium",speed:1,intensity:1,curtainScale:.5,turbulence:.58,glow:.72,starDensity:.56,introDuration:2.4,introFeather:.16,introStart:-.22,introEnd:1.32,introSkyEnd:.48,introStarStart:.34,paused:!1});function h(r,n,o,u){let c=typeof r=="number"?r:Number(r);return Number.isFinite(c)?Math.min(o,Math.max(n,c)):u}function st(r,n){if(typeof r!="string")return n;let o=r.trim();return/^#[0-9a-f]{6}$/i.test(o)?o.toUpperCase():n}function ut(r){let n=xn(r)?r:{},o=Nt;return{distance:h(n.distance,10,40,o.distance),elevation:h(n.elevation,-30,30,o.elevation),azimuth:h(n.azimuth,-180,180,o.azimuth),orbitSpeed:h(n.orbitSpeed,-8,8,o.orbitSpeed),roll:h(n.roll,-45,45,o.roll),fov:h(n.fov,25,75,o.fov),diskInner:h(n.diskInner,1.2,6,o.diskInner),diskOuter:h(n.diskOuter,8,24,o.diskOuter),diskThickness:h(n.diskThickness,.05,.8,o.diskThickness),diskDensity:h(n.diskDensity,.1,2,o.diskDensity),brightness:h(n.brightness,.2,2,o.brightness),spinSpeed:h(n.spinSpeed,0,.2,o.spinSpeed),grain:h(n.grain,.1,1.2,o.grain),doppler:h(n.doppler,0,1,o.doppler),hotColor:st(n.hotColor,o.hotColor),midColor:st(n.midColor,o.midColor),coolColor:st(n.coolColor,o.coolColor),starBrightness:h(n.starBrightness,0,2,o.starBrightness),glow:h(n.glow,0,2,o.glow),exposure:h(n.exposure,.25,1.8,o.exposure),vignette:h(n.vignette,0,1,o.vignette),steps:o.steps,resolution:o.resolution,maxDpr:o.maxDpr,paused:o.paused}}function Gt(){try{return ut(JSON.parse(localStorage.getItem(bn)||"{}"))}catch{return{...Nt}}}function xn(r){return r!==null&&typeof r=="object"}var qn=Object.freeze({top:{axis:"y",enter:-100,rest:-50},bottom:{axis:"y",enter:100,rest:50},left:{axis:"x",enter:100,rest:50},right:{axis:"x",enter:-100,rest:-50}});var Vn=Object.freeze({quality:"medium",speed:.35,amplitude:1,frequency:1,zoom:1,rotation:0,exposure:1,timeOffset:5.07,introDuration:2.8,introFeather:.18,introAngle:32,introZoom:.16,introEnabled:!0,paused:!1,colors:Object.freeze(["#d81159","#8f2d56","#218380","#fbb13c","#73d2de"])});var Sn=`
260
+ (()=>{var S=class{constructor(e){this.report=e;this.signal=this.#e.signal}#a=!1;#s=new Set;signal;#e=new AbortController;get disposed(){return this.#a}own(e){let t=!0,i=()=>{t&&(t=!1,this.#s.delete(i),e())};return this.#a?i():this.#s.add(i),i}listen(e,t,i,n){return this.#a?()=>{}:(e.addEventListener(t,i,n),this.own(()=>e.removeEventListener(t,i,n)))}dispose(){if(!this.#a){this.#a=!0,this.#e.abort();for(let e of[...this.#s].reverse())try{e()}catch(t){try{this.report(t)}catch{}}}}};function B(r){let e=0,t=0,i=0,n=(s,d)=>{if(++t>8192||d>10)throw Error("BG_ASSET_SHAPE: Visual asset structure exceeds its budget.");if(ArrayBuffer.isView(s)){if((s instanceof Float32Array||s instanceof Float64Array)&&!s.every(Number.isFinite))throw Error("BG_ASSET_NUMBER: Prepared visual numbers must be finite.");if(e+=s.byteLength,e>32*1024*1024)throw Error("BG_ASSET_SIZE: Prepared visual assets exceed 32 MiB.");return s}if(Array.isArray(s))return s.map(f=>n(f,d+1));if(s&&typeof s=="object"&&[Object.prototype,null].includes(Object.getPrototypeOf(s))){let f={};for(let[h,x]of Object.entries(s)){if(y({[h]:null}),i+=new TextEncoder().encode(h).length+4,i>65536)throw Error("BG_ASSET_METADATA: Visual asset metadata exceeds 64 KiB.");f[h]=n(x,d+1)}return f}let l=y(s);if(i+=new TextEncoder().encode(JSON.stringify(l)).length,i>65536)throw Error("BG_ASSET_METADATA: Visual asset metadata exceeds 64 KiB.");return l};return n(r,0)}function y(r){let e=0,t=(n,s)=>{if(++e>4096||s>8)throw Error("BG_STATE_LIMIT: Visual state exceeds the bounded schema.");if(n===null||typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n))throw Error("BG_STATE_NUMBER: Visual numbers must be finite.");return n}if(typeof n=="string"){if(n.length>1024)throw Error("BG_STATE_STRING: Visual strings must be bounded.");return n}if(Array.isArray(n))return n.map(d=>t(d,s+1));if(n&&typeof n=="object"&&[Object.prototype,null].includes(Object.getPrototypeOf(n))){let d={};for(let[l,f]of Object.entries(n)){if(/^(?:__proto__|constructor|prototype|token|accessToken|refreshToken|authorization|cookie|bridge|conversation|history|source|url|path)$/i.test(l))throw Error("BG_STATE_FIELD: Visual state contains an unsupported field.");f!==void 0&&(d[l]=t(f,s+1))}return d}throw Error("BG_STATE_TYPE: Visual state must contain serializable visual values.")},i=t(r,0);if(new TextEncoder().encode(JSON.stringify(i)).length>65536)throw Error("BG_STATE_SIZE: Visual state exceeds the message budget.");return i}function D(r,e){if(![r.width,r.height,r.left,r.top,e].every(Number.isFinite)||r.width<0||r.height<0)throw Error("BG_VIEWPORT_INVALID: Invalid visual dimensions.");let t=Math.max(1,Math.min(8192,r.width)),i=Math.max(1,Math.min(8192,r.height)),n=Math.min(3,Math.max(.5,e),Math.sqrt(16777216/(t*i)));return{width:t,height:i,left:r.left,top:r.top,dpr:n}}var W=/(token|cookie|password|secret|credential|authorization|apikey)/i,X=/^(content|text|body|prompt|messages|title|filename|name|raw|data|database64|commandline|sessionid|accountid|threadid|projectid)$|(?:path|url|uri)$/i;function m(r){return r.slice(0,8e3).replace(/\b[A-Za-z][A-Za-z0-9+.-]*:\/\/[^\s"'<>]+/g,t=>{try{let i=new URL(t);if(["127.0.0.1","localhost","[::1]"].includes(i.hostname)&&!i.username&&!i.password&&["/json/version","/json/list","/"].includes(i.pathname))return`${i.origin}${i.pathname}`}catch{}return"[url]"}).replace(/(?:\b[A-Za-z]:[\\/]|\\\\|\/(?:Users|home|tmp|var|etc|opt|mnt)\/|~\/)[^\r\n"'<>]*/g,"[path]").replace(/\b(?:Bearer\s+\S+|(?:authorization|password|secret|(?:access[_-]?|refresh[_-]?)?token|api[_-]?key|cookie)\s*[:=]\s*[^,;\r\n]+)/gi,"[credential]").replace(/\bsk-[A-Za-z0-9_-]{8,}|\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,"[credential]").replace(/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g,"[email]").slice(0,4e3)+(r.length>8e3?" [truncated]":"")}function C(r){let e=256,t=new WeakSet,i=(n,s)=>{if(--e<0||s>6)return"[truncated]";if(typeof n=="string")return m(n);if(n===null||typeof n=="boolean"||typeof n=="number")return n;if(typeof n!="object")return"[unsupported]";if(t.has(n))return"[circular]";if(t.add(n),n instanceof Error)return{name:m(n.name),message:m(n.message)};if(Array.isArray(n))return n.slice(0,128).map(l=>i(l,s+1));let d=Object.create(null);for(let[l,f]of Object.entries(n).slice(0,128)){let h=l.replace(/[^a-z0-9]/gi,"");d[m(l).slice(0,160)]=W.test(h)||X.test(h)?"[redacted]":i(f,s+1)}return d};try{return i(r,0)}catch{return{redactionFailed:!0}}}var q=Symbol.for("code-codex:runtime-events:v1"),V=window,T=V[q]??={events:[],dropped:0};function v(r,e,t,i={}){let n={source:m(r).slice(0,160),action:m(e).slice(0,160),outcome:m(t).slice(0,160),details:{...C(i),observedAt:Date.now(),documentElapsedMs:Math.round(performance.now())}},s=new TextEncoder().encode(JSON.stringify(n)).length;s>7e3&&(n.details={truncated:!0,originalBytes:s,observedAt:Date.now(),documentElapsedMs:Math.round(performance.now())}),T.events.push(n),T.events.length>1e3&&(T.events.splice(0,200),T.dropped+=200)}var Y=Symbol.for("code-codex:background-startup-hold:v1");function j(){let r=window;return r[Y]??={active:!1,layers:new Set,next:-1,pending:new Map,painted:new WeakSet,openings:new WeakMap}}function K(r){return r.closest("[data-code-codex-particle-layer]")}function w(r){return!!K(r)&&j().active}var M=()=>{let r=window;return r[Symbol.for("code-codex:background-isolation:v1")]??=new Map},k=class{constructor(e,t,i,n,s,d=()=>{},l={}){this.host=i;this.onError=d;if(typeof Worker!="function"||typeof n.transferControlToOffscreen!="function")throw Error("BG_BACKEND_UNAVAILABLE: Independent background rendering is unavailable.");let f=y(s),h=D(i.getBoundingClientRect(),devicePixelRatio||1);this.#t={id:e,mode:"worker",phase:"preparing",frames:0,pending:0},M().set(this,this.#t),this.#e=new S(o=>v("background","resource release","failed",{id:e,error:String(o)})),this.ready=this.firstFrame=new Promise((o,a)=>{this.#a=o,this.#s=a}),this.ready.catch(()=>{}),this.#f=h;let x=URL.createObjectURL(new Blob([t],{type:"text/javascript"}));this.#e.own(()=>URL.revokeObjectURL(x));try{this.#p=new Worker(x,{name:"code-codex-background-"+e})}catch(o){throw this.#e.dispose(),M().delete(this),o}let E=this.#p,L=setTimeout(()=>this.#o("BG_FIRST_FRAME_TIMEOUT: The background did not produce a first frame within 15 seconds."),15e3);this.#e.own(()=>clearTimeout(L)),this.#e.listen(n,"webglcontextlost",o=>{o.preventDefault(),this.#o("BG_WORKER_CONTEXT_LOST: The transferred background graphics context was lost. Enable the background again to retry.")}),this.#e.listen(E,"error",o=>this.#o("BG_WORKER_ERROR: "+o.message)),this.#e.listen(E,"messageerror",()=>this.#o("BG_WORKER_PROTOCOL: The background response could not be decoded.")),this.#e.listen(E,"message",o=>{let a=o.data;if(!(this.#i||a?.v!==1||a.session!==this.#c)){if(a.type==="failed"){this.#o("BG_WORKER_RENDER_FAILED: "+String(a.message).slice(0,1500));return}if(a.type==="first-frame"&&!this.#d&&(this.#d=!0,this.#t.frames=a.frames??1,clearTimeout(L),this.#t.phase="running",this.#a(),this.#v(),v("background","isolated first frame","ready",{id:e,backend:"worker"})),a.type==="sample"&&Number.isSafeInteger(a.frames)&&(this.#t.frames=a.frames),a.type==="event"&&typeof a.event=="string"&&this.kernelEvent(a.event,a.value),a.type==="result"&&Number.isSafeInteger(a.callId)){let c=this.#l.get(a.callId);c&&(clearTimeout(c.timer),this.#l.delete(a.callId),a.error?c.reject(Error("BG_KERNEL_FAILED: "+String(a.error))):c.resolve(a.value))}a.type==="ack"&&a.seq===this.#u&&(clearTimeout(this.#g),this.#g=void 0,this.#u=0,this.#t.pending=0,this.#m())}});let F=new ResizeObserver(()=>{let o=D(this.host.getBoundingClientRect(),devicePixelRatio||1);JSON.stringify(o)!==JSON.stringify(this.#f)&&(this.#f=o,this.#h({viewport:o}))});F.observe(i),this.#e.own(()=>F.disconnect());let P=new IntersectionObserver(o=>{this.#y=o[0]?.isIntersecting??!0,this.#v()});P.observe(i),this.#e.own(()=>P.disconnect());let _=matchMedia("(prefers-reduced-motion: reduce)");this.#e.listen(_,"change",()=>this.#h({reduced:_.matches})),this.#e.listen(document,"visibilitychange",()=>this.#v()),this.#e.listen(window,"code-codex:background-hold-changed",()=>this.#v()),this.#e.listen(window,"pagehide",()=>this.dispose());let G=o=>{if(!this.#d||this.#i||l.interactive===!1||!["pointerup","pointercancel"].includes(o.type)&&o.composedPath().some(b=>b instanceof Element&&b.matches('button,a,input,textarea,select,[contenteditable],dialog,[role="menu"],[role="menubar"],[popover]')))return;let a=o,c=this.#f;if(o instanceof PointerEvent&&!["pointermove","pointerleave","pointerup","pointercancel"].includes(o.type)&&(a.clientX<c.left||a.clientX>c.left+c.width||a.clientY<c.top||a.clientY>c.top+c.height))return;let g={type:o.type};if(o instanceof PointerEvent)Object.assign(g,{clientX:a.clientX,clientY:a.clientY,pointerId:a.pointerId,button:a.button,buttons:a.buttons,isPrimary:a.isPrimary,pointerType:a.pointerType});else if(o instanceof WheelEvent){let b=this.#r.find(p=>p.type==="state"&&p.input?.type==="wheel");if(b){let p=b.input;p.deltaX=Math.max(-1e4,Math.min(1e4,p.deltaX+o.deltaX)),p.deltaY=Math.max(-1e4,Math.min(1e4,p.deltaY+o.deltaY));return}Object.assign(g,{deltaX:o.deltaX,deltaY:o.deltaY,deltaMode:o.deltaMode,clientX:o.clientX,clientY:o.clientY})}else o instanceof KeyboardEvent&&Object.assign(g,{repeat:o.repeat,isComposing:o.isComposing,altKey:o.altKey,ctrlKey:o.ctrlKey,metaKey:o.metaKey,shiftKey:o.shiftKey,key:"",code:""});o.type==="pointermove"?((a.clientX<c.left||a.clientX>c.left+c.width||a.clientY<c.top||a.clientY>c.top+c.height)&&(g.type="pointerleave"),this.#h({input:g})):this.#r.length<8?(this.#r.push({type:"state",input:g}),this.#m()):this.#o("BG_INPUT_QUEUE_FULL: Background input exceeded the bounded discrete-event queue.")};for(let o of["pointermove","pointerleave","pointerdown","pointerup","pointercancel","wheel","keydown"])this.#e.listen(window,o,G,{passive:!0});try{let o=n.transferControlToOffscreen();E.postMessage({v:1,session:this.#c,type:"init",canvas:o,settings:f,viewport:this.#f,reduced:_.matches,held:w(i)},[o])}catch(o){this.#o("BG_CANVAS_TRANSFER: "+String(o))}}ready;firstFrame;#a;#s;#e;#p;#c=crypto.randomUUID();#b=0;#u=0;#n;#r=[];#l=new Map;#x=0;#d=!1;#i=!1;#y=!0;#f;#g;#t;get diagnostics(){return{...this.#t}}setSettings(e){this.#h({settings:y(e)})}updateSettings(e){this.setSettings(e)}replay(){if(!this.#i){if(this.#r.length>=8)throw Error("BG_COMMAND_QUEUE_FULL: Wait for the pending visual command.");this.#r.push({type:"replay"}),this.#m()}}kernelEvent(e,t){}activityChanged(e){}call(e,t=[],i=3e4){if(this.#i)return Promise.reject(Error("BG_KERNEL_DISPOSED: The visual worker has been retired."));if(this.#l.size>=8||this.#r.length>=8)return Promise.reject(Error("BG_COMMAND_QUEUE_FULL: Wait for the pending visual command."));let n=B(t),s=++this.#x,d=new Promise((l,f)=>{let h=setTimeout(()=>{this.#l.delete(s),f(Error("BG_KERNEL_TIMEOUT: The visual command did not confirm completion. It was not replayed."))},i);this.#l.set(s,{resolve:l,reject:f,timer:h})});return this.#r.push({type:"call",method:e,args:n,callId:s}),this.#m(),d}resumeOpening(){this.replay()}#v=()=>{let e=!document.hidden&&this.#y&&(!this.#d||!w(this.host));this.#h({visible:e}),this.activityChanged(e)};#h(e){this.#i||(this.#n={...this.#n,...e},this.#m())}#m(){if(this.#i||this.#u)return;let e;if(this.#n&&["settings","viewport","visible","reduced"].some(t=>t in this.#n)){let{input:t,...i}=this.#n;e={type:"state",...i},this.#n=t?{input:t}:void 0}else if(this.#r.length)e=this.#r.shift();else if(this.#n)e={type:"state",...this.#n},this.#n=void 0;else return;this.#u=++this.#b,this.#t.pending=1;try{this.#p.postMessage({v:1,session:this.#c,seq:this.#u,...e})}catch(t){this.#o("BG_WORKER_SEND_FAILED: "+String(t));return}this.#g=setTimeout(()=>this.#o("BG_WORKER_ACK_TIMEOUT: The visual worker stopped acknowledging bounded updates."),5e3)}#o(e){if(!this.#i){this.#t.phase="failed",this.#t.error=e,this.#s(Error(e)),v("background","visual worker","failed",{id:this.#t.id,session:this.#c,sequence:this.#b,pending:this.#u,message:e});try{this.onError(e)}finally{this.dispose()}}}dispose(){if(this.#i)return;this.#i=!0,this.#e.dispose(),clearTimeout(this.#g),this.#n=void 0,this.#r=[],this.#d||this.#s(new DOMException("Background preparation was cancelled.","AbortError"));for(let l of this.#l.values())clearTimeout(l.timer),l.reject(new DOMException("Background command was cancelled.","AbortError"));this.#l.clear();let e=this.#p,t=this.#c,i=++this.#b;this.#t.phase="disposing";let n=!1,s=()=>{n||(n=!0,clearTimeout(d),e.terminate(),M().delete(this))},d=setTimeout(()=>{v("background","worker disposal","unconfirmed",{id:this.#t.id,timeoutMs:1500}),s()},1500);e.addEventListener("message",l=>{l.data?.session===t&&l.data?.type==="disposed"&&s()});try{e.postMessage({v:1,session:t,seq:i,type:"dispose"})}catch{s()}}};var A=class extends k{constructor(e,t,i,n,s){super("black-hole",e,t,i,n,s),i.style.opacity="0",this.ready.then(()=>{super.replay(),i.style.opacity="1"}).catch(()=>{})}};var Z="code-codex:black-hole-background:v1";var U=Object.freeze({distance:24,elevation:-5.5,azimuth:0,orbitSpeed:0,roll:-20,fov:42,diskInner:3,diskOuter:15,diskThickness:.26,diskDensity:1,brightness:1,spinSpeed:.06,grain:.48,doppler:.35,hotColor:"#FFF3DE",midColor:"#FF9838",coolColor:"#8E3A0B",starBrightness:0,glow:1,exposure:.9,vignette:.28,steps:200,resolution:.4,maxDpr:1,paused:!1}),Te=Object.freeze({variant:"bottom",inertialWheel:!0,openingDuration:2,wheelSensitivity:1,wheelDownIntensity:.4,wheelUpIntensity:.8,wheelTravelScale:1,wheelDownDistance:100,wheelUpDistance:20,wheelUpTrailDistance:18,wheelUpTrailStrength:1.15,wheelUpStiffness:180,wheelUpDamping:48,wheelReleaseDelay:70,wheelUpReleaseDelay:80,maxReleaseVelocity:2.4,returnStiffness:180,returnDamping:14,initialStretch:1.8,initialBlur:0,rimColor:"#FFFFFF",violetColor:"#A558FB",blueColor:"#4922E5",shadowColor:"#000000"}),we=Object.freeze({low:Object.freeze({steps:56,resolutionScale:.56,maxDpr:1}),medium:Object.freeze({steps:76,resolutionScale:.72,maxDpr:1.25}),high:Object.freeze({steps:100,resolutionScale:.86,maxDpr:1.5})}),Re=Object.freeze({quality:"high",speed:.72,intensity:1.15,turbulence:1,radius:3,colorShift:0,pointerInfluence:.45,introDuration:2.2,introFeather:.22,paused:!1}),ke=Object.freeze({low:Object.freeze({steps:32,rayScale:.72,maxDpr:1.1,minAdaptiveScale:.92,noiseAtlasSize:512}),medium:Object.freeze({steps:50,rayScale:.76,maxDpr:1.25,minAdaptiveScale:.9,noiseAtlasSize:768}),high:Object.freeze({steps:72,rayScale:.82,maxDpr:1.4,minAdaptiveScale:.9,noiseAtlasSize:1024})}),Ae=Object.freeze({hue:0,saturation:1,quality:"medium",speed:1,intensity:1,curtainScale:.5,turbulence:.58,glow:.72,starDensity:.56,introDuration:2.4,introFeather:.16,introStart:-.22,introEnd:1.32,introSkyEnd:.48,introStarStart:.34,paused:!1});function u(r,e,t,i){let n=typeof r=="number"?r:Number(r);return Number.isFinite(n)?Math.min(t,Math.max(e,n)):i}function I(r,e){if(typeof r!="string")return e;let t=r.trim();return/^#[0-9a-f]{6}$/i.test(t)?t.toUpperCase():e}function $(r){let e=J(r)?r:{},t=U;return{distance:u(e.distance,10,40,t.distance),elevation:u(e.elevation,-30,30,t.elevation),azimuth:u(e.azimuth,-180,180,t.azimuth),orbitSpeed:u(e.orbitSpeed,-8,8,t.orbitSpeed),roll:u(e.roll,-45,45,t.roll),fov:u(e.fov,25,75,t.fov),diskInner:u(e.diskInner,1.2,6,t.diskInner),diskOuter:u(e.diskOuter,8,24,t.diskOuter),diskThickness:u(e.diskThickness,.05,.8,t.diskThickness),diskDensity:u(e.diskDensity,.1,2,t.diskDensity),brightness:u(e.brightness,.2,2,t.brightness),spinSpeed:u(e.spinSpeed,0,.2,t.spinSpeed),grain:u(e.grain,.1,1.2,t.grain),doppler:u(e.doppler,0,1,t.doppler),hotColor:I(e.hotColor,t.hotColor),midColor:I(e.midColor,t.midColor),coolColor:I(e.coolColor,t.coolColor),starBrightness:u(e.starBrightness,0,2,t.starBrightness),glow:u(e.glow,0,2,t.glow),exposure:u(e.exposure,.25,1.8,t.exposure),vignette:u(e.vignette,0,1,t.vignette),steps:t.steps,resolution:t.resolution,maxDpr:t.maxDpr,paused:t.paused}}function O(){try{return $(JSON.parse(localStorage.getItem(Z)||"{}"))}catch{return{...U}}}function J(r){return r!==null&&typeof r=="object"}var _e=Object.freeze({top:{axis:"y",enter:-100,rest:-50},bottom:{axis:"y",enter:100,rest:50},left:{axis:"x",enter:100,rest:50},right:{axis:"x",enter:-100,rest:-50}});var De=Object.freeze({quality:"medium",speed:.35,amplitude:1,frequency:1,zoom:1,rotation:0,exposure:1,timeOffset:5.07,introDuration:2.8,introFeather:.18,introAngle:32,introZoom:.16,introEnabled:!0,paused:!1,colors:Object.freeze(["#d81159","#8f2d56","#218380","#fbb13c","#73d2de"])});var Me=Object.freeze([.72,.46]),Ie=Math.PI/180;var z=class extends A{constructor(r,e,t,i){super(`"use strict";(()=>{globalThis.window=globalThis;function Qt(n,t,o){let i=globalThis,a=t,c=!0,b=!1,e=new Set,g=new Set,S=new EventTarget,$=Object.assign(new EventTarget,{matches:!1,media:"(prefers-reduced-motion: reduce)"}),ce=()=>({...a,x:a.left,y:a.top,right:a.left+a.width,bottom:a.top+a.height,toJSON(){return this}}),A=Object.assign(new EventTarget,{getBoundingClientRect:ce,closest:()=>null,style:{setProperty(){},removeProperty(){}},dataset:{},contains:()=>!1}),J=new Map,de={},Ve=new Proxy(n,{get(f,m){if(m==="getBoundingClientRect")return ce;if(m==="clientWidth"||m==="offsetWidth")return a.width;if(m==="clientHeight"||m==="offsetHeight")return a.height;if(m==="closest")return()=>null;if(m==="parentElement")return A;if(m==="setPointerCapture"||m==="releasePointerCapture"||m==="replaceWith")return()=>{};if(m==="style")return A.style;if(m==="dataset")return de;if(m==="getContext")return(R,y)=>{if(J.has(R))return J.get(R);let Q=f.getContext(R,y);if(!Q)return null;let ie=null,Ke=new Map,fe=new Proxy(Q,{get(B,E){let k=Reflect.get(B,E,B);return typeof k!="function"?k:(Ke.has(E)||Ke.set(E,(...T)=>{let Le=Reflect.apply(k,B,T);return E==="bindFramebuffer"&&(T[0]===B.FRAMEBUFFER||T[0]===B.DRAW_FRAMEBUFFER)&&(ie=T[1]),(E==="drawArrays"||E==="drawElements"||E==="drawArraysInstanced"||E==="drawElementsInstanced")&&ie===null&&o(),Le}),Ke.get(E))}});return J.set(R,fe),fe};let F=Reflect.get(f,m,f);return typeof F=="function"?F.bind(f):F},set(f,m,F){return Reflect.set(f,m,F,f)}});Object.defineProperties(A,{clientWidth:{get:()=>a.width},clientHeight:{get:()=>a.height}});let Ye=Object.assign(S,{get hidden(){return!c},get visibilityState(){return c?"visible":"hidden"}});Object.defineProperties(Ye,{hidden:{get:()=>!c},visibilityState:{get:()=>c?"visible":"hidden"}}),i.window=i,i.document=Ye,i.matchMedia=()=>$,i.Element=class extends EventTarget{},Object.defineProperties(i,{innerWidth:{configurable:!0,get:()=>a.width},innerHeight:{configurable:!0,get:()=>a.height},devicePixelRatio:{configurable:!0,get:()=>a.dpr}}),i.ResizeObserver=class{constructor(f){this.callback=f;e.add(this)}observe(){this.callback([{target:A,contentRect:ce()}])}disconnect(){e.delete(this)}},i.IntersectionObserver=class{constructor(f){this.callback=f;g.add(this)}observe(){this.callback([{target:A,isIntersecting:c,intersectionRatio:c?1:0}])}disconnect(){g.delete(this)}};let De=(f,m)=>{let F=new Event(f);for(let[R,y]of Object.entries(m))Object.defineProperty(F,R,{value:y});return F};return{host:A,canvas:Ve,viewport(f){a=f;for(let m of e)m.callback([{target:A,contentRect:ce()}]);i.dispatchEvent(new Event("resize"))},visibility(f){if(c!==f){c=f,S.dispatchEvent(new Event("visibilitychange"));for(let m of g)m.callback([{target:A,isIntersecting:f,intersectionRatio:f?1:0}])}},motion(f){b!==f&&(b=f,$.matches=f,$.dispatchEvent(new Event("change")))},input(f,m){i.dispatchEvent(De(f,m)),A.dispatchEvent(De(f,m)),n.dispatchEvent(De(f,m))},dispose(){e.clear(),g.clear();for(let f of J.values())try{f.getExtension("WEBGL_lose_context")?.loseContext()}catch{}J.clear()}}}function st(n){let t=0,o=0,i=0,a=(c,b)=>{if(++o>8192||b>10)throw Error("BG_ASSET_SHAPE: Visual asset structure exceeds its budget.");if(ArrayBuffer.isView(c)){if((c instanceof Float32Array||c instanceof Float64Array)&&!c.every(Number.isFinite))throw Error("BG_ASSET_NUMBER: Prepared visual numbers must be finite.");if(t+=c.byteLength,t>32*1024*1024)throw Error("BG_ASSET_SIZE: Prepared visual assets exceed 32 MiB.");return c}if(Array.isArray(c))return c.map(g=>a(g,b+1));if(c&&typeof c=="object"&&[Object.prototype,null].includes(Object.getPrototypeOf(c))){let g={};for(let[S,$]of Object.entries(c)){if(Me({[S]:null}),i+=new TextEncoder().encode(S).length+4,i>65536)throw Error("BG_ASSET_METADATA: Visual asset metadata exceeds 64 KiB.");g[S]=a($,b+1)}return g}let e=Me(c);if(i+=new TextEncoder().encode(JSON.stringify(e)).length,i>65536)throw Error("BG_ASSET_METADATA: Visual asset metadata exceeds 64 KiB.");return e};return a(n,0)}function Me(n){let t=0,o=(a,c)=>{if(++t>4096||c>8)throw Error("BG_STATE_LIMIT: Visual state exceeds the bounded schema.");if(a===null||typeof a=="boolean")return a;if(typeof a=="number"){if(!Number.isFinite(a))throw Error("BG_STATE_NUMBER: Visual numbers must be finite.");return a}if(typeof a=="string"){if(a.length>1024)throw Error("BG_STATE_STRING: Visual strings must be bounded.");return a}if(Array.isArray(a))return a.map(b=>o(b,c+1));if(a&&typeof a=="object"&&[Object.prototype,null].includes(Object.getPrototypeOf(a))){let b={};for(let[e,g]of Object.entries(a)){if(/^(?:__proto__|constructor|prototype|token|accessToken|refreshToken|authorization|cookie|bridge|conversation|history|source|url|path)$/i.test(e))throw Error("BG_STATE_FIELD: Visual state contains an unsupported field.");g!==void 0&&(b[e]=o(g,c+1))}return b}throw Error("BG_STATE_TYPE: Visual state must contain serializable visual values.")},i=o(n,0);if(new TextEncoder().encode(JSON.stringify(i)).length>65536)throw Error("BG_STATE_SIZE: Visual state exceeds the message budget.");return i}function Rt(n,t){if(![n.width,n.height,n.left,n.top,t].every(Number.isFinite)||n.width<0||n.height<0)throw Error("BG_VIEWPORT_INVALID: Invalid visual dimensions.");let o=Math.max(1,Math.min(8192,n.width)),i=Math.max(1,Math.min(8192,n.height)),a=Math.min(3,Math.max(.5,t),Math.sqrt(16777216/(o*i)));return{width:o,height:i,left:n.left,top:n.top,dpr:a}}var Mn=()=>{};function en(n){Mn=n}var Dn=/(token|cookie|password|secret|credential|authorization|apikey)/i,Ln=/^(content|text|body|prompt|messages|title|filename|name|raw|data|database64|commandline|sessionid|accountid|threadid|projectid)$|(?:path|url|uri)$/i;function oe(n){return n.slice(0,8e3).replace(/\\b[A-Za-z][A-Za-z0-9+.-]*:\\/\\/[^\\s"'<>]+/g,o=>{try{let i=new URL(o);if(["127.0.0.1","localhost","[::1]"].includes(i.hostname)&&!i.username&&!i.password&&["/json/version","/json/list","/"].includes(i.pathname))return\`\${i.origin}\${i.pathname}\`}catch{}return"[url]"}).replace(/(?:\\b[A-Za-z]:[\\\\/]|\\\\\\\\|\\/(?:Users|home|tmp|var|etc|opt|mnt)\\/|~\\/)[^\\r\\n"'<>]*/g,"[path]").replace(/\\b(?:Bearer\\s+\\S+|(?:authorization|password|secret|(?:access[_-]?|refresh[_-]?)?token|api[_-]?key|cookie)\\s*[:=]\\s*[^,;\\r\\n]+)/gi,"[credential]").replace(/\\bsk-[A-Za-z0-9_-]{8,}|\\beyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+/g,"[credential]").replace(/\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}\\b/g,"[email]").slice(0,4e3)+(n.length>8e3?" [truncated]":"")}function tn(n){let t=256,o=new WeakSet,i=(a,c)=>{if(--t<0||c>6)return"[truncated]";if(typeof a=="string")return oe(a);if(a===null||typeof a=="boolean"||typeof a=="number")return a;if(typeof a!="object")return"[unsupported]";if(o.has(a))return"[circular]";if(o.add(a),a instanceof Error)return{name:oe(a.name),message:oe(a.message)};if(Array.isArray(a))return a.slice(0,128).map(e=>i(e,c+1));let b=Object.create(null);for(let[e,g]of Object.entries(a).slice(0,128)){let S=e.replace(/[^a-z0-9]/gi,"");b[oe(e).slice(0,160)]=Dn.test(S)||Ln.test(S)?"[redacted]":i(g,c+1)}return b};try{return i(n,0)}catch{return{redactionFailed:!0}}}var Pn=Symbol.for("code-codex:runtime-events:v1"),In=window,lt=In[Pn]??={events:[],dropped:0};function nn(n,t,o,i={}){let a={source:oe(n).slice(0,160),action:oe(t).slice(0,160),outcome:oe(o).slice(0,160),details:{...tn(i),observedAt:Date.now(),documentElapsedMs:Math.round(performance.now())}},c=new TextEncoder().encode(JSON.stringify(a)).length;c>7e3&&(a.details={truncated:!0,originalBytes:c,observedAt:Date.now(),documentElapsedMs:Math.round(performance.now())}),lt.events.push(a),lt.events.length>1e3&&(lt.events.splice(0,200),lt.dropped+=200)}var Fn=Symbol.for("code-codex:background-startup-hold:v1");function kt(){let n=window;return n[Fn]??={active:!1,layers:new Set,next:-1,pending:new Map,painted:new WeakSet,openings:new WeakMap}}function Bn(n){return n.closest("[data-code-codex-particle-layer]")}function Cn(n,t){t.native=requestAnimationFrame(o=>{let i=kt();t.native=void 0,i.pending.has(n)&&(i.active&&i.painted.has(t.layer)||(i.pending.delete(n),i.active&&(i.painted.add(t.layer),i.layers.add(t.layer),nn("background-opening","initial frame","prepared")),t.callback(o)))})}function At(n,t){let o=Bn(n);if(!o)return requestAnimationFrame(t);let i=kt(),a=i.next--,c={layer:o,callback:t};return i.pending.set(a,c),Cn(a,c),a}function _t(n){if(n>=0){cancelAnimationFrame(n);return}let t=kt(),o=t.pending.get(n);o?.native!==void 0&&cancelAnimationFrame(o.native),t.pending.delete(n)}var Un=Object.freeze({distance:24,elevation:-5.5,azimuth:0,orbitSpeed:0,roll:-20,fov:42,diskInner:3,diskOuter:15,diskThickness:.26,diskDensity:1,brightness:1,spinSpeed:.06,grain:.48,doppler:.35,hotColor:"#FFF3DE",midColor:"#FF9838",coolColor:"#8E3A0B",starBrightness:0,glow:1,exposure:.9,vignette:.28,steps:200,resolution:.4,maxDpr:1,paused:!1}),fr=Object.freeze({variant:"bottom",inertialWheel:!0,openingDuration:2,wheelSensitivity:1,wheelDownIntensity:.4,wheelUpIntensity:.8,wheelTravelScale:1,wheelDownDistance:100,wheelUpDistance:20,wheelUpTrailDistance:18,wheelUpTrailStrength:1.15,wheelUpStiffness:180,wheelUpDamping:48,wheelReleaseDelay:70,wheelUpReleaseDelay:80,maxReleaseVelocity:2.4,returnStiffness:180,returnDamping:14,initialStretch:1.8,initialBlur:0,rimColor:"#FFFFFF",violetColor:"#A558FB",blueColor:"#4922E5",shadowColor:"#000000"}),mr=Object.freeze({low:Object.freeze({steps:56,resolutionScale:.56,maxDpr:1}),medium:Object.freeze({steps:76,resolutionScale:.72,maxDpr:1.25}),high:Object.freeze({steps:100,resolutionScale:.86,maxDpr:1.5})}),hr=Object.freeze({quality:"high",speed:.72,intensity:1.15,turbulence:1,radius:3,colorShift:0,pointerInfluence:.45,introDuration:2.2,introFeather:.22,paused:!1}),pr=Object.freeze({low:Object.freeze({steps:32,rayScale:.72,maxDpr:1.1,minAdaptiveScale:.92,noiseAtlasSize:512}),medium:Object.freeze({steps:50,rayScale:.76,maxDpr:1.25,minAdaptiveScale:.9,noiseAtlasSize:768}),high:Object.freeze({steps:72,rayScale:.82,maxDpr:1.4,minAdaptiveScale:.9,noiseAtlasSize:1024})}),gr=Object.freeze({hue:0,saturation:1,quality:"medium",speed:1,intensity:1,curtainScale:.5,turbulence:.58,glow:.72,starDensity:.56,introDuration:2.4,introFeather:.16,introStart:-.22,introEnd:1.32,introSkyEnd:.48,introStarStart:.34,paused:!1});function v(n,t,o,i){let a=typeof n=="number"?n:Number(n);return Number.isFinite(a)?Math.min(o,Math.max(t,a)):i}function Mt(n,t){if(typeof n!="string")return t;let o=n.trim();return/^#[0-9a-f]{6}$/i.test(o)?o.toUpperCase():t}function Dt(n){let t=Hn(n)?n:{},o=Un;return{distance:v(t.distance,10,40,o.distance),elevation:v(t.elevation,-30,30,o.elevation),azimuth:v(t.azimuth,-180,180,o.azimuth),orbitSpeed:v(t.orbitSpeed,-8,8,o.orbitSpeed),roll:v(t.roll,-45,45,o.roll),fov:v(t.fov,25,75,o.fov),diskInner:v(t.diskInner,1.2,6,o.diskInner),diskOuter:v(t.diskOuter,8,24,o.diskOuter),diskThickness:v(t.diskThickness,.05,.8,o.diskThickness),diskDensity:v(t.diskDensity,.1,2,o.diskDensity),brightness:v(t.brightness,.2,2,o.brightness),spinSpeed:v(t.spinSpeed,0,.2,o.spinSpeed),grain:v(t.grain,.1,1.2,o.grain),doppler:v(t.doppler,0,1,o.doppler),hotColor:Mt(t.hotColor,o.hotColor),midColor:Mt(t.midColor,o.midColor),coolColor:Mt(t.coolColor,o.coolColor),starBrightness:v(t.starBrightness,0,2,o.starBrightness),glow:v(t.glow,0,2,o.glow),exposure:v(t.exposure,.25,1.8,o.exposure),vignette:v(t.vignette,0,1,o.vignette),steps:o.steps,resolution:o.resolution,maxDpr:o.maxDpr,paused:o.paused}}function Hn(n){return n!==null&&typeof n=="object"}var vr=Object.freeze({top:{axis:"y",enter:-100,rest:-50},bottom:{axis:"y",enter:100,rest:50},left:{axis:"x",enter:100,rest:50},right:{axis:"x",enter:-100,rest:-50}});var br=Object.freeze({quality:"medium",speed:.35,amplitude:1,frequency:1,zoom:1,rotation:0,exposure:1,timeOffset:5.07,introDuration:2.8,introFeather:.18,introAngle:32,introZoom:.16,introEnabled:!0,paused:!1,colors:Object.freeze(["#d81159","#8f2d56","#218380","#fbb13c","#73d2de"])});var yr=Object.freeze([.72,.46]),xr=Math.PI/180;var On=\`
261
261
  attribute vec2 aPos;
262
262
  varying vec2 vUv;
263
263
  void main() {
264
264
  vUv = aPos * 0.5 + 0.5;
265
265
  gl_Position = vec4(aPos, 0.0, 1.0);
266
266
  }
267
- `,En=`
267
+ \`,zn=\`
268
268
  precision highp float;
269
269
 
270
270
  #define MAX_STEPS __MAX_STEPS__
@@ -558,7 +558,7 @@ void main() {
558
558
  if (uEncode > 0.5) col = col / (1.0 + col);
559
559
  gl_FragColor = vec4(col, 1.0);
560
560
  }
561
- `;function lt(r,n=null){return En.replace("__MAX_STEPS__",n===null?"460":String(n)).replace("__HAS_FIXED_STEPS__",n===null?"0":"1").replace("__HAS_STARS__",r?"1":"0")}var Tn=`
561
+ \`;function Lt(n,t=null){return zn.replace("__MAX_STEPS__",t===null?"460":String(t)).replace("__HAS_FIXED_STEPS__",t===null?"0":"1").replace("__HAS_STARS__",n?"1":"0")}var Gn=\`
562
562
  precision highp float;
563
563
  varying vec2 vUv;
564
564
  uniform sampler2D uCur;
@@ -569,7 +569,7 @@ void main() {
569
569
  vec3 p = texture2D(uPrev, vUv).rgb;
570
570
  gl_FragColor = vec4(mix(p, c, uAlpha), 1.0);
571
571
  }
572
- `,Rn=`
572
+ \`,Nn=\`
573
573
  precision highp float;
574
574
  varying vec2 vUv;
575
575
  uniform sampler2D uTex;
@@ -588,7 +588,7 @@ void main() {
588
588
  s *= max(0.0, l - uThreshold) / max(0.0001, l);
589
589
  gl_FragColor = vec4(s * uPack, 1.0);
590
590
  }
591
- `,wn=`
591
+ \`,Wn=\`
592
592
  precision highp float;
593
593
  varying vec2 vUv;
594
594
  uniform sampler2D uTex;
@@ -601,7 +601,7 @@ void main() {
601
601
  + texture2D(uTex, vUv - uStep * 3.2307692).rgb) * 0.0702702;
602
602
  gl_FragColor = vec4(s, 1.0);
603
603
  }
604
- `,An=`
604
+ \`,Xn=\`
605
605
  precision highp float;
606
606
  varying vec2 vUv;
607
607
  uniform sampler2D uScene;
@@ -614,6 +614,7 @@ uniform float uVignette;
614
614
  uniform float uScrimDir;
615
615
  uniform float uScrimAmt;
616
616
  uniform float uSeed;
617
+ uniform float uOpening;
617
618
  vec3 aces(vec3 x) {
618
619
  return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
619
620
  }
@@ -635,6 +636,8 @@ void main() {
635
636
  }
636
637
  float n = fract(sin(dot(gl_FragCoord.xy + uSeed, vec2(12.9898, 78.233))) * 43758.5453);
637
638
  c += (n - 0.5) / 255.0;
639
+ if (uOpening < 1.0) c *= smoothstep(0.0, 1.0, uOpening);
638
640
  gl_FragColor = vec4(c, 1.0);
639
641
  }
640
- `,Ht=Object.freeze([.72,.46]),ke=Math.PI/180;function kn(r){let n=r.trim().replace("#",""),o=n.length===3?n.charAt(0)+n.charAt(0)+n.charAt(1)+n.charAt(1)+n.charAt(2)+n.charAt(2):n.slice(0,6),u=Number.parseInt(o,16);return[(u>>16&255)/255,(u>>8&255)/255,(u&255)/255].map(m=>m<=.04045?m/12.92:Math.pow((m+.055)/1.055,2.4))}function zt(r){return[r.distance,r.elevation,r.azimuth,r.orbitSpeed,r.roll,r.fov,r.diskInner,r.diskOuter,r.diskThickness,r.diskDensity,r.brightness,r.spinSpeed,r.grain,r.doppler,r.hotColor,r.midColor,r.coolColor,r.starBrightness,r.steps].join("|")}function Ot(r){return`${r.resolution}|${r.maxDpr}`}function Dn(r,n,o,u){let c=window.matchMedia("(prefers-reduced-motion: reduce)"),m=c.matches,fe={alpha:!1,antialias:!1,depth:!1,stencil:!1,powerPreference:"high-performance",preserveDrawingBuffer:!1},e=n.getContext("webgl2",fe)||n.getContext("webgl",fe),Z,z=(t,i)=>{r.dataset.webgl=t,n.hidden=!0,Z!==i&&(Z=i,u(i))};if(!e){let t="WebGL is unavailable; Black Hole Background could not be rendered.";throw z("unsupported",t),new Error(t)}let ct=e.getExtension("WEBGL_debug_renderer_info"),qt=ct?String(e.getParameter(ct.UNMASKED_RENDERER_WEBGL)||""):"",Xe=/swiftshader|llvmpipe|softpipe|software|microsoft basic/i.test(qt),dt=typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext,_e=Math.max(2,Number(e.getParameter(e.MAX_TEXTURE_SIZE))||4096),ft=e.getParameter(e.MAX_VIEWPORT_DIMS),Vt=Math.max(2,Number(ft?.[0])||_e),Yt=Math.max(2,Number(ft?.[1])||_e),Kt=Math.min(_e,Vt),Zt=Math.min(_e,Yt),mt=(t,i)=>{let a=e.createShader(t);return a?(e.shaderSource(a,i),e.compileShader(a),e.getShaderParameter(a,e.COMPILE_STATUS)?a:(console.error("black-hole: shader compilation failed",e.getShaderInfoLog(a)||"no log"),e.deleteShader(a),null)):null},q=t=>{let i=mt(e.VERTEX_SHADER,Sn);if(!i)return null;let a=mt(e.FRAGMENT_SHADER,t);if(!a)return e.deleteShader(i),null;let l=e.createProgram();if(!l)return e.deleteShader(i),e.deleteShader(a),null;if(e.attachShader(l,i),e.attachShader(l,a),e.bindAttribLocation(l,0,"aPos"),e.linkProgram(l),e.deleteShader(i),e.deleteShader(a),!e.getProgramParameter(l,e.LINK_STATUS))return console.error("black-hole: program link failed",e.getProgramInfoLog(l)||"no log"),e.deleteProgram(l),null;let s={},g=e.getProgramParameter(l,e.ACTIVE_UNIFORMS);for(let y=0;y<g;y+=1){let b=e.getActiveUniform(l,y);b&&(s[b.name]=e.getUniformLocation(l,b.name))}return{program:l,uniforms:s}},x=!0,me=e.UNSIGNED_BYTE,Me=e.RGBA;if(dt){let t=e;t.getExtension("EXT_color_buffer_half_float")||t.getExtension("EXT_color_buffer_float")?(me=t.HALF_FLOAT,Me=t.RGBA16F):x=!1}else{let t=e.getExtension("OES_texture_half_float"),i=e.getExtension("EXT_color_buffer_half_float");t&&i?me=t.HALF_FLOAT_OES:x=!1}x||(me=e.UNSIGNED_BYTE,Me=e.RGBA);let qe=dt||!!e.getExtension("OES_texture_half_float_linear")||!x?e.LINEAR:e.NEAREST,he=x?1:.12,pe=(t,i)=>{let a=e.createTexture(),l=e.createFramebuffer();if(!a||!l)return a&&e.deleteTexture(a),l&&e.deleteFramebuffer(l),null;e.bindTexture(e.TEXTURE_2D,a),e.texImage2D(e.TEXTURE_2D,0,Me,t,i,0,e.RGBA,me,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,qe),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,qe),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindFramebuffer(e.FRAMEBUFFER,l),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a,0);let s=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),s!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(a),e.deleteFramebuffer(l),null):{framebuffer:l,texture:a,width:t,height:i}},D=null,_=null,Ve=!1,R=new Map,Le=new Set,Ie=0,$t=6,M=null,p=null,O=null,f=null,$=null,B=null,L=null,w=null,v=null,A=null,Fe=null,Ce=null,I=0,j=0,Q=0,S=0,E=0,ge=null,Ye=-1,Ke=-1,Ze=-1,J=null,ee=null,te=null,Pe=m?6:0,F=0,ne=!0,Ue=!0,Be=!document.hidden,re=!0,ve=!1,oe=0,C=!0,T=!0,V=!1,P=16,ht=o().paused||m,pt=new WeakMap,$e=t=>Xe?130:Math.max(60,Math.min(460,Math.round(t))),He=(t,i)=>`${t?"stars":"plain"}:${i}`,ie=t=>{e.useProgram(t.program),e.uniform1f(t.uniforms.uEncode??null,x?0:1),S>0&&E>0&&e.uniform2f(t.uniforms.uRes??null,S,E),e.uniform2f(t.uniforms.uFocus??null,Ht[0],1-Ht[1]),ge=null},jt=(t,i)=>{for(R.set(t,{program:i,lastUsed:++Ie});R.size>$t;){let a,l=Number.POSITIVE_INFINITY;for(let[g,y]of R)y.lastUsed<l&&(a=g,l=y.lastUsed);if(!a)break;let s=R.get(a);R.delete(a),s&&e.deleteProgram(s.program.program)}},gt=t=>{if(t)for(let i of R.values())e.deleteProgram(i.program.program);R.clear(),Le.clear(),Ie=0},vt=(t,i)=>{let a=He(t,i),l=R.get(a);if(l)return l.lastUsed=++Ie,l.program;if(Le.has(a))return null;let s=q(lt(t,i));return s?(ie(s),jt(a,s),s):(Le.add(a),null)},je=()=>{if(ee!==null){let t=window.cancelIdleCallback;t?.(ee),ee=null}te!==null&&(window.clearTimeout(te),te=null),J=null},yt=(t,i)=>{let a=He(t,i);if(R.has(a)||Le.has(a)||(J={key:a,stars:t,steps:i},ee!==null||te!==null))return;let l=()=>{ee=null,te=null;let g=J;if(J=null,!g||!ne||!re)return;if(!Ue||!Be){J=g;return}if(vt(g.stars,g.steps)){let k=o();He(k.starBrightness>.001,$e(k.steps))===g.key&&(I=0,C=!0,T=!0,H())}let b=J;b&&ne&&re&&yt(b.stars,b.steps)},s=window.requestIdleCallback;s?ee=s(l,{timeout:400}):te=window.setTimeout(l,100)},Qt=t=>t?(!_&&!Ve&&(_=q(lt(!0)),_?ie(_):Ve=!0),_??D):D,Jt=(t,i)=>{let a=R.get(He(t,i));return a?(a.lastUsed=++Ie,a.program):(yt(t,i),Qt(t))},bt=()=>{if(je(),gt(!0),D=q(lt(!1)),_=null,Ve=!1,M=q(Tn),p=q(Rn),O=q(wn),f=q(An),!D||!M||!p||!O||!f||(ie(D),e.useProgram(M.program),e.uniform1i(M.uniforms.uCur??null,0),e.uniform1i(M.uniforms.uPrev??null,1),e.useProgram(p.program),e.uniform1i(p.uniforms.uTex??null,0),e.uniform1f(p.uniforms.uDecode??null,x?0:1),e.uniform1f(p.uniforms.uPack??null,he),e.uniform1f(p.uniforms.uThreshold??null,.85),e.useProgram(O.program),e.uniform1i(O.uniforms.uTex??null,0),e.useProgram(f.program),e.uniform1i(f.uniforms.uScene??null,0),e.uniform1i(f.uniforms.uBloom??null,1),e.uniform1f(f.uniforms.uDecode??null,x?0:1),e.uniform1f(f.uniforms.uPack??null,he),ge=null,Ye=-1,Ke=-1,Ze=-1,$=e.createBuffer(),!$))return!1;e.bindBuffer(e.ARRAY_BUFFER,$),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),e.STATIC_DRAW),e.enableVertexAttribArray(0),e.vertexAttribPointer(0,2,e.FLOAT,!1,0,0),e.disable(e.DEPTH_TEST),e.disable(e.BLEND);let t=o();return vt(t.starBrightness>.001,$e(t.steps)),!0},ze=()=>{for(let t of[B,L,w,v,A])t&&(e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer));B=L=w=v=A=null,Fe=Ce=null,I=0},ye=()=>{ze(),$&&e.deleteBuffer($),$=null;for(let t of[D,_,M,p,O,f])t&&e.deleteProgram(t.program);D=_=M=p=O=f=null,gt(!0)},Qe=()=>{let t=r.getBoundingClientRect(),i=o(),a=Xe?1:Math.min(window.devicePixelRatio||1,Math.max(1,i.maxDpr)),l=Math.max(1,Math.round(t.width)),s=Math.max(1,Math.round(t.height)),g=Xe?.34:Math.min(1,Math.max(.4,i.resolution)),y=Math.max(2,Math.round(l*a)),b=Math.max(2,Math.round(s*a)),k=Math.min(1,Kt/y,Zt/b),N=Math.max(2,Math.floor(y*k)),Y=Math.max(2,Math.floor(b*k)),U=Math.max(2,Math.round(N*g)),Se=Math.max(2,Math.round(Y*g));if(N===j&&Y===Q&&U===S&&Se===E&&B&&L&&w&&v&&A)return!1;j=N,Q=Y,S=U,E=Se,n.width=N,n.height=Y,n.style.width=`${l}px`,n.style.height=`${s}px`,ze();let Ee=Math.max(2,S>>2),Te=Math.max(2,E>>2),Re=()=>(B=pe(S,E),L=pe(S,E),w=pe(S,E),v=pe(Ee,Te),A=pe(Ee,Te),!!(B&&L&&w&&v&&A)),G=Re();if(!G&&x&&(ze(),x=!1,me=e.UNSIGNED_BYTE,Me=e.RGBA,qe=e.LINEAR,he=.12,G=Re()),!G||!B||!L||!w||!v||!A)return ze(),j=Q=S=E=0,ve=!0,z("allocation-failed","The GPU could not allocate the Black Hole Background render targets."),!1;ve=!1,n.hidden=!1,r.dataset.webgl="",Z&&(Z=void 0,u(void 0)),D&&ie(D),_&&ie(_);for(let we of R.values())ie(we.program);return p&&(e.useProgram(p.program),e.uniform1f(p.uniforms.uDecode??null,x?0:1),e.uniform1f(p.uniforms.uPack??null,he),e.uniform2f(p.uniforms.uTexel??null,1/S,1/E)),f&&(e.useProgram(f.program),e.uniform1f(f.uniforms.uDecode??null,x?0:1),e.uniform1f(f.uniforms.uPack??null,he)),ge=null,!0},be=(t,i)=>{ge!==t.program&&(e.useProgram(t.program),ge=t.program),e.bindFramebuffer(e.FRAMEBUFFER,i?.framebuffer??null);let a=i?.width??j,l=i?.height??Q;(Ke!==a||Ze!==l)&&(e.viewport(0,0,a,l),Ke=a,Ze=l)},xe=()=>e.drawArrays(e.TRIANGLES,0,3),ae=(t,i)=>{Ye!==i&&(e.activeTexture(e.TEXTURE0+i),Ye=i),e.bindTexture(e.TEXTURE_2D,t)},Je=[[.5,.333],[.25,.667],[.75,.111],[.125,.444],[.625,.778],[.375,.222],[.875,.556],[.0625,.889]],et={hot:{source:null,value:[0,0,0]},mid:{source:null,value:[0,0,0]},cool:{source:null,value:[0,0,0]}},tt=(t,i)=>(i.source!==t&&(i.source=t,i.value=kn(t)),i.value),nt=(t,i=!0,a=!0)=>{if(!D||!M||!p||!O||!f)return;let l=O;if(!B||!L||!w||!v||!A)return;let s=o();if(!i&&(!Fe||!Ce))return;if(i){let b=$e(s.steps),k=Jt(s.starBrightness>.001,b);if(!k)return;let N=(s.azimuth+s.orbitSpeed*t)*ke,Y=Math.max(-88,Math.min(88,s.elevation))*ke,U=Math.max(2.2,s.distance),Se=Math.cos(Y),Ee=U*Se*Math.cos(N),Te=U*Math.sin(Y),Re=U*Se*Math.sin(N),G=-Ee/U,we=-Te/U,Ne=-Re/U,se=Ne,le=0,ue=-G,rt=Math.hypot(se,le,ue)||1;se/=rt,le/=rt,ue/=rt;let kt=le*Ne-ue*we,Dt=ue*G-se*Ne,_t=se*we-le*G,ce=Math.cos(s.roll*ke),de=Math.sin(s.roll*ke),tn=se*ce+kt*de,nn=le*ce+Dt*de,rn=ue*ce+_t*de,on=-se*de+kt*ce,an=-le*de+Dt*ce,sn=-ue*de+_t*ce;be(k,B);let d=k.uniforms;e.uniform3f(d.uCamPos??null,Ee,Te,Re),e.uniform3f(d.uRight??null,tn,nn,rn),e.uniform3f(d.uUp??null,on,an,sn),e.uniform3f(d.uFwd??null,G,we,Ne);let Mt=s.spinSpeed*6.2831853,ot=t/46,Lt=ot-Math.floor(ot),It=ot+.5,ln=It-Math.floor(It);if(e.uniform4f(d.uWind??null,Lt*46,ln*46,Math.abs(2*Lt-1),Mt*t*.05),pt.get(k.program)!==s){let W=tt(s.hotColor,et.hot),Ae=tt(s.midColor,et.mid),K=tt(s.coolColor,et.cool),Ge=Math.max(s.diskInner+.5,s.diskOuter);e.uniform1f(d.uTanHalf??null,Math.tan(Math.max(8,Math.min(110,s.fov))*.5*ke)),d.uSteps&&e.uniform1f(d.uSteps,b),e.uniform1f(d.uSkyR??null,Math.max(U*1.35,Ge*2.4)),e.uniform1f(d.uDiskIn??null,Math.max(1.05,s.diskInner)),e.uniform1f(d.uDiskOut??null,Ge),e.uniform1f(d.uThick??null,Math.max(.02,s.diskThickness)),e.uniform1f(d.uDensity??null,Math.max(0,s.diskDensity)),e.uniform1f(d.uSpin??null,Mt),e.uniform1f(d.uGrain??null,Math.max(.02,s.grain)),e.uniform1f(d.uBright??null,Math.max(0,s.brightness)),e.uniform1f(d.uDoppler??null,Math.max(0,Math.min(1,s.doppler))),e.uniform3f(d.uHot??null,W[0],W[1],W[2]),e.uniform3f(d.uMid??null,Ae[0],Ae[1],Ae[2]),e.uniform3f(d.uCool??null,K[0],K[1],K[2]),d.uStars&&e.uniform1f(d.uStars,Math.max(0,s.starBrightness)),pt.set(k.program,s)}let it=Je[I%Je.length]??Je[0];if(!it)return;e.uniform2f(d.uJitter??null,it[0]-.5,it[1]-.5),e.uniform1f(d.uSeed??null,I%64*17.13),xe();let un=I===0?1:.14;be(M,w),ae(B.texture,0),ae(L.texture,1),e.uniform1f(M.uniforms.uAlpha??null,un),xe();let Ft=w,cn=L;if(L=w,w=cn,I+=1,Fe=Ft,a){be(p,v),ae(Ft.texture,0),xe();let W=(Ae,K,Ge,dn)=>{be(l,K),ae(Ae.texture,0),e.uniform2f(l.uniforms.uStep??null,Ge/K.width,dn/K.height),xe()};W(v,A,1,0),W(A,v,0,1),W(v,A,2.6,0),W(A,v,0,2.6),Ce=v}}if(i&&!a)return;let g=Fe,y=Ce;!g||!y||(be(f,null),ae(g.texture,0),ae(y.texture,1),e.uniform1f(f.uniforms.uGlow??null,Math.max(0,s.glow)*.26),e.uniform1f(f.uniforms.uExposure??null,Math.max(.05,s.exposure)),e.uniform1f(f.uniforms.uVignette??null,Math.max(0,Math.min(1,s.vignette))),e.uniform1f(f.uniforms.uScrimDir??null,0),e.uniform1f(f.uniforms.uScrimAmt??null,0),e.uniform1f(f.uniforms.uSeed??null,t*60%1e3),xe())},xt=()=>ne&&re&&Ue&&Be;function H(){!xt()||oe||ve&&!V||(oe=Ut(n,en))}let Oe=()=>{oe&&Bt(oe),oe=0,F=0};function en(t){if(oe=0,!xt()||(V&&(V=!1,Qe()&&(I=0,P=16,C=!0)),ve))return;let i=o().paused||m;i!==ht&&(i&&(I=0,P=16,C=!0),ht=i,F=0,T=!0);let a=F?Math.min(.05,(t-F)/1e3):0;if(F=t,!i)Pe+=a,nt(Pe,!0,!0),C=!1,T=!1;else if(C){let l=P===16||P<=1;nt(Pe,!0,l),P=Math.max(0,P-1),P===0&&(C=!1,T=!1)}else T&&(nt(Pe,!1,!0),T=!1);!i||C||T||V?H():F=0}if(!bt()){let t="The Black Hole Background shaders could not be initialized.";throw z("build-failed",t),ye(),new Error(t)}if(!Qe()){let t="The GPU could not allocate the Black Hole Background render targets.";throw ye(),new Error(t)}H();let St=new ResizeObserver(()=>{V=!0,H()});St.observe(r);let Et=new IntersectionObserver(t=>{Ue=t[0]?.isIntersecting??!0,Ue?(F=0,T=!0,H()):Oe()},{threshold:0});Et.observe(r);let Tt=()=>{Be=!document.hidden,F=0,Be?(T=!0,H()):Oe()},Rt=t=>{t.preventDefault(),re=!1,ve=!1,je(),Oe(),j=Q=S=E=0,z("context-lost","The Black Hole Background graphics context was lost; waiting for recovery.")},wt=()=>{if(ye(),j=Q=S=E=0,re=!0,!bt()){re=!1,ye(),z("lost","The Black Hole Background WebGL context could not be restored.");return}F=0,V=!1,Qe()&&(P=16,C=!0,T=!0,H())},At=t=>{m=t.matches,F=0,I=0,P=16,C=!0,T=!0,H()};return document.addEventListener("visibilitychange",Tt),n.addEventListener("webglcontextlost",Rt),n.addEventListener("webglcontextrestored",wt),c.addEventListener("change",At),{invalidate:(t,i)=>{ne&&(i&&(V=!0),t&&(I=0,P=16,C=!0),T=!0,H())},dispose:()=>{ne&&(ne=!1,je(),Oe(),St.disconnect(),Et.disconnect(),document.removeEventListener("visibilitychange",Tt),n.removeEventListener("webglcontextlost",Rt),n.removeEventListener("webglcontextrestored",wt),c.removeEventListener("change",At),ye())}}}var De=class{#e;#t;constructor(n,o,u,c){this.#e=ut(u),this.#t=Dn(n,o,()=>this.#e,c)}setSettings(n){let o=ut(n),u=zt(o)!==zt(this.#e),c=Ot(o)!==Ot(this.#e);this.#e=o,this.#t.invalidate(u,c)}dispose(){this.#t.dispose()}};var Wt=window,Xt=Symbol.for("code-codex:background-modules:v1"),_n=Wt[Xt]??(Wt[Xt]=new Map);_n.set("black-hole",{id:"black-hole",api:1,version:"1.0.0",exports:{BlackHoleRenderer:De},startup(r,n){let o=document.createElement("canvas");return o.style.cssText="width:100%;height:100%;display:block",r.append(o),new De(r,o,{...Gt(),paused:!1},n)}});})();
642
+ \`,rn=Object.freeze([.72,.46]),Xe=Math.PI/180;function qn(n){let t=n.trim().replace("#",""),o=t.length===3?t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2):t.slice(0,6),i=Number.parseInt(o,16);return[(i>>16&255)/255,(i>>8&255)/255,(i&255)/255].map(c=>c<=.04045?c/12.92:Math.pow((c+.055)/1.055,2.4))}function on(n){return[n.distance,n.elevation,n.azimuth,n.orbitSpeed,n.roll,n.fov,n.diskInner,n.diskOuter,n.diskThickness,n.diskDensity,n.brightness,n.spinSpeed,n.grain,n.doppler,n.hotColor,n.midColor,n.coolColor,n.starBrightness,n.steps].join("|")}function an(n){return\`\${n.resolution}|\${n.maxDpr}\`}function Vn(n,t,o,i){let a=window.matchMedia("(prefers-reduced-motion: reduce)"),c=a.matches,b={alpha:!1,antialias:!1,depth:!1,stencil:!1,powerPreference:"high-performance",preserveDrawingBuffer:!1},e=t.getContext("webgl2",b)||t.getContext("webgl",b),g,S=(r,s)=>{n.dataset.webgl=r,t.hidden=!0,g!==s&&(g=s,i(s))};if(!e){let r="WebGL is unavailable; Black Hole Background could not be rendered.";throw S("unsupported",r),new Error(r)}let $=e.getExtension("WEBGL_debug_renderer_info"),ce=$?String(e.getParameter($.UNMASKED_RENDERER_WEBGL)||""):"",A=/swiftshader|llvmpipe|softpipe|software|microsoft basic/i.test(ce),J=typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext,de=Math.max(2,Number(e.getParameter(e.MAX_TEXTURE_SIZE))||4096),Ve=e.getParameter(e.MAX_VIEWPORT_DIMS),Ye=Math.max(2,Number(Ve?.[0])||de),De=Math.max(2,Number(Ve?.[1])||de),f=Math.min(de,Ye),m=Math.min(de,De),F=(r,s)=>{let l=e.createShader(r);return l?(e.shaderSource(l,s),e.compileShader(l),e.getShaderParameter(l,e.COMPILE_STATUS)?l:(console.error("black-hole: shader compilation failed",e.getShaderInfoLog(l)||"no log"),e.deleteShader(l),null)):null},R=r=>{let s=F(e.VERTEX_SHADER,On);if(!s)return null;let l=F(e.FRAGMENT_SHADER,r);if(!l)return e.deleteShader(s),null;let d=e.createProgram();if(!d)return e.deleteShader(s),e.deleteShader(l),null;if(e.attachShader(d,s),e.attachShader(d,l),e.bindAttribLocation(d,0,"aPos"),e.linkProgram(d),e.deleteShader(s),e.deleteShader(l),!e.getProgramParameter(d,e.LINK_STATUS))return console.error("black-hole: program link failed",e.getProgramInfoLog(d)||"no log"),e.deleteProgram(d),null;let u={},w=e.getProgramParameter(d,e.ACTIVE_UNIFORMS);for(let D=0;D<w;D+=1){let L=e.getActiveUniform(d,D);L&&(u[L.name]=e.getUniformLocation(d,L.name))}return{program:d,uniforms:u}},y=!0,Q=e.UNSIGNED_BYTE,ie=e.RGBA;if(J){let r=e;r.getExtension("EXT_color_buffer_half_float")||r.getExtension("EXT_color_buffer_float")?(Q=r.HALF_FLOAT,ie=r.RGBA16F):y=!1}else{let r=e.getExtension("OES_texture_half_float"),s=e.getExtension("EXT_color_buffer_half_float");r&&s?Q=r.HALF_FLOAT_OES:y=!1}y||(Q=e.UNSIGNED_BYTE,ie=e.RGBA);let fe=J||!!e.getExtension("OES_texture_half_float_linear")||!y?e.LINEAR:e.NEAREST,B=y?1:.12,E=(r,s)=>{let l=e.createTexture(),d=e.createFramebuffer();if(!l||!d)return l&&e.deleteTexture(l),d&&e.deleteFramebuffer(d),null;e.bindTexture(e.TEXTURE_2D,l),e.texImage2D(e.TEXTURE_2D,0,ie,r,s,0,e.RGBA,Q,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,fe),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,fe),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindFramebuffer(e.FRAMEBUFFER,d),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,l,0);let u=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),u!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(l),e.deleteFramebuffer(d),null):{framebuffer:d,texture:l,width:r,height:s}},k=null,T=null,Le=!1,C=new Map,je=new Set,Ze=0,hn=6,z=null,x=null,ee=null,p=null,me=null,Z=null,G=null,U=null,_=null,H=null,$e=null,Je=null,N=0,he=0,pe=0,P=0,I=0,Pe=null,ft=-1,mt=-1,ht=-1,ge=null,ve=null,be=null,Ie=c?6:0,W=0,pt=0,ye=!0,Qe=!0,et=!document.hidden,xe=!0,Fe=!1,Se=0,X=!0,M=!0,ae=!1,q=16,It=o().paused||c,Ft=new WeakMap,gt=r=>A?130:Math.max(60,Math.min(460,Math.round(r))),tt=(r,s)=>\`\${r?"stars":"plain"}:\${s}\`,Ee=r=>{e.useProgram(r.program),e.uniform1f(r.uniforms.uEncode??null,y?0:1),P>0&&I>0&&e.uniform2f(r.uniforms.uRes??null,P,I),e.uniform2f(r.uniforms.uFocus??null,rn[0],1-rn[1]),Pe=null},pn=(r,s)=>{for(C.set(r,{program:s,lastUsed:++Ze});C.size>hn;){let l,d=Number.POSITIVE_INFINITY;for(let[w,D]of C)D.lastUsed<d&&(l=w,d=D.lastUsed);if(!l)break;let u=C.get(l);C.delete(l),u&&e.deleteProgram(u.program.program)}},Bt=r=>{if(r)for(let s of C.values())e.deleteProgram(s.program.program);C.clear(),je.clear(),Ze=0},Ct=(r,s)=>{let l=tt(r,s),d=C.get(l);if(d)return d.lastUsed=++Ze,d.program;if(je.has(l))return null;let u=R(Lt(r,s));return u?(Ee(u),pn(l,u),u):(je.add(l),null)},vt=()=>{if(ve!==null){let r=window.cancelIdleCallback;r?.(ve),ve=null}be!==null&&(window.clearTimeout(be),be=null),ge=null},Ut=(r,s)=>{let l=tt(r,s);if(C.has(l)||je.has(l)||(ge={key:l,stars:r,steps:s},ve!==null||be!==null))return;let d=()=>{ve=null,be=null;let w=ge;if(ge=null,!w||!ye||!xe)return;if(!Qe||!et){ge=w;return}if(Ct(w.stars,w.steps)){let O=o();tt(O.starBrightness>.001,gt(O.steps))===w.key&&(N=0,X=!0,M=!0,V())}let L=ge;L&&ye&&xe&&Ut(L.stars,L.steps)},u=window.requestIdleCallback;u?ve=u(d,{timeout:400}):be=window.setTimeout(d,100)},gn=r=>r?(!T&&!Le&&(T=R(Lt(!0)),T?Ee(T):Le=!0),T??k):k,vn=(r,s)=>{let l=C.get(tt(r,s));return l?(l.lastUsed=++Ze,l.program):(Ut(r,s),gn(r))},Ht=()=>{if(vt(),Bt(!0),k=R(Lt(!1)),T=null,Le=!1,z=R(Gn),x=R(Nn),ee=R(Wn),p=R(Xn),!k||!z||!x||!ee||!p||(Ee(k),e.useProgram(z.program),e.uniform1i(z.uniforms.uCur??null,0),e.uniform1i(z.uniforms.uPrev??null,1),e.useProgram(x.program),e.uniform1i(x.uniforms.uTex??null,0),e.uniform1f(x.uniforms.uDecode??null,y?0:1),e.uniform1f(x.uniforms.uPack??null,B),e.uniform1f(x.uniforms.uThreshold??null,.85),e.useProgram(ee.program),e.uniform1i(ee.uniforms.uTex??null,0),e.useProgram(p.program),e.uniform1i(p.uniforms.uScene??null,0),e.uniform1i(p.uniforms.uBloom??null,1),e.uniform1f(p.uniforms.uDecode??null,y?0:1),e.uniform1f(p.uniforms.uPack??null,B),Pe=null,ft=-1,mt=-1,ht=-1,me=e.createBuffer(),!me))return!1;e.bindBuffer(e.ARRAY_BUFFER,me),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),e.STATIC_DRAW),e.enableVertexAttribArray(0),e.vertexAttribPointer(0,2,e.FLOAT,!1,0,0),e.disable(e.DEPTH_TEST),e.disable(e.BLEND);let r=o();return Ct(r.starBrightness>.001,gt(r.steps)),!0},nt=()=>{for(let r of[Z,G,U,_,H])r&&(e.deleteTexture(r.texture),e.deleteFramebuffer(r.framebuffer));Z=G=U=_=H=null,$e=Je=null,N=0},Be=()=>{nt(),me&&e.deleteBuffer(me),me=null;for(let r of[k,T,z,x,ee,p])r&&e.deleteProgram(r.program);k=T=z=x=ee=p=null,Bt(!0)},bt=()=>{let r=n.getBoundingClientRect(),s=o(),l=A?1:Math.min(window.devicePixelRatio||1,Math.max(1,s.maxDpr)),d=Math.max(1,Math.round(r.width)),u=Math.max(1,Math.round(r.height)),w=A?.34:Math.min(1,Math.max(.4,s.resolution)),D=Math.max(2,Math.round(d*l)),L=Math.max(2,Math.round(u*l)),O=Math.min(1,f/D,m/L),te=Math.max(2,Math.floor(D*O)),se=Math.max(2,Math.floor(L*O)),Y=Math.max(2,Math.round(te*w)),He=Math.max(2,Math.round(se*w));if(te===he&&se===pe&&Y===P&&He===I&&Z&&G&&U&&_&&H)return!1;he=te,pe=se,P=Y,I=He,t.width=te,t.height=se,t.style.width=\`\${d}px\`,t.style.height=\`\${u}px\`,nt();let Oe=Math.max(2,P>>2),ze=Math.max(2,I>>2),Ge=()=>(Z=E(P,I),G=E(P,I),U=E(P,I),_=E(Oe,ze),H=E(Oe,ze),!!(Z&&G&&U&&_&&H)),ne=Ge();if(!ne&&y&&(nt(),y=!1,Q=e.UNSIGNED_BYTE,ie=e.RGBA,fe=e.LINEAR,B=.12,ne=Ge()),!ne||!Z||!G||!U||!_||!H)return nt(),he=pe=P=I=0,Fe=!0,S("allocation-failed","The GPU could not allocate the Black Hole Background render targets."),!1;Fe=!1,t.hidden=!1,n.dataset.webgl="",g&&(g=void 0,i(void 0)),k&&Ee(k),T&&Ee(T);for(let Ne of C.values())Ee(Ne.program);return x&&(e.useProgram(x.program),e.uniform1f(x.uniforms.uDecode??null,y?0:1),e.uniform1f(x.uniforms.uPack??null,B),e.uniform2f(x.uniforms.uTexel??null,1/P,1/I)),p&&(e.useProgram(p.program),e.uniform1f(p.uniforms.uDecode??null,y?0:1),e.uniform1f(p.uniforms.uPack??null,B)),Pe=null,!0},Ce=(r,s)=>{Pe!==r.program&&(e.useProgram(r.program),Pe=r.program),e.bindFramebuffer(e.FRAMEBUFFER,s?.framebuffer??null);let l=s?.width??he,d=s?.height??pe;(mt!==l||ht!==d)&&(e.viewport(0,0,l,d),mt=l,ht=d)},Ue=()=>e.drawArrays(e.TRIANGLES,0,3),Te=(r,s)=>{ft!==s&&(e.activeTexture(e.TEXTURE0+s),ft=s),e.bindTexture(e.TEXTURE_2D,r)},yt=[[.5,.333],[.25,.667],[.75,.111],[.125,.444],[.625,.778],[.375,.222],[.875,.556],[.0625,.889]],xt={hot:{source:null,value:[0,0,0]},mid:{source:null,value:[0,0,0]},cool:{source:null,value:[0,0,0]}},St=(r,s)=>(s.source!==r&&(s.source=r,s.value=qn(r)),s.value),rt=(r,s=!0,l=!0)=>{if(!k||!z||!x||!ee||!p)return;let d=ee;if(!Z||!G||!U||!_||!H)return;let u=o();if(!s&&(!$e||!Je))return;if(s){let L=gt(u.steps),O=vn(u.starBrightness>.001,L);if(!O)return;let te=(u.azimuth+u.orbitSpeed*r)*Xe,se=Math.max(-88,Math.min(88,u.elevation))*Xe,Y=Math.max(2.2,u.distance),He=Math.cos(se),Oe=Y*He*Math.cos(te),ze=Y*Math.sin(se),Ge=Y*He*Math.sin(te),ne=-Oe/Y,Ne=-ze/Y,it=-Ge/Y,we=it,Re=0,ke=-ne,Et=Math.hypot(we,Re,ke)||1;we/=Et,Re/=Et,ke/=Et;let Vt=Re*it-ke*Ne,Yt=ke*ne-we*it,Kt=we*Ne-Re*ne,Ae=Math.cos(u.roll*Xe),_e=Math.sin(u.roll*Xe),yn=we*Ae+Vt*_e,xn=Re*Ae+Yt*_e,Sn=ke*Ae+Kt*_e,En=-we*_e+Vt*Ae,Tn=-Re*_e+Yt*Ae,wn=-ke*_e+Kt*Ae;Ce(O,Z);let h=O.uniforms;e.uniform3f(h.uCamPos??null,Oe,ze,Ge),e.uniform3f(h.uRight??null,yn,xn,Sn),e.uniform3f(h.uUp??null,En,Tn,wn),e.uniform3f(h.uFwd??null,ne,Ne,it);let jt=u.spinSpeed*6.2831853,Tt=r/46,Zt=Tt-Math.floor(Tt),$t=Tt+.5,Rn=$t-Math.floor($t);if(e.uniform4f(h.uWind??null,Zt*46,Rn*46,Math.abs(2*Zt-1),jt*r*.05),Ft.get(O.program)!==u){let re=St(u.hotColor,xt.hot),We=St(u.midColor,xt.mid),le=St(u.coolColor,xt.cool),at=Math.max(u.diskInner+.5,u.diskOuter);e.uniform1f(h.uTanHalf??null,Math.tan(Math.max(8,Math.min(110,u.fov))*.5*Xe)),h.uSteps&&e.uniform1f(h.uSteps,L),e.uniform1f(h.uSkyR??null,Math.max(Y*1.35,at*2.4)),e.uniform1f(h.uDiskIn??null,Math.max(1.05,u.diskInner)),e.uniform1f(h.uDiskOut??null,at),e.uniform1f(h.uThick??null,Math.max(.02,u.diskThickness)),e.uniform1f(h.uDensity??null,Math.max(0,u.diskDensity)),e.uniform1f(h.uSpin??null,jt),e.uniform1f(h.uGrain??null,Math.max(.02,u.grain)),e.uniform1f(h.uBright??null,Math.max(0,u.brightness)),e.uniform1f(h.uDoppler??null,Math.max(0,Math.min(1,u.doppler))),e.uniform3f(h.uHot??null,re[0],re[1],re[2]),e.uniform3f(h.uMid??null,We[0],We[1],We[2]),e.uniform3f(h.uCool??null,le[0],le[1],le[2]),h.uStars&&e.uniform1f(h.uStars,Math.max(0,u.starBrightness)),Ft.set(O.program,u)}let wt=yt[N%yt.length]??yt[0];if(!wt)return;e.uniform2f(h.uJitter??null,wt[0]-.5,wt[1]-.5),e.uniform1f(h.uSeed??null,N%64*17.13),Ue();let kn=N===0?1:.14;Ce(z,U),Te(Z.texture,0),Te(G.texture,1),e.uniform1f(z.uniforms.uAlpha??null,kn),Ue();let Jt=U,An=G;if(G=U,U=An,N+=1,$e=Jt,l){Ce(x,_),Te(Jt.texture,0),Ue();let re=(We,le,at,_n)=>{Ce(d,le),Te(We.texture,0),e.uniform2f(d.uniforms.uStep??null,at/le.width,_n/le.height),Ue()};re(_,H,1,0),re(H,_,0,1),re(_,H,2.6,0),re(H,_,0,2.6),Je=_}}if(s&&!l)return;let w=$e,D=Je;!w||!D||(Ce(p,null),Te(w.texture,0),Te(D.texture,1),e.uniform1f(p.uniforms.uOpening??null,c||u.paused?1:Math.min(1,pt/1)),e.uniform1f(p.uniforms.uGlow??null,Math.max(0,u.glow)*.26),e.uniform1f(p.uniforms.uExposure??null,Math.max(.05,u.exposure)),e.uniform1f(p.uniforms.uVignette??null,Math.max(0,Math.min(1,u.vignette))),e.uniform1f(p.uniforms.uScrimDir??null,0),e.uniform1f(p.uniforms.uScrimAmt??null,0),e.uniform1f(p.uniforms.uSeed??null,r*60%1e3),Ue())},Ot=()=>ye&&xe&&Qe&&et;function V(){!Ot()||Se||Fe&&!ae||(Se=At(t,bn))}let ot=()=>{Se&&_t(Se),Se=0,W=0};function bn(r){if(Se=0,!Ot()||(ae&&(ae=!1,bt()&&(N=0,q=16,X=!0)),Fe))return;let s=o().paused||c;s!==It&&(s&&(N=0,q=16,X=!0),It=s,W=0,M=!0);let l=W?Math.min(.05,(r-W)/1e3):0;if(W=r,s||(pt+=l),!s)Ie+=l,rt(Ie,!0,!0),X=!1,M=!1;else if(X){let d=q===16||q<=1;rt(Ie,!0,d),q=Math.max(0,q-1),q===0&&(X=!1,M=!1)}else M&&(rt(Ie,!1,!0),M=!1);!s||X||M||ae?V():W=0}if(!Ht()){let r="The Black Hole Background shaders could not be initialized.";throw S("build-failed",r),Be(),new Error(r)}if(!bt()){let r="The GPU could not allocate the Black Hole Background render targets.";throw Be(),new Error(r)}V();let zt=new ResizeObserver(()=>{ae=!0,V()});zt.observe(n);let Gt=new IntersectionObserver(r=>{Qe=r[0]?.isIntersecting??!0,Qe?(W=0,M=!0,V()):ot()},{threshold:0});Gt.observe(n);let Nt=()=>{et=!document.hidden,W=0,et?(M=!0,V()):ot()},Wt=r=>{r.preventDefault(),xe=!1,Fe=!1,vt(),ot(),he=pe=P=I=0,S("context-lost","The Black Hole Background graphics context was lost; waiting for recovery.")},Xt=()=>{if(Be(),he=pe=P=I=0,xe=!0,!Ht()){xe=!1,Be(),S("lost","The Black Hole Background WebGL context could not be restored.");return}W=0,ae=!1,bt()&&(q=16,X=!0,M=!0,V())},qt=r=>{c=r.matches,W=0,N=0,q=16,X=!0,M=!0,V()};return document.addEventListener("visibilitychange",Nt),t.addEventListener("webglcontextlost",Wt),t.addEventListener("webglcontextrestored",Xt),a.addEventListener("change",qt),{replay:()=>{pt=0,M=!0,rt(Ie,!1,!0),V()},invalidate:(r,s)=>{ye&&(s&&(ae=!0),r&&(N=0,q=16,X=!0),M=!0,V())},dispose:()=>{ye&&(ye=!1,vt(),ot(),zt.disconnect(),Gt.disconnect(),document.removeEventListener("visibilitychange",Nt),t.removeEventListener("webglcontextlost",Wt),t.removeEventListener("webglcontextrestored",Xt),a.removeEventListener("change",qt),Be())}}}var ut=class{#e;#t;constructor(t,o,i,a){this.#e=Dt(i),this.#t=Vn(t,o,()=>this.#e,a)}setSettings(t){let o=Dt(t),i=on(o)!==on(this.#e),a=an(o)!==an(this.#e);this.#e=o,this.#t.invalidate(i,a)}replay(){this.#t.replay()}dispose(){this.#t.dispose()}};var sn=[];function ln(n,t,o,i){return new ut(n,t,o,i)}var qe=globalThis,ct="",un=0,cn=!1,ue,K,Pt=0,dn=!1,fn=0,j=(n,t={})=>qe.postMessage({v:1,session:ct,type:n,...t}),dt=n=>j("failed",{code:"BG_WORKER_RENDER_FAILED",message:String(n instanceof Error?n.message:n).slice(0,1500)});qe.addEventListener("error",n=>dt(n.error??n.message));qe.addEventListener("unhandledrejection",n=>dt(n.reason));qe.addEventListener("message",n=>{let t=n.data;if(!(cn||!t||t.v!==1||typeof t.session!="string"))try{if(t.type==="init"){if(ct||!(t.canvas instanceof OffscreenCanvas)||t.session.length>100)throw Error("BG_INIT_INVALID: Invalid or duplicate background initialization.");ct=t.session,en((i,a)=>j("event",{event:i,value:st(a)}));let o=Rt(t.viewport,t.viewport.dpr);K=Qt(t.canvas,o,()=>{Pt++,dn||(dn=!0,j("first-frame",{frames:Pt}),t.held===!0&&queueMicrotask(()=>K?.visibility(!1)));let i=performance.now();i-fn>=1e3&&(fn=i,j("sample",{frames:Pt,at:i}))}),K.motion(t.reduced===!0),ue=ln(K.host,K.canvas,Me(t.settings),i=>{i&&dt(i)});return}if(t.session!==ct||!Number.isSafeInteger(t.seq)||t.seq<=un)return;if(un=t.seq,t.type==="state"){if(t.settings!==void 0){let o=Me(t.settings);ue.setSettings?ue.setSettings(o):ue.updateSettings?.(o)}if(t.viewport&&K?.viewport(Rt(t.viewport,t.viewport.dpr)),typeof t.reduced=="boolean"&&K?.motion(t.reduced),typeof t.visible=="boolean"&&K?.visibility(t.visible),t.input){let{type:o,...i}=t.input;if(!["pointermove","pointerdown","pointerup","pointercancel","pointerleave","wheel","keydown"].includes(o))throw Error("BG_INPUT_METHOD: Unsupported background input.");K?.input(o,Me(i))}j("ack",{seq:t.seq});return}if(t.type==="replay"){ue.replay?.(),j("ack",{seq:t.seq});return}if(t.type==="call"){if(typeof t.method!="string"||!sn.includes(t.method)||!Array.isArray(t.args)||t.args.length>8||!Number.isSafeInteger(t.callId))throw Error("BG_KERNEL_COMMAND: The visual kernel command is not supported.");let o=st(t.args);j("ack",{seq:t.seq}),Promise.resolve().then(()=>ue[t.method](...o)).then(i=>j("result",{callId:t.callId,value:st(i??null)}),i=>j("result",{callId:t.callId,error:String(i).slice(0,1500)}));return}if(t.type==="dispose"){cn=!0;try{ue?.dispose()}finally{K?.dispose(),j("disposed"),setTimeout(()=>qe.close(),0)}return}throw Error("BG_WORKER_METHOD: Unsupported background command.")}catch(o){dt(o)}});})();
643
+ `,r,e,t,i)}},H=window,N=Symbol.for("code-codex:background-modules:v1"),Q=H[N]??(H[N]=new Map);Q.set("black-hole",{id:"black-hole",api:1,version:"1.0.6",exports:{BlackHoleRenderer:z},startup(r,e){let t=document.createElement("canvas");return t.style.cssText="width:100%;height:100%;display:block",r.append(t),new z(r,t,{...O(),paused:!1},e)}});})();