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
@@ -0,0 +1,172 @@
1
+ (()=>{var E=class{constructor(t){this.report=t;this.signal=this.#e.signal}#s=!1;#a=new Set;signal;#e=new AbortController;get disposed(){return this.#s}own(t){let r=!0,n=()=>{r&&(r=!1,this.#a.delete(n),t())};return this.#s?n():this.#a.add(n),n}listen(t,r,n,e){return this.#s?()=>{}:(t.addEventListener(r,n,e),this.own(()=>t.removeEventListener(r,n,e)))}dispose(){if(!this.#s){this.#s=!0,this.#e.abort();for(let t of[...this.#a].reverse())try{t()}catch(r){try{this.report(r)}catch{}}}}};function B(o){let t=0,r=0,n=0,e=(i,l)=>{if(++r>8192||l>10)throw Error("BG_ASSET_SHAPE: Visual asset structure exceeds its budget.");if(ArrayBuffer.isView(i)){if((i instanceof Float32Array||i instanceof Float64Array)&&!i.every(Number.isFinite))throw Error("BG_ASSET_NUMBER: Prepared visual numbers must be finite.");if(t+=i.byteLength,t>32*1024*1024)throw Error("BG_ASSET_SIZE: Prepared visual assets exceed 32 MiB.");return i}if(Array.isArray(i))return i.map(d=>e(d,l+1));if(i&&typeof i=="object"&&[Object.prototype,null].includes(Object.getPrototypeOf(i))){let d={};for(let[p,w]of Object.entries(i)){if(b({[p]:null}),n+=new TextEncoder().encode(p).length+4,n>65536)throw Error("BG_ASSET_METADATA: Visual asset metadata exceeds 64 KiB.");d[p]=e(w,l+1)}return d}let c=b(i);if(n+=new TextEncoder().encode(JSON.stringify(c)).length,n>65536)throw Error("BG_ASSET_METADATA: Visual asset metadata exceeds 64 KiB.");return c};return e(o,0)}function b(o){let t=0,r=(e,i)=>{if(++t>4096||i>8)throw Error("BG_STATE_LIMIT: Visual state exceeds the bounded schema.");if(e===null||typeof e=="boolean")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw Error("BG_STATE_NUMBER: Visual numbers must be finite.");return e}if(typeof e=="string"){if(e.length>1024)throw Error("BG_STATE_STRING: Visual strings must be bounded.");return e}if(Array.isArray(e))return e.map(l=>r(l,i+1));if(e&&typeof e=="object"&&[Object.prototype,null].includes(Object.getPrototypeOf(e))){let l={};for(let[c,d]of Object.entries(e)){if(/^(?:__proto__|constructor|prototype|token|accessToken|refreshToken|authorization|cookie|bridge|conversation|history|source|url|path)$/i.test(c))throw Error("BG_STATE_FIELD: Visual state contains an unsupported field.");d!==void 0&&(l[c]=r(d,i+1))}return l}throw Error("BG_STATE_TYPE: Visual state must contain serializable visual values.")},n=r(o,0);if(new TextEncoder().encode(JSON.stringify(n)).length>65536)throw Error("BG_STATE_SIZE: Visual state exceeds the message budget.");return n}function T(o,t){if(![o.width,o.height,o.left,o.top,t].every(Number.isFinite)||o.width<0||o.height<0)throw Error("BG_VIEWPORT_INVALID: Invalid visual dimensions.");let r=Math.max(1,Math.min(8192,o.width)),n=Math.max(1,Math.min(8192,o.height)),e=Math.min(3,Math.max(.5,t),Math.sqrt(16777216/(r*n)));return{width:r,height:n,left:o.left,top:o.top,dpr:e}}var D=/(token|cookie|password|secret|credential|authorization|apikey)/i,z=/^(content|text|body|prompt|messages|title|filename|name|raw|data|database64|commandline|sessionid|accountid|threadid|projectid)$|(?:path|url|uri)$/i;function h(o){return o.slice(0,8e3).replace(/\b[A-Za-z][A-Za-z0-9+.-]*:\/\/[^\s"'<>]+/g,r=>{try{let n=new URL(r);if(["127.0.0.1","localhost","[::1]"].includes(n.hostname)&&!n.username&&!n.password&&["/json/version","/json/list","/"].includes(n.pathname))return`${n.origin}${n.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)+(o.length>8e3?" [truncated]":"")}function N(o){let t=256,r=new WeakSet,n=(e,i)=>{if(--t<0||i>6)return"[truncated]";if(typeof e=="string")return h(e);if(e===null||typeof e=="boolean"||typeof e=="number")return e;if(typeof e!="object")return"[unsupported]";if(r.has(e))return"[circular]";if(r.add(e),e instanceof Error)return{name:h(e.name),message:h(e.message)};if(Array.isArray(e))return e.slice(0,128).map(c=>n(c,i+1));let l=Object.create(null);for(let[c,d]of Object.entries(e).slice(0,128)){let p=c.replace(/[^a-z0-9]/gi,"");l[h(c).slice(0,160)]=D.test(p)||z.test(p)?"[redacted]":n(d,i+1)}return l};try{return n(o,0)}catch{return{redactionFailed:!0}}}var j=Symbol.for("code-codex:runtime-events:v1"),W=window,k=W[j]??={events:[],dropped:0};function f(o,t,r,n={}){let e={source:h(o).slice(0,160),action:h(t).slice(0,160),outcome:h(r).slice(0,160),details:{...N(n),observedAt:Date.now(),documentElapsedMs:Math.round(performance.now())}},i=new TextEncoder().encode(JSON.stringify(e)).length;i>7e3&&(e.details={truncated:!0,originalBytes:i,observedAt:Date.now(),documentElapsedMs:Math.round(performance.now())}),k.events.push(e),k.events.length>1e3&&(k.events.splice(0,200),k.dropped+=200)}var V=Symbol.for("code-codex:background-startup-hold:v1");function X(){let o=window;return o[V]??={active:!1,layers:new Set,next:-1,pending:new Map,painted:new WeakSet,openings:new WeakMap}}function Y(o){return o.closest("[data-code-codex-particle-layer]")}function _(o){return!!Y(o)&&X().active}var M=()=>{let o=window;return o[Symbol.for("code-codex:background-isolation:v1")]??=new Map},x=class{constructor(t,r,n,e,i,l=()=>{},c={}){this.host=n;this.onError=l;if(typeof Worker!="function"||typeof e.transferControlToOffscreen!="function")throw Error("BG_BACKEND_UNAVAILABLE: Independent background rendering is unavailable.");let d=b(i),p=T(n.getBoundingClientRect(),devicePixelRatio||1);this.#t={id:t,mode:"worker",phase:"preparing",frames:0,pending:0},M().set(this,this.#t),this.#e=new E(s=>f("background","resource release","failed",{id:t,error:String(s)})),this.ready=this.firstFrame=new Promise((s,a)=>{this.#s=s,this.#a=a}),this.ready.catch(()=>{}),this.#p=p;let w=URL.createObjectURL(new Blob([r],{type:"text/javascript"}));this.#e.own(()=>URL.revokeObjectURL(w));try{this.#m=new Worker(w,{name:"code-codex-background-"+t})}catch(s){throw this.#e.dispose(),M().delete(this),s}let v=this.#m,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(e,"webglcontextlost",s=>{s.preventDefault(),this.#o("BG_WORKER_CONTEXT_LOST: The transferred background graphics context was lost. Enable the background again to retry.")}),this.#e.listen(v,"error",s=>this.#o("BG_WORKER_ERROR: "+s.message)),this.#e.listen(v,"messageerror",()=>this.#o("BG_WORKER_PROTOCOL: The background response could not be decoded.")),this.#e.listen(v,"message",s=>{let a=s.data;if(!(this.#i||a?.v!==1||a.session!==this.#u)){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.#s(),this.#y(),f("background","isolated first frame","ready",{id:t,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 u=this.#l.get(a.callId);u&&(clearTimeout(u.timer),this.#l.delete(a.callId),a.error?u.reject(Error("BG_KERNEL_FAILED: "+String(a.error))):u.resolve(a.value))}a.type==="ack"&&a.seq===this.#c&&(clearTimeout(this.#g),this.#g=void 0,this.#c=0,this.#t.pending=0,this.#h())}});let O=new ResizeObserver(()=>{let s=T(this.host.getBoundingClientRect(),devicePixelRatio||1);JSON.stringify(s)!==JSON.stringify(this.#p)&&(this.#p=s,this.#f({viewport:s}))});O.observe(n),this.#e.own(()=>O.disconnect());let I=new IntersectionObserver(s=>{this.#w=s[0]?.isIntersecting??!0,this.#y()});I.observe(n),this.#e.own(()=>I.disconnect());let R=matchMedia("(prefers-reduced-motion: reduce)");this.#e.listen(R,"change",()=>this.#f({reduced:R.matches})),this.#e.listen(document,"visibilitychange",()=>this.#y()),this.#e.listen(window,"code-codex:background-hold-changed",()=>this.#y()),this.#e.listen(window,"pagehide",()=>this.dispose());let U=s=>{if(!this.#d||this.#i||c.interactive===!1||!["pointerup","pointercancel"].includes(s.type)&&s.composedPath().some(y=>y instanceof Element&&y.matches('button,a,input,textarea,select,[contenteditable],dialog,[role="menu"],[role="menubar"],[popover]')))return;let a=s,u=this.#p;if(s instanceof PointerEvent&&!["pointermove","pointerleave","pointerup","pointercancel"].includes(s.type)&&(a.clientX<u.left||a.clientX>u.left+u.width||a.clientY<u.top||a.clientY>u.top+u.height))return;let g={type:s.type};if(s 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(s instanceof WheelEvent){let y=this.#r.find(m=>m.type==="state"&&m.input?.type==="wheel");if(y){let m=y.input;m.deltaX=Math.max(-1e4,Math.min(1e4,m.deltaX+s.deltaX)),m.deltaY=Math.max(-1e4,Math.min(1e4,m.deltaY+s.deltaY));return}Object.assign(g,{deltaX:s.deltaX,deltaY:s.deltaY,deltaMode:s.deltaMode,clientX:s.clientX,clientY:s.clientY})}else s instanceof KeyboardEvent&&Object.assign(g,{repeat:s.repeat,isComposing:s.isComposing,altKey:s.altKey,ctrlKey:s.ctrlKey,metaKey:s.metaKey,shiftKey:s.shiftKey,key:"",code:""});s.type==="pointermove"?((a.clientX<u.left||a.clientX>u.left+u.width||a.clientY<u.top||a.clientY>u.top+u.height)&&(g.type="pointerleave"),this.#f({input:g})):this.#r.length<8?(this.#r.push({type:"state",input:g}),this.#h()):this.#o("BG_INPUT_QUEUE_FULL: Background input exceeded the bounded discrete-event queue.")};for(let s of["pointermove","pointerleave","pointerdown","pointerup","pointercancel","wheel","keydown"])this.#e.listen(window,s,U,{passive:!0});try{let s=e.transferControlToOffscreen();v.postMessage({v:1,session:this.#u,type:"init",canvas:s,settings:d,viewport:this.#p,reduced:R.matches,held:_(n)},[s])}catch(s){this.#o("BG_CANVAS_TRANSFER: "+String(s))}}ready;firstFrame;#s;#a;#e;#m;#u=crypto.randomUUID();#b=0;#c=0;#n;#r=[];#l=new Map;#v=0;#d=!1;#i=!1;#w=!0;#p;#g;#t;get diagnostics(){return{...this.#t}}setSettings(t){this.#f({settings:b(t)})}updateSettings(t){this.setSettings(t)}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.#h()}}kernelEvent(t,r){}activityChanged(t){}call(t,r=[],n=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 e=B(r),i=++this.#v,l=new Promise((c,d)=>{let p=setTimeout(()=>{this.#l.delete(i),d(Error("BG_KERNEL_TIMEOUT: The visual command did not confirm completion. It was not replayed."))},n);this.#l.set(i,{resolve:c,reject:d,timer:p})});return this.#r.push({type:"call",method:t,args:e,callId:i}),this.#h(),l}resumeOpening(){this.replay()}#y=()=>{let t=!document.hidden&&this.#w&&(!this.#d||!_(this.host));this.#f({visible:t}),this.activityChanged(t)};#f(t){this.#i||(this.#n={...this.#n,...t},this.#h())}#h(){if(this.#i||this.#c)return;let t;if(this.#n&&["settings","viewport","visible","reduced"].some(r=>r in this.#n)){let{input:r,...n}=this.#n;t={type:"state",...n},this.#n=r?{input:r}:void 0}else if(this.#r.length)t=this.#r.shift();else if(this.#n)t={type:"state",...this.#n},this.#n=void 0;else return;this.#c=++this.#b,this.#t.pending=1;try{this.#m.postMessage({v:1,session:this.#u,seq:this.#c,...t})}catch(r){this.#o("BG_WORKER_SEND_FAILED: "+String(r));return}this.#g=setTimeout(()=>this.#o("BG_WORKER_ACK_TIMEOUT: The visual worker stopped acknowledging bounded updates."),5e3)}#o(t){if(!this.#i){this.#t.phase="failed",this.#t.error=t,this.#a(Error(t)),f("background","visual worker","failed",{id:this.#t.id,session:this.#u,sequence:this.#b,pending:this.#c,message:t});try{this.onError(t)}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.#a(new DOMException("Background preparation was cancelled.","AbortError"));for(let c of this.#l.values())clearTimeout(c.timer),c.reject(new DOMException("Background command was cancelled.","AbortError"));this.#l.clear();let t=this.#m,r=this.#u,n=++this.#b;this.#t.phase="disposing";let e=!1,i=()=>{e||(e=!0,clearTimeout(l),t.terminate(),M().delete(this))},l=setTimeout(()=>{f("background","worker disposal","unconfirmed",{id:this.#t.id,timeoutMs:1500}),i()},1500);t.addEventListener("message",c=>{c.data?.session===r&&c.data?.type==="disposed"&&i()});try{t.postMessage({v:1,session:r,seq:n,type:"dispose"})}catch{i()}}};function q(o){try{let t=[],r=new Set,n=o;for(;n!=null&&t.length<8&&!r.has(n);)if(r.add(n),n instanceof Error)t.push(`${n.name}: ${n.message}`),n=n.cause;else{t.push(typeof n=="string"?n:"Non-Error rejection");break}let e=o&&typeof o=="object"&&"code"in o?o.code:void 0,i={errorChain:t,...typeof e=="string"||typeof e=="number"?{errorCode:typeof e=="string"?e.slice(0,160):e}:{},...o instanceof Error&&o.stack?{exceptionStack:o.stack.slice(0,3e3)}:{},chainTruncated:n!=null&&t.length>=8},l=new TextEncoder().encode(JSON.stringify(i)).length;return l>5800&&(i.errorChain=t.map(c=>c.slice(0,80)),typeof i.exceptionStack=="string"&&(i.exceptionStack=i.exceptionStack.slice(0,200)),i.detailsTruncated=!0,i.originalDetailBytes=l),i}catch{return{errorChain:["Exception details could not be inspected safely."]}}}var A=new Map;function P(o,t){try{let r=performance.now(),n=A.has(o)||A.size<256?o:"other handlers",e=A.get(n);if(e||(e={start:r,count:0,suppressed:0},A.set(n,e)),r-e.start>1e4&&(e.suppressed&&f("handled-exception",n,"throttled",{suppressedCount:e.suppressed}),e.start=r,e.count=0,e.suppressed=0),++e.count>3){e.suppressed++;return}let i=q(t),l=(t instanceof Error||t instanceof DOMException)&&t.name==="AbortError";f("handled-exception",n,l?"cancelled":"failed",{...i,recovery:"Existing handler continues; recording does not retry, reset settings or prove recovery succeeded."})}catch{}}var K="code-codex:spectral-drape-background:v1",C={bodyColor:"#6A4BFF",highlightColor:"#E4DBFF",backgroundColor:"#0a0a0a",density:1,dotSize:.55,strands:9,amplitude:1,frequency:1,thickness:2.15,depth:1.2,softness:.6,intensity:1,colorShift:.3,tilt:-40,turn:-45,roll:110,zoom:1,flow:1,speed:1,interactive:!0,brush:1,brushRadius:.2,parallax:1,clickRipples:!0,seed:0,paused:!1,dpr:2,introEnabled:!0,introDuration:4.6,introStrength:1},H={density:[.2,2.5,.05],dotSize:[.2,3,.05],strands:[1,12,1],amplitude:[0,3,.05],frequency:[.1,3,.05],thickness:[.2,3,.05],depth:[0,3,.05],softness:[0,1,.01],intensity:[0,3,.05],colorShift:[-1,1,.01],tilt:[-90,90,1],turn:[-90,90,1],roll:[-180,180,1],zoom:[.4,2.5,.05],flow:[0,3,.05],speed:[0,3,.05],brush:[0,3,.05],brushRadius:[.05,.6,.01],parallax:[0,3,.05],seed:[0,20,1],dpr:[.5,2,.25],introDuration:[.8,12,.1],introStrength:[0,2,.05]};function Z(o){let t=o&&typeof o=="object"?o:{},r={...C};for(let[n,e]of Object.entries(r)){let i=t[n],l=H[n];l?r[n]=typeof i=="number"&&Number.isFinite(i)?Math.max(l[0],Math.min(l[1],l[2]===1?Math.round(i):i)):e:typeof e=="boolean"?r[n]=typeof i=="boolean"?i:e:r[n]=typeof i=="string"&&/^#[a-f0-9]{6}$/i.test(i)?i:e}return r}function F(){try{return Z(JSON.parse(localStorage.getItem(K)??"{}"))}catch(o){return P("Spectral settings read",o),{...C}}}var G=class extends x{constructor(o,t,r,n){super("spectral-drape",`"use strict";(()=>{globalThis.window=globalThis;function Ne(o,t,i){let r=globalThis,n=t,s=!0,u=!1,h=new Set,b=new Set,v=new EventTarget,x=Object.assign(new EventTarget,{matches:!1,media:"(prefers-reduced-motion: reduce)"}),T=()=>({...n,x:n.left,y:n.top,right:n.left+n.width,bottom:n.top+n.height,toJSON(){return this}}),e=Object.assign(new EventTarget,{getBoundingClientRect:T,closest:()=>null,style:{setProperty(){},removeProperty(){}},dataset:{},contains:()=>!1}),S=new Map,l={},_=new Proxy(o,{get(f,m){if(m==="getBoundingClientRect")return T;if(m==="clientWidth"||m==="offsetWidth")return n.width;if(m==="clientHeight"||m==="offsetHeight")return n.height;if(m==="closest")return()=>null;if(m==="parentElement")return e;if(m==="setPointerCapture"||m==="releasePointerCapture"||m==="replaceWith")return()=>{};if(m==="style")return e.style;if(m==="dataset")return l;if(m==="getContext")return(N,W)=>{if(S.has(N))return S.get(N);let g=f.getContext(N,W);if(!g)return null;let a=null,R=new Map,D=new Proxy(g,{get(F,M){let U=Reflect.get(F,M,F);return typeof U!="function"?U:(R.has(M)||R.set(M,(...k)=>{let L=Reflect.apply(U,F,k);return M==="bindFramebuffer"&&(k[0]===F.FRAMEBUFFER||k[0]===F.DRAW_FRAMEBUFFER)&&(a=k[1]),(M==="drawArrays"||M==="drawElements"||M==="drawArraysInstanced"||M==="drawElementsInstanced")&&a===null&&i(),L}),R.get(M))}});return S.set(N,D),D};let I=Reflect.get(f,m,f);return typeof I=="function"?I.bind(f):I},set(f,m,I){return Reflect.set(f,m,I,f)}});Object.defineProperties(e,{clientWidth:{get:()=>n.width},clientHeight:{get:()=>n.height}});let p=Object.assign(v,{get hidden(){return!s},get visibilityState(){return s?"visible":"hidden"}});Object.defineProperties(p,{hidden:{get:()=>!s},visibilityState:{get:()=>s?"visible":"hidden"}}),r.window=r,r.document=p,r.matchMedia=()=>x,r.Element=class extends EventTarget{},Object.defineProperties(r,{innerWidth:{configurable:!0,get:()=>n.width},innerHeight:{configurable:!0,get:()=>n.height},devicePixelRatio:{configurable:!0,get:()=>n.dpr}}),r.ResizeObserver=class{constructor(f){this.callback=f;h.add(this)}observe(){this.callback([{target:e,contentRect:T()}])}disconnect(){h.delete(this)}},r.IntersectionObserver=class{constructor(f){this.callback=f;b.add(this)}observe(){this.callback([{target:e,isIntersecting:s,intersectionRatio:s?1:0}])}disconnect(){b.delete(this)}};let B=(f,m)=>{let I=new Event(f);for(let[N,W]of Object.entries(m))Object.defineProperty(I,N,{value:W});return I};return{host:e,canvas:_,viewport(f){n=f;for(let m of h)m.callback([{target:e,contentRect:T()}]);r.dispatchEvent(new Event("resize"))},visibility(f){if(s!==f){s=f,v.dispatchEvent(new Event("visibilitychange"));for(let m of b)m.callback([{target:e,isIntersecting:f,intersectionRatio:f?1:0}])}},motion(f){u!==f&&(u=f,x.matches=f,x.dispatchEvent(new Event("change")))},input(f,m){r.dispatchEvent(B(f,m)),e.dispatchEvent(B(f,m)),o.dispatchEvent(B(f,m))},dispose(){h.clear(),b.clear();for(let f of S.values())try{f.getExtension("WEBGL_lose_context")?.loseContext()}catch{}S.clear()}}}function ee(o){let t=0,i=0,r=0,n=(s,u)=>{if(++i>8192||u>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(t+=s.byteLength,t>32*1024*1024)throw Error("BG_ASSET_SIZE: Prepared visual assets exceed 32 MiB.");return s}if(Array.isArray(s))return s.map(b=>n(b,u+1));if(s&&typeof s=="object"&&[Object.prototype,null].includes(Object.getPrototypeOf(s))){let b={};for(let[v,x]of Object.entries(s)){if(Y({[v]:null}),r+=new TextEncoder().encode(v).length+4,r>65536)throw Error("BG_ASSET_METADATA: Visual asset metadata exceeds 64 KiB.");b[v]=n(x,u+1)}return b}let h=Y(s);if(r+=new TextEncoder().encode(JSON.stringify(h)).length,r>65536)throw Error("BG_ASSET_METADATA: Visual asset metadata exceeds 64 KiB.");return h};return n(o,0)}function Y(o){let t=0,i=(n,s)=>{if(++t>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(u=>i(u,s+1));if(n&&typeof n=="object"&&[Object.prototype,null].includes(Object.getPrototypeOf(n))){let u={};for(let[h,b]of Object.entries(n)){if(/^(?:__proto__|constructor|prototype|token|accessToken|refreshToken|authorization|cookie|bridge|conversation|history|source|url|path)$/i.test(h))throw Error("BG_STATE_FIELD: Visual state contains an unsupported field.");b!==void 0&&(u[h]=i(b,s+1))}return u}throw Error("BG_STATE_TYPE: Visual state must contain serializable visual values.")},r=i(o,0);if(new TextEncoder().encode(JSON.stringify(r)).length>65536)throw Error("BG_STATE_SIZE: Visual state exceeds the message budget.");return r}function pe(o,t){if(![o.width,o.height,o.left,o.top,t].every(Number.isFinite)||o.width<0||o.height<0)throw Error("BG_VIEWPORT_INVALID: Invalid visual dimensions.");let i=Math.max(1,Math.min(8192,o.width)),r=Math.max(1,Math.min(8192,o.height)),n=Math.min(3,Math.max(.5,t),Math.sqrt(16777216/(i*r)));return{width:i,height:r,left:o.left,top:o.top,dpr:n}}var gt=()=>{};function Fe(o){gt=o}var ht=/(token|cookie|password|secret|credential|authorization|apikey)/i,bt=/^(content|text|body|prompt|messages|title|filename|name|raw|data|database64|commandline|sessionid|accountid|threadid|projectid)$|(?:path|url|uri)$/i;function G(o){return o.slice(0,8e3).replace(/\\b[A-Za-z][A-Za-z0-9+.-]*:\\/\\/[^\\s"'<>]+/g,i=>{try{let r=new URL(i);if(["127.0.0.1","localhost","[::1]"].includes(r.hostname)&&!r.username&&!r.password&&["/json/version","/json/list","/"].includes(r.pathname))return\`\${r.origin}\${r.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)+(o.length>8e3?" [truncated]":"")}function ze(o){let t=256,i=new WeakSet,r=(n,s)=>{if(--t<0||s>6)return"[truncated]";if(typeof n=="string")return G(n);if(n===null||typeof n=="boolean"||typeof n=="number")return n;if(typeof n!="object")return"[unsupported]";if(i.has(n))return"[circular]";if(i.add(n),n instanceof Error)return{name:G(n.name),message:G(n.message)};if(Array.isArray(n))return n.slice(0,128).map(h=>r(h,s+1));let u=Object.create(null);for(let[h,b]of Object.entries(n).slice(0,128)){let v=h.replace(/[^a-z0-9]/gi,"");u[G(h).slice(0,160)]=ht.test(v)||bt.test(v)?"[redacted]":r(b,s+1)}return u};try{return r(o,0)}catch{return{redactionFailed:!0}}}var wt=Symbol.for("code-codex:runtime-events:v1"),vt=window,te=vt[wt]??={events:[],dropped:0};function me(o,t,i,r={}){let n={source:G(o).slice(0,160),action:G(t).slice(0,160),outcome:G(i).slice(0,160),details:{...ze(r),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())}),te.events.push(n),te.events.length>1e3&&(te.events.splice(0,200),te.dropped+=200)}var yt=Symbol.for("code-codex:background-startup-hold:v1");function ge(){let o=window;return o[yt]??={active:!1,layers:new Set,next:-1,pending:new Map,painted:new WeakSet,openings:new WeakMap}}function Et(o){return o.closest("[data-code-codex-particle-layer]")}function xt(o,t){t.native=requestAnimationFrame(i=>{let r=ge();t.native=void 0,r.pending.has(o)&&(r.active&&r.painted.has(t.layer)||(r.pending.delete(o),r.active&&(r.painted.add(t.layer),r.layers.add(t.layer),me("background-opening","initial frame","prepared")),t.callback(i)))})}function Ge(o,t){let i=Et(o);if(!i)return requestAnimationFrame(t);let r=ge(),n=r.next--,s={layer:i,callback:t};return r.pending.set(n,s),xt(n,s),n}function ne(o){if(o>=0){cancelAnimationFrame(o);return}let t=ge(),i=t.pending.get(o);i?.native!==void 0&&cancelAnimationFrame(i.native),t.pending.delete(o)}var kt={bodyColor:"#6A4BFF",highlightColor:"#E4DBFF",backgroundColor:"#0a0a0a",density:1,dotSize:.55,strands:9,amplitude:1,frequency:1,thickness:2.15,depth:1.2,softness:.6,intensity:1,colorShift:.3,tilt:-40,turn:-45,roll:110,zoom:1,flow:1,speed:1,interactive:!0,brush:1,brushRadius:.2,parallax:1,clickRipples:!0,seed:0,paused:!1,dpr:2,introEnabled:!0,introDuration:4.6,introStrength:1},St={density:[.2,2.5,.05],dotSize:[.2,3,.05],strands:[1,12,1],amplitude:[0,3,.05],frequency:[.1,3,.05],thickness:[.2,3,.05],depth:[0,3,.05],softness:[0,1,.01],intensity:[0,3,.05],colorShift:[-1,1,.01],tilt:[-90,90,1],turn:[-90,90,1],roll:[-180,180,1],zoom:[.4,2.5,.05],flow:[0,3,.05],speed:[0,3,.05],brush:[0,3,.05],brushRadius:[.05,.6,.01],parallax:[0,3,.05],seed:[0,20,1],dpr:[.5,2,.25],introDuration:[.8,12,.1],introStrength:[0,2,.05]};function De(o){let t=o&&typeof o=="object"?o:{},i={...kt};for(let[r,n]of Object.entries(i)){let s=t[r],u=St[r];u?i[r]=typeof s=="number"&&Number.isFinite(s)?Math.max(u[0],Math.min(u[1],u[2]===1?Math.round(s):s)):n:typeof n=="boolean"?i[r]=typeof s=="boolean"?s:n:i[r]=typeof s=="string"&&/^#[a-f0-9]{6}$/i.test(s)?s:n}return i}var Ue=["#6A4BFF","#E4DBFF"],Rt=\`
2
+ precision highp float;
3
+
4
+ #define MAX_STRANDS 12
5
+ #define MAX_RIPPLES 4
6
+
7
+ attribute vec2 aGrid;
8
+
9
+ uniform mat4 modelMatrix;
10
+ uniform mat4 viewMatrix;
11
+ uniform mat4 projectionMatrix;
12
+
13
+ uniform float uTime;
14
+ uniform float uClock;
15
+ uniform float uSeed;
16
+ uniform float uStrands;
17
+ uniform float uAmplitude;
18
+ uniform float uFrequency;
19
+ uniform float uThickness;
20
+ uniform float uDepth;
21
+ uniform float uSpacing;
22
+ uniform float uSize;
23
+ uniform float uViewHeight;
24
+ uniform float uIntensity;
25
+ uniform float uShift;
26
+ uniform vec3 uBodyLab;
27
+ uniform vec3 uGlowLab;
28
+ uniform vec3 uWake;
29
+ uniform vec3 uWakeVector;
30
+ uniform float uWakeRadius;
31
+ uniform float uAspect;
32
+ uniform vec4 uRipple[MAX_RIPPLES];
33
+ uniform vec2 uIntro;
34
+
35
+ varying vec3 vColor;
36
+ varying float vGlow;
37
+
38
+ float hash(float n) {
39
+ return fract(sin(n * 127.1 + uSeed * 311.7) * 43758.5453);
40
+ }
41
+
42
+ vec3 labToLinear(vec3 lab) {
43
+ float l = lab.x + 0.3963377774 * lab.y + 0.2158037573 * lab.z;
44
+ float m = lab.x - 0.1055613458 * lab.y - 0.0638541728 * lab.z;
45
+ float s = lab.x - 0.0894841775 * lab.y - 1.2914855480 * lab.z;
46
+ l = l * l * l;
47
+ m = m * m * m;
48
+ s = s * s * s;
49
+ return vec3(
50
+ 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,
51
+ -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,
52
+ -0.0041960863 * l - 0.7034186147 * m + 1.7076147010 * s
53
+ );
54
+ }
55
+
56
+ vec3 toSrgb(vec3 c) {
57
+ c = clamp(c, 0.0, 1.0);
58
+ return mix(c * 12.92, 1.055 * pow(c, vec3(1.0 / 2.4)) - 0.055, step(0.0031308, c));
59
+ }
60
+
61
+ float strands(vec2 g, float t) {
62
+ float sum = 0.0;
63
+ for (int k = 0; k < MAX_STRANDS; k++) {
64
+ float index = float(k);
65
+ if (index >= uStrands) break;
66
+ float a = hash(index + 1.0);
67
+ float b = hash(index + 17.0);
68
+ float c = hash(index + 43.0);
69
+ float frequency = uFrequency * (0.55 + 0.9 * a);
70
+ float phase = b * 6.2831853;
71
+ float along = g.x * 6.2831853 * frequency;
72
+ float wave =
73
+ sin(along + phase + t * (0.35 + 0.45 * a)) * 0.62 +
74
+ sin(along * 2.07 - phase * 1.31 - t * (0.27 + 0.36 * b)) * 0.26 +
75
+ sin(along * 0.47 + phase * 0.7 + t * (0.19 + 0.2 * c)) * 0.3;
76
+ float line = 0.5 + (c - 0.5) * 0.8 + uAmplitude * 0.16 * wave;
77
+ float width = uThickness * (0.022 + 0.05 * c) * (0.75 + 0.5 * sin(along * 0.5 + t * 0.4 + phase));
78
+ float d = (g.y - line) / max(width, 0.004);
79
+ sum += exp(-d * d);
80
+ }
81
+ float edge = smoothstep(0.0, 0.12, g.y) * (1.0 - smoothstep(0.88, 1.0, g.y)) *
82
+ smoothstep(0.0, 0.05, g.x) * (1.0 - smoothstep(0.95, 1.0, g.x));
83
+ return (1.0 - exp(-sum * 1.1)) * edge;
84
+ }
85
+
86
+ void main() {
87
+ float field = strands(aGrid, uTime);
88
+ vec3 local = vec3((aGrid.x - 0.5) * 11.0, (aGrid.y - 0.5) * 11.0, field * uDepth);
89
+
90
+ float introLight = 1.0;
91
+ if (uIntro.x < 1.0 && uIntro.y > 0.0) {
92
+ // Deform the actual point grid: gathered light threads open along their length.
93
+ // The moving fold is geometry, not a screen-space reveal or an overlay.
94
+ float delay = aGrid.x * 0.38 + 0.07 * pow(sin(aGrid.y * 3.14159265), 2.0);
95
+ float opened = smoothstep(delay, delay + 0.54, uIntro.x);
96
+ float gather = (1.0 - opened) * min(0.94, uIntro.y * 0.84);
97
+ float thread = floor(aGrid.y * 6.0) / 6.0;
98
+ float spine = sin(aGrid.x * 6.2831853 + thread * 2.4) * 0.35;
99
+ local.y = mix(local.y, spine + local.y * 0.08, gather);
100
+ local.x *= 1.0 - gather * 0.14;
101
+ local.z = local.z * (1.0 - gather * 0.75)
102
+ + sin(aGrid.y * 3.14159265 + aGrid.x * 2.4 + opened * 2.0) * gather * 1.2;
103
+ introLight = (1.0 - gather * 0.65) + sin(opened * 3.14159265) * 0.12;
104
+ }
105
+
106
+ float reveal = 0.0;
107
+ vec4 rippleSurfaceClip = vec4(0.0);
108
+ for (int k = 0; k < MAX_RIPPLES; k++) {
109
+ vec4 ripple = uRipple[k];
110
+ float age = uClock - ripple.z;
111
+ if (ripple.w <= 0.0 || age < 0.0 || age > 6.0) continue;
112
+ // Project the actual folded/opening geometry, not an undeformed z=0 plane.
113
+ // Skip this work entirely when no live ripple exists; share across four rings.
114
+ if (rippleSurfaceClip.w == 0.0) rippleSurfaceClip = projectionMatrix * viewMatrix * modelMatrix * vec4(local, 1.0);
115
+ vec2 surfaceNdc = rippleSurfaceClip.xy / rippleSurfaceClip.w;
116
+ float radius = length((surfaceNdc - ripple.xy) * vec2(uAspect, 1.0)) * 9.0 / projectionMatrix[1][1];
117
+ float front = radius - age * 3.4;
118
+ float envelope = exp(-front * front * 3.0) * exp(-age * 0.5) * ripple.w;
119
+ local.z += sin(front * 3.2) * 0.3 * envelope;
120
+ reveal += envelope;
121
+ }
122
+
123
+ vec4 world = modelMatrix * vec4(local, 1.0);
124
+ vec4 clip = projectionMatrix * viewMatrix * world;
125
+ vec2 ndc = clip.xy / clip.w;
126
+ vec2 offset = (ndc - uWake.xy) * vec2(uAspect, 1.0);
127
+ float touch = exp(-dot(offset, offset) / max(uWakeRadius * uWakeRadius, 1e-4)) * uWake.z;
128
+ world.xyz += uWakeVector * touch;
129
+
130
+ vec4 view = viewMatrix * world;
131
+ gl_Position = projectionMatrix * view;
132
+
133
+ float eye = -view.z;
134
+ float size = uSpacing * uSize * projectionMatrix[1][1] * uViewHeight * 0.5 / max(eye, 0.1);
135
+ float nearness = clamp(9.0 / max(eye, 0.1), 0.35, 1.8);
136
+ float shade = mix(0.35, 1.0, smoothstep(0.55, 1.2, nearness));
137
+
138
+ float lift = smoothstep(0.06, 0.95, field);
139
+ float glow = (pow(lift, 1.35) * 1.3 + reveal * 1.1) * shade * uIntensity;
140
+ float shown = max(size, 1.35);
141
+ vGlow = glow * min(size * size / (shown * shown), 1.0) * introLight;
142
+ gl_PointSize = shown * (1.0 + touch * 0.35);
143
+
144
+ float tone = clamp(lift * 0.9 + (aGrid.x - 0.5) * uShift + reveal * 0.25, 0.0, 1.0);
145
+ vec3 lab = mix(uBodyLab, uGlowLab, tone);
146
+ vColor = toSrgb(max(labToLinear(lab), vec3(0.0)));
147
+ }
148
+ \`,Mt=\`
149
+ precision highp float;
150
+
151
+ uniform float uSoftness;
152
+ uniform float uInk;
153
+ uniform float uIntroOpacity;
154
+
155
+ varying vec3 vColor;
156
+ varying float vGlow;
157
+
158
+ void main() {
159
+ vec2 c = gl_PointCoord - 0.5;
160
+ float r = length(c) * 2.0;
161
+ float disc = 1.0 - smoothstep(mix(0.55, 0.0, uSoftness), 1.0, r);
162
+ float amount = disc * vGlow;
163
+ if (amount * uIntroOpacity < 0.003) discard;
164
+ if (uInk > 0.5) {
165
+ float alpha = clamp(amount, 0.0, 1.0);
166
+ gl_FragColor = vec4(vColor * alpha, alpha) * uIntroOpacity;
167
+ } else {
168
+ gl_FragColor = vec4(vColor * amount, clamp(amount, 0.0, 1.0)) * uIntroOpacity;
169
+ }
170
+ }
171
+ \`;function w(o,t,i){return Math.min(i,Math.max(t,o))}function re(o){return o*Math.PI/180}function We(o){let t=(o||"").trim().toLowerCase();return!t||t==="transparent"?!0:/^#[0-9a-f]{8}$/.test(t)?t.endsWith("00"):/^#[0-9a-f]{4}$/.test(t)?t.endsWith("0"):/^(?:rgba?|hsla?)\\(.*[,/]\\s*(0|0?\\.0+|0%)\\s*\\)$/.test(t)}function he(o,t){let i=(o||"").trim().replace(/^#/,"");if(i.length===3||i.length===4){let r=parseInt(i[0]+i[0],16),n=parseInt(i[1]+i[1],16),s=parseInt(i[2]+i[2],16);if(!Number.isNaN(r)&&!Number.isNaN(n)&&!Number.isNaN(s))return[r/255,n/255,s/255]}else if(i.length>=6){let r=parseInt(i.slice(0,2),16),n=parseInt(i.slice(2,4),16),s=parseInt(i.slice(4,6),16);if(!Number.isNaN(r)&&!Number.isNaN(n)&&!Number.isNaN(s))return[r/255,n/255,s/255]}return t}function q(o){return o<=.04045?o/12.92:Math.pow((o+.055)/1.055,2.4)}function je(o,t){let[i,r,n]=he(o,t),s=q(i),u=q(r),h=q(n),b=Math.cbrt(.4122214708*s+.5363325363*u+.0514459929*h),v=Math.cbrt(.2119034982*s+.6806995451*u+.1073969566*h),x=Math.cbrt(.0883024619*s+.2817188376*u+.6299787005*h);return[.2104542553*b+.793617785*v-.0040720468*x,1.9779984951*b-2.428592205*v+.4505937099*x,.0259040371*b+.7827717662*v-.808675766*x]}function At(o){if(We(o))return 0;let[t,i,r]=he(o,[0,0,0]),n=q(t),s=q(i),u=q(r);return .2126*n+.7152*s+.0722*u}function Lt(o,t,i,r,n){let s=Math.cos(o),u=Math.sin(o),h=Math.cos(t),b=Math.sin(t),v=Math.cos(i),x=Math.sin(i),T=h*v,e=s*x+u*b*v,S=u*x-s*b*v,l=-h*x,_=s*v-u*b*x,p=u*v+s*b*x,B=b,f=-u*h,m=s*h;n[0]=T*r,n[1]=e*r,n[2]=S*r,n[3]=0,n[4]=l*r,n[5]=_*r,n[6]=p*r,n[7]=0,n[8]=B*r,n[9]=f*r,n[10]=m*r,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1}function Tt(o,t,i,r,n){let s=1/Math.tan(o*Math.PI/360),u=1/(i-r);n[0]=s/Math.max(t,1e-4),n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=(r+i)*u,n[11]=-1,n[12]=0,n[13]=0,n[14]=2*r*i*u,n[15]=0}function Ve(o){let t=De(o);return{...t,colors:[t.bodyColor,t.highlightColor]}}var oe=class{constructor(t,i,r,n=()=>{}){let s={current:Ve(r)},u={current:()=>{}},h={current:()=>{}},b={current:()=>{}},v={current:()=>{}},x={current:()=>{}},T={current:()=>{}};this.dispose=(()=>{let e=i.getContext("webgl2",{alpha:!0,antialias:!1,depth:!1,premultipliedAlpha:!0,powerPreference:"high-performance"})||i.getContext("webgl",{alpha:!0,antialias:!1,depth:!1,premultipliedAlpha:!0,powerPreference:"high-performance"});if(!e)throw new Error("SPECTRAL_WEBGL_UNAVAILABLE: WebGL is required.");let S=[],l=null,_=null;try{let d=(y,E)=>{let A=e.createShader(y);if(!A)throw new Error("Failed to create WebGL shader");if(S.push(A),e.shaderSource(A,E),e.compileShader(A),!e.getShaderParameter(A,e.COMPILE_STATUS))throw new Error(e.getShaderInfoLog(A)||"Shader compilation error");return A};if(l=e.createProgram(),!l)throw new Error("Failed to create WebGL program");if(e.attachShader(l,d(e.VERTEX_SHADER,Rt)),e.attachShader(l,d(e.FRAGMENT_SHADER,Mt)),e.linkProgram(l),!e.getProgramParameter(l,e.LINK_STATUS))throw new Error(e.getProgramInfoLog(l)||"Program link error");e.useProgram(l),_=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,_);let c=e.getAttribLocation(l,"aGrid");e.enableVertexAttribArray(c),e.vertexAttribPointer(c,2,e.FLOAT,!1,0,0)}catch(d){throw n(d instanceof Error?d.message:String(d)),S.forEach(c=>e.deleteShader(c)),l&&e.deleteProgram(l),_&&e.deleteBuffer(_),d}let p={modelMatrix:e.getUniformLocation(l,"modelMatrix"),viewMatrix:e.getUniformLocation(l,"viewMatrix"),projectionMatrix:e.getUniformLocation(l,"projectionMatrix"),uTime:e.getUniformLocation(l,"uTime"),uClock:e.getUniformLocation(l,"uClock"),uSeed:e.getUniformLocation(l,"uSeed"),uStrands:e.getUniformLocation(l,"uStrands"),uAmplitude:e.getUniformLocation(l,"uAmplitude"),uFrequency:e.getUniformLocation(l,"uFrequency"),uThickness:e.getUniformLocation(l,"uThickness"),uDepth:e.getUniformLocation(l,"uDepth"),uSpacing:e.getUniformLocation(l,"uSpacing"),uSize:e.getUniformLocation(l,"uSize"),uViewHeight:e.getUniformLocation(l,"uViewHeight"),uIntensity:e.getUniformLocation(l,"uIntensity"),uShift:e.getUniformLocation(l,"uShift"),uBodyLab:e.getUniformLocation(l,"uBodyLab"),uGlowLab:e.getUniformLocation(l,"uGlowLab"),uWake:e.getUniformLocation(l,"uWake"),uWakeVector:e.getUniformLocation(l,"uWakeVector"),uWakeRadius:e.getUniformLocation(l,"uWakeRadius"),uAspect:e.getUniformLocation(l,"uAspect"),uRipple0:e.getUniformLocation(l,"uRipple[0]"),uSoftness:e.getUniformLocation(l,"uSoftness"),uInk:e.getUniformLocation(l,"uInk"),uIntro:e.getUniformLocation(l,"uIntro"),uIntroOpacity:e.getUniformLocation(l,"uIntroOpacity")},B=0,f=11/259,m=d=>{let c=Math.sqrt(w(d||1,.2,2.5)),y=Math.max(24,Math.round(260*c)),E=Math.max(16,Math.round(170*c));B=y*E,f=11/(y-1);let A=new Float32Array(B*2),K=0,Q=1/(y-1),$=1/(E-1);for(let z=0;z<E;z++){let j=z*$;for(let X=0;X<y;X++)A[K++]=X*Q,A[K++]=j}e.bindBuffer(e.ARRAY_BUFFER,_),e.bufferData(e.ARRAY_BUFFER,A,e.STATIC_DRAW)};b.current=m,m(s.current.density);let I=new Float32Array(16),N=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,-9,1]),W=new Float32Array(16),g={x:.5,y:.5,inside:!1,presses:0,pressX:0,pressY:0},a={time:0,clock:0,leanX:0,leanY:0,wakeX:9,wakeY:9,lastX:.5,lastY:.5,hasLast:!1,velocityX:0,velocityY:0,strength:0,presses:0,nextRipple:0,ripples:new Float32Array([0,0,-99,0,0,0,-99,0,0,0,-99,0,0,0,-99,0])},R=0,D=0,F=!0,M=!1,U=window.matchMedia("(prefers-reduced-motion: reduce)"),k=0,L=()=>{!R&&!M&&F&&!document.hidden&&(R=Ge(t,Je))};h.current=L,T.current=()=>{k=0,D=0,L()},v.current=(d=.5,c=.5,y=1)=>{let E=a.nextRipple*4;a.nextRipple=(a.nextRipple+1)%4,a.ripples[E]=w(d,-.5,1.5),a.ripples[E+1]=w(c,-.5,1.5),a.ripples[E+2]=a.clock,a.ripples[E+3]=y,L()},x.current=()=>{for(let d=0;d<4;d++)a.ripples[d*4+2]=-99,a.ripples[d*4+3]=0;a.strength=0,a.velocityX=0,a.velocityY=0,L()};let ae=()=>{let d=i.getBoundingClientRect(),c=Math.min(window.devicePixelRatio||1,Math.max(s.current.dpr||2,.5)),y=Math.max(1,Math.round(d.width*c)),E=Math.max(1,Math.round(d.height*c));(i.width!==y||i.height!==E)&&(i.width=y,i.height=E),L()};u.current=ae;let we=d=>{let c=t.getBoundingClientRect();g.x=(d.clientX-c.left)/Math.max(c.width,1),g.y=1-(d.clientY-c.top)/Math.max(c.height,1),g.inside=!0},ve=d=>{we(d),L()},ye=d=>{we(d),g.pressX=2*g.x-1,g.pressY=2*g.y-1,g.presses+=1,L()},J=()=>{g.inside=!1,L()};function Je(d){if(R=0,M)return;let c=s.current,y=Math.min(Math.max((d-(D||d))/1e3,0),.05);D=d;let E=U.matches;!c.introEnabled||E||c.introStrength<=0?k=1:k<1&&(k=Math.min(1,k+y/w(c.introDuration,.8,12)));let A=k.toFixed(4);t.dataset.introProgress!==A&&(t.dataset.introProgress=A);let K=!c.paused&&!E;K&&(a.time+=y*w(c.speed??1,0,4)*w(c.flow??1,0,4)*.3),E||(a.clock+=y);let Q=i.width,$=i.height,z=Q/Math.max($,1),j=!!c.interactive&&!E&&g.inside,X=w(c.parallax??1,0,3),Se=j?(g.x-.5)*2:0,Re=j?(g.y-.5)*2:0,Me=1-Math.exp(-2.2*y);a.leanX+=(Se-a.leanX)*Me,a.leanY+=(Re-a.leanY)*Me;let Ae=k*k*(3-2*k),ce=(1-Ae)*w(c.introStrength,0,2),Qe=re(w(c.tilt??-40,-180,180))-.06*a.leanY*X-.12*ce,et=re(w(c.turn??-45,-180,180))+.08*a.leanX*X-.48*ce,tt=re(w(c.roll??110,-180,180))+.16*ce,nt=w(c.zoom??1,.3,3);Tt(38,z,.1,100,W),Lt(Qe,et,tt,nt,I);let Le=0,Te=0;j?(a.hasLast||(a.lastX=g.x,a.lastY=g.y,a.wakeX=g.x,a.wakeY=g.y,a.hasLast=!0),y>0&&(Le=(g.x-a.lastX)/y,Te=(g.y-a.lastY)/y),a.lastX=g.x,a.lastY=g.y):a.hasLast=!1;let _e=1-Math.exp(-6*y);a.velocityX+=(w(Le,-5,5)-a.velocityX)*_e,a.velocityY+=(w(Te,-5,5)-a.velocityY)*_e;let Ie=1-Math.exp(-7*y);j&&(a.wakeX+=(g.x-a.wakeX)*Ie,a.wakeY+=(g.y-a.wakeY)*Ie);let le=Math.hypot(a.velocityX*z,a.velocityY),rt=j?w(.9*le,0,1.4):0;a.strength+=(rt-a.strength)*(1-Math.exp(-4*y));let Oe=9*Math.tan(re(38)/2),ot=w(c.brush??1,0,3),it=a.velocityX/Math.max(le,1e-4),st=a.velocityY/Math.max(le,1e-4),at=it*z*Oe*.16,ct=st*Oe*.16;if(g.presses!==a.presses&&(a.presses=g.presses,c.clickRipples&&c.interactive&&!E)){let O=a.nextRipple*4;a.nextRipple=(a.nextRipple+1)%4,a.ripples[O]=g.pressX,a.ripples[O+1]=g.pressY,a.ripples[O+2]=a.clock,a.ripples[O+3]=1}e.viewport(0,0,Q,$);let ue=c.backgroundColor??"#0a0a0a",Ce=We(ue),lt=At(ue),Pe=!Ce&&lt>.25;if(Ce)e.clearColor(0,0,0,0);else{let[O,pt,mt]=he(ue,[.039,.039,.039]);e.clearColor(O,pt,mt,1)}e.clear(e.COLOR_BUFFER_BIT),e.disable(e.DEPTH_TEST),e.enable(e.BLEND),Pe?e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA):e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE_MINUS_SRC_ALPHA);let ut=c.colors?.[0]??Ue[0],dt=c.colors?.[1]??c.colors?.[0]??Ue[1],de=je(ut,[.416,.294,1]),fe=je(dt,[.894,.859,1]);e.useProgram(l),e.uniformMatrix4fv(p.modelMatrix,!1,I),e.uniformMatrix4fv(p.viewMatrix,!1,N),e.uniformMatrix4fv(p.projectionMatrix,!1,W),e.uniform1f(p.uTime,a.time),e.uniform1f(p.uClock,a.clock),e.uniform1f(p.uSeed,.137*(c.seed??0)),e.uniform1f(p.uStrands,Math.round(w(c.strands??8,1,12))),e.uniform1f(p.uAmplitude,w(c.amplitude??1,0,3)),e.uniform1f(p.uFrequency,.6*w(c.frequency??1,.05,4)),e.uniform1f(p.uThickness,w(c.thickness??.7,.2,4)),e.uniform1f(p.uDepth,1.6*w(c.depth??1,0,3)),e.uniform1f(p.uSpacing,f),e.uniform1f(p.uSize,.5*w(c.dotSize??1,.1,4)),e.uniform1f(p.uViewHeight,$),e.uniform1f(p.uIntensity,w(c.intensity??1,0,4)),e.uniform1f(p.uShift,w(c.colorShift??.3,-1,1)),e.uniform3f(p.uBodyLab,de[0],de[1],de[2]),e.uniform3f(p.uGlowLab,fe[0],fe[1],fe[2]),e.uniform3f(p.uWake,2*a.wakeX-1,2*a.wakeY-1,a.strength*ot),e.uniform3f(p.uWakeVector,at,ct,0),e.uniform1f(p.uWakeRadius,w(c.brushRadius??.2,.03,1)),e.uniform1f(p.uAspect,z),e.uniform4fv(p.uRipple0,a.ripples),e.uniform1f(p.uSoftness,w(c.softness??.6,0,1)),e.uniform1f(p.uInk,Pe?1:0),e.uniform2f(p.uIntro,k,w(c.introStrength,0,2)),e.uniform1f(p.uIntroOpacity,Ae),e.drawArrays(e.POINTS,0,B);let Be=!1;for(let O=0;O<4;O++)if(a.ripples[O*4+3]>0&&a.clock-a.ripples[O*4+2]<6){Be=!0;break}let ft=Be||a.strength>.002||Math.abs(a.leanX-Se)>.001||Math.abs(a.leanY-Re)>.001;!E&&(k<1||K||ft)&&L()}let H=()=>{R&&(ne(R),R=0),D=0,L()},Ee=new ResizeObserver(ae);Ee.observe(i);let xe=new IntersectionObserver(([d])=>{F=d.isIntersecting,H()},{rootMargin:"80px"});xe.observe(t),t.addEventListener("pointermove",ve,{passive:!0}),t.addEventListener("pointerdown",ye,{passive:!0}),t.addEventListener("pointerleave",J,{passive:!0}),t.addEventListener("pointercancel",J,{passive:!0}),document.addEventListener("visibilitychange",H),U.addEventListener("change",H);let ke=d=>{d.preventDefault(),M=!0,R&&(ne(R),R=0),n("SPECTRAL_CONTEXT_LOST: The graphics context was lost. Enable the background again to retry.")};return i.addEventListener("webglcontextlost",ke),ae(),()=>{M=!0,h.current=()=>{},b.current=()=>{},v.current=()=>{},x.current=()=>{},T.current=()=>{},R&&ne(R),i.removeEventListener("webglcontextlost",ke),Ee.disconnect(),xe.disconnect(),t.removeEventListener("pointermove",ve),t.removeEventListener("pointerdown",ye),t.removeEventListener("pointerleave",J),t.removeEventListener("pointercancel",J),document.removeEventListener("visibilitychange",H),U.removeEventListener("change",H),_&&e.deleteBuffer(_),l&&e.deleteProgram(l),S.forEach(d=>e.deleteShader(d))}})(),this.setSettings=e=>{let S=s.current;s.current=Ve(e),S.density!==s.current.density&&b.current(s.current.density),!S.introEnabled&&s.current.introEnabled&&T.current(),S.dpr!==s.current.dpr&&u.current(),h.current()},this.replay=()=>T.current()}};var Xe=[];function Ye(o,t,i,r){return new oe(o,t,i,r)}var Z=globalThis,ie="",qe=0,He=!1,V,C,be=0,Ke=!1,$e=0,P=(o,t={})=>Z.postMessage({v:1,session:ie,type:o,...t}),se=o=>P("failed",{code:"BG_WORKER_RENDER_FAILED",message:String(o instanceof Error?o.message:o).slice(0,1500)});Z.addEventListener("error",o=>se(o.error??o.message));Z.addEventListener("unhandledrejection",o=>se(o.reason));Z.addEventListener("message",o=>{let t=o.data;if(!(He||!t||t.v!==1||typeof t.session!="string"))try{if(t.type==="init"){if(ie||!(t.canvas instanceof OffscreenCanvas)||t.session.length>100)throw Error("BG_INIT_INVALID: Invalid or duplicate background initialization.");ie=t.session,Fe((r,n)=>P("event",{event:r,value:ee(n)}));let i=pe(t.viewport,t.viewport.dpr);C=Ne(t.canvas,i,()=>{be++,Ke||(Ke=!0,P("first-frame",{frames:be}),t.held===!0&&queueMicrotask(()=>C?.visibility(!1)));let r=performance.now();r-$e>=1e3&&($e=r,P("sample",{frames:be,at:r}))}),C.motion(t.reduced===!0),V=Ye(C.host,C.canvas,Y(t.settings),r=>{r&&se(r)});return}if(t.session!==ie||!Number.isSafeInteger(t.seq)||t.seq<=qe)return;if(qe=t.seq,t.type==="state"){if(t.settings!==void 0){let i=Y(t.settings);V.setSettings?V.setSettings(i):V.updateSettings?.(i)}if(t.viewport&&C?.viewport(pe(t.viewport,t.viewport.dpr)),typeof t.reduced=="boolean"&&C?.motion(t.reduced),typeof t.visible=="boolean"&&C?.visibility(t.visible),t.input){let{type:i,...r}=t.input;if(!["pointermove","pointerdown","pointerup","pointercancel","pointerleave","wheel","keydown"].includes(i))throw Error("BG_INPUT_METHOD: Unsupported background input.");C?.input(i,Y(r))}P("ack",{seq:t.seq});return}if(t.type==="replay"){V.replay?.(),P("ack",{seq:t.seq});return}if(t.type==="call"){if(typeof t.method!="string"||!Xe.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 i=ee(t.args);P("ack",{seq:t.seq}),Promise.resolve().then(()=>V[t.method](...i)).then(r=>P("result",{callId:t.callId,value:ee(r??null)}),r=>P("result",{callId:t.callId,error:String(r).slice(0,1500)}));return}if(t.type==="dispose"){He=!0;try{V?.dispose()}finally{C?.dispose(),P("disposed"),setTimeout(()=>Z.close(),0)}return}throw Error("BG_WORKER_METHOD: Unsupported background command.")}catch(i){se(i)}});})();
172
+ `,o,t,r,n)}},$=Symbol.for("code-codex:background-modules:v1");(window[$]??=new Map).set("spectral-drape",{id:"spectral-drape",api:1,version:"1.0.2",exports:{SpectralDrapeRenderer:G},startup(o,t){let r=document.createElement("canvas");return r.style.cssText="width:100%;height:100%;display:block",o.append(r),new G(o,r,F(),t)}});})();
package/package.json CHANGED
@@ -1,59 +1,70 @@
1
- {
2
- "name": "dsh-ccx",
3
- "version": "0.8.9",
4
- "description": "DSH 桌面版背景主题插件:给 DeepSeek Harness 换上动态背景——10 种原版场景渲染器(银河 / 辉光地平线 / 层峦 / 云穹 / 极光电离层 / 黑洞 / 云列车 / 粒子成像 / 像素雕塑 / 闪烁方块)、壁纸视频素材库、UI 表面分区透明,以及逐像素复刻的 Appearance 设置面板。",
5
- "keywords": [
6
- "dsh",
7
- "dsh-plugin",
8
- "deepseek-harness",
9
- "deepseek",
10
- "appearance",
11
- "background",
12
- "theme",
13
- "wallpaper",
14
- "desktop"
15
- ],
16
- "type": "module",
17
- "main": "./lib/index.js",
18
- "icon": "./assets/icon.svg",
19
- "exports": {
20
- ".": "./lib/index.js",
21
- "./client": "./lib/client.js",
22
- "./package.json": "./package.json"
23
- },
24
- "files": [
25
- "lib",
26
- "assets",
27
- "cordis.patch.yml",
28
- "README.md",
29
- "LICENSE",
30
- "NOTICE"
31
- ],
32
- "engines": {
33
- "node": ">=18"
34
- },
35
- "repository": {
36
- "type": "git",
37
- "url": "git+https://github.com/Witherwithwinter/dsh-ccx.git"
38
- },
39
- "bugs": {
40
- "url": "https://github.com/Witherwithwinter/dsh-ccx/issues"
41
- },
42
- "homepage": "https://github.com/Witherwithwinter/dsh-ccx#readme",
43
- "author": "Witherwithwinter",
44
- "license": "MIT",
45
- "dsh": {
46
- "manifestVersion": 1,
47
- "bundle": {
48
- "patch": "./cordis.patch.yml"
49
- },
50
- "client": {
51
- "platform": "web",
52
- "inject": []
53
- }
54
- },
55
- "devDependencies": {
56
- "pixelmatch": "^8.0.0",
57
- "pngjs": "^7.0.0"
58
- }
59
- }
1
+ {
2
+ "name": "dsh-ccx",
3
+ "version": "0.9.0",
4
+ "description": "DSH 桌面版背景主题插件:给 DeepSeek Harness 0.2.2+ 换上动态背景——13 种同步 code-codex 上游的原版场景渲染器(新增 ASCII 字符砖块 / 浅海字迹 / 光谱帷幔)、壁纸视频素材库、UI 表面分区透明与 Windows 标题栏适配,以及原版复刻设置面板。",
5
+ "scripts": {
6
+ "build": "node scripts/build.mjs",
7
+ "build:dev": "node scripts/build.mjs --dev",
8
+ "typecheck": "tsc --noEmit",
9
+ "test": "node test/host-smoke.test.mjs && node test/client-unit.test.mjs"
10
+ },
11
+ "keywords": [
12
+ "dsh",
13
+ "dsh-plugin",
14
+ "deepseek-harness",
15
+ "deepseek",
16
+ "appearance",
17
+ "background",
18
+ "theme",
19
+ "wallpaper",
20
+ "desktop"
21
+ ],
22
+ "type": "module",
23
+ "main": "./lib/index.js",
24
+ "icon": "./assets/icon.svg",
25
+ "exports": {
26
+ ".": "./lib/index.js",
27
+ "./client": "./lib/client.js",
28
+ "./package.json": "./package.json"
29
+ },
30
+ "files": [
31
+ "lib",
32
+ "src",
33
+ "assets",
34
+ "cordis.patch.yml",
35
+ "tsconfig.json",
36
+ "README.md",
37
+ "LICENSE",
38
+ "NOTICE"
39
+ ],
40
+ "engines": {
41
+ "node": ">=18"
42
+ },
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/Witherwithwinter/dsh-ccx.git"
46
+ },
47
+ "bugs": {
48
+ "url": "https://github.com/Witherwithwinter/dsh-ccx/issues"
49
+ },
50
+ "homepage": "https://github.com/Witherwithwinter/dsh-ccx#readme",
51
+ "author": "Witherwithwinter",
52
+ "license": "MIT",
53
+ "dsh": {
54
+ "manifestVersion": 1,
55
+ "bundle": {
56
+ "patch": "./cordis.patch.yml"
57
+ },
58
+ "client": {
59
+ "platform": "web",
60
+ "inject": []
61
+ }
62
+ },
63
+ "devDependencies": {
64
+ "@types/node": "^26.6.6",
65
+ "esbuild": "^0.28.2",
66
+ "pixelmatch": "^8.0.0",
67
+ "pngjs": "^7.0.0",
68
+ "typescript": "^7.0.2"
69
+ }
70
+ }
@@ -0,0 +1,90 @@
1
+ import { API_BASE } from '../shared/constants';
2
+ import type { SceneSchema, StateResponse, WallpaperItem } from '../shared/types';
3
+
4
+ export function apiGet<T>(path: string): Promise<T> {
5
+ return fetch(API_BASE + path, { credentials: 'omit' }).then((r) => {
6
+ if (!r.ok) throw new Error(`HTTP ${r.status}`);
7
+ return r.json() as Promise<T>;
8
+ });
9
+ }
10
+
11
+ export function apiPostJson<T>(path: string, payload: unknown): Promise<T> {
12
+ return fetch(API_BASE + path, {
13
+ method: 'POST',
14
+ credentials: 'omit',
15
+ headers: { 'Content-Type': 'application/json' },
16
+ body: JSON.stringify(payload),
17
+ }).then(async (r) => {
18
+ const data = (await r.json()) as T & { ok?: boolean; error?: string };
19
+ if (!r.ok && data && typeof data === 'object' && !('ok' in data)) {
20
+ throw new Error(`HTTP ${r.status}`);
21
+ }
22
+ return data;
23
+ });
24
+ }
25
+
26
+ export function uploadWallpaper(
27
+ name: string,
28
+ bytes: ArrayBuffer,
29
+ ): Promise<{ ok: boolean; error?: string; wallpaper?: WallpaperItem; wallpapers?: WallpaperItem[] }> {
30
+ return fetch(`${API_BASE}/wallpaper-upload?name=${encodeURIComponent(name)}`, {
31
+ method: 'POST',
32
+ credentials: 'omit',
33
+ headers: { 'Content-Type': 'application/octet-stream' },
34
+ body: bytes,
35
+ }).then((r) => r.json());
36
+ }
37
+
38
+ export function fetchState(): Promise<StateResponse> {
39
+ return apiGet<StateResponse>('/state.json');
40
+ }
41
+
42
+ let cachedSchemas: Record<string, SceneSchema> | null = null;
43
+ let schemasPromise: Promise<Record<string, SceneSchema>> | null = null;
44
+
45
+ export function getCachedSchemas(): Record<string, SceneSchema> | null {
46
+ return cachedSchemas;
47
+ }
48
+
49
+ export function schemaOf(sceneId: string): SceneSchema | null {
50
+ return cachedSchemas && cachedSchemas[sceneId] ? cachedSchemas[sceneId] : null;
51
+ }
52
+
53
+ export function ensureSchemas(): Promise<Record<string, SceneSchema>> {
54
+ if (cachedSchemas) return Promise.resolve(cachedSchemas);
55
+ if (!schemasPromise) {
56
+ schemasPromise = apiGet<Record<string, SceneSchema>>('/scene-schemas.json')
57
+ .then((s) => {
58
+ cachedSchemas = s && typeof s === 'object' ? s : {};
59
+ return cachedSchemas;
60
+ })
61
+ .catch(() => {
62
+ schemasPromise = null;
63
+ return {};
64
+ });
65
+ }
66
+ return schemasPromise;
67
+ }
68
+
69
+ let cachedOceanThumbs: Record<string, string> | null = null;
70
+ let oceanThumbsPromise: Promise<Record<string, string>> | null = null;
71
+
72
+ export function getCachedOceanThumbs(): Record<string, string> | null {
73
+ return cachedOceanThumbs;
74
+ }
75
+
76
+ export function ensureOceanThumbs(): Promise<Record<string, string>> {
77
+ if (cachedOceanThumbs) return Promise.resolve(cachedOceanThumbs);
78
+ if (!oceanThumbsPromise) {
79
+ oceanThumbsPromise = apiGet<Record<string, string>>('/vendor-shallow-ocean-thumbs.json')
80
+ .then((t) => {
81
+ cachedOceanThumbs = t && typeof t === 'object' ? t : {};
82
+ return cachedOceanThumbs;
83
+ })
84
+ .catch(() => {
85
+ oceanThumbsPromise = null;
86
+ return {};
87
+ });
88
+ }
89
+ return oceanThumbsPromise;
90
+ }