gitframes 1.3.0 → 1.3.1

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 (35) hide show
  1. package/dist/audio/index.mjs +4 -4
  2. package/dist/{audio-C4kiPbrV.mjs → audio-DvL7gQQ8.mjs} +3 -3
  3. package/dist/{audio-C4kiPbrV.mjs.map → audio-DvL7gQQ8.mjs.map} +1 -1
  4. package/dist/{audio-CiXUMGyk.mjs → audio-sZdRh_qg.mjs} +3 -3
  5. package/dist/{audio-CiXUMGyk.mjs.map → audio-sZdRh_qg.mjs.map} +1 -1
  6. package/dist/{dist-C37594c6.mjs → dist-8vbhZYqX.mjs} +471 -152
  7. package/dist/dist-8vbhZYqX.mjs.map +1 -0
  8. package/dist/{dist-CMF9eNLB.mjs → dist-B0vCkDzJ.mjs} +37 -3
  9. package/dist/dist-B0vCkDzJ.mjs.map +1 -0
  10. package/dist/effects/index.mjs +2 -2
  11. package/dist/{effects-C9connag.mjs → effects-C3nV-k4T.mjs} +4 -4
  12. package/dist/{effects-C9connag.mjs.map → effects-C3nV-k4T.mjs.map} +1 -1
  13. package/dist/fonts/index.mjs +1 -1
  14. package/dist/{fonts-Dn18r_ST.mjs → fonts-dn-pl4Pe.mjs} +3 -3
  15. package/dist/{fonts-Dn18r_ST.mjs.map → fonts-dn-pl4Pe.mjs.map} +1 -1
  16. package/dist/{index-YZsTjqut.d.mts → index-D-O2kwLx.d.mts} +3 -3
  17. package/dist/{index-YZsTjqut.d.mts.map → index-D-O2kwLx.d.mts.map} +1 -1
  18. package/dist/index.d.mts +67 -49
  19. package/dist/index.d.mts.map +1 -1
  20. package/dist/index.mjs +96 -52
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/react/index.mjs +2 -2
  23. package/dist/renderer/index.d.mts +2 -2
  24. package/dist/renderer/index.mjs +3 -3
  25. package/dist/{renderer-DgY7XBYE.mjs → renderer-CMDIVxhv.mjs} +315 -12
  26. package/dist/renderer-CMDIVxhv.mjs.map +1 -0
  27. package/dist/{renderers-CLJQRPVU-CMZnHNK0.mjs → renderers-CLJQRPVU-DuQ7-PaC.mjs} +3 -3
  28. package/dist/{renderers-CLJQRPVU-CMZnHNK0.mjs.map → renderers-CLJQRPVU-DuQ7-PaC.mjs.map} +1 -1
  29. package/dist/signals/index.mjs +5 -5
  30. package/dist/{signals-BB_kdndF.mjs → signals-CLaCq092.mjs} +2 -2
  31. package/dist/{signals-BB_kdndF.mjs.map → signals-CLaCq092.mjs.map} +1 -1
  32. package/package.json +52 -52
  33. package/dist/dist-C37594c6.mjs.map +0 -1
  34. package/dist/dist-CMF9eNLB.mjs.map +0 -1
  35. package/dist/renderer-DgY7XBYE.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"dist-CMF9eNLB.mjs","names":["ProgrammaticSignal","window","COMPOSITE_OPERATIONS","GlobalCompositeOperation","ConfigSchemaRegistry","ConfigBuilder","z"],"sources":["../../core/dist/index.mjs","../../node-sdk/dist/renderer.mjs","../../node-sdk/dist/index.mjs","../../renderers/dist/index.mjs","../../compositions/dist/layer-logic-B4xSPDvq.mjs","../../compositions/dist/index.mjs"],"sourcesContent":["import { nanoid } from \"nanoid\";\nimport z$1, { z } from \"zod\";\n\n//#region src/signals/programmatic.ts\nvar ProgrammaticSignal = class ProgrammaticSignal {\n\tgpuBinding;\n\tlabel;\n\t_evaluator;\n\t_samples;\n\t_fps;\n\t_durationFrames;\n\t_cachedFrame = -1;\n\t_cachedValue = 0;\n\t_seekedFrame = -1;\n\t_subscribers = /* @__PURE__ */ new Set();\n\t_children = /* @__PURE__ */ new Set();\n\tget fps() {\n\t\treturn this._fps;\n\t}\n\tconstructor(source, options = {}) {\n\t\tthis._fps = options.fps ?? 24;\n\t\tthis._durationFrames = options.durationFrames;\n\t\tthis.gpuBinding = options.gpuBinding;\n\t\tthis.label = options.label;\n\t\tif (typeof source === \"number\") {\n\t\t\tconst constVal = source;\n\t\t\tthis._evaluator = () => constVal;\n\t\t\tthis._cachedValue = constVal;\n\t\t} else if (typeof source === \"function\") this._evaluator = source;\n\t\telse if (isSignal(source)) this._evaluator = (ctx) => Number(source.get(ctx)) || 0;\n\t\telse {\n\t\t\tconst arr = source;\n\t\t\tthis._samples = arr instanceof Float32Array ? arr : new Float32Array(Array.from(arr));\n\t\t\tthis._durationFrames = this._samples.length;\n\t\t\tthis._cachedValue = this._samples.length > 0 ? this._samples[0] : 0;\n\t\t\tthis._evaluator = (ctx) => {\n\t\t\t\tif (!this._samples || this._samples.length === 0) return 0;\n\t\t\t\tconst compFps = ctx.fps ?? this._fps;\n\t\t\t\tconst targetFrame = compFps !== this._fps && compFps > 0 ? ctx.frame / compFps * this._fps : ctx.frame;\n\t\t\t\tconst idx = Math.max(0, Math.min(this._samples.length - 1, Math.round(targetFrame)));\n\t\t\t\treturn this._samples[idx];\n\t\t\t};\n\t\t}\n\t}\n\tget value() {\n\t\treturn this.get();\n\t}\n\tget(ctx) {\n\t\tregisterSignalDependency(this._subscribers);\n\t\tframeSignal.get();\n\t\tconst currentFrame = ctx?.frame ?? (this._seekedFrame >= 0 ? this._seekedFrame : frameSignal.value);\n\t\tif (this._cachedFrame === currentFrame) return this._cachedValue;\n\t\tconst fps = ctx?.fps ?? this._fps;\n\t\tconst time = ctx?.time ?? (fps > 0 ? currentFrame / fps : 0);\n\t\tconst duration = ctx?.duration ?? this._durationFrames ?? 100;\n\t\tconst resolvedCtx = {\n\t\t\tframe: currentFrame,\n\t\t\tfps,\n\t\t\ttime,\n\t\t\tduration,\n\t\t\tdurationMs: ctx?.durationMs ?? duration / fps * 1e3,\n\t\t\tprogress: duration > 0 ? currentFrame / duration : 0,\n\t\t\tdeltaTime: ctx?.deltaTime ?? (fps > 0 ? 1 / fps : .0416)\n\t\t};\n\t\tthis._cachedFrame = currentFrame;\n\t\tthis._cachedValue = this._evaluator(resolvedCtx);\n\t\treturn this._cachedValue;\n\t}\n\tpeek() {\n\t\treturn this._cachedValue;\n\t}\n\tregisterChild(child) {\n\t\tthis._children.add(child);\n\t}\n\t_derive(evaluator, options, other) {\n\t\tconst child = new ProgrammaticSignal(evaluator, {\n\t\t\tfps: this._fps,\n\t\t\tdurationFrames: this._durationFrames,\n\t\t\t...options\n\t\t});\n\t\tthis._children.add(child);\n\t\tif (other instanceof ProgrammaticSignal) other.registerChild(child);\n\t\treturn child;\n\t}\n\tseekFrame(frame) {\n\t\tthis._seekedFrame = frame;\n\t\tthis._cachedFrame = -1;\n\t\tfor (const sub of this._subscribers) sub.markDirty();\n\t\tfor (const child of this._children) child.seekFrame(frame);\n\t}\n\tinvalidate() {\n\t\tthis._cachedFrame = -1;\n\t\tfor (const sub of this._subscribers) sub.markDirty();\n\t\tfor (const child of this._children) child.invalidate();\n\t}\n\tvalueOf() {\n\t\treturn this.get();\n\t}\n\t[Symbol.toPrimitive](hint) {\n\t\tif (hint === \"number\") return Number(this.get());\n\t\tif (hint === \"string\") return String(this.get());\n\t\treturn this.get();\n\t}\n\tsmooth(windowFrames) {\n\t\tconst window = Math.max(1, Math.round(windowFrames));\n\t\tif (window <= 1) return this;\n\t\treturn this._derive((ctx) => {\n\t\t\tlet sum = 0;\n\t\t\tlet count = 0;\n\t\t\tconst startF = Math.max(0, ctx.frame - window + 1);\n\t\t\tfor (let f = startF; f <= ctx.frame; f++) {\n\t\t\t\tsum += this.get({\n\t\t\t\t\t...ctx,\n\t\t\t\t\tframe: f,\n\t\t\t\t\ttime: f / ctx.fps\n\t\t\t\t});\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\treturn count > 0 ? sum / count : 0;\n\t\t}, { label: `${this.label ?? \"sig\"}_smoothed(${window})` });\n\t}\n\tremap(inMin, inMax, outMin, outMax, clamp = false) {\n\t\tconst inRange = inMax - inMin;\n\t\tconst outRange = outMax - outMin;\n\t\treturn this._derive((ctx) => {\n\t\t\tconst val = this.get(ctx);\n\t\t\tconst remapped = outMin + (inRange !== 0 ? (val - inMin) / inRange : 0) * outRange;\n\t\t\tif (clamp) {\n\t\t\t\tconst lo = Math.min(outMin, outMax);\n\t\t\t\tconst hi = Math.max(outMin, outMax);\n\t\t\t\treturn Math.max(lo, Math.min(hi, remapped));\n\t\t\t}\n\t\t\treturn remapped;\n\t\t}, { label: `${this.label ?? \"sig\"}_remap` });\n\t}\n\tclamp(min, max) {\n\t\tconst lo = Math.min(min, max);\n\t\tconst hi = Math.max(min, max);\n\t\treturn this._derive((ctx) => Math.max(lo, Math.min(hi, this.get(ctx))), { label: `${this.label ?? \"sig\"}_clamped` });\n\t}\n\tgate(threshold, options = {}) {\n\t\tconst mode = options.mode ?? \"gate\";\n\t\tconst debounce = Math.max(1, options.debounceFrames ?? 2);\n\t\tconst hold = Math.max(1, options.holdFrames ?? 4);\n\t\tconst invert = Boolean(options.invert);\n\t\treturn this._derive((ctx) => {\n\t\t\tconst currentF = ctx.frame;\n\t\t\tlet out = 0;\n\t\t\tif (mode === \"gate\") out = this.get(ctx) >= threshold ? 1 : 0;\n\t\t\telse if (mode === \"trigger\") {\n\t\t\t\tlet lastTrigger = -Infinity;\n\t\t\t\tconst startF = Math.max(0, currentF - 120);\n\t\t\t\tfor (let f = startF; f <= currentF; f++) {\n\t\t\t\t\tconst v = this.get({\n\t\t\t\t\t\t...ctx,\n\t\t\t\t\t\tframe: f,\n\t\t\t\t\t\ttime: f / ctx.fps\n\t\t\t\t\t});\n\t\t\t\t\tconst prev = f > 0 ? this.get({\n\t\t\t\t\t\t...ctx,\n\t\t\t\t\t\tframe: f - 1,\n\t\t\t\t\t\ttime: (f - 1) / ctx.fps\n\t\t\t\t\t}) : 0;\n\t\t\t\t\tif (v >= threshold && prev < threshold && f - lastTrigger >= debounce) lastTrigger = f;\n\t\t\t\t}\n\t\t\t\tout = currentF >= lastTrigger && currentF < lastTrigger + hold ? 1 : 0;\n\t\t\t} else if (mode === \"toggle\") {\n\t\t\t\tlet toggleCount = 0;\n\t\t\t\tlet lastTrigger = -Infinity;\n\t\t\t\tfor (let f = 0; f <= currentF; f++) {\n\t\t\t\t\tconst v = this.get({\n\t\t\t\t\t\t...ctx,\n\t\t\t\t\t\tframe: f,\n\t\t\t\t\t\ttime: f / ctx.fps\n\t\t\t\t\t});\n\t\t\t\t\tconst prev = f > 0 ? this.get({\n\t\t\t\t\t\t...ctx,\n\t\t\t\t\t\tframe: f - 1,\n\t\t\t\t\t\ttime: (f - 1) / ctx.fps\n\t\t\t\t\t}) : 0;\n\t\t\t\t\tif (v >= threshold && prev < threshold && f - lastTrigger >= debounce) {\n\t\t\t\t\t\ttoggleCount++;\n\t\t\t\t\t\tlastTrigger = f;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tout = toggleCount % 2 === 1 ? 1 : 0;\n\t\t\t}\n\t\t\treturn invert ? 1 - out : out;\n\t\t}, { label: `${this.label ?? \"sig\"}_gate(${threshold})` });\n\t}\n\tvelocity(dt = 1) {\n\t\tconst step = Math.max(1, Math.round(dt));\n\t\treturn this._derive((ctx) => {\n\t\t\tconst curr = this.get(ctx);\n\t\t\tconst prevF = Math.max(0, ctx.frame - step);\n\t\t\tconst prev = this.get({\n\t\t\t\t...ctx,\n\t\t\t\tframe: prevF,\n\t\t\t\ttime: prevF / ctx.fps\n\t\t\t});\n\t\t\tconst deltaSec = step / ctx.fps;\n\t\t\treturn deltaSec > 0 ? (curr - prev) / deltaSec : curr - prev;\n\t\t}, { label: `${this.label ?? \"sig\"}_velocity` });\n\t}\n\tdelay(frames) {\n\t\tconst shift = Math.max(0, Math.round(frames));\n\t\treturn this._derive((ctx) => {\n\t\t\tconst delayedF = Math.max(0, ctx.frame - shift);\n\t\t\treturn this.get({\n\t\t\t\t...ctx,\n\t\t\t\tframe: delayedF,\n\t\t\t\ttime: delayedF / ctx.fps\n\t\t\t});\n\t\t}, { label: `${this.label ?? \"sig\"}_delay(${shift})` });\n\t}\n\tspring(stiffness = 150, damping = 12) {\n\t\treturn this._derive((ctx) => {\n\t\t\tconst targetFrame = ctx.frame;\n\t\t\tif (targetFrame <= 0) return this.get(ctx);\n\t\t\tlet pos = this.get({\n\t\t\t\t...ctx,\n\t\t\t\tframe: 0,\n\t\t\t\ttime: 0\n\t\t\t});\n\t\t\tlet vel = 0;\n\t\t\tconst dt = 1 / Math.max(1, ctx.fps);\n\t\t\tfor (let f = 1; f <= targetFrame; f++) {\n\t\t\t\tconst targetVal = this.get({\n\t\t\t\t\t...ctx,\n\t\t\t\t\tframe: f,\n\t\t\t\t\ttime: f / ctx.fps\n\t\t\t\t});\n\t\t\t\tconst displacement = pos - targetVal;\n\t\t\t\tconst force = -stiffness * displacement - damping * vel;\n\t\t\t\tvel += force * dt;\n\t\t\t\tpos += vel * dt;\n\t\t\t}\n\t\t\treturn pos;\n\t\t}, { label: `${this.label ?? \"sig\"}_spring` });\n\t}\n\tadd(other) {\n\t\tif (typeof other === \"number\") return this._derive((ctx) => this.get(ctx) + other);\n\t\treturn this._derive((ctx) => this.get(ctx) + (Number(other.get(ctx)) || 0), void 0, other);\n\t}\n\tsubtract(other) {\n\t\tif (typeof other === \"number\") return this._derive((ctx) => this.get(ctx) - other);\n\t\treturn this._derive((ctx) => this.get(ctx) - (Number(other.get(ctx)) || 0), void 0, other);\n\t}\n\tmultiply(factor) {\n\t\tif (typeof factor === \"number\") return this._derive((ctx) => this.get(ctx) * factor);\n\t\treturn this._derive((ctx) => this.get(ctx) * (Number(factor.get(ctx)) || 0), void 0, factor);\n\t}\n\tinvert() {\n\t\treturn this._derive((ctx) => 1 - this.get(ctx), { label: `${this.label ?? \"sig\"}_inverted` });\n\t}\n\tpow(exponent) {\n\t\treturn this._derive((ctx) => this.get(ctx) ** exponent);\n\t}\n\tmap(fn) {\n\t\treturn this._derive((ctx) => fn(this.get(ctx), ctx));\n\t}\n\ttoFrameArray(totalFrames, fps) {\n\t\tconst count = Math.max(1, totalFrames);\n\t\tconst f = fps ?? this._fps;\n\t\tconst out = new Float32Array(count);\n\t\tfor (let i = 0; i < count; i++) out[i] = this.get({\n\t\t\tframe: i,\n\t\t\tfps: f,\n\t\t\ttime: i / f,\n\t\t\tduration: count,\n\t\t\tdurationMs: count / f * 1e3,\n\t\t\tprogress: i / count,\n\t\t\tdeltaTime: 1 / f\n\t\t});\n\t\treturn out;\n\t}\n};\nfunction programmaticSignal(source, options) {\n\treturn new ProgrammaticSignal(source, options);\n}\n\n//#endregion\n//#region src/signals/index.ts\nlet activeComputed = null;\nfunction registerSignalDependency(subscribers) {\n\tif (activeComputed !== null) {\n\t\tsubscribers.add(activeComputed);\n\t\tactiveComputed.deps.add(subscribers);\n\t}\n}\nfunction isSignal(val) {\n\treturn val !== null && typeof val === \"object\" && \"get\" in val && typeof val.get === \"function\" && \"value\" in val;\n}\nvar StateSignalImpl = class {\n\t_value;\n\t_subscribers = /* @__PURE__ */ new Set();\n\tconstructor(initialValue) {\n\t\tthis._value = initialValue;\n\t}\n\tget value() {\n\t\treturn this.get();\n\t}\n\tset value(nextValue) {\n\t\tthis.set(nextValue);\n\t}\n\tget() {\n\t\tif (activeComputed !== null) {\n\t\t\tthis._subscribers.add(activeComputed);\n\t\t\tactiveComputed.deps.add(this._subscribers);\n\t\t}\n\t\treturn this._value;\n\t}\n\tpeek() {\n\t\treturn this._value;\n\t}\n\tset(nextValue) {\n\t\tif (Object.is(this._value, nextValue)) return;\n\t\tthis._value = nextValue;\n\t\tthis.notifySubscribers();\n\t}\n\tupdate(fn) {\n\t\tthis.set(fn(this._value));\n\t}\n\tnotifySubscribers() {\n\t\tif (this._subscribers.size === 0) return;\n\t\tconst toNotify = Array.from(this._subscribers);\n\t\tfor (const sub of toNotify) sub.markDirty();\n\t}\n\tvalueOf() {\n\t\treturn this.get();\n\t}\n\t[Symbol.toPrimitive](hint) {\n\t\tif (hint === \"number\") return Number(this.get());\n\t\tif (hint === \"string\") return String(this.get());\n\t\treturn this.get();\n\t}\n};\nvar ComputedImpl = class {\n\t_fn;\n\t_value;\n\t_dirty = true;\n\t_evaluating = false;\n\tdeps = /* @__PURE__ */ new Set();\n\t_subscribers = /* @__PURE__ */ new Set();\n\tconstructor(fn) {\n\t\tthis._fn = fn;\n\t}\n\tget value() {\n\t\treturn this.get();\n\t}\n\tget() {\n\t\tif (activeComputed !== null && activeComputed !== this) {\n\t\t\tthis._subscribers.add(activeComputed);\n\t\t\tactiveComputed.deps.add(this._subscribers);\n\t\t}\n\t\tif (this._dirty) this.compute();\n\t\treturn this._value;\n\t}\n\tpeek() {\n\t\tif (this._dirty) this.compute();\n\t\treturn this._value;\n\t}\n\tmarkDirty() {\n\t\tif (this._dirty) return;\n\t\tthis._dirty = true;\n\t\tconst toNotify = Array.from(this._subscribers);\n\t\tfor (const sub of toNotify) sub.markDirty();\n\t}\n\tcompute() {\n\t\tif (this._evaluating) throw new Error(\"Cyclic dependency detected in computed signal\");\n\t\tfor (const depSubSet of this.deps) depSubSet.delete(this);\n\t\tthis.deps.clear();\n\t\tconst prevActive = activeComputed;\n\t\tactiveComputed = this;\n\t\tthis._evaluating = true;\n\t\ttry {\n\t\t\tthis._value = this._fn();\n\t\t\tthis._dirty = false;\n\t\t} finally {\n\t\t\tthis._evaluating = false;\n\t\t\tactiveComputed = prevActive;\n\t\t}\n\t}\n\tvalueOf() {\n\t\treturn this.get();\n\t}\n\t[Symbol.toPrimitive](hint) {\n\t\tif (hint === \"number\") return Number(this.get());\n\t\tif (hint === \"string\") return String(this.get());\n\t\treturn this.get();\n\t}\n};\nvar FrameArraySignalImpl = class {\n\tgpuBinding;\n\tfps;\n\t_samples;\n\t_cachedFrame = -1;\n\t_cachedValue = 0;\n\t_seekedFrame = -1;\n\t_subscribers = /* @__PURE__ */ new Set();\n\tconstructor(samples, fps = 24, gpuBinding) {\n\t\tthis._samples = samples;\n\t\tthis.fps = fps;\n\t\tthis.gpuBinding = gpuBinding;\n\t\tif (samples.length > 0) this._cachedValue = samples[0];\n\t}\n\tget value() {\n\t\treturn this.get();\n\t}\n\tget(ctx) {\n\t\tif (activeComputed !== null) {\n\t\t\tthis._subscribers.add(activeComputed);\n\t\t\tactiveComputed.deps.add(this._subscribers);\n\t\t}\n\t\tframeSignal.get();\n\t\tconst currentFrame = ctx?.frame ?? (this._seekedFrame >= 0 ? this._seekedFrame : frameSignal.value);\n\t\tif (this._cachedFrame === currentFrame) return this._cachedValue;\n\t\tthis._cachedFrame = currentFrame;\n\t\tif (!this._samples || this._samples.length === 0) {\n\t\t\tthis._cachedValue = 0;\n\t\t\treturn 0;\n\t\t}\n\t\tconst compFps = ctx?.fps ?? this.fps;\n\t\tconst targetFrame = compFps !== this.fps && compFps > 0 ? currentFrame / compFps * this.fps : currentFrame;\n\t\tconst idx = Math.max(0, Math.min(this._samples.length - 1, Math.round(targetFrame)));\n\t\tthis._cachedValue = Number(this._samples[idx]) || 0;\n\t\treturn this._cachedValue;\n\t}\n\tpeek() {\n\t\treturn this._cachedValue;\n\t}\n\tseekFrame(frame) {\n\t\tthis._seekedFrame = frame;\n\t\tthis._cachedFrame = frame;\n\t\tif (!this._samples || this._samples.length === 0) this._cachedValue = 0;\n\t\telse {\n\t\t\tconst idx = Math.max(0, Math.min(this._samples.length - 1, Math.round(frame)));\n\t\t\tthis._cachedValue = Number(this._samples[idx]) || 0;\n\t\t}\n\t\tfor (const sub of this._subscribers) sub.markDirty();\n\t}\n\tvalueOf() {\n\t\treturn this.get();\n\t}\n\t[Symbol.toPrimitive](hint) {\n\t\tif (hint === \"number\") return Number(this.get());\n\t\tif (hint === \"string\") return String(this.get());\n\t\treturn this.get();\n\t}\n};\nfunction signal(initialValue) {\n\treturn new StateSignalImpl(initialValue);\n}\nfunction computed(fn) {\n\treturn new ComputedImpl(fn);\n}\nfunction frameArraySignal(samples, fps = 24, gpuBinding) {\n\treturn new FrameArraySignalImpl(samples, fps, gpuBinding);\n}\nconst frameSignal = signal(0);\nconst timeSignal = signal(0);\nconst progressSignal = signal(0);\nfunction updateClockSignals(frame, fps = 24, durationMs) {\n\tframeSignal.set(frame);\n\tconst timeSec = fps > 0 ? frame / fps : 0;\n\ttimeSignal.set(timeSec);\n\tif (durationMs && durationMs > 0) {\n\t\tconst durSec = durationMs / 1e3;\n\t\tprogressSignal.set(Math.max(0, Math.min(1, timeSec / durSec)));\n\t} else progressSignal.set(0);\n}\nvar ProceduralSignalImpl = class {\n\tgpuBinding;\n\t_config;\n\tconstructor(config) {\n\t\tthis._config = {\n\t\t\ttype: \"sine\",\n\t\t\tfrequency: 1,\n\t\t\tamplitude: 1,\n\t\t\toffset: 0,\n\t\t\tphase: 0,\n\t\t\t...config\n\t\t};\n\t\tthis.gpuBinding = config.gpuBinding;\n\t}\n\tget value() {\n\t\treturn this.get();\n\t}\n\tget(ctx) {\n\t\tframeSignal.get();\n\t\tconst frame = ctx?.frame ?? frameSignal.value;\n\t\tconst fps = ctx?.fps ?? 24;\n\t\tconst time = ctx?.time ?? (fps > 0 ? frame / fps : 0);\n\t\tif (this._config.fn) return this._config.fn(ctx ?? {\n\t\t\tframe,\n\t\t\tfps,\n\t\t\ttime,\n\t\t\tduration: 0,\n\t\t\tdurationMs: 0,\n\t\t\tprogress: 0,\n\t\t\tdeltaTime: fps > 0 ? 1 / fps : 0\n\t\t});\n\t\tconst freq = this._config.frequency ?? 1;\n\t\tconst amp = this._config.amplitude ?? 1;\n\t\tconst off = this._config.offset ?? 0;\n\t\tconst phase = this._config.phase ?? 0;\n\t\tswitch (this._config.type ?? \"sine\") {\n\t\t\tcase \"sine\": return off + amp * Math.sin(2 * Math.PI * freq * time + phase);\n\t\t\tcase \"triangle\": return off + amp * (2 * Math.abs(2 * (time * freq + phase / (2 * Math.PI) - Math.floor(time * freq + phase / (2 * Math.PI) + .5))) - 1);\n\t\t\tcase \"sawtooth\": return off + amp * (2 * (time * freq + phase / (2 * Math.PI) - Math.floor(time * freq + phase / (2 * Math.PI) + .5)));\n\t\t\tcase \"square\": return off + (Math.sin(2 * Math.PI * freq * time + phase) >= 0 ? amp : -amp);\n\t\t\tcase \"bounce\": {\n\t\t\t\tconst cycle = time * freq % 1;\n\t\t\t\treturn off + amp * Math.abs(Math.sin(Math.PI * cycle));\n\t\t\t}\n\t\t\tdefault: return off + amp * Math.sin(2 * Math.PI * freq * time + phase);\n\t\t}\n\t}\n\tpeek() {\n\t\treturn this.get();\n\t}\n\tvalueOf() {\n\t\treturn this.get();\n\t}\n\t[Symbol.toPrimitive](hint) {\n\t\tif (hint === \"number\") return Number(this.get());\n\t\tif (hint === \"string\") return String(this.get());\n\t\treturn this.get();\n\t}\n};\nfunction signalBuilder(config) {\n\treturn new ProceduralSignalImpl(config);\n}\nfunction sineSignal(options = {}) {\n\tconst min = options.min;\n\tconst max = options.max;\n\tlet amplitude = options.amplitude ?? 1;\n\tlet offset = options.offset ?? 0;\n\tif (min !== void 0 && max !== void 0) {\n\t\toffset = (min + max) / 2;\n\t\tamplitude = (max - min) / 2;\n\t} else if (min !== void 0) offset = min + amplitude;\n\telse if (max !== void 0) offset = max - amplitude;\n\tconst period = options.period;\n\tconst frequency = options.frequency;\n\tconst phase = options.phase ?? 0;\n\treturn signalBuilder({\n\t\ttype: \"custom\",\n\t\tfn: (ctx) => {\n\t\t\tlet angle;\n\t\t\tif (period !== void 0 && period > 0) angle = 2 * Math.PI * ctx.frame / period + phase;\n\t\t\telse {\n\t\t\t\tconst freq = frequency ?? 1;\n\t\t\t\tangle = 2 * Math.PI * freq * ctx.time + phase;\n\t\t\t}\n\t\t\treturn offset + amplitude * Math.sin(angle);\n\t\t}\n\t});\n}\nfunction cosineSignal(options = {}) {\n\tconst min = options.min;\n\tconst max = options.max;\n\tlet amplitude = options.amplitude ?? 1;\n\tlet offset = options.offset ?? 0;\n\tif (min !== void 0 && max !== void 0) {\n\t\toffset = (min + max) / 2;\n\t\tamplitude = (max - min) / 2;\n\t} else if (min !== void 0) offset = min + amplitude;\n\telse if (max !== void 0) offset = max - amplitude;\n\tconst period = options.period;\n\tconst frequency = options.frequency;\n\tconst phase = options.phase ?? 0;\n\treturn signalBuilder({\n\t\ttype: \"custom\",\n\t\tfn: (ctx) => {\n\t\t\tlet angle;\n\t\t\tif (period !== void 0 && period > 0) angle = 2 * Math.PI * ctx.frame / period + phase;\n\t\t\telse {\n\t\t\t\tconst freq = frequency ?? 1;\n\t\t\t\tangle = 2 * Math.PI * freq * ctx.time + phase;\n\t\t\t}\n\t\t\treturn offset + amplitude * Math.cos(angle);\n\t\t}\n\t});\n}\nconst Signal = {\n\tstate: signal,\n\tcomputed,\n\tbuilder: signalBuilder,\n\tfromArray: frameArraySignal,\n\tprogrammatic: programmaticSignal,\n\tframe: frameSignal,\n\ttime: timeSignal,\n\tprogress: progressSignal,\n\tsine: sineSignal,\n\tcosine: cosineSignal\n};\n\n//#endregion\n//#region src/effects/index.ts\nvar Effect = class {\n\tsignals;\n\tconfig;\n\t_frameHooks = [];\n\tconstructor(initialConfig) {\n\t\tthis.config = { ...initialConfig };\n\t\tthis.signals = {};\n\t\tfor (const [key, val] of Object.entries(initialConfig)) if (isSignal(val)) this.signals[key] = val;\n\t\telse this.signals[key] = signal(val);\n\t\treturn new Proxy(this, {\n\t\t\tget(target, prop, receiver) {\n\t\t\t\tif (typeof prop === \"string\" && prop in target.signals) {\n\t\t\t\t\tconst sig = target.signals[prop];\n\t\t\t\t\treturn sig ? sig.value : void 0;\n\t\t\t\t}\n\t\t\t\treturn Reflect.get(target, prop, receiver);\n\t\t\t},\n\t\t\tset(target, prop, val, receiver) {\n\t\t\t\tif (typeof prop === \"string\" && prop in target.signals) {\n\t\t\t\t\tconst currentSig = target.signals[prop];\n\t\t\t\t\tif (isSignal(val)) {\n\t\t\t\t\t\ttarget.signals[prop] = val;\n\t\t\t\t\t\ttarget.config[prop] = val;\n\t\t\t\t\t} else if (currentSig && typeof currentSig.set === \"function\") {\n\t\t\t\t\t\tcurrentSig.set(val);\n\t\t\t\t\t\ttarget.config[prop] = val;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.signals[prop] = signal(val);\n\t\t\t\t\t\ttarget.config[prop] = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn Reflect.set(target, prop, val, receiver);\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* Game-engine per-frame lifecycle hook.\n\t* Invoked before rendering each frame so scripts or agents can mutate properties.\n\t*/\n\tonRequestFrame(callback) {\n\t\tthis._frameHooks.push(callback);\n\t\treturn this;\n\t}\n\tnotifyFrame(ctx) {\n\t\tfor (const hook of this._frameHooks) hook(ctx);\n\t}\n\t/**\n\t* Samples concrete scalar / config values for the current frame.\n\t*/\n\tresolveUniforms(ctx) {\n\t\tconst out = {};\n\t\tfor (const [k, sig] of Object.entries(this.signals)) out[k] = sig.get(ctx);\n\t\treturn out;\n\t}\n\t/**\n\t* Returns WebGPU texture bindings attached to any property signal.\n\t*/\n\tresolveTextures() {\n\t\tconst out = {};\n\t\tfor (const [k, sig] of Object.entries(this.signals)) {\n\t\t\tconst gpu = sig.gpuBinding;\n\t\t\tif (gpu?.textureView) out[`${k}TextureView`] = gpu.textureView;\n\t\t\tif (gpu?.texture) out[`${k}Texture`] = gpu.texture;\n\t\t}\n\t\treturn out;\n\t}\n\t/**\n\t* Converts the effect into an operation node for the VirtualMediaData AST.\n\t*/\n\ttoOperation() {\n\t\tconst opPayload = {\n\t\t\top: this.op,\n\t\t\teffect: this,\n\t\t\tonRequestFrame: (ctx) => this.notifyFrame(ctx),\n\t\t\tsignals: this.signals,\n\t\t\t...this.config\n\t\t};\n\t\tfor (const [k, sig] of Object.entries(this.signals)) {\n\t\t\tconst orig = this.config[k];\n\t\t\tif (!isSignal(orig) && (typeof orig === \"string\" || typeof orig === \"boolean\")) opPayload[k] = sig.value;\n\t\t\telse opPayload[k] = sig;\n\t\t}\n\t\treturn opPayload;\n\t}\n};\n\n//#endregion\n//#region src/errors.ts\nvar ModerationError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"ModerationError\";\n\t}\n};\nvar ModerationUnrefundableError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"ModerationUnrefundableError\";\n\t}\n};\n\n//#endregion\n//#region src/id-gen.ts\n/**\n* Generates a unique ID using nanoid.\n* This function is cross-platform compatible (Node.js and Browser).\n*\n* @param size - Optional size of the ID (default is 21)\n* @returns A unique string ID\n*/\nconst generateId = (size) => {\n\treturn nanoid(size);\n};\n\n//#endregion\n//#region src/node-metadata.ts\nconst HandleDefinitionSchema = z$1.object({\n\tdataTypes: z$1.custom(),\n\tlabel: z$1.string(),\n\trequired: z$1.boolean().optional(),\n\torder: z$1.number(),\n\tdescription: z$1.string().optional()\n});\nconst ConfigHandleSchema = z$1.object({\n\tconfigKey: z$1.string(),\n\tdataTypes: z$1.custom(),\n\tlabel: z$1.string(),\n\tdescription: z$1.string().optional()\n});\n/**\n* Metadata defining the interface and identity of a node.\n* This is safe to import in any environment.\n*/\nconst NodeMetadataSchema = z$1.object({\n\ttype: z$1.string().min(1),\n\tversion: z$1.number().int().positive().optional(),\n\tbaseType: z$1.string().optional(),\n\tdisplayName: z$1.string().min(1),\n\tdescription: z$1.string().optional(),\n\tshowInQuickAccess: z$1.boolean().optional(),\n\tshowInSidebar: z$1.boolean().optional(),\n\tadvanced: z$1.boolean().optional(),\n\tcategory: z$1.string().min(1),\n\tsubcategory: z$1.string().optional(),\n\tdefaultDimensions: z$1.object({\n\t\twidth: z$1.number().positive().optional(),\n\t\theight: z$1.number().positive().optional()\n\t}).optional(),\n\thandles: z$1.object({\n\t\tinputs: z$1.array(HandleDefinitionSchema),\n\t\toutputs: z$1.array(HandleDefinitionSchema)\n\t}),\n\tvariableInputs: z$1.discriminatedUnion(\"enabled\", [z$1.object({\n\t\tenabled: z$1.literal(true),\n\t\tdataTypes: z$1.custom()\n\t}), z$1.object({\n\t\tenabled: z$1.literal(false),\n\t\tdataTypes: z$1.custom().optional()\n\t})]).optional(),\n\tvariableOutputs: z$1.discriminatedUnion(\"enabled\", [z$1.object({\n\t\tenabled: z$1.literal(true),\n\t\tdataTypes: z$1.custom()\n\t}), z$1.object({\n\t\tenabled: z$1.literal(false),\n\t\tdataTypes: z$1.custom().optional()\n\t})]).optional(),\n\tisTerminal: z$1.boolean().optional(),\n\tisTransient: z$1.boolean().optional(),\n\tconfigSchema: z$1.custom().optional(),\n\tdefaultConfig: z$1.record(z$1.string(), z$1.unknown()).optional(),\n\tvalidation: z$1.any().optional(),\n\tresultSchema: z$1.custom().optional(),\n\tconfigHandles: z$1.array(ConfigHandleSchema).optional()\n});\n\n//#endregion\n//#region src/types/base.ts\nconst DataTypeVal = {\n\tText: \"Text\",\n\tNumber: \"Number\",\n\tBoolean: \"Boolean\",\n\tImage: \"Image\",\n\tVideo: \"Video\",\n\tAudio: \"Audio\",\n\tSVG: \"SVG\",\n\tCaption: \"Caption\",\n\tLottie: \"Lottie\",\n\tThreeD: \"ThreeD\",\n\tGIF: \"GIF\",\n\tSignal: \"Signal\",\n\tLUT: \"LUT\"\n};\nconst DataType = DataTypeVal;\nconst DataTypes = Object.values(DataTypeVal);\nconst HandleTypeVal = {\n\tInput: \"Input\",\n\tOutput: \"Output\"\n};\nconst JsonValueSchema = z$1.lazy(() => z$1.union([\n\tz$1.string(),\n\tz$1.number(),\n\tz$1.boolean(),\n\tz$1.null(),\n\tz$1.array(JsonValueSchema),\n\tz$1.record(z$1.string(), JsonValueSchema.optional())\n]));\n/**\n* Zod schema for the FileAsset model\n* Matches the Prisma schema definitions for types and nullability.\n*/\nconst FileAssetSchema = z$1.object({\n\tid: z$1.cuid2(),\n\tname: z$1.string(),\n\tcreatedAt: z$1.coerce.date(),\n\tupdatedAt: z$1.coerce.date(),\n\tuserId: z$1.cuid2().nullable(),\n\twidth: z$1.number().int().nullable(),\n\theight: z$1.number().int().nullable(),\n\tbucket: z$1.string(),\n\tsize: z$1.number().int(),\n\tmimeType: z$1.string(),\n\tkey: z$1.string(),\n\tisUploaded: z$1.boolean().default(true),\n\tduration: z$1.number().int().nullable(),\n\tsampleRate: z$1.number().int().nullable().optional(),\n\tchannels: z$1.number().int().nullable().optional(),\n\tbitDepth: z$1.number().int().nullable().optional(),\n\taudioCodec: z$1.string().nullable().optional(),\n\taudioBitrate: z$1.number().int().nullable().optional(),\n\tfps: z$1.number().int().nullable(),\n\tfingerprint: z$1.string().nullable()\n});\nconst NodeVisualConfigSchema = z$1.object({\n\tposition: z$1.object({\n\t\tx: z$1.number(),\n\t\ty: z$1.number()\n\t}).optional(),\n\twidth: z$1.number().nullish(),\n\theight: z$1.number().nullish(),\n\tlocked: z$1.boolean().optional().default(false),\n\tcollapsed: z$1.boolean().optional().default(false)\n}).passthrough();\n\n//#endregion\n//#region src/types/config/colors.ts\nconst dataTypeColors = {\n\tText: {\n\t\tbg: \"bg-blue-500\",\n\t\tstroke: \"stroke-blue-500\",\n\t\thex: \"#3b82f6\",\n\t\ttext: \"text-blue-500\",\n\t\tborder: \"border-blue-500\"\n\t},\n\tImage: {\n\t\tbg: \"bg-purple-500\",\n\t\tstroke: \"stroke-purple-500\",\n\t\thex: \"#a855f7\",\n\t\ttext: \"text-purple-500\",\n\t\tborder: \"border-purple-500\"\n\t},\n\tVideo: {\n\t\tbg: \"bg-teal-500\",\n\t\tstroke: \"stroke-teal-500\",\n\t\thex: \"oklch(60% 0.118 184.704)\",\n\t\ttext: \"text-teal-500\",\n\t\tborder: \"border-teal-500\"\n\t},\n\tAudio: {\n\t\tbg: \"bg-orange-500\",\n\t\tstroke: \"stroke-orange-500\",\n\t\thex: \"#f97316\",\n\t\ttext: \"text-orange-500\",\n\t\tborder: \"border-orange-500\"\n\t},\n\tNumber: {\n\t\tbg: \"bg-green-600\",\n\t\tstroke: \"stroke-green-600\",\n\t\thex: \"#16a34a\",\n\t\ttext: \"text-green-600\",\n\t\tborder: \"border-green-600\"\n\t},\n\tBoolean: {\n\t\tbg: \"bg-amber-600\",\n\t\tstroke: \"stroke-amber-600\",\n\t\thex: \"#d97706\",\n\t\ttext: \"text-amber-600\",\n\t\tborder: \"border-amber-600\"\n\t},\n\tSVG: {\n\t\tbg: \"bg-lime-600\",\n\t\tstroke: \"stroke-lime-600\",\n\t\thex: \"#65a30d\",\n\t\ttext: \"text-lime-600\",\n\t\tborder: \"border-lime-600\"\n\t},\n\tCaption: {\n\t\tbg: \"bg-rose-500\",\n\t\tstroke: \"stroke-rose-500\",\n\t\thex: \"#f43f5e\",\n\t\ttext: \"text-rose-500\",\n\t\tborder: \"border-rose-500\"\n\t},\n\tGIF: {\n\t\tbg: \"bg-pink-500\",\n\t\tstroke: \"stroke-pink-500\",\n\t\thex: \"#ec4899\",\n\t\ttext: \"text-pink-500\",\n\t\tborder: \"border-pink-500\"\n\t},\n\tLottie: {\n\t\tbg: \"bg-indigo-500\",\n\t\tstroke: \"stroke-indigo-500\",\n\t\thex: \"#6366f1\",\n\t\ttext: \"text-indigo-500\",\n\t\tborder: \"border-indigo-500\"\n\t},\n\tSignal: {\n\t\tbg: \"bg-fuchsia-500\",\n\t\tstroke: \"stroke-fuchsia-500\",\n\t\thex: \"#d946ef\",\n\t\ttext: \"text-fuchsia-500\",\n\t\tborder: \"border-fuchsia-500\"\n\t},\n\tLUT: {\n\t\tbg: \"bg-cyan-600\",\n\t\tstroke: \"stroke-cyan-600\",\n\t\thex: \"#0891b2\",\n\t\ttext: \"text-cyan-600\",\n\t\tborder: \"border-cyan-600\"\n\t}\n};\n\n//#endregion\n//#region src/types/config/schemas.ts\nconst DATA_TYPE_EXTENSIONS = {\n\tImage: \"png\",\n\tVideo: \"mp4\",\n\tAudio: \"mp3\",\n\tText: \"txt\",\n\tNumber: \"txt\",\n\tBoolean: \"txt\",\n\tSVG: \"svg\",\n\tCaption: \"srt\",\n\tLottie: \"json\",\n\tThreeD: \"glb\",\n\tGIF: \"gif\",\n\tSignal: \"txt\",\n\tLUT: \"cube\"\n};\nconst MIME_TYPES = {\n\tpng: \"image/png\",\n\tjpg: \"image/jpeg\",\n\tjpeg: \"image/jpeg\",\n\tgif: \"image/gif\",\n\twebp: \"image/webp\",\n\tsvg: \"image/svg+xml\",\n\tmp4: \"video/mp4\",\n\twebm: \"video/webm\",\n\tmov: \"video/quicktime\",\n\tmp3: \"audio/mpeg\",\n\twav: \"audio/wav\",\n\togg: \"audio/ogg\",\n\tpdf: \"application/pdf\",\n\tjson: \"application/json\",\n\ttxt: \"text/plain\",\n\tsrt: \"text/srt\",\n\taac: \"audio/aac\",\n\tflac: \"audio/flac\"\n};\nconst COMPOSITE_OPERATIONS = [\n\t\"source-over\",\n\t\"source-in\",\n\t\"source-out\",\n\t\"source-atop\",\n\t\"destination-over\",\n\t\"destination-in\",\n\t\"destination-out\",\n\t\"destination-atop\",\n\t\"lighter\",\n\t\"copy\",\n\t\"xor\",\n\t\"multiply\",\n\t\"screen\",\n\t\"overlay\",\n\t\"darken\",\n\t\"lighten\",\n\t\"color-dodge\",\n\t\"color-burn\",\n\t\"hard-light\",\n\t\"soft-light\",\n\t\"difference\",\n\t\"exclusion\",\n\t\"hue\",\n\t\"saturation\",\n\t\"color\",\n\t\"luminosity\"\n];\nconst GlobalCompositeOperation = z.enum(COMPOSITE_OPERATIONS);\nvar ConfigSchemaRegistry = class ConfigSchemaRegistry {\n\tstatic schemas = /* @__PURE__ */ new Map();\n\tstatic register(type, schema) {\n\t\tConfigSchemaRegistry.schemas.set(type, schema);\n\t}\n\tstatic get(type) {\n\t\treturn ConfigSchemaRegistry.schemas.get(type);\n\t}\n\tstatic clear() {\n\t\tConfigSchemaRegistry.schemas.clear();\n\t}\n};\n\n//#endregion\n//#region src/types/constants.ts\nconst COMPOSITOR_DEFAULTS = {\n\tFONT_FAMILY: \"Inter\",\n\tFONT_SIZE: 64,\n\tFILL: \"#ffffff\",\n\tLINE_HEIGHT: 1.1,\n\tALIGN: \"left\",\n\tVERTICAL_ALIGN: \"top\",\n\tLETTER_SPACING: 0,\n\tSTROKE_WIDTH: 0,\n\tSTROKE: \"#000000\",\n\tCORNER_RADIUS: 0,\n\tPADDING: 0\n};\n\n//#endregion\n//#region src/types/node-result.ts\nconst FileDataSchema = z$1.object({ entity: z$1.custom().optional() });\nconst SignalStatsSchema = z$1.object({\n\tmin: z$1.number().optional(),\n\tmax: z$1.number().optional(),\n\tmean: z$1.number().optional(),\n\trms: z$1.number().optional(),\n\tpeak: z$1.number().optional(),\n\tbeats: z$1.array(z$1.number()).optional(),\n\ttempo: z$1.number().optional()\n});\nconst SignalChannelMetaSchema = z$1.object({\n\tid: z$1.string(),\n\tname: z$1.string(),\n\tindex: z$1.number(),\n\tstats: SignalStatsSchema.optional()\n});\nconst GeneratorSignalDataSchema = z$1.object({\n\tv: z$1.literal(2).optional(),\n\ttype: z$1.literal(\"generator\"),\n\tnodeId: z$1.string().optional(),\n\tbaseType: z$1.string().optional(),\n\tfunc: z$1.enum([\n\t\t\"sine\",\n\t\t\"triangle\",\n\t\t\"sawtooth\",\n\t\t\"square\",\n\t\t\"custom\"\n\t]).or(z$1.string()).default(\"sine\"),\n\tfrequency: z$1.number().default(1),\n\tamplitude: z$1.number().default(1),\n\tphase: z$1.number().default(0),\n\toffset: z$1.number().default(0),\n\twaveform: z$1.string().optional(),\n\tbpm: z$1.number().optional(),\n\tsyncToBpm: z$1.boolean().optional(),\n\tfmFrequency: z$1.number().optional(),\n\tfmDepth: z$1.number().optional(),\n\tenvelope: z$1.string().optional(),\n\tfnBody: z$1.string().optional(),\n\tfnParams: z$1.array(z$1.record(z$1.string(), z$1.unknown())).optional(),\n\tcustomWGSL: z$1.string().optional(),\n\tsignalFnName: z$1.string().optional(),\n\toutputType: z$1.string().optional(),\n\tfps: z$1.number().optional(),\n\tdurationMs: z$1.number().optional(),\n\tstats: SignalStatsSchema.optional()\n}).passthrough();\nconst AudioExtractorSignalDataSchema = z$1.object({\n\tv: z$1.literal(2).optional(),\n\ttype: z$1.literal(\"audio_extractor\"),\n\tnodeId: z$1.string().optional(),\n\tsourceUrl: z$1.string().optional(),\n\tchannel: z$1.enum([\n\t\t\"primary\",\n\t\t\"beat\",\n\t\t\"bass\",\n\t\t\"energy\",\n\t\t\"spectral_flux\"\n\t]).or(z$1.string()).optional(),\n\tchannelIndex: z$1.number().optional(),\n\tchannels: z$1.array(SignalChannelMetaSchema).optional(),\n\textractionMode: z$1.string().optional(),\n\tattackMs: z$1.number().optional(),\n\treleaseMs: z$1.number().optional(),\n\tsensitivity: z$1.number().optional(),\n\tnoiseFloorDb: z$1.number().optional(),\n\tdynamicRangeDb: z$1.number().optional(),\n\tautoRange: z$1.boolean().optional(),\n\tsmoothing: z$1.number().optional(),\n\tcurve: z$1.string().optional(),\n\tbeatThreshold: z$1.number().optional(),\n\tbeatDecayMs: z$1.number().optional(),\n\tpreviewMode: z$1.string().optional(),\n\tsamples: z$1.union([z$1.array(z$1.number()), z$1.instanceof(Float32Array)]).optional(),\n\tfps: z$1.number().optional(),\n\tdurationMs: z$1.number().optional(),\n\tstats: SignalStatsSchema.optional(),\n\tstate: z$1.enum([\n\t\t\"pending\",\n\t\t\"ready\",\n\t\t\"failed\"\n\t]).optional(),\n\terror: z$1.string().optional(),\n\tvirtualMedia: z$1.record(z$1.string(), z$1.unknown()).optional(),\n\tsignalFnName: z$1.string().optional(),\n\tcustomWGSL: z$1.string().optional()\n}).passthrough();\nconst SignalMathDataSchema = z$1.object({\n\tv: z$1.literal(2).optional(),\n\ttype: z$1.literal(\"signal_math\"),\n\tnodeId: z$1.string().optional(),\n\top: z$1.string().optional(),\n\toperation: z$1.string().optional(),\n\tsignalA: z$1.unknown().optional(),\n\tsignalB: z$1.unknown().optional(),\n\tbValue: z$1.number().optional(),\n\tinMin: z$1.number().optional(),\n\tinMax: z$1.number().optional(),\n\toutMin: z$1.number().optional(),\n\toutMax: z$1.number().optional(),\n\tclampMin: z$1.number().optional(),\n\tclampMax: z$1.number().optional(),\n\texponent: z$1.number().optional(),\n\tedge0: z$1.number().optional(),\n\tedge1: z$1.number().optional(),\n\tcustomWGSL: z$1.string().optional(),\n\tstats: SignalStatsSchema.optional()\n}).passthrough();\nconst SignalGateDataSchema = z$1.object({\n\tv: z$1.literal(2).optional(),\n\ttype: z$1.literal(\"gate\"),\n\tnodeId: z$1.string().optional(),\n\tsourceSignal: z$1.unknown().optional(),\n\tthreshold: z$1.number().optional(),\n\tdebounceMs: z$1.number().optional(),\n\tmode: z$1.enum([\n\t\t\"gate\",\n\t\t\"trigger\",\n\t\t\"toggle\"\n\t]).optional(),\n\tholdFrames: z$1.number().optional(),\n\tinvert: z$1.boolean().optional(),\n\tstats: SignalStatsSchema.optional()\n}).passthrough();\nconst SignalDataSchema = z$1.union([\n\tGeneratorSignalDataSchema,\n\tAudioExtractorSignalDataSchema,\n\tSignalMathDataSchema,\n\tSignalGateDataSchema,\n\tz$1.object({ type: z$1.string() }).passthrough()\n]);\nfunction serializeSignalData(data) {\n\treturn JSON.stringify(data, (_key, value) => {\n\t\tif (value instanceof Float32Array) return Array.from(value);\n\t\treturn value;\n\t});\n}\nfunction deserializeSignalData(raw) {\n\tif (typeof raw === \"string\") try {\n\t\treturn SignalDataSchema.parse(JSON.parse(raw));\n\t} catch {\n\t\treturn { type: \"unknown\" };\n\t}\n\treturn SignalDataSchema.parse(raw);\n}\nconst OutputItemSchema = z$1.object({\n\ttype: z$1.custom(),\n\tdata: z$1.any(),\n\toutputHandleId: z$1.string().optional()\n});\nconst createOutputItemSchema = (type, dataSchema) => {\n\treturn z$1.object({\n\t\ttype,\n\t\tdata: dataSchema,\n\t\toutputHandleId: z$1.string().optional()\n\t});\n};\nconst SingleOutputGenericSchema = (outputItemSchema) => z$1.object({\n\tselectedOutputIndex: z$1.literal(0),\n\toutputs: z$1.tuple([z$1.object({ items: z$1.tuple([outputItemSchema]) })])\n});\nconst MultiOutputGenericSchema = (outputItemSchema) => z$1.object({\n\tselectedOutputIndex: z$1.number(),\n\toutputs: z$1.array(z$1.object({ items: z$1.array(outputItemSchema) })),\n\tsourceFingerprint: z$1.string().optional()\n});\nconst AnyOutputUnionSchema = z$1.object({\n\ttype: z$1.custom(),\n\tdata: z$1.any(),\n\toutputHandleId: z$1.string().optional()\n});\nconst NodeResultSchema = z$1.object({\n\tselectedOutputIndex: z$1.number(),\n\toutputs: z$1.array(z$1.object({ items: z$1.array(AnyOutputUnionSchema) }))\n});\nconst ExportResultSchema = MultiOutputGenericSchema(AnyOutputUnionSchema);\n\n//#endregion\n//#region src/types/video/base-layer-schema.ts\nconst AnimationTypeSchema = z.enum([\n\t\"fade-in\",\n\t\"fade-out\",\n\t\"slide-in-left\",\n\t\"slide-in-right\",\n\t\"slide-in-top\",\n\t\"slide-in-bottom\",\n\t\"zoom-in\",\n\t\"zoom-out\",\n\t\"rotate-cw\",\n\t\"rotate-ccw\",\n\t\"bounce\",\n\t\"shake\"\n]);\nconst VideoAnimationSchema = z.object({\n\tid: z.string(),\n\ttype: AnimationTypeSchema,\n\tvalue: z.number()\n});\nconst VideoSpatialPropsSchema = z.object({\n\tx: z.number().default(0),\n\ty: z.number().default(0),\n\twidth: z.number().optional(),\n\theight: z.number().optional(),\n\trotation: z.number().default(0),\n\tscale: z.number().min(0).default(1),\n\topacity: z.number().min(0).max(1).default(1),\n\tzIndex: z.number().int().optional(),\n\tblendMode: GlobalCompositeOperation.optional()\n});\nconst VideoTimingPropsSchema = z.object({\n\tstartFrame: z.number().int().min(0).default(0),\n\tdurationInMS: z.number().int().min(1).optional(),\n\ttrimStart: z.number().int().min(0).optional(),\n\ttrimEnd: z.number().int().min(0).optional(),\n\tspeed: z.number().min(.25).max(4).optional()\n});\nconst VideoTextPropsSchema = z.object({\n\ttext: z.string().optional(),\n\tfontSize: z.number().optional(),\n\tfontFamily: z.string().optional(),\n\tfontStyle: z.string().optional(),\n\tfontWeight: z.union([z.number(), z.string()]).optional(),\n\tfill: z.string().optional(),\n\talign: z.string().optional(),\n\tverticalAlign: z.string().optional(),\n\tletterSpacing: z.number().optional(),\n\tlineHeight: z.number().optional(),\n\tpadding: z.number().optional(),\n\tstroke: z.string().optional(),\n\tstrokeWidth: z.number().optional(),\n\tstrokeAlign: z.enum([\n\t\t\"inside\",\n\t\t\"center\",\n\t\t\"outside\"\n\t]).optional(),\n\ttextShadow: z.string().optional(),\n\ttextBackgroundColor: z.string().optional(),\n\tshadows: z.array(z.object({\n\t\tcolor: z.string(),\n\t\toffset: z.object({\n\t\t\tx: z.number(),\n\t\t\ty: z.number()\n\t\t}).optional(),\n\t\tblurRadius: z.number().optional()\n\t})).optional(),\n\ttextAnimation: z.any().optional(),\n\tbottomPadding: z.number().optional(),\n\tmaxWidth: z.number().optional()\n});\nconst VideoStylePropsSchema = z.object({\n\tbackgroundColor: z.string().optional(),\n\tborderColor: z.string().optional(),\n\tborderWidth: z.number().optional(),\n\tstrokeRadius: z.number().optional(),\n\tautoDimensions: z.boolean().optional()\n});\nconst VideoLayerTypeSchema = z.enum([\n\t\"Video\",\n\t\"Image\",\n\t\"Audio\",\n\t\"Text\",\n\t\"Caption\",\n\t\"SVG\",\n\t\"GIF\",\n\t\"Lottie\"\n]);\nconst BaseVideoLayerPropsSchema = VideoSpatialPropsSchema.merge(VideoTimingPropsSchema).merge(VideoTextPropsSchema).merge(VideoStylePropsSchema).extend({\n\ttype: VideoLayerTypeSchema.optional(),\n\tanimations: z.array(VideoAnimationSchema).optional()\n});\n\n//#endregion\n//#region src/types/video/transition-schema.ts\nconst TransitionTypeSchema = z.enum([\n\t\"none\",\n\t\"crossfade\",\n\t\"wipe-left\",\n\t\"wipe-right\",\n\t\"slide-up\",\n\t\"slide-down\"\n]);\nconst TransitionSchema = z.object({\n\ttype: TransitionTypeSchema,\n\tdurationFrames: z.number().min(1)\n});\n\n//#endregion\n//#region src/types/video/virtual-video.ts\nconst MediaSourceSchema = z.object({ entity: FileAssetSchema.optional() });\nconst MediaMetadataSchema = z.object({\n\twidth: z.number().optional().nullable(),\n\theight: z.number().optional().nullable(),\n\tfps: z.number().optional().nullable(),\n\tdurationMs: z.number().optional().nullable(),\n\tsampleRate: z.number().optional().nullable(),\n\tchannels: z.number().optional().nullable(),\n\tbitDepth: z.number().optional().nullable(),\n\taudioCodec: z.string().optional().nullable(),\n\taudioBitrate: z.number().optional().nullable()\n});\nconst TimelineSegmentSchema = z.object({\n\tstartSec: z.number(),\n\tendSec: z.number().optional()\n});\nconst TimelineTransformSchema = z.object({\n\tstartFrame: z.number().optional(),\n\tsegments: z.array(TimelineSegmentSchema).optional()\n});\nconst BaseMediaOperationPropsSchema = z.object({\n\tvolume: z.number().optional(),\n\topacity: z.number().optional(),\n\tstartFrame: z.number().optional(),\n\ttimeline: TimelineTransformSchema.optional()\n});\n/** Original source file (leaf node) */\nconst SourceOperationSchema = BaseMediaOperationPropsSchema.extend({\n\top: z.literal(\"source\"),\n\tsource: MediaSourceSchema,\n\tsourceMeta: MediaMetadataSchema,\n\tdataType: z.enum(Object.values(DataTypeVal))\n});\n/** Text content (leaf node) */\nconst TextOperationSchema = BaseMediaOperationPropsSchema.extend({\n\top: z.literal(\"text\"),\n\ttext: z.string(),\n\tmetadata: MediaMetadataSchema.optional(),\n\tdataType: z.enum(Object.values(DataTypeVal))\n}).passthrough();\nconst MediaOperationSchema = z.union([\n\tSourceOperationSchema,\n\tTextOperationSchema,\n\tBaseMediaOperationPropsSchema.extend({\n\t\top: z.string(),\n\t\tmetadata: MediaMetadataSchema.optional(),\n\t\tdataType: z.enum(Object.values(DataTypeVal))\n\t}).passthrough()\n]);\nconst VirtualMediaDataSchema = z.lazy(() => z.object({\n\tmetadata: MediaMetadataSchema,\n\toperation: MediaOperationSchema,\n\tchildren: z.array(VirtualMediaDataSchema).default([])\n}));\n\n//#endregion\n//#region src/types/video/layer-schema.ts\nconst ExtendedLayerSchema = BaseVideoLayerPropsSchema.extend({\n\tid: z.string(),\n\tname: z.string().optional(),\n\ttype: VideoLayerTypeSchema,\n\tvirtualMedia: VirtualMediaDataSchema.optional(),\n\ttransitionIn: TransitionSchema.optional(),\n\ttransitionOut: TransitionSchema.optional(),\n\tdurationInMS: z.number(),\n\tmaxDurationInMS: z.number().optional(),\n\tsrc: z.string().optional(),\n\tvolume: z.number().default(1),\n\tinputHandleId: z.string().optional(),\n\tisPlaceholder: z.boolean().optional(),\n\tlockAspect: z.boolean().optional(),\n\tlockRatio: z.boolean().optional(),\n\tzIndex: z.number().optional()\n}).strict();\n\n//#endregion\n//#region src/types/video/rendering-defaults.ts\nconst DEFAULT_FPS = 60;\nconst DEFAULT_DURATION_MS = 3e3;\nconst DEFAULT_MEDIA_DIMENSION = 1080;\n/** Default styling applied to new Text layers. */\nconst TEXT_LAYER_DEFAULTS = {\n\tfontSize: 60,\n\tfontFamily: \"Inter\",\n\tfill: \"#ffffff\",\n\tfontStyle: \"normal\",\n\talign: \"start\",\n\tpadding: 0\n};\n/** Default styling applied to new Caption layers. */\nconst CAPTION_LAYER_DEFAULTS = {\n\tfontSize: 48,\n\tfontFamily: \"Inter\",\n\tfill: \"#ffffff\",\n\talign: \"center\",\n\tverticalAlign: \"bottom\",\n\tpadding: 0,\n\tlineHeight: 1.1,\n\ttextAnimation: {\n\t\tin: \"none\",\n\t\tout: \"none\",\n\t\tentranceMs: 0,\n\t\texitMs: 0,\n\t\tkinetic: \"none\",\n\t\tapplyBy: \"word\",\n\t\tsmoothing: true\n\t},\n\tbottomPadding: 60\n};\n\n//#endregion\n//#region src/types/video/resolve-media.ts\n/**\n* Identify the actual leaf media type (Video, Image, etc) by walking down the tree.\n* This can differ from getMediaType() if an operation (like Ken Burns) upgrades\n* an Image to a Video.\n*/\nfunction getLeafMediaType(vv) {\n\tif (!vv) return void 0;\n\tif (vv.operation?.op === \"source\") return vv.operation.dataType;\n\tif (vv.children && vv.children.length > 0) return getLeafMediaType(vv.children[0]);\n\treturn vv.operation.dataType;\n}\n/**\n* Resolve the MIME type of the leaf source media.\n*/\nfunction resolveMediaMimeType(vv) {\n\tif (!vv) return void 0;\n\tif (vv.operation?.op === \"source\") {\n\t\tconst op = vv.operation;\n\t\tif (op.mimeType) return op.mimeType;\n\t\tif (op.sourceMeta?.mimeType) return op.sourceMeta.mimeType;\n\t\tif (op.source?.entity?.mimeType) return op.source.entity.mimeType;\n\t\tconst url = typeof op.source === \"string\" ? op.source : op.url ?? op.source?.url;\n\t\tif (typeof url === \"string\") {\n\t\t\tconst ext = url.split(\".\").pop()?.toLowerCase();\n\t\t\tif (ext === \"mp4\") return \"video/mp4\";\n\t\t\tif (ext === \"webm\") return \"video/webm\";\n\t\t\tif (ext === \"mov\") return \"video/quicktime\";\n\t\t\tif (ext === \"png\") return \"image/png\";\n\t\t\tif (ext === \"jpg\" || ext === \"jpeg\") return \"image/jpeg\";\n\t\t\tif (ext === \"webp\") return \"image/webp\";\n\t\t\tif (ext === \"svg\") return \"image/svg+xml\";\n\t\t\tif (ext === \"mp3\") return \"audio/mpeg\";\n\t\t\tif (ext === \"wav\") return \"audio/wav\";\n\t\t\tif (ext === \"aac\") return \"audio/aac\";\n\t\t}\n\t}\n\tif (vv.children && vv.children.length > 0) return resolveMediaMimeType(vv.children[0]);\n}\n/**\n* Create a VirtualMediaData from a FileData source or Text.\n* Used by Import, VideoGen, and Text nodes to wrap concrete content.\n*/\nfunction createVirtualMedia(source, type = \"Video\") {\n\tif (source && typeof source === \"object\" && \"operation\" in source && \"metadata\" in source) return source;\n\tif (typeof source === \"string\") {\n\t\tconst url = source;\n\t\tconst sourceMeta$1 = {\n\t\t\twidth: void 0,\n\t\t\theight: void 0,\n\t\t\tdurationMs: type === \"Image\" || /\\.(png|jpg|jpeg|webp|gif|svg)$/i.test(url) ? DEFAULT_DURATION_MS : void 0,\n\t\t\tfps: void 0\n\t\t};\n\t\treturn {\n\t\t\tmetadata: sourceMeta$1,\n\t\t\toperation: {\n\t\t\t\top: \"source\",\n\t\t\t\turl,\n\t\t\t\tsource: url,\n\t\t\t\tsourceMeta: sourceMeta$1,\n\t\t\t\tdataType: type\n\t\t\t},\n\t\t\tchildren: []\n\t\t};\n\t}\n\tif (typeof source === \"object\" && source !== null && (\"url\" in source || \"path\" in source)) {\n\t\tconst desc = source;\n\t\tconst url = desc.url ?? desc.path;\n\t\tconst isImage = type === \"Image\" || /\\.(png|jpg|jpeg|webp|gif|svg)$/i.test(url);\n\t\tconst durationMs = desc.durationMs ?? (isImage ? DEFAULT_DURATION_MS : void 0);\n\t\tconst sourceMeta$1 = {\n\t\t\twidth: desc.width,\n\t\t\theight: desc.height,\n\t\t\tdurationMs,\n\t\t\tfps: desc.fps,\n\t\t\tsampleRate: desc.sampleRate,\n\t\t\tchannels: desc.channels,\n\t\t\tbitDepth: desc.bitDepth,\n\t\t\taudioCodec: desc.audioCodec,\n\t\t\taudioBitrate: desc.audioBitrate\n\t\t};\n\t\treturn {\n\t\t\tmetadata: sourceMeta$1,\n\t\t\toperation: {\n\t\t\t\top: \"source\",\n\t\t\t\turl,\n\t\t\t\tsource: url,\n\t\t\t\tsourceMeta: sourceMeta$1,\n\t\t\t\tdataType: type\n\t\t\t},\n\t\t\tchildren: []\n\t\t};\n\t}\n\tconst sourceMeta = getFileDataMetadata(source) || {\n\t\twidth: void 0,\n\t\theight: void 0,\n\t\tdurationMs: void 0,\n\t\tfps: void 0\n\t};\n\treturn {\n\t\tmetadata: sourceMeta,\n\t\toperation: {\n\t\t\top: \"source\",\n\t\t\tsource: { entity: source?.entity },\n\t\t\tsourceMeta,\n\t\t\tdataType: type\n\t\t},\n\t\tchildren: []\n\t};\n}\n/**\n* Identify if a VirtualMediaData node is intended to be Video, Audio, Image, or Text.\n*/\nfunction getMediaType(vv) {\n\tif (!vv) throw new Error(\"No media data provided\");\n\treturn vv.operation.dataType;\n}\n/**\n* Append an operation to an existing VirtualMediaData (recursive).\n* This creates a new parent node wrapping the current one as a child.\n*/\nfunction appendOperation(vv, operation) {\n\treturn {\n\t\tmetadata: computeNextMetadata(getActiveMediaMetadata(vv) ?? {}, operation),\n\t\toperation,\n\t\tchildren: [vv]\n\t};\n}\n/**\n* Helper to compute the metadata of the NEXT node in the operator tree.\n*/\nfunction computeNextMetadata(baseMeta, op) {\n\tlet { width, height, durationMs, fps, sampleRate, channels, bitDepth, audioCodec, audioBitrate } = baseMeta;\n\tif (\"metadata\" in op && op.metadata) {\n\t\twidth = op.metadata.width ?? width;\n\t\theight = op.metadata.height ?? height;\n\t\tdurationMs = op.metadata.durationMs ?? durationMs;\n\t\tfps = op.metadata.fps ?? fps;\n\t\tsampleRate = op.metadata.sampleRate ?? sampleRate;\n\t\tchannels = op.metadata.channels ?? channels;\n\t\tbitDepth = op.metadata.bitDepth ?? bitDepth;\n\t\taudioCodec = op.metadata.audioCodec ?? audioCodec;\n\t\taudioBitrate = op.metadata.audioBitrate ?? audioBitrate;\n\t}\n\tif (op.dataType === \"Audio\" || op.dataType === \"Text\" || op.dataType === \"Caption\") {\n\t\twidth = void 0;\n\t\theight = void 0;\n\t\tfps = void 0;\n\t}\n\treturn {\n\t\twidth,\n\t\theight,\n\t\tdurationMs,\n\t\tfps,\n\t\tsampleRate,\n\t\tchannels,\n\t\tbitDepth,\n\t\taudioCodec,\n\t\taudioBitrate\n\t};\n}\nfunction getFileDataMetadata(filedata) {\n\tif (!filedata) return null;\n\tconst { entity } = filedata;\n\tconst width = entity?.width;\n\tconst height = entity?.height;\n\tlet durationMs = entity?.duration;\n\tconst fps = entity?.fps;\n\tconst sampleRate = entity?.sampleRate;\n\tconst channels = entity?.channels;\n\tconst bitDepth = entity?.bitDepth;\n\tconst audioCodec = entity?.audioCodec;\n\tconst audioBitrate = entity?.audioBitrate;\n\tif (durationMs === void 0 || durationMs === null) {\n\t\tconst mimeType = entity?.mimeType ?? \"\";\n\t\tif (mimeType.startsWith(\"image/\") || mimeType === \"image/svg+xml\") durationMs = DEFAULT_DURATION_MS;\n\t}\n\tif (width === void 0 && height === void 0 && durationMs === void 0 && sampleRate === void 0 && channels === void 0) return null;\n\treturn {\n\t\twidth,\n\t\theight,\n\t\tdurationMs: durationMs === 0 ? void 0 : durationMs,\n\t\tfps,\n\t\tsampleRate,\n\t\tchannels,\n\t\tbitDepth,\n\t\taudioCodec,\n\t\taudioBitrate\n\t};\n}\n/**\n* Get the active metadata from the VirtualMediaData node.\n* Simply returns the metadata property of the node.\n* Supports legacy formats (sourceMeta) and extracts from source if needed.\n*/\nfunction getActiveMediaMetadata(vv) {\n\tif (!vv) return null;\n\tlet width = vv.metadata?.width;\n\tlet height = vv.metadata?.height;\n\tlet durationMs = vv.metadata?.durationMs;\n\tlet fps = vv.metadata?.fps;\n\tlet sampleRate = vv.metadata?.sampleRate;\n\tlet channels = vv.metadata?.channels;\n\tlet bitDepth = vv.metadata?.bitDepth;\n\tlet audioCodec = vv.metadata?.audioCodec;\n\tlet audioBitrate = vv.metadata?.audioBitrate;\n\tconst op = vv.operation;\n\tif (op?.op === \"source\") {\n\t\tconst sm = op.sourceMeta || {};\n\t\tconst fdm = op.source ? getFileDataMetadata(op.source) : null;\n\t\twidth = width ?? sm.width ?? fdm?.width;\n\t\theight = height ?? sm.height ?? fdm?.height;\n\t\tdurationMs = durationMs ?? sm.durationMs ?? fdm?.durationMs;\n\t\tfps = fps ?? sm.fps ?? fdm?.fps;\n\t\tsampleRate = sampleRate ?? sm.sampleRate ?? fdm?.sampleRate;\n\t\tchannels = channels ?? sm.channels ?? fdm?.channels;\n\t\tbitDepth = bitDepth ?? sm.bitDepth ?? fdm?.bitDepth;\n\t\taudioCodec = audioCodec ?? sm.audioCodec ?? fdm?.audioCodec;\n\t\taudioBitrate = audioBitrate ?? sm.audioBitrate ?? fdm?.audioBitrate;\n\t}\n\tif (width === void 0 && height === void 0 && durationMs === void 0 && sampleRate === void 0 && channels === void 0) return null;\n\treturn {\n\t\twidth,\n\t\theight,\n\t\tdurationMs: durationMs === 0 ? void 0 : durationMs,\n\t\tfps,\n\t\tsampleRate,\n\t\tchannels,\n\t\tbitDepth,\n\t\taudioCodec,\n\t\taudioBitrate\n\t};\n}\n/**\n* Compute the dimensions and offsets for rendering a cropped video.\n* Traverses the VirtualMediaData tree to find nested crops and source dimensions.\n*/\nfunction computeVideoCropRenderProps(virtualMedia) {\n\tlet totalOffsetX = 0;\n\tlet totalOffsetY = 0;\n\tlet hasCrop = false;\n\tlet sourceMetaFound = null;\n\tlet currentNode = virtualMedia;\n\twhile (currentNode) {\n\t\tconst op = currentNode.operation;\n\t\tif (op.op === \"Crop\") {\n\t\t\thasCrop = true;\n\t\t\tconst anyOp = op;\n\t\t\tconst inputMeta = currentNode.children[0]?.metadata;\n\t\t\tconst inputW = inputMeta?.width ?? 0;\n\t\t\tconst inputH = inputMeta?.height ?? 0;\n\t\t\tif (inputW > 0 && inputH > 0) {\n\t\t\t\tconst cropLeftPx = anyOp.leftPercentage / 100 * inputW;\n\t\t\t\tconst cropTopPx = anyOp.topPercentage / 100 * inputH;\n\t\t\t\ttotalOffsetX += cropLeftPx;\n\t\t\t\ttotalOffsetY += cropTopPx;\n\t\t\t}\n\t\t}\n\t\tif (op.op === \"source\") sourceMetaFound = op.sourceMeta ?? currentNode.metadata;\n\t\tcurrentNode = currentNode.children[0];\n\t}\n\tif (!hasCrop || !sourceMetaFound) return null;\n\tconst sourceW = sourceMetaFound.width ?? 1;\n\tconst sourceH = sourceMetaFound.height ?? 1;\n\treturn {\n\t\tvideoNaturalWidth: sourceW,\n\t\tvideoNaturalHeight: sourceH,\n\t\tcropTranslatePercentageX: -(totalOffsetX / sourceW) * 100,\n\t\tcropTranslatePercentageY: -(totalOffsetY / sourceH) * 100\n\t};\n}\n\n//#endregion\n//#region src/utils/is-equal.ts\n/**\n* Performs a deep comparison between two values to determine if they are equivalent.\n* Handles primitives, objects, arrays, Dates, and NaNs.\n*/\nfunction isEqual(a, b) {\n\tif (a === b) return true;\n\tif (typeof a === \"number\" && typeof b === \"number\" && Number.isNaN(a) && Number.isNaN(b)) return true;\n\tif (a && b && typeof a === \"object\" && typeof b === \"object\") {\n\t\tif (a.constructor !== b.constructor) return false;\n\t\tif (Array.isArray(a)) {\n\t\t\tif (a.length !== b.length) return false;\n\t\t\tfor (let i = 0; i < a.length; i++) if (!isEqual(a[i], b[i])) return false;\n\t\t\treturn true;\n\t\t}\n\t\tif (a instanceof Date) return a.getTime() === b.getTime();\n\t\tif (a instanceof RegExp) return a.toString() === b.toString();\n\t\tconst keys = Object.keys(a);\n\t\tif (keys.length !== Object.keys(b).length) return false;\n\t\tfor (const key of keys) {\n\t\t\tif (!Object.hasOwn(b, key)) return false;\n\t\t\tif (!isEqual(a[key], b[key])) return false;\n\t\t}\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n//#endregion\n//#region src/utils/virtual-media.ts\n/**\n* Gets a stable object for hashing/fingerprinting by sorting keys and skipping volatile fields.\n*/\nfunction getStableData(data) {\n\tif (typeof data !== \"object\" || data === null) return data;\n\tif (Array.isArray(data)) return data.map(getStableData);\n\tconst result = {};\n\tconst keys = Object.keys(data).sort();\n\tfor (const key of keys) {\n\t\tconst val = data[key];\n\t\tif (key === \"createdAt\" || key === \"updatedAt\" || key === \"dataUrl\" || key === \"filePath\") continue;\n\t\tif (typeof val === \"string\" && val.startsWith(\"blob:\")) continue;\n\t\tif (key === \"entity\" && val && typeof val === \"object\" && val.id) {\n\t\t\tresult.entity = { id: val.id };\n\t\t\tcontinue;\n\t\t}\n\t\tresult[key] = getStableData(val);\n\t}\n\treturn result;\n}\n/**\n* Generates a fingerprint for the given data.\n*/\nfunction getFingerprint(data) {\n\tconst stableData = getStableData(data);\n\tconst str = JSON.stringify(stableData);\n\tif (str.length === 0) return \"0\";\n\tconst getHash = (seed) => {\n\t\tlet h1 = 3735928559 ^ seed;\n\t\tlet h2 = 1103547991 ^ seed;\n\t\tfor (let i = 0; i < str.length; i++) {\n\t\t\tconst ch = str.charCodeAt(i);\n\t\t\th1 = Math.imul(h1 ^ ch, 2654435761);\n\t\t\th2 = Math.imul(h2 ^ ch, 1597334677);\n\t\t}\n\t\th1 = Math.imul(h1 ^ h1 >>> 16, 2246822519);\n\t\th1 = Math.imul(h1 ^ h1 >>> 13, 3266489917);\n\t\th1 = h1 ^ h1 >>> 16;\n\t\th2 = Math.imul(h2 ^ h2 >>> 16, 2246822519);\n\t\th2 = Math.imul(h2 ^ h2 >>> 13, 3266489917);\n\t\th2 = h2 ^ h2 >>> 16;\n\t\treturn (h1 >>> 0).toString(36).padStart(7, \"0\") + (h2 >>> 0).toString(36).padStart(7, \"0\");\n\t};\n\treturn getHash(0) + getHash(1);\n}\n/**\n* Generates a version-aware fingerprint for render caching.\n* Includes app version so cached renders are invalidated on version bumps.\n*/\nfunction getRenderFingerprint(data, appVersion, extra) {\n\treturn getFingerprint({\n\t\t__v: appVersion,\n\t\tdata,\n\t\t...extra\n\t});\n}\n/**\n* Checks if data is VirtualMediaData.\n*/\nfunction isVirtualMediaData(data) {\n\treturn typeof data === \"object\" && data !== null && \"metadata\" in data && \"operation\" in data && \"children\" in data;\n}\n/**\n* Checks if the virtual media is just a raw source without any significant operations\n* that would require a rendering step (like transformations, trimming, or effects).\n*/\nfunction hasOnlySingleSource(data) {\n\tif (!isVirtualMediaData(data)) return false;\n\tif (data.operation.op === \"source\") {\n\t\tif (data.children && data.children.length > 0) return false;\n\t\tconst op = data.operation;\n\t\treturn !(op.volume !== void 0 && op.volume !== 1 || op.opacity !== void 0 && op.opacity !== 1 || op.startFrame !== void 0 && op.startFrame !== 0 || op.timeline && (op.timeline.startFrame !== void 0 && op.timeline.startFrame !== 0 || op.timeline.segments && op.timeline.segments.length > 0));\n\t}\n\tif (data.operation.op === \"compose\") return false;\n\tif (data.operation.op === \"layer\" && data.children.length === 1) {\n\t\tconst op = data.operation;\n\t\tif (!(op.x !== void 0 && op.x !== 0 || op.y !== void 0 && op.y !== 0 || op.rotation !== void 0 && op.rotation !== 0 || op.scale !== void 0 && op.scale !== 1 || op.opacity !== void 0 && op.opacity !== 1 || op.volume !== void 0 && op.volume !== 1 || op.zIndex !== void 0 || op.blendMode !== void 0 || op.filters !== void 0 || op.transitionIn !== void 0 || op.transitionOut !== void 0 || op.animations && op.animations.length > 0 || op.trimStart !== void 0 || op.trimEnd !== void 0 || op.speed !== void 0 || op.backgroundColor !== void 0 || op.borderColor !== void 0 || op.borderWidth !== void 0 || op.strokeRadius !== void 0)) return hasOnlySingleSource(data.children[0]);\n\t}\n\treturn false;\n}\n/**\n* Finds the source asset in a virtual media tree.\n*/\nfunction findSourceAsset(vm) {\n\tif (vm.operation.op === \"source\") return vm.operation.source;\n\tif (vm.children && vm.children.length > 0) return findSourceAsset(vm.children[0]);\n\treturn null;\n}\n\n//#endregion\n//#region src/utils/result-cache.ts\n/**\n* Checks if a cached node result can be reused based on source fingerprint.\n* Returns the valid cached result, or null if the cache is stale.\n*/\nfunction checkNodeResultCache(currentResult, input) {\n\tif (!currentResult?.sourceFingerprint) return null;\n\tconst inputFingerprint = getFingerprint(input);\n\tif (currentResult.sourceFingerprint !== inputFingerprint) return null;\n\treturn currentResult;\n}\n/**\n* Creates a fresh result with a source fingerprint stamp.\n*/\nfunction stampResult(result, input) {\n\treturn {\n\t\t...result,\n\t\tsourceFingerprint: getFingerprint(input)\n\t};\n}\n\n//#endregion\n//#region src/utils/svg.ts\n/**\n* Attempts to parse the width and height of an SVG from its buffer.\n* Falls back to viewBox ratios if explicitly defined sizes are missing.\n*/\nfunction extractSvgDimensions(buffer) {\n\ttry {\n\t\tconst match = buffer.toString(\"utf-8\").match(/<svg[^>]*>/i);\n\t\tif (!match) return null;\n\t\tconst svgTag = match[0];\n\t\tconst getAttr = (name) => {\n\t\t\tconst attrMatch = svgTag.match(new RegExp(`${name}=[\"']([^\"']+)[\"']`, \"i\"));\n\t\t\tif (!attrMatch) return null;\n\t\t\tconst val = parseFloat(attrMatch[1].replace(/[a-z%]/gi, \"\"));\n\t\t\treturn isNaN(val) ? null : val;\n\t\t};\n\t\tlet w = getAttr(\"width\");\n\t\tlet h = getAttr(\"height\");\n\t\tconst viewBoxMatch = svgTag.match(/viewBox=[\"']([^\"']+)[\"']/i);\n\t\tif (viewBoxMatch) {\n\t\t\tconst parts = viewBoxMatch[1].split(/[\\s,]+/).map(parseFloat);\n\t\t\tif (parts.length >= 4 && !isNaN(parts[2]) && !isNaN(parts[3])) {\n\t\t\t\tconst vbW = parts[2];\n\t\t\t\tconst vbH = parts[3];\n\t\t\t\tif (w == null && h == null) {\n\t\t\t\t\tw = vbW;\n\t\t\t\t\th = vbH;\n\t\t\t\t} else if (w != null && h == null) h = w * (vbH / vbW);\n\t\t\t\telse if (h != null && w == null) w = h * (vbW / vbH);\n\t\t\t}\n\t\t}\n\t\tif (w != null && h != null && w > 0 && h > 0) return {\n\t\t\tw,\n\t\t\th\n\t\t};\n\t\treturn null;\n\t} catch (error) {\n\t\tconsole.error(\"Error parsing SVG dimensions\", error);\n\t\treturn null;\n\t}\n}\n\n//#endregion\nexport { AnimationTypeSchema, AnyOutputUnionSchema, AudioExtractorSignalDataSchema, BaseMediaOperationPropsSchema, BaseVideoLayerPropsSchema, CAPTION_LAYER_DEFAULTS, COMPOSITE_OPERATIONS, COMPOSITOR_DEFAULTS, ConfigHandleSchema, ConfigSchemaRegistry, DATA_TYPE_EXTENSIONS, DEFAULT_DURATION_MS, DEFAULT_FPS, DEFAULT_MEDIA_DIMENSION, DataType, DataTypeVal, DataTypes, Effect, ExportResultSchema, ExtendedLayerSchema, FileAssetSchema, FileDataSchema, GeneratorSignalDataSchema, GlobalCompositeOperation, HandleTypeVal, JsonValueSchema, MIME_TYPES, MediaMetadataSchema, MediaOperationSchema, MediaSourceSchema, ModerationError, ModerationUnrefundableError, MultiOutputGenericSchema, NodeMetadataSchema, NodeResultSchema, NodeVisualConfigSchema, OutputItemSchema, ProgrammaticSignal, Signal, SignalChannelMetaSchema, SignalDataSchema, SignalGateDataSchema, SignalMathDataSchema, SignalStatsSchema, SingleOutputGenericSchema, SourceOperationSchema, TEXT_LAYER_DEFAULTS, TextOperationSchema, TimelineSegmentSchema, TimelineTransformSchema, TransitionSchema, TransitionTypeSchema, VideoAnimationSchema, VideoLayerTypeSchema, VideoSpatialPropsSchema, VideoStylePropsSchema, VideoTextPropsSchema, VideoTimingPropsSchema, VirtualMediaDataSchema, appendOperation, checkNodeResultCache, computeVideoCropRenderProps, computed, cosineSignal, createOutputItemSchema, createVirtualMedia, dataTypeColors, deserializeSignalData, extractSvgDimensions, findSourceAsset, frameArraySignal, frameSignal, generateId, getActiveMediaMetadata, getFileDataMetadata, getFingerprint, getLeafMediaType, getMediaType, getRenderFingerprint, hasOnlySingleSource, isEqual, isSignal, isVirtualMediaData, programmaticSignal, progressSignal, registerSignalDependency, resolveMediaMimeType, serializeSignalData, signal, signalBuilder, sineSignal, stampResult, timeSignal, updateClockSignals };\n//# sourceMappingURL=index.mjs.map","//#region renderer/index.ts\nfunction defineRenderer(plugin) {\n\treturn Object.freeze(plugin);\n}\nconst GLOBAL_WEBGPU_REGISTRY_KEY = Symbol.for(\"gitframes.webgpuRegistry\");\nvar WebGPURegistry = class {\n\trenderers = /* @__PURE__ */ new Map();\n\tregister(op, renderer) {\n\t\tthis.renderers.set(op, renderer);\n\t}\n\tget(op) {\n\t\treturn this.renderers.get(op);\n\t}\n\thas(op) {\n\t\treturn this.renderers.has(op);\n\t}\n};\nconst webgpuRegistry = (() => {\n\tconst g = globalThis;\n\tif (!g[GLOBAL_WEBGPU_REGISTRY_KEY]) g[GLOBAL_WEBGPU_REGISTRY_KEY] = new WebGPURegistry();\n\treturn g[GLOBAL_WEBGPU_REGISTRY_KEY];\n})();\nfunction registerWebGPURenderer(op, renderer) {\n\twebgpuRegistry.register(op, renderer);\n}\nvar AudioProcessorRegistry = class {\n\tprocessors = /* @__PURE__ */ new Map();\n\tregister(opType, processor) {\n\t\tthis.processors.set(opType, processor);\n\t}\n\tget(opType) {\n\t\treturn this.processors.get(opType) || null;\n\t}\n};\nconst GLOBAL_AUDIO_KEY = Symbol.for(\"gitframes.audioRegistry\");\nconst audioRegistry = (() => {\n\tconst g = globalThis;\n\tif (!g[GLOBAL_AUDIO_KEY]) g[GLOBAL_AUDIO_KEY] = new AudioProcessorRegistry();\n\treturn g[GLOBAL_AUDIO_KEY];\n})();\n\n//#endregion\nexport { WebGPURegistry, audioRegistry, defineRenderer, registerWebGPURenderer, webgpuRegistry };\n//# sourceMappingURL=renderer.mjs.map","import { WebGPURegistry, audioRegistry, defineRenderer, registerWebGPURenderer, webgpuRegistry } from \"./renderer.mjs\";\nimport { z } from \"zod\";\nimport { FileDataSchema, MultiOutputGenericSchema, SingleOutputGenericSchema, VirtualMediaDataSchema, createOutputItemSchema } from \"@gitframes/core\";\n\n//#region shared/config-builder.ts\nvar ConfigBuilder = class ConfigBuilder {\n\tconstructor(shape = {}, options = { strict: true }) {\n\t\tthis.shape = shape;\n\t\tthis.options = options;\n\t}\n\tfield(key, schema, options) {\n\t\tconst withMeta = options ? schema.meta({ ...options }) : schema;\n\t\treturn new ConfigBuilder({\n\t\t\t...this.shape,\n\t\t\t[key]: withMeta\n\t\t}, this.options);\n\t}\n\tbuild() {\n\t\tconst base = z.object(this.shape);\n\t\treturn { schema: this.options.strict !== false ? base.strict() : base };\n\t}\n};\nfunction configBuilder(options = { strict: true }) {\n\treturn new ConfigBuilder({}, options);\n}\n\n//#endregion\n//#region shared/schemas.ts\nconst COMPOSITE_OPERATIONS = [\n\t\"source-over\",\n\t\"source-in\",\n\t\"source-out\",\n\t\"source-atop\",\n\t\"destination-over\",\n\t\"destination-in\",\n\t\"destination-out\",\n\t\"destination-atop\",\n\t\"lighter\",\n\t\"copy\",\n\t\"xor\",\n\t\"multiply\",\n\t\"screen\",\n\t\"overlay\",\n\t\"darken\",\n\t\"lighten\",\n\t\"color-dodge\",\n\t\"color-burn\",\n\t\"hard-light\",\n\t\"soft-light\",\n\t\"difference\",\n\t\"exclusion\",\n\t\"hue\",\n\t\"saturation\",\n\t\"color\",\n\t\"luminosity\"\n];\nconst GlobalCompositeOperation = z.enum(COMPOSITE_OPERATIONS);\nconst ColorSchema = z.string().optional();\nconst PercentageSchema = z.number().min(0).max(100);\nconst DimensionSchema = z.number().min(0).optional();\nconst AnimationSchema = z.object({ animations: z.array(z.object({\n\tid: z.string(),\n\ttype: z.enum([\n\t\t\"fade-in\",\n\t\t\"fade-out\",\n\t\t\"slide-in-left\",\n\t\t\"slide-in-right\",\n\t\t\"slide-in-top\",\n\t\t\"slide-in-bottom\",\n\t\t\"zoom-in\",\n\t\t\"zoom-out\",\n\t\t\"rotate-cw\",\n\t\t\"rotate-ccw\",\n\t\t\"bounce\",\n\t\t\"shake\"\n\t]),\n\tvalue: z.number()\n})).optional() });\nconst StrokeSchema = z.object({\n\tstroke: ColorSchema,\n\tstrokeWidth: z.number().min(0).optional(),\n\tstrokeAlign: z.enum([\n\t\t\"inside\",\n\t\t\"center\",\n\t\t\"outside\"\n\t]).optional().default(\"inside\"),\n\tstrokeRadius: z.number().min(0).optional()\n});\nconst ImageResultSchema = SingleOutputGenericSchema(createOutputItemSchema(z.literal(\"Image\"), FileDataSchema));\nconst VideoResultSchema = SingleOutputGenericSchema(createOutputItemSchema(z.literal(\"Video\"), VirtualMediaDataSchema));\nconst AudioResultSchema = SingleOutputGenericSchema(createOutputItemSchema(z.literal(\"Audio\"), VirtualMediaDataSchema));\nconst TextResultSchema = SingleOutputGenericSchema(createOutputItemSchema(z.literal(\"Text\"), z.string()));\nconst NumberResultSchema = SingleOutputGenericSchema(createOutputItemSchema(z.literal(\"Number\"), z.number()));\nconst SignalResultSchema = SingleOutputGenericSchema(createOutputItemSchema(z.literal(\"Signal\"), z.unknown()));\n\n//#endregion\nexport { AnimationSchema, AudioResultSchema, COMPOSITE_OPERATIONS, ColorSchema, ConfigBuilder, DimensionSchema, FileDataSchema, GlobalCompositeOperation, ImageResultSchema, MultiOutputGenericSchema, NumberResultSchema, PercentageSchema, SignalResultSchema, SingleOutputGenericSchema, StrokeSchema, TextResultSchema, VideoResultSchema, VirtualMediaDataSchema, WebGPURegistry, audioRegistry, configBuilder, createOutputItemSchema, defineRenderer, registerWebGPURenderer, webgpuRegistry };\n//# sourceMappingURL=index.mjs.map","import { createContext, useContext, useMemo } from \"react\";\nimport { GetFontAssetUrl } from \"@gitframes/client-utils\";\nimport { SlugFontCache, SlugGeometry, registerHeadlessFont } from \"@gitframes/webgpu-renderers\";\n\n//#region src/blend.ts\nconst mapBlendModeToSkia = (mode) => {\n\tif (!mode) return \"srcOver\";\n\tswitch (mode) {\n\t\tcase \"source-over\": return \"srcOver\";\n\t\tcase \"source-in\": return \"srcIn\";\n\t\tcase \"source-out\": return \"srcOut\";\n\t\tcase \"source-atop\": return \"srcATop\";\n\t\tcase \"destination-over\": return \"dstOver\";\n\t\tcase \"destination-in\": return \"dstIn\";\n\t\tcase \"destination-out\": return \"dstOut\";\n\t\tcase \"destination-atop\": return \"dstATop\";\n\t\tcase \"copy\": return \"src\";\n\t\tcase \"xor\": return \"xor\";\n\t\tcase \"multiply\": return \"multiply\";\n\t\tcase \"screen\": return \"screen\";\n\t\tcase \"overlay\": return \"overlay\";\n\t\tcase \"darken\": return \"darken\";\n\t\tcase \"lighten\":\n\t\tcase \"lighter\": return \"lighten\";\n\t\tcase \"color-dodge\": return \"colorDodge\";\n\t\tcase \"color-burn\": return \"colorBurn\";\n\t\tcase \"hard-light\": return \"hardLight\";\n\t\tcase \"soft-light\": return \"softLight\";\n\t\tcase \"difference\": return \"difference\";\n\t\tcase \"exclusion\": return \"exclusion\";\n\t\tcase \"hue\": return \"hue\";\n\t\tcase \"saturation\": return \"saturation\";\n\t\tcase \"color\": return \"color\";\n\t\tcase \"luminosity\": return \"luminosity\";\n\t\tdefault: return \"srcOver\";\n\t}\n};\nconst requiresIsolation = (mode) => {\n\treturn mode === \"destination-in\" || mode === \"source-in\";\n};\n\n//#endregion\n//#region src/geometry.ts\nfunction computeStrokeRect(w, h, cornerRadius, strokeWidth, align = \"outside\") {\n\tif (align === \"inside\") {\n\t\tconst half = strokeWidth / 2;\n\t\treturn {\n\t\t\tx: half,\n\t\t\ty: half,\n\t\t\twidth: Math.max(0, w - strokeWidth),\n\t\t\theight: Math.max(0, h - strokeWidth),\n\t\t\tradius: cornerRadius === 0 ? 0 : Math.max(0, cornerRadius - half)\n\t\t};\n\t}\n\tif (align === \"outside\") {\n\t\tconst half = strokeWidth / 2;\n\t\treturn {\n\t\t\tx: -half,\n\t\t\ty: -half,\n\t\t\twidth: w + strokeWidth,\n\t\t\theight: h + strokeWidth,\n\t\t\tradius: cornerRadius === 0 ? 0 : cornerRadius + half\n\t\t};\n\t}\n\treturn {\n\t\tx: 0,\n\t\ty: 0,\n\t\twidth: w,\n\t\theight: h,\n\t\tradius: cornerRadius\n\t};\n}\n\n//#endregion\n//#region src/interpolate.ts\nconst { cbrt, sqrt, PI: π } = Math;\nconst x2t = (x, a, b, c, d) => {\n\tconst q = a + b * x;\n\tconst s = q ** 2 + c;\n\tif (s > 0) {\n\t\tconst root = sqrt(s);\n\t\treturn cbrt(q + root) + cbrt(q - root) - d;\n\t}\n\tconst l = cbrt(sqrt(q * q - s));\n\tconst angle = q ? Math.atan(sqrt(-s) / q) : -π / 2;\n\tlet φ;\n\tif (b < 0) φ = (q > 0 ? 2 * π : π) - angle;\n\telse if (d < 0) φ = (q > 0 ? 2 * π : -3 * π) + angle;\n\telse φ = (q > 0 ? 0 : π) + angle;\n\treturn 2 * l * Math.cos(φ / 3) - d;\n};\nconst Y = (t, ay, by, cy) => ((ay * t + 3 * by) * t + cy) * t;\nconst linearEasing = (x) => x;\nfunction bezier(mX1, mY1, mX2, mY2) {\n\tif (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) throw new Error(\"bezier x values must be in [0, 1] range\");\n\tif (mX1 === mY1 && mX2 === mY2) return linearEasing;\n\tconst a = 6 * (3 * mX1 - 3 * mX2 + 1);\n\tconst b = 6 * (mX2 - 2 * mX1);\n\tconst c = 3 * mX1;\n\tconst a2 = a * a;\n\tconst b2 = b * b;\n\tconst d = b / a;\n\tconst e = 3 * b * c / a2 - b2 * b / (a2 * a);\n\tconst w1 = 2 * c / a - b2 / a2;\n\tconst w = w1 * w1 * w1;\n\tconst o = 3 / a;\n\tconst ay = 3 * mY1 - 3 * mY2 + 1;\n\tconst by = mY2 - 2 * mY1;\n\tconst cy = 3 * mY1;\n\tconst X2T = a ? x2t : linearEasing;\n\treturn function BezierEasing(x) {\n\t\tif (x === 0 || x === 1) return x;\n\t\treturn Y(X2T(x, e, o, w, d), ay, by, cy);\n\t};\n}\nconst Easing = {\n\tlinear: linearEasing,\n\tease: bezier(.25, .1, .25, 1),\n\tquad: (t) => t * t,\n\tcubic: (t) => t * t * t,\n\tpoly: (n) => (t) => t ** n,\n\tsin: (t) => 1 - Math.cos(t * Math.PI / 2),\n\tcircle: (t) => 1 - Math.sqrt(1 - t * t),\n\texp: (t) => 2 ** (10 * (t - 1)),\n\telastic: (bounciness = 1) => {\n\t\tconst p = bounciness * Math.PI;\n\t\treturn (t) => 1 - Math.cos(t * Math.PI / 2) ** 3 * Math.cos(t * p);\n\t},\n\tback: (s = 1.70158) => (t) => t * t * ((s + 1) * t - s),\n\tbounce: (t) => {\n\t\tif (t < 1 / 2.75) return 7.5625 * t * t;\n\t\tif (t < 2 / 2.75) {\n\t\t\tconst t2$1 = t - 1.5 / 2.75;\n\t\t\treturn 7.5625 * t2$1 * t2$1 + .75;\n\t\t}\n\t\tif (t < 2.5 / 2.75) {\n\t\t\tconst t2$1 = t - 2.25 / 2.75;\n\t\t\treturn 7.5625 * t2$1 * t2$1 + .9375;\n\t\t}\n\t\tconst t2 = t - 2.625 / 2.75;\n\t\treturn 7.5625 * t2 * t2 + .984375;\n\t},\n\tbezier,\n\tin: (fn) => fn,\n\tout: (fn) => (t) => 1 - fn(1 - t),\n\tinOut: (fn) => (t) => t < .5 ? fn(t * 2) / 2 : 1 - fn((1 - t) * 2) / 2\n};\nfunction interpolate(value, inputRange, outputRange, options) {\n\tconst extrapolateLeft = options?.extrapolateLeft ?? \"extend\";\n\tconst extrapolateRight = options?.extrapolateRight ?? \"extend\";\n\tif (inputRange.length !== outputRange.length) throw new Error(\"inputRange and outputRange must have the same length\");\n\tif (inputRange.length < 2) throw new Error(\"inputRange must have at least 2 elements\");\n\tconst firstInput = inputRange[0];\n\tconst lastInput = inputRange[inputRange.length - 1];\n\tif (value < firstInput) {\n\t\tif (extrapolateLeft === \"clamp\") return outputRange[0];\n\t\tif (extrapolateLeft === \"identity\") return value;\n\t}\n\tif (value > lastInput) {\n\t\tif (extrapolateRight === \"clamp\") return outputRange[outputRange.length - 1];\n\t\tif (extrapolateRight === \"identity\") return value;\n\t}\n\tlet i = 1;\n\tfor (; i < inputRange.length - 1; i++) if (value < inputRange[i]) break;\n\tconst x0 = inputRange[i - 1];\n\tconst x1 = inputRange[i];\n\tconst y0 = outputRange[i - 1];\n\tconst y1 = outputRange[i];\n\tif (x0 === x1) return y0;\n\tlet progress = (value - x0) / (x1 - x0);\n\tif (options?.easing) progress = options.easing(progress);\n\treturn y0 + progress * (y1 - y0);\n}\n\n//#endregion\n//#region src/math3d/vector3.ts\nconst Vector3Math = {\n\tcreate(x = 0, y = 0, z = 0) {\n\t\treturn [\n\t\t\tx,\n\t\t\ty,\n\t\t\tz\n\t\t];\n\t},\n\tcopy(v) {\n\t\treturn [\n\t\t\tv[0],\n\t\t\tv[1],\n\t\t\tv[2]\n\t\t];\n\t},\n\tset(out, x, y, z) {\n\t\tout[0] = x;\n\t\tout[1] = y;\n\t\tout[2] = z;\n\t\treturn out;\n\t},\n\tadd(a, b) {\n\t\treturn [\n\t\t\ta[0] + b[0],\n\t\t\ta[1] + b[1],\n\t\t\ta[2] + b[2]\n\t\t];\n\t},\n\tsubtract(a, b) {\n\t\treturn [\n\t\t\ta[0] - b[0],\n\t\t\ta[1] - b[1],\n\t\t\ta[2] - b[2]\n\t\t];\n\t},\n\tmultiplyScalar(v, s) {\n\t\treturn [\n\t\t\tv[0] * s,\n\t\t\tv[1] * s,\n\t\t\tv[2] * s\n\t\t];\n\t},\n\tdot(a, b) {\n\t\treturn a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n\t},\n\tcross(a, b) {\n\t\treturn [\n\t\t\ta[1] * b[2] - a[2] * b[1],\n\t\t\ta[2] * b[0] - a[0] * b[2],\n\t\t\ta[0] * b[1] - a[1] * b[0]\n\t\t];\n\t},\n\tlengthSq(v) {\n\t\treturn v[0] * v[0] + v[1] * v[1] + v[2] * v[2];\n\t},\n\tlength(v) {\n\t\treturn Math.hypot(v[0], v[1], v[2]);\n\t},\n\tdistance(a, b) {\n\t\treturn Math.hypot(a[0] - b[0], a[1] - b[1], a[2] - b[2]);\n\t},\n\tnormalize(v) {\n\t\tconst len = Math.hypot(v[0], v[1], v[2]);\n\t\tif (len === 0) return [\n\t\t\t0,\n\t\t\t0,\n\t\t\t0\n\t\t];\n\t\tconst inv = 1 / len;\n\t\treturn [\n\t\t\tv[0] * inv,\n\t\t\tv[1] * inv,\n\t\t\tv[2] * inv\n\t\t];\n\t},\n\tlerp(a, b, t) {\n\t\treturn [\n\t\t\ta[0] + (b[0] - a[0]) * t,\n\t\t\ta[1] + (b[1] - a[1]) * t,\n\t\t\ta[2] + (b[2] - a[2]) * t\n\t\t];\n\t},\n\tequals(a, b, epsilon = 1e-6) {\n\t\treturn Math.abs(a[0] - b[0]) <= epsilon && Math.abs(a[1] - b[1]) <= epsilon && Math.abs(a[2] - b[2]) <= epsilon;\n\t}\n};\n\n//#endregion\n//#region src/math3d/matrix4.ts\n/**\n* Column-major 4x4 matrix mathematics for WebGPU 3D rendering and camera projections.\n* Memory layout matches WGSL `mat4x4<f32>`:\n* [ 0, 4, 8, 12 ]\n* [ 1, 5, 9, 13 ]\n* [ 2, 6, 10, 14 ]\n* [ 3, 7, 11, 15 ]\n*/\nconst Matrix4Math = {\n\tidentity() {\n\t\treturn [\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1\n\t\t];\n\t},\n\tcopy(m) {\n\t\treturn [...m];\n\t},\n\tmultiply(a, b) {\n\t\tconst out = new Array(16);\n\t\tfor (let row = 0; row < 4; row++) for (let col = 0; col < 4; col++) out[col * 4 + row] = a[0 + row] * b[col * 4 + 0] + a[4 + row] * b[col * 4 + 1] + a[8 + row] * b[col * 4 + 2] + a[12 + row] * b[col * 4 + 3];\n\t\treturn out;\n\t},\n\ttranslate(tx, ty, tz = 0) {\n\t\treturn [\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1,\n\t\t\t0,\n\t\t\ttx,\n\t\t\tty,\n\t\t\ttz,\n\t\t\t1\n\t\t];\n\t},\n\tscale(sx, sy, sz = 1) {\n\t\treturn [\n\t\t\tsx,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\tsy,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\tsz,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1\n\t\t];\n\t},\n\trotateX(rad) {\n\t\tconst c = Math.cos(rad);\n\t\tconst s = Math.sin(rad);\n\t\treturn [\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\tc,\n\t\t\ts,\n\t\t\t0,\n\t\t\t0,\n\t\t\t-s,\n\t\t\tc,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1\n\t\t];\n\t},\n\trotateY(rad) {\n\t\tconst c = Math.cos(rad);\n\t\tconst s = Math.sin(rad);\n\t\treturn [\n\t\t\tc,\n\t\t\t0,\n\t\t\t-s,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\ts,\n\t\t\t0,\n\t\t\tc,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1\n\t\t];\n\t},\n\trotateZ(rad) {\n\t\tconst c = Math.cos(rad);\n\t\tconst s = Math.sin(rad);\n\t\treturn [\n\t\t\tc,\n\t\t\ts,\n\t\t\t0,\n\t\t\t0,\n\t\t\t-s,\n\t\t\tc,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1\n\t\t];\n\t},\n\trotateAxis(axis, rad) {\n\t\tconst norm = Vector3Math.normalize(axis);\n\t\tconst x = norm[0];\n\t\tconst y = norm[1];\n\t\tconst z = norm[2];\n\t\tconst c = Math.cos(rad);\n\t\tconst s = Math.sin(rad);\n\t\tconst t = 1 - c;\n\t\treturn [\n\t\t\tt * x * x + c,\n\t\t\tt * x * y + s * z,\n\t\t\tt * x * z - s * y,\n\t\t\t0,\n\t\t\tt * x * y - s * z,\n\t\t\tt * y * y + c,\n\t\t\tt * y * z + s * x,\n\t\t\t0,\n\t\t\tt * x * z + s * y,\n\t\t\tt * y * z - s * x,\n\t\t\tt * z * z + c,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1\n\t\t];\n\t},\n\tlookAt(eye, target, up = [\n\t\t0,\n\t\t-1,\n\t\t0\n\t]) {\n\t\tlet f = Vector3Math.subtract(target, eye);\n\t\tif (Vector3Math.lengthSq(f) === 0) f = [\n\t\t\t0,\n\t\t\t0,\n\t\t\t1\n\t\t];\n\t\telse f = Vector3Math.normalize(f);\n\t\tlet r = Vector3Math.cross(f, up);\n\t\tif (Vector3Math.lengthSq(r) === 0) r = [\n\t\t\t1,\n\t\t\t0,\n\t\t\t0\n\t\t];\n\t\telse r = Vector3Math.normalize(r);\n\t\tconst u = Vector3Math.cross(r, f);\n\t\treturn [\n\t\t\tr[0],\n\t\t\tu[0],\n\t\t\tf[0],\n\t\t\t0,\n\t\t\tr[1],\n\t\t\tu[1],\n\t\t\tf[1],\n\t\t\t0,\n\t\t\tr[2],\n\t\t\tu[2],\n\t\t\tf[2],\n\t\t\t0,\n\t\t\t-Vector3Math.dot(r, eye),\n\t\t\t-Vector3Math.dot(u, eye),\n\t\t\t-Vector3Math.dot(f, eye),\n\t\t\t1\n\t\t];\n\t},\n\tperspective(fovYRad, aspect, near, far) {\n\t\tconst f = 1 / Math.tan(fovYRad / 2);\n\t\tconst rangeInv = 1 / (far - near);\n\t\treturn [\n\t\t\tf / aspect,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\tf,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\tfar * rangeInv,\n\t\t\t1,\n\t\t\t0,\n\t\t\t0,\n\t\t\t-near * far * rangeInv,\n\t\t\t0\n\t\t];\n\t},\n\torthographic(left, right, bottom, top, near, far) {\n\t\tconst lr = 1 / (right - left);\n\t\tconst bt = 1 / (top - bottom);\n\t\tconst nf = 1 / (far - near);\n\t\treturn [\n\t\t\t2 * lr,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t2 * bt,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\tnf,\n\t\t\t0,\n\t\t\t-(right + left) * lr,\n\t\t\t-(top + bottom) * bt,\n\t\t\t-near * nf,\n\t\t\t1\n\t\t];\n\t},\n\tinvert(m) {\n\t\tconst inv = new Array(16);\n\t\tinv[0] = m[5] * m[10] * m[15] - m[5] * m[11] * m[14] - m[9] * m[6] * m[15] + m[9] * m[7] * m[14] + m[13] * m[6] * m[11] - m[13] * m[7] * m[10];\n\t\tinv[4] = -m[4] * m[10] * m[15] + m[4] * m[11] * m[14] + m[8] * m[6] * m[15] - m[8] * m[7] * m[14] - m[12] * m[6] * m[11] + m[12] * m[7] * m[10];\n\t\tinv[8] = m[4] * m[9] * m[15] - m[4] * m[11] * m[13] - m[8] * m[5] * m[15] + m[8] * m[7] * m[13] + m[12] * m[5] * m[11] - m[12] * m[7] * m[9];\n\t\tinv[12] = -m[4] * m[9] * m[14] + m[4] * m[10] * m[13] + m[8] * m[5] * m[14] - m[8] * m[6] * m[13] - m[12] * m[5] * m[10] + m[12] * m[6] * m[9];\n\t\tinv[1] = -m[1] * m[10] * m[15] + m[1] * m[11] * m[14] + m[9] * m[2] * m[15] - m[9] * m[3] * m[14] - m[13] * m[2] * m[11] + m[13] * m[3] * m[10];\n\t\tinv[5] = m[0] * m[10] * m[15] - m[0] * m[11] * m[14] - m[8] * m[2] * m[15] + m[8] * m[3] * m[14] + m[12] * m[2] * m[11] - m[12] * m[3] * m[10];\n\t\tinv[9] = -m[0] * m[9] * m[15] + m[0] * m[11] * m[13] + m[8] * m[1] * m[15] - m[8] * m[3] * m[13] - m[12] * m[1] * m[11] + m[12] * m[3] * m[9];\n\t\tinv[13] = m[0] * m[9] * m[14] - m[0] * m[10] * m[13] - m[8] * m[1] * m[14] + m[8] * m[2] * m[13] + m[12] * m[1] * m[10] - m[12] * m[2] * m[9];\n\t\tinv[2] = m[1] * m[6] * m[15] - m[1] * m[7] * m[14] - m[5] * m[2] * m[15] + m[5] * m[3] * m[14] + m[13] * m[2] * m[7] - m[13] * m[3] * m[6];\n\t\tinv[6] = -m[0] * m[6] * m[15] + m[0] * m[7] * m[14] + m[4] * m[2] * m[15] - m[4] * m[3] * m[14] - m[12] * m[2] * m[7] + m[12] * m[3] * m[6];\n\t\tinv[10] = m[0] * m[5] * m[15] - m[0] * m[7] * m[13] - m[4] * m[1] * m[15] + m[4] * m[3] * m[13] + m[12] * m[1] * m[7] - m[12] * m[3] * m[5];\n\t\tinv[14] = -m[0] * m[5] * m[14] + m[0] * m[6] * m[13] + m[4] * m[1] * m[14] - m[4] * m[2] * m[13] - m[12] * m[1] * m[6] + m[12] * m[2] * m[5];\n\t\tinv[3] = -m[1] * m[6] * m[11] + m[1] * m[7] * m[10] + m[5] * m[2] * m[11] - m[5] * m[3] * m[10] - m[9] * m[2] * m[7] + m[9] * m[3] * m[6];\n\t\tinv[7] = m[0] * m[6] * m[11] - m[0] * m[7] * m[10] - m[4] * m[2] * m[11] + m[4] * m[3] * m[10] + m[8] * m[2] * m[7] - m[8] * m[3] * m[6];\n\t\tinv[11] = -m[0] * m[5] * m[11] + m[0] * m[7] * m[9] + m[4] * m[1] * m[11] - m[4] * m[3] * m[9] - m[8] * m[1] * m[7] + m[8] * m[3] * m[5];\n\t\tinv[15] = m[0] * m[5] * m[10] - m[0] * m[6] * m[9] - m[4] * m[1] * m[10] + m[4] * m[2] * m[9] + m[8] * m[1] * m[6] - m[8] * m[2] * m[5];\n\t\tlet det = m[0] * inv[0] + m[1] * inv[4] + m[2] * inv[8] + m[3] * inv[12];\n\t\tif (Math.abs(det) < 1e-12) return null;\n\t\tdet = 1 / det;\n\t\tfor (let i = 0; i < 16; i++) inv[i] *= det;\n\t\treturn inv;\n\t},\n\ttranspose(m) {\n\t\treturn [\n\t\t\tm[0],\n\t\t\tm[4],\n\t\t\tm[8],\n\t\t\tm[12],\n\t\t\tm[1],\n\t\t\tm[5],\n\t\t\tm[9],\n\t\t\tm[13],\n\t\t\tm[2],\n\t\t\tm[6],\n\t\t\tm[10],\n\t\t\tm[14],\n\t\t\tm[3],\n\t\t\tm[7],\n\t\t\tm[11],\n\t\t\tm[15]\n\t\t];\n\t},\n\tprojectPoint(m, p) {\n\t\tconst x = p[0];\n\t\tconst y = p[1];\n\t\tconst z = p[2];\n\t\tconst X = m[0] * x + m[4] * y + m[8] * z + m[12];\n\t\tconst Y$1 = m[1] * x + m[5] * y + m[9] * z + m[13];\n\t\tconst Z = m[2] * x + m[6] * y + m[10] * z + m[14];\n\t\tconst W = m[3] * x + m[7] * y + m[11] * z + m[15];\n\t\tconst wInv = Math.abs(W) > 1e-6 ? 1 / W : 1;\n\t\treturn [\n\t\t\tX * wInv,\n\t\t\tY$1 * wInv,\n\t\t\tZ * wInv\n\t\t];\n\t},\n\tprojectRectangle(m, width, height) {\n\t\treturn [\n\t\t\tMatrix4Math.projectPoint(m, [\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t0\n\t\t\t]),\n\t\t\tMatrix4Math.projectPoint(m, [\n\t\t\t\twidth,\n\t\t\t\t0,\n\t\t\t\t0\n\t\t\t]),\n\t\t\tMatrix4Math.projectPoint(m, [\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\t0\n\t\t\t]),\n\t\t\tMatrix4Math.projectPoint(m, [\n\t\t\t\t0,\n\t\t\t\theight,\n\t\t\t\t0\n\t\t\t])\n\t\t];\n\t},\n\ttoFloat32Array(m) {\n\t\treturn new Float32Array(m);\n\t}\n};\n\n//#endregion\n//#region src/math3d/camera3d.ts\n/**\n* Camera 3D mathematics, kinematics, and projection solver.\n* Provides unified View-Projection matrices, LookAt target tracking,\n* spherical orbit turntable, multi-octave camera shake, and rack-focus CoC solvers.\n*/\n/** Smooth multi-harmonic procedural continuous noise */\nfunction smoothHarmonicNoise(t, seed, octaves = 3) {\n\tlet total = 0;\n\tlet frequency = 1;\n\tlet amplitude = 1;\n\tlet maxAmp = 0;\n\tfor (let i = 0; i < octaves; i++) {\n\t\tconst s1 = Math.sin(t * frequency * 2 * Math.PI + seed + i * 1.7);\n\t\tconst s2 = Math.cos(t * frequency * 1.414 * Math.PI + seed * 2.1 + i * .9);\n\t\ttotal += (s1 * .6 + s2 * .4) * amplitude;\n\t\tmaxAmp += amplitude;\n\t\tfrequency *= 2;\n\t\tamplitude *= .5;\n\t}\n\treturn maxAmp > 0 ? total / maxAmp : 0;\n}\nconst Camera3D = {\n\tcreateDefaultCamera(width, height, fovDegrees = 50) {\n\t\tconst fovRad = fovDegrees * Math.PI / 180;\n\t\tconst distance = height / 2 / Math.tan(fovRad / 2);\n\t\treturn {\n\t\t\teye: [\n\t\t\t\twidth / 2,\n\t\t\t\theight / 2,\n\t\t\t\t-distance\n\t\t\t],\n\t\t\ttarget: [\n\t\t\t\twidth / 2,\n\t\t\t\theight / 2,\n\t\t\t\t0\n\t\t\t],\n\t\t\tup: [\n\t\t\t\t0,\n\t\t\t\t-1,\n\t\t\t\t0\n\t\t\t],\n\t\t\tfov: fovDegrees,\n\t\t\taspect: Math.max(1e-4, width / height),\n\t\t\tnear: 1,\n\t\t\tfar: 5e4,\n\t\t\tzoom: 1,\n\t\t\tfocusDistance: distance,\n\t\t\tfStop: 2.8,\n\t\t\tmaxBlurRadius: 32\n\t\t};\n\t},\n\tcomputeViewMatrix(camera) {\n\t\treturn Matrix4Math.lookAt(camera.eye, camera.target, camera.up);\n\t},\n\tcomputeProjectionMatrix(camera) {\n\t\tconst fovRad = camera.fov * Math.PI / 180;\n\t\tconst p = Matrix4Math.perspective(fovRad, camera.aspect, camera.near, camera.far);\n\t\tif (camera.zoom !== 1 && camera.zoom > 0) {\n\t\t\tp[0] *= camera.zoom;\n\t\t\tp[5] *= camera.zoom;\n\t\t}\n\t\treturn p;\n\t},\n\tcomputeViewProjectionMatrix(camera) {\n\t\tconst v = Camera3D.computeViewMatrix(camera);\n\t\tconst p = Camera3D.computeProjectionMatrix(camera);\n\t\treturn Matrix4Math.multiply(p, v);\n\t},\n\tdolly(eye, target, deltaDistance) {\n\t\tconst forward = Vector3Math.normalize(Vector3Math.subtract(target, eye));\n\t\tconst move = Vector3Math.multiplyScalar(forward, deltaDistance);\n\t\treturn {\n\t\t\teye: Vector3Math.add(eye, move),\n\t\t\ttarget\n\t\t};\n\t},\n\ttruckPedestal(eye, target, up, deltaX, deltaY) {\n\t\tconst forward = Vector3Math.normalize(Vector3Math.subtract(target, eye));\n\t\tconst right = Vector3Math.normalize(Vector3Math.cross(forward, up));\n\t\tconst trueUp = Vector3Math.cross(right, forward);\n\t\tconst moveX = Vector3Math.multiplyScalar(right, deltaX);\n\t\tconst moveY = Vector3Math.multiplyScalar(trueUp, deltaY);\n\t\tconst totalMove = Vector3Math.add(moveX, moveY);\n\t\treturn {\n\t\t\teye: Vector3Math.add(eye, totalMove),\n\t\t\ttarget: Vector3Math.add(target, totalMove)\n\t\t};\n\t},\n\torbit(target, radius, azimuthDeg, elevationDeg) {\n\t\tconst azRad = azimuthDeg * Math.PI / 180;\n\t\tconst elRad = elevationDeg * Math.PI / 180;\n\t\tconst cosEl = Math.cos(elRad);\n\t\tconst sinEl = Math.sin(elRad);\n\t\tconst cosAz = Math.cos(azRad);\n\t\tconst sinAz = Math.sin(azRad);\n\t\treturn [\n\t\t\ttarget[0] + radius * cosEl * sinAz,\n\t\t\ttarget[1] - radius * sinEl,\n\t\t\ttarget[2] - radius * cosEl * cosAz\n\t\t];\n\t},\n\tapplyOrientation(pose, pitchDeg, yawDeg, rollDeg) {\n\t\tif (pitchDeg === 0 && yawDeg === 0 && rollDeg === 0) return pose;\n\t\tconst forward = Vector3Math.normalize(Vector3Math.subtract(pose.target, pose.eye));\n\t\tconst right = Vector3Math.normalize(Vector3Math.cross(forward, pose.up));\n\t\tconst trueUp = Vector3Math.cross(right, forward);\n\t\tconst dist = Vector3Math.distance(pose.eye, pose.target);\n\t\tlet fwd = forward;\n\t\tlet up = trueUp;\n\t\tif (yawDeg !== 0) {\n\t\t\tconst yawRad = yawDeg * Math.PI / 180;\n\t\t\tconst cosY = Math.cos(yawRad);\n\t\t\tconst sinY = Math.sin(yawRad);\n\t\t\tfwd = Vector3Math.normalize(Vector3Math.subtract(Vector3Math.multiplyScalar(fwd, cosY), Vector3Math.multiplyScalar(right, sinY)));\n\t\t}\n\t\tconst currentRight = Vector3Math.normalize(Vector3Math.cross(fwd, up));\n\t\tif (pitchDeg !== 0) {\n\t\t\tconst pitchRad = pitchDeg * Math.PI / 180;\n\t\t\tconst cosP = Math.cos(pitchRad);\n\t\t\tconst sinP = Math.sin(pitchRad);\n\t\t\tfwd = Vector3Math.normalize(Vector3Math.add(Vector3Math.multiplyScalar(fwd, cosP), Vector3Math.multiplyScalar(up, sinP)));\n\t\t\tup = Vector3Math.normalize(Vector3Math.cross(currentRight, fwd));\n\t\t}\n\t\tif (rollDeg !== 0) {\n\t\t\tconst rollRad = rollDeg * Math.PI / 180;\n\t\t\tconst cosR = Math.cos(rollRad);\n\t\t\tconst sinR = Math.sin(rollRad);\n\t\t\tup = Vector3Math.normalize(Vector3Math.add(Vector3Math.multiplyScalar(up, cosR), Vector3Math.multiplyScalar(currentRight, sinR)));\n\t\t}\n\t\tconst newTarget = Vector3Math.add(pose.eye, Vector3Math.multiplyScalar(fwd, dist));\n\t\treturn {\n\t\t\t...pose,\n\t\t\ttarget: newTarget,\n\t\t\tup\n\t\t};\n\t},\n\tapplyCameraShake(pose, timeSeconds, options) {\n\t\tconst { translationAmplitude, rotationAmplitude, frequency = 2.5, octaves = 3, seed = 42 } = options;\n\t\tif (translationAmplitude <= 0 && rotationAmplitude <= 0) return pose;\n\t\tconst t = timeSeconds * frequency;\n\t\tconst dx = smoothHarmonicNoise(t, seed, octaves) * translationAmplitude;\n\t\tconst dy = smoothHarmonicNoise(t, seed + 101.5, octaves) * translationAmplitude;\n\t\tconst dz = smoothHarmonicNoise(t, seed + 203.7, octaves) * (translationAmplitude * .5);\n\t\tconst rotX = smoothHarmonicNoise(t, seed + 307.1, octaves) * rotationAmplitude;\n\t\tconst rotY = smoothHarmonicNoise(t, seed + 409.3, octaves) * rotationAmplitude;\n\t\tconst forward = Vector3Math.normalize(Vector3Math.subtract(pose.target, pose.eye));\n\t\tconst right = Vector3Math.normalize(Vector3Math.cross(forward, pose.up));\n\t\tconst trueUp = Vector3Math.cross(right, forward);\n\t\tconst disp = Vector3Math.add(Vector3Math.multiplyScalar(right, dx), Vector3Math.add(Vector3Math.multiplyScalar(trueUp, dy), Vector3Math.multiplyScalar(forward, dz)));\n\t\tconst newEye = Vector3Math.add(pose.eye, disp);\n\t\tconst newTarget = Vector3Math.add(pose.target, Vector3Math.add(Vector3Math.multiplyScalar(right, rotY * 10), Vector3Math.multiplyScalar(trueUp, rotX * 10)));\n\t\treturn {\n\t\t\t...pose,\n\t\t\teye: newEye,\n\t\t\ttarget: newTarget\n\t\t};\n\t},\n\tcomputeCircleOfConfusion(depth, focusDistance, focalLengthMm, fStop, maxBlurRadius = 32) {\n\t\tif (focusDistance <= 0 || fStop <= 0 || depth <= 0) return 0;\n\t\tconst delta = Math.abs(depth - focusDistance);\n\t\tconst aperture = focalLengthMm / fStop;\n\t\tconst coc = delta / depth * aperture * .5;\n\t\treturn Math.min(maxBlurRadius, Math.max(0, coc));\n\t},\n\tcomputeCameraFrustumPlanes(vp) {\n\t\tconst normalizePlane = (p) => {\n\t\t\tconst len = Math.hypot(p[0], p[1], p[2]);\n\t\t\tif (len === 0) return p;\n\t\t\treturn [\n\t\t\t\tp[0] / len,\n\t\t\t\tp[1] / len,\n\t\t\t\tp[2] / len,\n\t\t\t\tp[3] / len\n\t\t\t];\n\t\t};\n\t\treturn {\n\t\t\tleft: normalizePlane([\n\t\t\t\tvp[3] + vp[0],\n\t\t\t\tvp[7] + vp[4],\n\t\t\t\tvp[11] + vp[8],\n\t\t\t\tvp[15] + vp[12]\n\t\t\t]),\n\t\t\tright: normalizePlane([\n\t\t\t\tvp[3] - vp[0],\n\t\t\t\tvp[7] - vp[4],\n\t\t\t\tvp[11] - vp[8],\n\t\t\t\tvp[15] - vp[12]\n\t\t\t]),\n\t\t\tbottom: normalizePlane([\n\t\t\t\tvp[3] + vp[1],\n\t\t\t\tvp[7] + vp[5],\n\t\t\t\tvp[11] + vp[9],\n\t\t\t\tvp[15] + vp[13]\n\t\t\t]),\n\t\t\ttop: normalizePlane([\n\t\t\t\tvp[3] - vp[1],\n\t\t\t\tvp[7] - vp[5],\n\t\t\t\tvp[11] - vp[9],\n\t\t\t\tvp[15] - vp[13]\n\t\t\t]),\n\t\t\tnear: normalizePlane([\n\t\t\t\tvp[2],\n\t\t\t\tvp[6],\n\t\t\t\tvp[10],\n\t\t\t\tvp[14]\n\t\t\t]),\n\t\t\tfar: normalizePlane([\n\t\t\t\tvp[3] - vp[2],\n\t\t\t\tvp[7] - vp[6],\n\t\t\t\tvp[11] - vp[10],\n\t\t\t\tvp[15] - vp[14]\n\t\t\t])\n\t\t};\n\t},\n\tisBoxInFrustum(min, max, planes) {\n\t\tconst planeList = [\n\t\t\tplanes.left,\n\t\t\tplanes.right,\n\t\t\tplanes.bottom,\n\t\t\tplanes.top,\n\t\t\tplanes.near,\n\t\t\tplanes.far\n\t\t];\n\t\tfor (const p of planeList) {\n\t\t\tconst px = p[0] > 0 ? max[0] : min[0];\n\t\t\tconst py = p[1] > 0 ? max[1] : min[1];\n\t\t\tconst pz = p[2] > 0 ? max[2] : min[2];\n\t\t\tif (p[0] * px + p[1] * py + p[2] * pz + p[3] < 0) return false;\n\t\t}\n\t\treturn true;\n\t}\n};\n\n//#endregion\n//#region src/math3d/light3d.ts\n/**\n* WebGPU 3D Lighting & Material Shading engine.\n* Supports Ambient, Directional, Point, and Spot light sources,\n* normal matrix computation for non-uniform surface scaling,\n* and binary uniform buffer packing for WGSL shaders.\n*/\nconst MAX_LIGHTS = 8;\nconst LIGHT_UNIFORM_SIZE_BYTES = 544;\n/**\n* Parses CSS / hex / rgb color strings, arrays, or color objects into normalized linear [r, g, b] floats in [0, 1].\n*/\nfunction parseColorToRgb(color) {\n\tif (!color) return [\n\t\t1,\n\t\t1,\n\t\t1\n\t];\n\tif (Array.isArray(color)) {\n\t\tconst r = color[0] ?? 1;\n\t\tconst g = color[1] ?? 1;\n\t\tconst b = color[2] ?? 1;\n\t\treturn [\n\t\t\tr > 1 ? r / 255 : r,\n\t\t\tg > 1 ? g / 255 : g,\n\t\t\tb > 1 ? b / 255 : b\n\t\t];\n\t}\n\tif (typeof color === \"object\" && color !== null) {\n\t\tconst r = color.r ?? 1;\n\t\tconst g = color.g ?? 1;\n\t\tconst b = color.b ?? 1;\n\t\treturn [\n\t\t\tr > 1 ? r / 255 : r,\n\t\t\tg > 1 ? g / 255 : g,\n\t\t\tb > 1 ? b / 255 : b\n\t\t];\n\t}\n\tif (typeof color !== \"string\") return [\n\t\t1,\n\t\t1,\n\t\t1\n\t];\n\tconst str = color.trim().toLowerCase();\n\tif (str.startsWith(\"#\")) {\n\t\tconst hex = str.slice(1);\n\t\tif (hex.length === 3) return [\n\t\t\tNumber.parseInt(hex[0] + hex[0], 16) / 255,\n\t\t\tNumber.parseInt(hex[1] + hex[1], 16) / 255,\n\t\t\tNumber.parseInt(hex[2] + hex[2], 16) / 255\n\t\t];\n\t\tif (hex.length >= 6) return [\n\t\t\tNumber.parseInt(hex.slice(0, 2), 16) / 255,\n\t\t\tNumber.parseInt(hex.slice(2, 4), 16) / 255,\n\t\t\tNumber.parseInt(hex.slice(4, 6), 16) / 255\n\t\t];\n\t}\n\tconst rgbMatch = str.match(/rgba?\\s*\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)/);\n\tif (rgbMatch) {\n\t\tconst r = Number.parseFloat(rgbMatch[1]) / 255;\n\t\tconst g = Number.parseFloat(rgbMatch[2]) / 255;\n\t\tconst b = Number.parseFloat(rgbMatch[3]) / 255;\n\t\treturn [\n\t\t\tMath.max(0, Math.min(1, r)),\n\t\t\tMath.max(0, Math.min(1, g)),\n\t\t\tMath.max(0, Math.min(1, b))\n\t\t];\n\t}\n\tconst hslMatch = str.match(/hsla?\\s*\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)%?\\s*,\\s*([\\d.]+)%?/);\n\tif (hslMatch) return hslToRgb(Number.parseFloat(hslMatch[1]) / 360, Number.parseFloat(hslMatch[2]) / 100, Number.parseFloat(hslMatch[3]) / 100);\n\treturn [\n\t\t1,\n\t\t1,\n\t\t1\n\t];\n}\nfunction hslToRgb(h, s, l) {\n\tif (s === 0) return [\n\t\tl,\n\t\tl,\n\t\tl\n\t];\n\tconst hue2rgb = (p$1, q$1, t) => {\n\t\tlet tt = t;\n\t\tif (tt < 0) tt += 1;\n\t\tif (tt > 1) tt -= 1;\n\t\tif (tt < 1 / 6) return p$1 + (q$1 - p$1) * 6 * tt;\n\t\tif (tt < 1 / 2) return q$1;\n\t\tif (tt < 2 / 3) return p$1 + (q$1 - p$1) * (2 / 3 - tt) * 6;\n\t\treturn p$1;\n\t};\n\tconst q = l < .5 ? l * (1 + s) : l + s - l * s;\n\tconst p = 2 * l - q;\n\treturn [\n\t\thue2rgb(p, q, h + 1 / 3),\n\t\thue2rgb(p, q, h),\n\t\thue2rgb(p, q, h - 1 / 3)\n\t];\n}\nconst Light3D = {\n\tcomputeNormalMatrix(modelMatrix) {\n\t\tconst inv = Matrix4Math.invert(modelMatrix);\n\t\tif (!inv) return Matrix4Math.identity();\n\t\treturn [\n\t\t\tinv[0],\n\t\t\tinv[4],\n\t\t\tinv[8],\n\t\t\t0,\n\t\t\tinv[1],\n\t\t\tinv[5],\n\t\t\tinv[9],\n\t\t\t0,\n\t\t\tinv[2],\n\t\t\tinv[6],\n\t\t\tinv[10],\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1\n\t\t];\n\t},\n\tprocessLight(opt) {\n\t\tconst color = parseColorToRgb(opt.color);\n\t\tconst intensity = opt.intensity ?? 1;\n\t\tconst posX = opt.position ? opt.position[0] : opt.x ?? 0;\n\t\tconst posY = opt.position ? opt.position[1] : opt.y ?? 0;\n\t\tconst posZ = opt.position ? opt.position[2] : opt.z ?? 0;\n\t\tconst kind = opt.lightType ?? opt.type ?? \"directional\";\n\t\tlet typeVal = 1;\n\t\tif (kind === \"ambient\") typeVal = 0;\n\t\telse if (kind === \"directional\") typeVal = 1;\n\t\telse if (kind === \"point\") typeVal = 2;\n\t\telse if (kind === \"spot\") typeVal = 3;\n\t\tlet dir = [\n\t\t\t0,\n\t\t\t0,\n\t\t\t-1\n\t\t];\n\t\tif (opt.direction) dir = Vector3Math.normalize(opt.direction);\n\t\telse if (opt.target || opt.targetX !== void 0 || opt.targetY !== void 0 || opt.targetZ !== void 0) {\n\t\t\tconst target = [\n\t\t\t\topt.target ? opt.target[0] : opt.targetX ?? posX,\n\t\t\t\topt.target ? opt.target[1] : opt.targetY ?? posY,\n\t\t\t\topt.target ? opt.target[2] : opt.targetZ ?? posZ\n\t\t\t];\n\t\t\tconst fromLight = Vector3Math.subtract(target, [\n\t\t\t\tposX,\n\t\t\t\tposY,\n\t\t\t\tposZ\n\t\t\t]);\n\t\t\tif (Vector3Math.length(fromLight) > 1e-4) dir = Vector3Math.normalize(fromLight);\n\t\t}\n\t\tconst radius = Math.max(1, opt.radius ?? 1e3);\n\t\tconst decay = opt.decay ?? 2;\n\t\tconst angleDeg = Math.max(.1, Math.min(180, opt.angle ?? 45));\n\t\tconst penumbraFrac = Math.max(0, Math.min(1, opt.penumbra ?? .2));\n\t\tconst outerRad = angleDeg * Math.PI / 180;\n\t\tconst innerRad = outerRad * (1 - penumbraFrac);\n\t\tconst cosOuter = Math.cos(outerRad);\n\t\tconst cosInner = Math.cos(innerRad);\n\t\treturn {\n\t\t\tposType: [\n\t\t\t\tposX,\n\t\t\t\tposY,\n\t\t\t\tposZ,\n\t\t\t\ttypeVal\n\t\t\t],\n\t\t\tdirRadius: [\n\t\t\t\tdir[0],\n\t\t\t\tdir[1],\n\t\t\t\tdir[2],\n\t\t\t\tradius\n\t\t\t],\n\t\t\tcolorIntensity: [\n\t\t\t\tcolor[0],\n\t\t\t\tcolor[1],\n\t\t\t\tcolor[2],\n\t\t\t\tintensity\n\t\t\t],\n\t\t\tspotParams: [\n\t\t\t\tcosOuter,\n\t\t\t\tcosInner,\n\t\t\t\tdecay,\n\t\t\t\t0\n\t\t\t]\n\t\t};\n\t},\n\tpackLightsUniforms(lights) {\n\t\tconst buffer = new Float32Array(LIGHT_UNIFORM_SIZE_BYTES / 4);\n\t\tif (!lights || lights.length === 0) {\n\t\t\tbuffer[4] = 0;\n\t\t\tbuffer[5] = 0;\n\t\t\treturn buffer;\n\t\t}\n\t\tlet ambientR = 0;\n\t\tlet ambientG = 0;\n\t\tlet ambientB = 0;\n\t\tconst directLights = [];\n\t\tfor (const l of lights) if ((l.lightType ?? l.type) === \"ambient\") {\n\t\t\tconst col = parseColorToRgb(l.color);\n\t\t\tconst int = l.intensity ?? 1;\n\t\t\tambientR += col[0] * int;\n\t\t\tambientG += col[1] * int;\n\t\t\tambientB += col[2] * int;\n\t\t} else if (directLights.length < MAX_LIGHTS) directLights.push(Light3D.processLight(l));\n\t\tbuffer[0] = ambientR;\n\t\tbuffer[1] = ambientG;\n\t\tbuffer[2] = ambientB;\n\t\tbuffer[3] = 1;\n\t\tbuffer[4] = directLights.length;\n\t\tbuffer[5] = 1;\n\t\tbuffer[6] = 0;\n\t\tbuffer[7] = 0;\n\t\tlet offset = 8;\n\t\tfor (let i = 0; i < MAX_LIGHTS; i++) {\n\t\t\tif (i < directLights.length) {\n\t\t\t\tconst dl = directLights[i];\n\t\t\t\tbuffer[offset + 0] = dl.posType[0];\n\t\t\t\tbuffer[offset + 1] = dl.posType[1];\n\t\t\t\tbuffer[offset + 2] = dl.posType[2];\n\t\t\t\tbuffer[offset + 3] = dl.posType[3];\n\t\t\t\tbuffer[offset + 4] = dl.dirRadius[0];\n\t\t\t\tbuffer[offset + 5] = dl.dirRadius[1];\n\t\t\t\tbuffer[offset + 6] = dl.dirRadius[2];\n\t\t\t\tbuffer[offset + 7] = dl.dirRadius[3];\n\t\t\t\tbuffer[offset + 8] = dl.colorIntensity[0];\n\t\t\t\tbuffer[offset + 9] = dl.colorIntensity[1];\n\t\t\t\tbuffer[offset + 10] = dl.colorIntensity[2];\n\t\t\t\tbuffer[offset + 11] = dl.colorIntensity[3];\n\t\t\t\tbuffer[offset + 12] = dl.spotParams[0];\n\t\t\t\tbuffer[offset + 13] = dl.spotParams[1];\n\t\t\t\tbuffer[offset + 14] = dl.spotParams[2];\n\t\t\t\tbuffer[offset + 15] = dl.spotParams[3];\n\t\t\t} else for (let j = 0; j < 16; j++) buffer[offset + j] = 0;\n\t\t\toffset += 16;\n\t\t}\n\t\treturn buffer;\n\t}\n};\n\n//#endregion\n//#region src/math3d/path3d.ts\n/**\n* 3D Path Mathematical Curves, Arc-Length Lookup Tables, and Rotation-Minimizing Frames (RMF).\n* Provides uniform-velocity parameterization and smooth tangent/normal kinematics along 3D curves.\n*/\nvar Path3D = class Path3D {\n\tsamples = [];\n\tframes = [];\n\ttotalLength = 0;\n\tconstructor(samples) {\n\t\tif (samples.length < 2) throw new Error(\"Path3D requires at least 2 coordinate samples\");\n\t\tthis.samples = samples;\n\t\tthis.totalLength = samples[samples.length - 1].distance;\n\t\tthis.computeRotationMinimizingFrames();\n\t}\n\t/**\n\t* Computes continuous Rotation-Minimizing Frames (RMF) along the path\n\t* using the Double Reflection Method (Wang et al. 2008), preventing gimbal flips.\n\t*/\n\tcomputeRotationMinimizingFrames() {\n\t\tconst count = this.samples.length;\n\t\tthis.frames = new Array(count);\n\t\tconst t0 = this.samples[0].tangent;\n\t\tlet upRef = [\n\t\t\t0,\n\t\t\t-1,\n\t\t\t0\n\t\t];\n\t\tif (Math.abs(Vector3Math.dot(t0, upRef)) > .95) upRef = [\n\t\t\t0,\n\t\t\t0,\n\t\t\t1\n\t\t];\n\t\tlet n0 = Vector3Math.normalize(Vector3Math.subtract(upRef, Vector3Math.multiplyScalar(t0, Vector3Math.dot(upRef, t0))));\n\t\tif (Vector3Math.lengthSq(n0) < 1e-4) n0 = [\n\t\t\t1,\n\t\t\t0,\n\t\t\t0\n\t\t];\n\t\tconst b0 = Vector3Math.normalize(Vector3Math.cross(t0, n0));\n\t\tthis.frames[0] = {\n\t\t\tnormal: n0,\n\t\t\tbinormal: b0,\n\t\t\trotation: this.eulerFromFrame(t0, n0, b0)\n\t\t};\n\t\tfor (let i = 0; i < count - 1; i++) {\n\t\t\tconst x0 = this.samples[i].position;\n\t\t\tconst x1 = this.samples[i + 1].position;\n\t\t\tconst t_i = this.samples[i].tangent;\n\t\t\tconst t_next = this.samples[i + 1].tangent;\n\t\t\tconst n_i = this.frames[i].normal;\n\t\t\tconst v1 = Vector3Math.subtract(x1, x0);\n\t\t\tconst c1 = Vector3Math.dot(v1, v1);\n\t\t\tlet n_next;\n\t\t\tif (c1 > 1e-8) {\n\t\t\t\tconst t_i_L = Vector3Math.subtract(t_i, Vector3Math.multiplyScalar(v1, 2 * Vector3Math.dot(v1, t_i) / c1));\n\t\t\t\tconst n_i_L = Vector3Math.subtract(n_i, Vector3Math.multiplyScalar(v1, 2 * Vector3Math.dot(v1, n_i) / c1));\n\t\t\t\tconst v2 = Vector3Math.subtract(t_next, t_i_L);\n\t\t\t\tconst c2 = Vector3Math.dot(v2, v2);\n\t\t\t\tif (c2 > 1e-8) n_next = Vector3Math.subtract(n_i_L, Vector3Math.multiplyScalar(v2, 2 * Vector3Math.dot(v2, n_i_L) / c2));\n\t\t\t\telse n_next = n_i_L;\n\t\t\t} else n_next = n_i;\n\t\t\tn_next = Vector3Math.normalize(Vector3Math.subtract(n_next, Vector3Math.multiplyScalar(t_next, Vector3Math.dot(t_next, n_next))));\n\t\t\tconst b_next = Vector3Math.normalize(Vector3Math.cross(t_next, n_next));\n\t\t\tthis.frames[i + 1] = {\n\t\t\t\tnormal: n_next,\n\t\t\t\tbinormal: b_next,\n\t\t\t\trotation: this.eulerFromFrame(t_next, n_next, b_next)\n\t\t\t};\n\t\t}\n\t}\n\t/**\n\t* Extracts pitch, yaw, roll Euler angles in degrees from the orthonormal frame.\n\t*/\n\teulerFromFrame(tangent, normal, binormal) {\n\t\treturn [\n\t\t\tMath.asin(Math.max(-1, Math.min(1, -tangent[1]))) * (180 / Math.PI),\n\t\t\tMath.atan2(tangent[0], tangent[2]) * (180 / Math.PI),\n\t\t\tMath.atan2(normal[0], normal[1]) * (180 / Math.PI)\n\t\t];\n\t}\n\t/**\n\t* Evaluates point, tangent, normal, binormal, and rotation at normalized progress u in [0, 1].\n\t* Progression moves with constant velocity along the arc length of the path.\n\t*/\n\tgetPointAt(u) {\n\t\tconst targetDist = Math.max(0, Math.min(1, u)) * this.totalLength;\n\t\treturn this.getPointAtDistance(targetDist);\n\t}\n\t/**\n\t* Evaluates point along path by absolute arc-length distance in pixels.\n\t*/\n\tgetPointAtDistance(distance) {\n\t\tconst d = Math.max(0, Math.min(this.totalLength, distance));\n\t\tconst count = this.samples.length;\n\t\tlet low = 0;\n\t\tlet high = count - 1;\n\t\twhile (low < high) {\n\t\t\tconst mid = low + high >> 1;\n\t\t\tif (this.samples[mid].distance < d) low = mid + 1;\n\t\t\telse high = mid;\n\t\t}\n\t\tconst idx1 = Math.max(1, low);\n\t\tconst idx0 = idx1 - 1;\n\t\tconst s0 = this.samples[idx0];\n\t\tconst s1 = this.samples[idx1];\n\t\tconst segLen = s1.distance - s0.distance;\n\t\tconst alpha = segLen > 1e-6 ? (d - s0.distance) / segLen : 0;\n\t\tconst position = Vector3Math.lerp(s0.position, s1.position, alpha);\n\t\tconst tangent = Vector3Math.normalize(Vector3Math.lerp(s0.tangent, s1.tangent, alpha));\n\t\tconst f0 = this.frames[idx0];\n\t\tconst f1 = this.frames[idx1];\n\t\tconst normal = Vector3Math.normalize(Vector3Math.lerp(f0.normal, f1.normal, alpha));\n\t\tconst binormal = Vector3Math.normalize(Vector3Math.cross(tangent, normal));\n\t\tconst rotation = [\n\t\t\tf0.rotation[0] + (f1.rotation[0] - f0.rotation[0]) * alpha,\n\t\t\tf0.rotation[1] + (f1.rotation[1] - f0.rotation[1]) * alpha,\n\t\t\tf0.rotation[2] + (f1.rotation[2] - f0.rotation[2]) * alpha\n\t\t];\n\t\treturn {\n\t\t\tposition,\n\t\t\ttangent,\n\t\t\tnormal,\n\t\t\tbinormal,\n\t\t\tdistance: d,\n\t\t\tt: this.totalLength > 0 ? d / this.totalLength : 0,\n\t\t\trotation\n\t\t};\n\t}\n\t/**\n\t* Creates a smooth Catmull-Rom spline path interpolating through 3D waypoints.\n\t*/\n\tstatic catmullRom(waypoints, options = {}) {\n\t\tif (waypoints.length < 2) throw new Error(\"Catmull-Rom spline requires at least 2 waypoints\");\n\t\tconst closed = Boolean(options.closed);\n\t\tconst samplesPerSegment = options.samplesPerSegment ?? 40;\n\t\tconst pts = [];\n\t\tif (closed) {\n\t\t\tpts.push(waypoints[waypoints.length - 1]);\n\t\t\tpts.push(...waypoints);\n\t\t\tpts.push(waypoints[0]);\n\t\t\tpts.push(waypoints[1]);\n\t\t} else {\n\t\t\tconst pFirst = waypoints[0];\n\t\t\tconst pSecond = waypoints[1];\n\t\t\tconst pLast = waypoints[waypoints.length - 1];\n\t\t\tconst pPrevLast = waypoints[waypoints.length - 2];\n\t\t\tpts.push(Vector3Math.subtract(pFirst, Vector3Math.subtract(pSecond, pFirst)));\n\t\t\tpts.push(...waypoints);\n\t\t\tpts.push(Vector3Math.add(pLast, Vector3Math.subtract(pLast, pPrevLast)));\n\t\t}\n\t\tconst numSegments = closed ? waypoints.length : waypoints.length - 1;\n\t\tconst rawSamples = [];\n\t\tfor (let s = 0; s < numSegments; s++) {\n\t\t\tconst p0 = pts[s];\n\t\t\tconst p1 = pts[s + 1];\n\t\t\tconst p2 = pts[s + 2];\n\t\t\tconst p3 = pts[s + 3];\n\t\t\tconst steps = s === numSegments - 1 ? samplesPerSegment : samplesPerSegment - 1;\n\t\t\tfor (let step = 0; step <= steps; step++) {\n\t\t\t\tconst t = step / samplesPerSegment;\n\t\t\t\tconst t2 = t * t;\n\t\t\t\tconst t3 = t2 * t;\n\t\t\t\tconst a0 = -.5 * t3 + t2 - .5 * t;\n\t\t\t\tconst a1 = 1.5 * t3 - 2.5 * t2 + 1;\n\t\t\t\tconst a2 = -1.5 * t3 + 2 * t2 + .5 * t;\n\t\t\t\tconst a3 = .5 * t3 - .5 * t2;\n\t\t\t\tconst pos = [\n\t\t\t\t\ta0 * p0[0] + a1 * p1[0] + a2 * p2[0] + a3 * p3[0],\n\t\t\t\t\ta0 * p0[1] + a1 * p1[1] + a2 * p2[1] + a3 * p3[1],\n\t\t\t\t\ta0 * p0[2] + a1 * p1[2] + a2 * p2[2] + a3 * p3[2]\n\t\t\t\t];\n\t\t\t\tconst da0 = -1.5 * t2 + 2 * t - .5;\n\t\t\t\tconst da1 = 4.5 * t2 - 5 * t;\n\t\t\t\tconst da2 = -4.5 * t2 + 4 * t + .5;\n\t\t\t\tconst da3 = 1.5 * t2 - 1 * t;\n\t\t\t\tconst tanVel = [\n\t\t\t\t\tda0 * p0[0] + da1 * p1[0] + da2 * p2[0] + da3 * p3[0],\n\t\t\t\t\tda0 * p0[1] + da1 * p1[1] + da2 * p2[1] + da3 * p3[1],\n\t\t\t\t\tda0 * p0[2] + da1 * p1[2] + da2 * p2[2] + da3 * p3[2]\n\t\t\t\t];\n\t\t\t\tconst tangent = Vector3Math.normalize(tanVel);\n\t\t\t\trawSamples.push({\n\t\t\t\t\tposition: pos,\n\t\t\t\t\ttangent\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tlet cumulativeDist = 0;\n\t\tconst samples = [{\n\t\t\tposition: rawSamples[0].position,\n\t\t\ttangent: rawSamples[0].tangent,\n\t\t\tdistance: 0\n\t\t}];\n\t\tfor (let i = 1; i < rawSamples.length; i++) {\n\t\t\tconst d = Vector3Math.distance(rawSamples[i].position, rawSamples[i - 1].position);\n\t\t\tcumulativeDist += d;\n\t\t\tsamples.push({\n\t\t\t\tposition: rawSamples[i].position,\n\t\t\t\ttangent: rawSamples[i].tangent,\n\t\t\t\tdistance: cumulativeDist\n\t\t\t});\n\t\t}\n\t\treturn new Path3D(samples);\n\t}\n\t/**\n\t* Creates a continuous 3D path from a chain of cubic Bezier segments.\n\t*/\n\tstatic bezier(segments, samplesPerSegment = 50) {\n\t\tif (segments.length === 0) throw new Error(\"Bezier path requires at least 1 segment\");\n\t\tconst rawSamples = [];\n\t\tfor (let s = 0; s < segments.length; s++) {\n\t\t\tconst seg = segments[s];\n\t\t\tconst steps = s === segments.length - 1 ? samplesPerSegment : samplesPerSegment - 1;\n\t\t\tfor (let step = 0; step <= steps; step++) {\n\t\t\t\tconst t = step / samplesPerSegment;\n\t\t\t\tconst u = 1 - t;\n\t\t\t\tconst uu = u * u;\n\t\t\t\tconst uuu = uu * u;\n\t\t\t\tconst tt = t * t;\n\t\t\t\tconst ttt = tt * t;\n\t\t\t\tconst pos = [\n\t\t\t\t\tuuu * seg.p0[0] + 3 * uu * t * seg.p1[0] + 3 * u * tt * seg.p2[0] + ttt * seg.p3[0],\n\t\t\t\t\tuuu * seg.p0[1] + 3 * uu * t * seg.p1[1] + 3 * u * tt * seg.p2[1] + ttt * seg.p3[1],\n\t\t\t\t\tuuu * seg.p0[2] + 3 * uu * t * seg.p1[2] + 3 * u * tt * seg.p2[2] + ttt * seg.p3[2]\n\t\t\t\t];\n\t\t\t\tconst tanVel = [\n\t\t\t\t\t3 * uu * (seg.p1[0] - seg.p0[0]) + 6 * u * t * (seg.p2[0] - seg.p1[0]) + 3 * tt * (seg.p3[0] - seg.p2[0]),\n\t\t\t\t\t3 * uu * (seg.p1[1] - seg.p0[1]) + 6 * u * t * (seg.p2[1] - seg.p1[1]) + 3 * tt * (seg.p3[1] - seg.p2[1]),\n\t\t\t\t\t3 * uu * (seg.p1[2] - seg.p0[2]) + 6 * u * t * (seg.p2[2] - seg.p1[2]) + 3 * tt * (seg.p3[2] - seg.p2[2])\n\t\t\t\t];\n\t\t\t\tconst tangent = Vector3Math.normalize(tanVel);\n\t\t\t\trawSamples.push({\n\t\t\t\t\tposition: pos,\n\t\t\t\t\ttangent\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tlet cumulativeDist = 0;\n\t\tconst samples = [{\n\t\t\tposition: rawSamples[0].position,\n\t\t\ttangent: rawSamples[0].tangent,\n\t\t\tdistance: 0\n\t\t}];\n\t\tfor (let i = 1; i < rawSamples.length; i++) {\n\t\t\tcumulativeDist += Vector3Math.distance(rawSamples[i].position, rawSamples[i - 1].position);\n\t\t\tsamples.push({\n\t\t\t\tposition: rawSamples[i].position,\n\t\t\t\ttangent: rawSamples[i].tangent,\n\t\t\t\tdistance: cumulativeDist\n\t\t\t});\n\t\t}\n\t\treturn new Path3D(samples);\n\t}\n\t/**\n\t* Creates a 3D volumetric helix / spiral path.\n\t*/\n\tstatic helix(options) {\n\t\tconst { center, radius, pitch, turns, axis = \"z\", samplesPerTurn = 60 } = options;\n\t\tconst totalSamples = Math.max(10, Math.round(turns * samplesPerTurn));\n\t\tconst rawSamples = [];\n\t\tfor (let i = 0; i <= totalSamples; i++) {\n\t\t\tconst progress = i / totalSamples;\n\t\t\tconst theta = progress * turns * Math.PI * 2;\n\t\t\tconst axial = (progress - .5) * pitch * turns;\n\t\t\tconst c = Math.cos(theta);\n\t\t\tconst s = Math.sin(theta);\n\t\t\tlet pos;\n\t\t\tlet tanVel;\n\t\t\tif (axis === \"z\") {\n\t\t\t\tpos = [\n\t\t\t\t\tcenter[0] + radius * c,\n\t\t\t\t\tcenter[1] + radius * s,\n\t\t\t\t\tcenter[2] + axial\n\t\t\t\t];\n\t\t\t\ttanVel = [\n\t\t\t\t\t-radius * s,\n\t\t\t\t\tradius * c,\n\t\t\t\t\tpitch * turns / (turns * Math.PI * 2)\n\t\t\t\t];\n\t\t\t} else if (axis === \"y\") {\n\t\t\t\tpos = [\n\t\t\t\t\tcenter[0] + radius * c,\n\t\t\t\t\tcenter[1] + axial,\n\t\t\t\t\tcenter[2] + radius * s\n\t\t\t\t];\n\t\t\t\ttanVel = [\n\t\t\t\t\t-radius * s,\n\t\t\t\t\tpitch * turns / (turns * Math.PI * 2),\n\t\t\t\t\tradius * c\n\t\t\t\t];\n\t\t\t} else {\n\t\t\t\tpos = [\n\t\t\t\t\tcenter[0] + axial,\n\t\t\t\t\tcenter[1] + radius * c,\n\t\t\t\t\tcenter[2] + radius * s\n\t\t\t\t];\n\t\t\t\ttanVel = [\n\t\t\t\t\tpitch * turns / (turns * Math.PI * 2),\n\t\t\t\t\t-radius * s,\n\t\t\t\t\tradius * c\n\t\t\t\t];\n\t\t\t}\n\t\t\trawSamples.push({\n\t\t\t\tposition: pos,\n\t\t\t\ttangent: Vector3Math.normalize(tanVel)\n\t\t\t});\n\t\t}\n\t\tlet cumulativeDist = 0;\n\t\tconst samples = [{\n\t\t\tposition: rawSamples[0].position,\n\t\t\ttangent: rawSamples[0].tangent,\n\t\t\tdistance: 0\n\t\t}];\n\t\tfor (let i = 1; i < rawSamples.length; i++) {\n\t\t\tcumulativeDist += Vector3Math.distance(rawSamples[i].position, rawSamples[i - 1].position);\n\t\t\tsamples.push({\n\t\t\t\tposition: rawSamples[i].position,\n\t\t\t\ttangent: rawSamples[i].tangent,\n\t\t\t\tdistance: cumulativeDist\n\t\t\t});\n\t\t}\n\t\treturn new Path3D(samples);\n\t}\n\t/**\n\t* Creates a 3D circular or arc orbit path.\n\t*/\n\tstatic circle(options) {\n\t\tconst { center, radius, startAngleDeg = 0, endAngleDeg = 360, samples = 128 } = options;\n\t\tconst startRad = startAngleDeg * Math.PI / 180;\n\t\tconst endRad = endAngleDeg * Math.PI / 180;\n\t\tconst rawSamples = [];\n\t\tfor (let i = 0; i <= samples; i++) {\n\t\t\tconst theta = startRad + (endRad - startRad) * (i / samples);\n\t\t\tconst c = Math.cos(theta);\n\t\t\tconst s = Math.sin(theta);\n\t\t\tconst pos = [\n\t\t\t\tcenter[0] + radius * c,\n\t\t\t\tcenter[1],\n\t\t\t\tcenter[2] + radius * s\n\t\t\t];\n\t\t\tconst tanVel = [\n\t\t\t\t-radius * s,\n\t\t\t\t0,\n\t\t\t\tradius * c\n\t\t\t];\n\t\t\trawSamples.push({\n\t\t\t\tposition: pos,\n\t\t\t\ttangent: Vector3Math.normalize(tanVel)\n\t\t\t});\n\t\t}\n\t\tlet cumulativeDist = 0;\n\t\tconst pathSamples = [{\n\t\t\tposition: rawSamples[0].position,\n\t\t\ttangent: rawSamples[0].tangent,\n\t\t\tdistance: 0\n\t\t}];\n\t\tfor (let i = 1; i < rawSamples.length; i++) {\n\t\t\tcumulativeDist += Vector3Math.distance(rawSamples[i].position, rawSamples[i - 1].position);\n\t\t\tpathSamples.push({\n\t\t\t\tposition: rawSamples[i].position,\n\t\t\t\ttangent: rawSamples[i].tangent,\n\t\t\t\tdistance: cumulativeDist\n\t\t\t});\n\t\t}\n\t\treturn new Path3D(pathSamples);\n\t}\n};\n\n//#endregion\n//#region src/playback-context.tsx\nconst PlaybackContext = createContext({\n\tframe: 0,\n\tfps: 24,\n\tisPlaying: false\n});\nconst PlaybackProvider = PlaybackContext.Provider;\nconst useCurrentFrame = () => {\n\treturn useContext(PlaybackContext).frame;\n};\nconst useVideoConfig = () => {\n\treturn {\n\t\tfps: useContext(PlaybackContext).fps,\n\t\twidth: 1920,\n\t\theight: 1080\n\t};\n};\n\n//#endregion\n//#region src/spring.ts\nconst defaultSpringConfig = {\n\tdamping: 10,\n\tmass: 1,\n\tstiffness: 100,\n\tovershootClamping: false\n};\nconst advanceCache = {};\nfunction advance({ animation, now, config }) {\n\tconst { toValue, lastTimestamp, current, velocity } = animation;\n\tconst deltaTime = Math.min(now - lastTimestamp, 64);\n\tif (config.damping <= 0) throw new Error(\"Spring damping must be greater than 0, otherwise the spring() animation will never end, causing an infinite loop.\");\n\tif (config.stiffness <= 0) throw new Error(\"Spring stiffness must be greater than 0.\");\n\tif (config.mass <= 0) throw new Error(\"Spring mass must be greater than 0.\");\n\tconst c = config.damping;\n\tconst m = config.mass;\n\tconst k = config.stiffness;\n\tconst cacheKey = [\n\t\ttoValue,\n\t\tlastTimestamp,\n\t\tcurrent,\n\t\tvelocity,\n\t\tc,\n\t\tm,\n\t\tk,\n\t\tnow\n\t].join(\"-\");\n\tif (advanceCache[cacheKey]) return advanceCache[cacheKey];\n\tconst v0 = -velocity;\n\tconst x0 = toValue - current;\n\tconst zeta = c / (2 * Math.sqrt(k * m));\n\tconst omega0 = Math.sqrt(k / m);\n\tconst omega1 = omega0 * Math.sqrt(1 - zeta ** 2);\n\tconst t = deltaTime / 1e3;\n\tconst sin1 = Math.sin(omega1 * t);\n\tconst cos1 = Math.cos(omega1 * t);\n\tconst underDampedEnvelope = Math.exp(-zeta * omega0 * t);\n\tconst underDampedFrag1 = underDampedEnvelope * (sin1 * ((v0 + zeta * omega0 * x0) / omega1) + x0 * cos1);\n\tconst underDampedPosition = toValue - underDampedFrag1;\n\tconst underDampedVelocity = zeta * omega0 * underDampedFrag1 - underDampedEnvelope * (cos1 * (v0 + zeta * omega0 * x0) - omega1 * x0 * sin1);\n\tconst criticallyDampedEnvelope = Math.exp(-omega0 * t);\n\tconst criticallyDampedPosition = toValue - criticallyDampedEnvelope * (x0 + (v0 + omega0 * x0) * t);\n\tconst criticallyDampedVelocity = criticallyDampedEnvelope * (v0 * (t * omega0 - 1) + t * x0 * omega0 * omega0);\n\tconst animationNode = {\n\t\ttoValue,\n\t\tprevPosition: current,\n\t\tlastTimestamp: now,\n\t\tcurrent: zeta < 1 ? underDampedPosition : criticallyDampedPosition,\n\t\tvelocity: zeta < 1 ? underDampedVelocity : criticallyDampedVelocity\n\t};\n\tadvanceCache[cacheKey] = animationNode;\n\treturn animationNode;\n}\nconst calculationCache = {};\nfunction springCalculation({ frame, fps, config = {} }) {\n\tconst from = 0;\n\tconst to = 1;\n\tconst cacheKey = [\n\t\tframe,\n\t\tfps,\n\t\tconfig.damping,\n\t\tconfig.mass,\n\t\tconfig.overshootClamping,\n\t\tconfig.stiffness\n\t].join(\"-\");\n\tif (calculationCache[cacheKey]) return calculationCache[cacheKey];\n\tlet animation = {\n\t\tlastTimestamp: 0,\n\t\tcurrent: from,\n\t\ttoValue: to,\n\t\tvelocity: 0,\n\t\tprevPosition: 0\n\t};\n\tconst frameClamped = Math.max(0, frame);\n\tconst unevenRest = frameClamped % 1;\n\tfor (let f = 0; f <= Math.floor(frameClamped); f++) {\n\t\tif (f === Math.floor(frameClamped)) f += unevenRest;\n\t\tconst time = f / fps * 1e3;\n\t\tanimation = advance({\n\t\t\tanimation,\n\t\t\tnow: time,\n\t\t\tconfig: {\n\t\t\t\t...defaultSpringConfig,\n\t\t\t\t...config\n\t\t\t}\n\t\t});\n\t}\n\tcalculationCache[cacheKey] = animation;\n\treturn animation;\n}\nconst measureCache = /* @__PURE__ */ new Map();\nfunction measureSpring({ fps, config = {}, threshold = .005 }) {\n\tif (typeof threshold !== \"number\") throw new TypeError(`threshold must be a number, got ${threshold}`);\n\tif (threshold === 0) return Infinity;\n\tif (threshold === 1) return 0;\n\tif (Number.isNaN(threshold)) throw new TypeError(\"Threshold is NaN\");\n\tif (!Number.isFinite(threshold)) throw new TypeError(\"Threshold is not finite\");\n\tif (threshold < 0) throw new TypeError(\"Threshold is below 0\");\n\tconst cacheKey = [\n\t\tfps,\n\t\tconfig.damping,\n\t\tconfig.mass,\n\t\tconfig.overshootClamping,\n\t\tconfig.stiffness,\n\t\tthreshold\n\t].join(\"-\");\n\tif (measureCache.has(cacheKey)) return measureCache.get(cacheKey);\n\tlet frame = 0;\n\tlet finishedFrame = 0;\n\tconst calc = () => {\n\t\treturn springCalculation({\n\t\t\tfps,\n\t\t\tframe,\n\t\t\tconfig\n\t\t});\n\t};\n\tlet animation = calc();\n\tconst calcDifference = () => {\n\t\treturn Math.abs(animation.current - animation.toValue);\n\t};\n\tlet difference = calcDifference();\n\twhile (difference >= threshold) {\n\t\tframe++;\n\t\tanimation = calc();\n\t\tdifference = calcDifference();\n\t}\n\tfinishedFrame = frame;\n\tfor (let i = 0; i < 20; i++) {\n\t\tframe++;\n\t\tanimation = calc();\n\t\tdifference = calcDifference();\n\t\tif (difference >= threshold) {\n\t\t\ti = 0;\n\t\t\tfinishedFrame = frame + 1;\n\t\t}\n\t}\n\tmeasureCache.set(cacheKey, finishedFrame);\n\treturn finishedFrame;\n}\nfunction spring({ frame: passedFrame, fps, config = {}, from = 0, to = 1, durationInFrames: passedDurationInFrames, durationRestThreshold, delay = 0, reverse = false }) {\n\tconst needsToCalculateNaturalDuration = reverse || typeof passedDurationInFrames !== \"undefined\";\n\tconst naturalDuration = needsToCalculateNaturalDuration ? measureSpring({\n\t\tfps,\n\t\tconfig,\n\t\tthreshold: durationRestThreshold\n\t}) : void 0;\n\tconst naturalDurationGetter = needsToCalculateNaturalDuration ? { get: () => naturalDuration } : { get: () => {\n\t\tthrow new Error(\"did not calculate natural duration\");\n\t} };\n\tconst delayProcessed = (reverse ? (passedDurationInFrames ?? naturalDurationGetter.get()) - passedFrame : passedFrame) + (reverse ? delay : -delay);\n\tconst durationProcessed = passedDurationInFrames === void 0 ? delayProcessed : delayProcessed / (passedDurationInFrames / naturalDurationGetter.get());\n\tif (passedDurationInFrames && delayProcessed > passedDurationInFrames) return to;\n\tconst spr = springCalculation({\n\t\tfps,\n\t\tframe: durationProcessed,\n\t\tconfig\n\t});\n\tconst inner = config.overshootClamping ? to >= from ? Math.min(spr.current, to) : Math.max(spr.current, to) : spr.current;\n\treturn from === 0 && to === 1 ? inner : interpolate(inner, [0, 1], [from, to]);\n}\n\n//#endregion\n//#region src/text-measurer.ts\nconst cache = /* @__PURE__ */ new Map();\nfunction getCacheKey(text, style) {\n\treturn JSON.stringify({\n\t\ttext,\n\t\t...style\n\t});\n}\n/**\n* Shared text measurer that uses SlugGeometry.measure for all environments.\n*/\nfunction measureText(text, style) {\n\tconst safeText = text ? String(text) : \" \";\n\tconst cacheKey = getCacheKey(safeText, style);\n\tconst cached = cache.get(cacheKey);\n\tif (cached) return cached;\n\tconst fontSize = style.fontSize ?? 48;\n\tlet fontFamily = style.fontFamily ?? \"Inter\";\n\tif (SlugFontCache.isFailed(fontFamily)) fontFamily = \"Inter\";\n\tconst letterSpacing = style.letterSpacing ?? 0;\n\tconst calculatedLineHeight = style.lineHeight !== void 0 && style.lineHeight < 10 ? style.lineHeight * fontSize : style.lineHeight ?? fontSize * 1.2;\n\tconst slugFont = SlugFontCache.getFont(fontFamily, style.fontWeight, null);\n\tconst padding = style.padding ?? 0;\n\tif (!slugFont) {\n\t\tif (!SlugFontCache.isFailed(fontFamily)) {\n\t\t\tconst fontUrl = GetFontAssetUrl(fontFamily);\n\t\t\tSlugFontCache.preloadSlugFont(null, fontFamily, fontUrl).catch(() => {});\n\t\t}\n\t\tconst lines = safeText.split(\"\\n\");\n\t\tlet totalWrappedLines = 0;\n\t\tconst maxW = style.width !== void 0 ? Math.max(10, style.width - padding * 2) : 0;\n\t\tfor (const line of lines) if (maxW > 0) {\n\t\t\tconst estLineWidth = line.length * fontSize * .55 + letterSpacing * line.length;\n\t\t\tconst wrapCount = Math.max(1, Math.ceil(estLineWidth / maxW));\n\t\t\ttotalWrappedLines += wrapCount;\n\t\t} else totalWrappedLines += 1;\n\t\tconst result$1 = {\n\t\t\twidth: style.width !== void 0 ? style.width : Math.ceil(safeText.length * fontSize * .6 + letterSpacing * safeText.length) + 2 + padding * 2,\n\t\t\theight: style.height !== void 0 ? style.height : Math.ceil(totalWrappedLines * calculatedLineHeight) + 2 + padding * 2\n\t\t};\n\t\tcache.set(cacheKey, result$1);\n\t\treturn result$1;\n\t}\n\tconst measured = SlugGeometry.measure(safeText, slugFont, fontSize, letterSpacing, calculatedLineHeight, style.width !== void 0 ? Math.max(0, style.width - padding * 2) : void 0, style.spans);\n\tconst result = {\n\t\twidth: style.width !== void 0 && !style.keepNaturalWidth ? style.width : Math.ceil(measured.width) + padding * 2 + 8,\n\t\theight: style.height !== void 0 ? style.height : Math.ceil(measured.height) + padding * 2\n\t};\n\tcache.set(cacheKey, result);\n\treturn result;\n}\n/**\n* Async variant of measureText. Preloads the Slug font and yields to the browser.\n*/\nfunction measureTextAsync(text, style) {\n\tlet fontFamily = style.fontFamily ?? \"Inter\";\n\tif (SlugFontCache.isFailed(fontFamily)) fontFamily = \"Inter\";\n\tif (SlugFontCache.isFailed(fontFamily)) return Promise.resolve(measureText(text, style));\n\tconst fontUrl = GetFontAssetUrl(fontFamily);\n\treturn SlugFontCache.preloadSlugFont(null, fontFamily, fontUrl).then(() => measureText(text, style)).catch(() => measureText(text, style));\n}\n\n//#endregion\n//#region src/utils.ts\nif (typeof globalThis !== \"undefined\") globalThis.__GATEWAI_DELAYS__ = globalThis.__GATEWAI_DELAYS__ || /* @__PURE__ */ new Set();\nconst hasDelayRender = () => {\n\treturn useMemo(() => {\n\t\tlet nextHandle = 0;\n\t\treturn {\n\t\t\tdelayRender: (_msg) => {\n\t\t\t\tconst h = nextHandle++;\n\t\t\t\tif (typeof globalThis !== \"undefined\") globalThis.__GATEWAI_DELAYS__.add(h);\n\t\t\t\treturn h;\n\t\t\t},\n\t\t\tcontinueRender: (h) => {\n\t\t\t\tif (typeof globalThis !== \"undefined\") globalThis.__GATEWAI_DELAYS__.delete(h);\n\t\t\t}\n\t\t};\n\t}, []);\n};\n/**\n* Preloads a font into the browser or headless environment.\n*/\nasync function preloadFont(family, url) {\n\tif (typeof window !== \"undefined\" && typeof FontFace !== \"undefined\") try {\n\t\tconst loadedFace = await new FontFace(family, `url(${url})`).load();\n\t\tdocument.fonts.add(loadedFace);\n\t\tawait document.fonts.ready;\n\t} catch (e) {\n\t\tconsole.warn(`[preloadFont] Failed to load font \"${family}\" from ${url}:`, e);\n\t}\n\telse await registerHeadlessFont(family, url);\n}\n\n//#endregion\nexport { Camera3D, Easing, LIGHT_UNIFORM_SIZE_BYTES, Light3D, MAX_LIGHTS, Matrix4Math, Path3D, PlaybackContext, PlaybackProvider, Vector3Math, bezier, computeStrokeRect, hasDelayRender, interpolate, mapBlendModeToSkia, measureSpring, measureText, measureTextAsync, parseColorToRgb, preloadFont, requiresIsolation, spring, springCalculation, useCurrentFrame, useVideoConfig };\n//# sourceMappingURL=index.mjs.map","import { DEFAULT_DURATION_MS, getActiveMediaMetadata, resolveMediaMimeType } from \"@gitframes/core\";\nimport { getEnv, resolveMediaSourceUrl } from \"@gitframes/client-utils\";\nimport { interpolate, spring } from \"@gitframes/renderers\";\n\n//#region src/utils/apply-operations.ts\nconst BASE_URL = getEnv(\"BASE_URL\");\nconst CDN_DOMAIN = getEnv(\"R2_CUSTOM_DOMAIN\");\nfunction getFontUrl(name) {\n\tif (CDN_DOMAIN) return `https://${CDN_DOMAIN}/fonts/${name}/font_file.ttf`;\n\treturn `${BASE_URL}/api/v1/fonts/load/${name}`;\n}\n/**\n* Compute render parameters for the CURRENT node only — does NOT recurse into\n* children. Each node in the VirtualMedia tree is responsible for exactly its\n* own operation; `SingleClipComposition` drives traversal via React recursion.\n*\n* This is the correct function to use inside the renderer.\n*/\nfunction computeRenderParams(vv) {\n\tconst op = vv.operation;\n\tconst baseMeta = getActiveMediaMetadata(vv);\n\tconst params = {\n\t\tsourceUrl: void 0,\n\t\ttrimStartSec: 0,\n\t\ttrimEndSec: null,\n\t\tspeed: 1,\n\t\tcropRegion: null,\n\t\tflipH: false,\n\t\tflipV: false,\n\t\trotation: 0,\n\t\teffectiveDurationSec: 0,\n\t\tmimeType: resolveMediaMimeType(vv) || null\n\t};\n\tswitch (op.op) {\n\t\tcase \"text\":\n\t\t\tparams.sourceUrl = void 0;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tparams.sourceUrl = resolveMediaSourceUrl(vv);\n\t\t\tbreak;\n\t}\n\tconst sourceDurationSec = (baseMeta?.durationMs ?? 0) / 1e3;\n\tparams.effectiveDurationSec = ((params.trimEndSec ?? sourceDurationSec) - params.trimStartSec) / params.speed;\n\treturn params;\n}\n\n//#endregion\n//#region src/utils/timing.ts\nfunction framesToSeconds(frames, fps) {\n\treturn frames / fps;\n}\nfunction secondsToFrames(seconds, fps) {\n\treturn Math.round(seconds * fps);\n}\nfunction formatTimecode(seconds) {\n\tconst mins = Math.floor(seconds / 60);\n\tconst secs = Math.floor(seconds % 60);\n\tconst ms = Math.floor(seconds % 1 * 100);\n\treturn `${mins.toString().padStart(2, \"0\")}:${secs.toString().padStart(2, \"0\")}.${ms.toString().padStart(2, \"0\")}`;\n}\n\n//#endregion\n//#region src/utils/layer-logic.ts\nconst isStaticVisualMedia = (type) => type === \"Image\" || type === \"SVG\" || type === \"Text\";\nconst resolveLayerDuration = (layerDurationInMS, metaDurationMs, defaultDuration = DEFAULT_DURATION_MS, type) => {\n\tif (type === \"Caption\") return metaDurationMs && metaDurationMs > 0 ? metaDurationMs : layerDurationInMS || defaultDuration;\n\tconst isStatic = isStaticVisualMedia(type);\n\tif (layerDurationInMS && metaDurationMs && !isStatic) return Math.min(layerDurationInMS, metaDurationMs);\n\treturn layerDurationInMS || metaDurationMs || defaultDuration;\n};\nconst calculateLayerTransform = (layer, frame, fps, viewport) => {\n\tconst relativeFrame = frame - (layer.startFrame ?? 0);\n\tlet x = layer.x ?? 0;\n\tlet y = layer.y ?? 0;\n\tlet scale = layer.scale ?? 1;\n\tlet rotation = layer.rotation ?? 0;\n\tlet opacity = layer.opacity ?? 1;\n\tconst volume = layer.volume ?? 1;\n\tconst layerDurationMs = resolveLayerDuration(layer.durationInMS, layer.virtualMedia?.metadata?.durationMs ?? void 0, DEFAULT_DURATION_MS, layer.type);\n\tconst duration = Math.round(layerDurationMs / 1e3 * fps);\n\tconst animations = layer.type === \"Text\" || layer.type === \"Caption\" ? [] : layer.animations ?? [];\n\tif (animations.length === 0) return {\n\t\tx,\n\t\ty,\n\t\tscale,\n\t\trotation,\n\t\topacity,\n\t\tvolume\n\t};\n\tanimations.forEach((anim) => {\n\t\tconst durFrames = anim.value * fps;\n\t\tconst isOut = anim.type.includes(\"-out\");\n\t\tconst startAnimFrame = isOut ? duration - durFrames : 0;\n\t\tconst endAnimFrame = isOut ? duration : durFrames;\n\t\tif (relativeFrame < startAnimFrame || relativeFrame > endAnimFrame) return;\n\t\tconst progress = interpolate(relativeFrame, [startAnimFrame, endAnimFrame], [0, 1], {\n\t\t\textrapolateLeft: \"clamp\",\n\t\t\textrapolateRight: \"clamp\"\n\t\t});\n\t\tswitch (anim.type) {\n\t\t\tcase \"fade-in\":\n\t\t\t\topacity *= progress;\n\t\t\t\tbreak;\n\t\t\tcase \"fade-out\":\n\t\t\t\topacity *= 1 - progress;\n\t\t\t\tbreak;\n\t\t\tcase \"slide-in-left\":\n\t\t\t\tx += -1 * viewport.w * (1 - progress);\n\t\t\t\tbreak;\n\t\t\tcase \"slide-in-right\":\n\t\t\t\tx += 1 * viewport.w * (1 - progress);\n\t\t\t\tbreak;\n\t\t\tcase \"slide-in-top\":\n\t\t\t\ty += -1 * viewport.h * (1 - progress);\n\t\t\t\tbreak;\n\t\t\tcase \"slide-in-bottom\":\n\t\t\t\ty += 1 * viewport.h * (1 - progress);\n\t\t\t\tbreak;\n\t\t\tcase \"zoom-in\":\n\t\t\t\tscale *= interpolate(progress, [0, 1], [0, 1]);\n\t\t\t\tbreak;\n\t\t\tcase \"zoom-out\":\n\t\t\t\tscale *= interpolate(progress, [0, 1], [1, 0]);\n\t\t\t\tbreak;\n\t\t\tcase \"rotate-cw\":\n\t\t\t\trotation += 360 * progress;\n\t\t\t\tbreak;\n\t\t\tcase \"rotate-ccw\":\n\t\t\t\trotation += -360 * progress;\n\t\t\t\tbreak;\n\t\t\tcase \"bounce\": {\n\t\t\t\tconst bounceVal = spring({\n\t\t\t\t\tframe: relativeFrame - startAnimFrame,\n\t\t\t\t\tfps,\n\t\t\t\t\tconfig: {\n\t\t\t\t\t\tdamping: 10,\n\t\t\t\t\t\tmass: .5,\n\t\t\t\t\t\tstiffness: 100\n\t\t\t\t\t},\n\t\t\t\t\tdurationInFrames: durFrames\n\t\t\t\t});\n\t\t\t\tscale *= bounceVal;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"shake\":\n\t\t\t\tx += 20 * Math.sin(relativeFrame * 10 * 2 * Math.PI / durFrames) * (1 - progress);\n\t\t\t\tbreak;\n\t\t}\n\t});\n\treturn {\n\t\tx,\n\t\ty,\n\t\tscale,\n\t\trotation,\n\t\topacity,\n\t\tvolume\n\t};\n};\n\n//#endregion\nexport { framesToSeconds as a, getFontUrl as c, formatTimecode as i, isStaticVisualMedia as n, secondsToFrames as o, resolveLayerDuration as r, computeRenderParams as s, calculateLayerTransform as t };\n//# sourceMappingURL=layer-logic-B4xSPDvq.mjs.map","import { a as framesToSeconds, c as getFontUrl, i as formatTimecode, n as isStaticVisualMedia, o as secondsToFrames, r as resolveLayerDuration, s as computeRenderParams, t as calculateLayerTransform } from \"./layer-logic-B4xSPDvq.mjs\";\nimport { getActiveMediaMetadata, getMediaType, isSignal, updateClockSignals } from \"@gitframes/core\";\nimport { RenderProvider, SlugFontCache, clearAllVideoCache, clearVideoNodeState, drawCaptionNode, drawGifNode, drawImageNode, drawLottieNode, drawParagraphNode, drawSignalNode, drawSvgNode, drawVideoNode, ensureDevice, getDevice, inputStore, lutStore, lutViewerWgsl, mediaDecoderCache, shaderStore, signalRegistry, useRenderContext } from \"@gitframes/webgpu-renderers\";\nimport { registerMp3Encoder } from \"@mediabunny/mp3-encoder\";\nimport { AudioSample, AudioSampleSink, AudioSampleSource, BufferTarget, Mp3OutputFormat, Mp4OutputFormat, Output, QUALITY_VERY_HIGH, StreamTarget, VideoSample, VideoSampleSource, WebMOutputFormat, canEncodeAudio, canEncodeVideo } from \"mediabunny\";\nimport React, { createContext, memo, useCallback, useContext, useEffect, useId, useRef, useState, useSyncExternalStore } from \"react\";\nimport { audioRegistry, webgpuRegistry } from \"@gitframes/node-sdk\";\nimport { getEnv } from \"@gitframes/client-utils\";\nimport { PlaybackProvider } from \"@gitframes/renderers\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\n\n//#region src/utils/normalization.ts\n/**\n* normalizeTimeline recurses through the virtual media tree and \"absorbs\"\n* generic timeline-shifting operations into standard properties\n* of their children.\n*/\nfunction normalizeTimeline(vv, fps, context = { timeOffsetSec: 0 }) {\n\tif (!vv) return vv;\n\tconst { operation, metadata = {}, children = [] } = vv;\n\tconst { timeOffsetSec, durationLimitMs } = context;\n\tif (!operation) return {\n\t\t...vv,\n\t\tchildren: (children || []).map((child) => normalizeTimeline(child, fps, context))\n\t};\n\tconst timeline = operation.timeline;\n\tconst segments = timeline?.segments || [];\n\tlet totalDurationMs = getActiveMediaMetadata(vv)?.durationMs ?? 0;\n\tif (segments.length > 0) {\n\t\tconst totalSegmentsFrames = segments.reduce((acc, seg) => {\n\t\t\tconst durSec = seg.endSec != null ? seg.endSec - seg.startSec : 0;\n\t\t\treturn acc + Math.max(1, Math.round(durSec * fps));\n\t\t}, 0);\n\t\tif (totalSegmentsFrames > 0) totalDurationMs = totalSegmentsFrames / fps * 1e3;\n\t}\n\tconst newOperation = { ...operation };\n\tconst rawStartFrame = timeline?.startFrame ?? newOperation.startFrame;\n\tif (typeof rawStartFrame === \"number\") newOperation.startFrame = rawStartFrame - secondsToFrames(timeOffsetSec, fps);\n\tconst newMetadata = {\n\t\t...metadata,\n\t\tdurationMs: totalDurationMs\n\t};\n\tconst childContext = typeof rawStartFrame === \"number\" || newOperation.op === \"compose\" ? {\n\t\ttimeOffsetSec: 0,\n\t\tdurationLimitMs: void 0\n\t} : {\n\t\ttimeOffsetSec,\n\t\tdurationLimitMs\n\t};\n\treturn {\n\t\tmetadata: newMetadata,\n\t\toperation: newOperation,\n\t\tchildren: (children || []).map((child) => normalizeTimeline(child, fps, childContext))\n\t};\n}\n\n//#endregion\n//#region src/utils/audio-extractor.ts\nlet mediaLogger = {\n\tinfo: (msg, ...args) => {\n\t\tif (typeof msg === \"object\" && msg !== null) console.info(\"[AudioExtractor]\", msg, ...args);\n\t\telse console.info(`[AudioExtractor] ${msg}`, ...args);\n\t},\n\twarn: (msg, ...args) => {\n\t\tif (typeof msg === \"object\" && msg !== null) console.warn(\"[AudioExtractor]\", msg, ...args);\n\t\telse console.warn(`[AudioExtractor] ${msg}`, ...args);\n\t},\n\terror: (msg, ...args) => {\n\t\tif (typeof msg === \"object\" && msg !== null) console.error(\"[AudioExtractor]\", msg, ...args);\n\t\telse console.error(`[AudioExtractor] ${msg}`, ...args);\n\t}\n};\nif (typeof window === \"undefined\" || typeof process !== \"undefined\" && process.versions?.node) import(\n\t/* webpackIgnore: true */\n\t/* @vite-ignore */\n\t\"@gitframes/server-utils\"\n).then((m) => {\n\tif (m.mediaLogger) mediaLogger = m.mediaLogger;\n}).catch(() => {});\nconst yieldToMain$1 = () => {\n\tif (typeof window === \"undefined\") return Promise.resolve();\n\tconst sched = globalThis.scheduler;\n\treturn typeof sched?.yield === \"function\" ? sched.yield() : new Promise((resolve) => setTimeout(resolve, 0));\n};\nconst waitForDelayRender$1 = async (timeoutMs = 3e4) => {\n\tawait new Promise((resolve) => setTimeout(resolve, 100));\n\tconst start = Date.now();\n\treturn new Promise((resolve) => {\n\t\tconst check = () => {\n\t\t\tconst browserHandles = typeof window !== \"undefined\" && window.renderer_delayRenderHandles ? window.renderer_delayRenderHandles : [];\n\t\t\tconst globalDelays = typeof globalThis !== \"undefined\" ? globalThis.__GATEWAI_DELAYS__ : null;\n\t\t\tconst hasBrowserDelays = browserHandles.length > 0;\n\t\t\tconst hasGlobalDelays = globalDelays instanceof Set && globalDelays.size > 0;\n\t\t\tif (!hasBrowserDelays && !hasGlobalDelays) {\n\t\t\t\tresolve();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (Date.now() - start > timeoutMs) {\n\t\t\t\tmediaLogger.warn(`[AudioExtractor] waitForDelayRender timed out waiting for handles: ${JSON.stringify({\n\t\t\t\t\tbrowserHandles,\n\t\t\t\t\tglobalDelays: globalDelays ? Array.from(globalDelays) : []\n\t\t\t\t})}`);\n\t\t\t\tresolve();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetTimeout(check, 50);\n\t\t};\n\t\tcheck();\n\t});\n};\n/**\n* Decodes all audio samples from a given source URL into raw Float32 mono/stereo channel buffers.\n*/\nasync function decodeAudioSource(url) {\n\tmediaLogger.info(`[AudioExtractor] decodeAudioSource started for url: ${url}`);\n\ttry {\n\t\tif (typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && !(typeof process !== \"undefined\" && process.versions && process.versions.node)) {\n\t\t\tmediaLogger.info(`[AudioExtractor] Browser detected. Fetching arrayBuffer for ${url}...`);\n\t\t\tconst AudioContextClass = window.AudioContext || window.webkitAudioContext;\n\t\t\tif (!AudioContextClass) throw new Error(\"AudioContext is not supported in this browser\");\n\t\t\tconst audioCtx = new AudioContextClass();\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(url);\n\t\t\t\tmediaLogger.info(`[AudioExtractor] Fetch response status for ${url}: ${response.status} (${response.statusText})`);\n\t\t\t\tif (!response.ok) throw new Error(`Failed to fetch audio source: ${response.statusText}`);\n\t\t\t\tconst arrayBuffer = await response.arrayBuffer();\n\t\t\t\tmediaLogger.info(`[AudioExtractor] Fetched ${arrayBuffer.byteLength} bytes. Decoding audio data...`);\n\t\t\t\tconst audioBuffer = await audioCtx.decodeAudioData(arrayBuffer);\n\t\t\t\tmediaLogger.info(`[AudioExtractor] Decoded successfully: ${audioBuffer.numberOfChannels} channels, sampleRate: ${audioBuffer.sampleRate}, duration: ${audioBuffer.duration}s`);\n\t\t\t\tconst channels = [];\n\t\t\t\tfor (let c = 0; c < audioBuffer.numberOfChannels; c++) channels.push(new Float32Array(audioBuffer.getChannelData(c)));\n\t\t\t\treturn {\n\t\t\t\t\tchannels,\n\t\t\t\t\tsampleRate: audioBuffer.sampleRate\n\t\t\t\t};\n\t\t\t} finally {\n\t\t\t\taudioCtx.close();\n\t\t\t\tmediaLogger.info(`[AudioExtractor] AudioContext closed for ${url}`);\n\t\t\t}\n\t\t}\n\t\tlet inputAcquired = false;\n\t\ttry {\n\t\t\tmediaLogger.info(`[AudioExtractor] Server / Node.js detected. Acquiring from inputStore for ${url}...`);\n\t\t\tconst input = await inputStore.acquire(url);\n\t\t\tinputAcquired = true;\n\t\t\tmediaLogger.info(`[AudioExtractor] inputStore acquired. Retrieving primary audio track...`);\n\t\t\tconst track = await input.getPrimaryAudioTrack();\n\t\t\tif (!track) {\n\t\t\t\tmediaLogger.warn(`[AudioExtractor] No primary audio track found in input for ${url}`);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst generator = new AudioSampleSink(track).samples(0);\n\t\t\tconst decodedPlanes = [];\n\t\t\tlet totalFrames = 0;\n\t\t\tlet sampleRate = 48e3;\n\t\t\tlet numChannels = 1;\n\t\t\tmediaLogger.info(`[AudioExtractor] Starting mediabunny generator loop for ${url}...`);\n\t\t\tfor await (const sample of generator) {\n\t\t\t\tsampleRate = sample.sampleRate;\n\t\t\t\tnumChannels = sample.numberOfChannels;\n\t\t\t\tconst sampleFrames = sample.numberOfFrames;\n\t\t\t\tif (decodedPlanes.length === 0) for (let c = 0; c < numChannels; c++) decodedPlanes.push([]);\n\t\t\t\tfor (let c = 0; c < numChannels; c++) {\n\t\t\t\t\tlet planeBuffer;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst allocSize = sample.allocationSize({\n\t\t\t\t\t\t\tplaneIndex: c,\n\t\t\t\t\t\t\tformat: \"f32-planar\"\n\t\t\t\t\t\t});\n\t\t\t\t\t\tplaneBuffer = new Float32Array(allocSize / 4);\n\t\t\t\t\t\tsample.copyTo(planeBuffer, {\n\t\t\t\t\t\t\tplaneIndex: c,\n\t\t\t\t\t\t\tformat: \"f32-planar\"\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tconst allocSize = sample.allocationSize({ planeIndex: c });\n\t\t\t\t\t\tif (sample.format === \"s16\" || sample.format === \"s16-planar\") {\n\t\t\t\t\t\t\tconst int16Buffer = new Int16Array(allocSize / 2);\n\t\t\t\t\t\t\tsample.copyTo(int16Buffer, { planeIndex: c });\n\t\t\t\t\t\t\tplaneBuffer = new Float32Array(int16Buffer.length);\n\t\t\t\t\t\t\tfor (let i = 0; i < int16Buffer.length; i++) planeBuffer[i] = (int16Buffer[i] ?? 0) / 32768;\n\t\t\t\t\t\t} else if (sample.format === \"s32\" || sample.format === \"s32-planar\") {\n\t\t\t\t\t\t\tconst int32Buffer = new Int32Array(allocSize / 4);\n\t\t\t\t\t\t\tsample.copyTo(int32Buffer, { planeIndex: c });\n\t\t\t\t\t\t\tplaneBuffer = new Float32Array(int32Buffer.length);\n\t\t\t\t\t\t\tfor (let i = 0; i < int32Buffer.length; i++) planeBuffer[i] = (int32Buffer[i] ?? 0) / 2147483648;\n\t\t\t\t\t\t} else if (sample.format === \"u8\" || sample.format === \"u8-planar\") {\n\t\t\t\t\t\t\tconst u8Buffer = new Uint8Array(allocSize);\n\t\t\t\t\t\t\tsample.copyTo(u8Buffer, { planeIndex: c });\n\t\t\t\t\t\t\tplaneBuffer = new Float32Array(u8Buffer.length);\n\t\t\t\t\t\t\tfor (let i = 0; i < u8Buffer.length; i++) planeBuffer[i] = ((u8Buffer[i] ?? 128) - 128) / 128;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tplaneBuffer = new Float32Array(allocSize / 4);\n\t\t\t\t\t\t\tsample.copyTo(planeBuffer, { planeIndex: c });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdecodedPlanes[c].push(planeBuffer);\n\t\t\t\t}\n\t\t\t\ttotalFrames += sampleFrames;\n\t\t\t\tsample.close();\n\t\t\t}\n\t\t\tmediaLogger.info(`[AudioExtractor] Generator loop finished. Decoded total frames: ${totalFrames}`);\n\t\t\tif (totalFrames === 0 || decodedPlanes.length === 0) return null;\n\t\t\treturn {\n\t\t\t\tchannels: decodedPlanes.map((planes) => {\n\t\t\t\t\tconst merged = new Float32Array(totalFrames);\n\t\t\t\t\tlet offset = 0;\n\t\t\t\t\tfor (const plane of planes) {\n\t\t\t\t\t\tmerged.set(plane, offset);\n\t\t\t\t\t\toffset += plane.length;\n\t\t\t\t\t}\n\t\t\t\t\treturn merged;\n\t\t\t\t}),\n\t\t\t\tsampleRate\n\t\t\t};\n\t\t} catch (err) {\n\t\t\tif (typeof process !== \"undefined\" && process.versions?.node) try {\n\t\t\t\tconst { execSync } = await import(\"node:child_process\");\n\t\t\t\tconst stdout = execSync(`ffmpeg -v error -i \"${url}\" -f f32le -ar 48000 -ac 2 pipe:1`, { maxBuffer: 100 * 1024 * 1024 });\n\t\t\t\tconst totalSamples = stdout.byteLength / 4;\n\t\t\t\tconst numFrames = totalSamples / 2;\n\t\t\t\tconst interleaved = new Float32Array(stdout.buffer, stdout.byteOffset, totalSamples);\n\t\t\t\tconst left = new Float32Array(numFrames);\n\t\t\t\tconst right = new Float32Array(numFrames);\n\t\t\t\tfor (let i = 0; i < numFrames; i++) {\n\t\t\t\t\tleft[i] = interleaved[i * 2];\n\t\t\t\t\tright[i] = interleaved[i * 2 + 1];\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tchannels: [left, right],\n\t\t\t\t\tsampleRate: 48e3\n\t\t\t\t};\n\t\t\t} catch (ffmpegErr) {\n\t\t\t\tmediaLogger.warn({ ffmpegErr }, `[AudioExtractor] ffmpeg fallback decode failed for ${url}`);\n\t\t\t}\n\t\t\tmediaLogger.error({ err }, `[AudioExtractor] Failed to decode source ${url}`);\n\t\t\treturn null;\n\t\t} finally {\n\t\t\tif (inputAcquired) inputStore.release(url);\n\t\t}\n\t} catch (err) {\n\t\tmediaLogger.error({ err }, `[AudioExtractor] Failed to decode source ${url}`);\n\t\treturn null;\n\t}\n}\n/**\n* Resamples a PCM buffer using linear interpolation to target sample rate & speed.\n*/\nasync function resampleAndStretchPCM(inputChannel, sourceSampleRate, targetSampleRate, speed, outputLength, trimOffsetSamples) {\n\tconst output = new Float32Array(outputLength);\n\tconst factor = sourceSampleRate / targetSampleRate * speed;\n\tconst YIELD_INTERVAL = 1e5;\n\tfor (let i = 0; i < outputLength; i++) {\n\t\tif (i > 0 && i % YIELD_INTERVAL === 0) await yieldToMain$1();\n\t\tconst srcIndex = trimOffsetSamples + i * factor;\n\t\tconst indexFloor = Math.floor(srcIndex);\n\t\tconst indexCeil = Math.ceil(srcIndex);\n\t\tif (indexFloor < 0) {\n\t\t\toutput[i] = 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (indexFloor >= inputChannel.length) break;\n\t\tconst weight = srcIndex - indexFloor;\n\t\tconst sampleFloor = inputChannel[indexFloor] ?? 0;\n\t\tconst val = sampleFloor + weight * ((indexCeil >= 0 && indexCeil < inputChannel.length ? inputChannel[indexCeil] ?? sampleFloor : sampleFloor) - sampleFloor);\n\t\toutput[i] = Number.isFinite(val) ? val : 0;\n\t}\n\treturn output;\n}\n/**\n* Recursively parses the VirtualMediaData tree and mixes all active audio tracks\n* into a single unified stereo PCM stream (Float32Array channels).\n*/\nasync function mixAudioTracks(virtualMedia, fps, targetSampleRate = 48e3, device, renderId) {\n\tmediaLogger.info(`[AudioExtractor] mixAudioTracks started. FPS: ${fps}, targetSampleRate: ${targetSampleRate}`);\n\tawait waitForDelayRender$1();\n\tshaderStore.registerSignalsFromComposition(renderId, virtualMedia);\n\tconst durationMs = getActiveMediaMetadata(virtualMedia)?.durationMs || 1e3;\n\tconst totalDurationSec = durationMs / 1e3;\n\tconst totalTargetSamples = Math.ceil(totalDurationSec * targetSampleRate);\n\tmediaLogger.info(`[AudioExtractor] Composition total duration: ${durationMs}ms (${totalDurationSec}s). Total mixed samples to allocate: ${totalTargetSamples}`);\n\tconst outputLeft = new Float32Array(totalTargetSamples);\n\tconst outputRight = new Float32Array(totalTargetSamples);\n\tconst mixedChannels = [outputLeft, outputRight];\n\tconst decodedCache = /* @__PURE__ */ new Map();\n\tasync function traverse(node, inheritedSeekSec, inheritedClockFrames, inheritedVolume, inheritedSpeed, inheritedDurationFrames) {\n\t\tif (!node) return null;\n\t\tconst op = node.operation;\n\t\tif (!op) {\n\t\t\tconst durationMs$1 = getActiveMediaMetadata(node)?.durationMs ?? 0;\n\t\t\tconst durationFrames = Math.round(durationMs$1 / 1e3 * fps);\n\t\t\tconst actualDurationFrames = inheritedDurationFrames !== null ? durationFrames > 0 ? Math.min(inheritedDurationFrames, durationFrames) : inheritedDurationFrames : durationFrames;\n\t\t\tconst localSamplesCount$1 = Math.ceil(actualDurationFrames / fps * targetSampleRate);\n\t\t\tif (localSamplesCount$1 <= 0) return null;\n\t\t\tconst localChannels$1 = [new Float32Array(localSamplesCount$1), new Float32Array(localSamplesCount$1)];\n\t\t\tfor (const child of node.children) {\n\t\t\t\tconst childChannels = await traverse(child, inheritedSeekSec, inheritedClockFrames, inheritedVolume, inheritedSpeed, actualDurationFrames);\n\t\t\t\tif (childChannels) {\n\t\t\t\t\tconst childOp = child.operation;\n\t\t\t\t\tconst childStartFrame = childOp?.startFrame ?? childOp?.timeline?.startFrame ?? 0;\n\t\t\t\t\tconst childStartSample = Math.round(childStartFrame / fps * targetSampleRate);\n\t\t\t\t\tfor (let c = 0; c < 2; c++) {\n\t\t\t\t\t\tconst dest = localChannels$1[c];\n\t\t\t\t\t\tconst src = childChannels[c];\n\t\t\t\t\t\tconst len = Math.min(src.length, dest.length - childStartSample);\n\t\t\t\t\t\tfor (let i = 0; i < len; i++) if (childStartSample + i >= 0) dest[childStartSample + i] += src[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn localChannels$1;\n\t\t}\n\t\tconst volume = inheritedVolume * (op.volume ?? 1) * (op.opacity === 0 ? 0 : 1) * (op.muted ? 0 : 1);\n\t\tconst speedMultiplier = inheritedSpeed;\n\t\tconst localClockFrames = inheritedClockFrames + (op.startFrame ?? op.timeline?.startFrame ?? 0);\n\t\tconst segments = op.timeline?.segments || [];\n\t\tconst nodeDurationMs = getActiveMediaMetadata(node)?.durationMs ?? 0;\n\t\tconst nodeDurationFrames = Math.round(nodeDurationMs / 1e3 * fps);\n\t\tconst nodeActualDurationFrames = inheritedDurationFrames !== null ? nodeDurationFrames > 0 ? Math.min(inheritedDurationFrames, nodeDurationFrames) : inheritedDurationFrames : nodeDurationFrames;\n\t\tconst localSamplesCount = Math.ceil(nodeActualDurationFrames / fps * targetSampleRate);\n\t\tif (localSamplesCount <= 0) return null;\n\t\tconst localLeft = new Float32Array(localSamplesCount);\n\t\tconst localRight = new Float32Array(localSamplesCount);\n\t\tconst localChannels = [localLeft, localRight];\n\t\tconst processSegment = async (seg, windowStartFrameOffset) => {\n\t\t\tconst totalSeekSec = inheritedSeekSec + (seg ? seg.startSec : 0);\n\t\t\tconst totalClockFrames = localClockFrames + windowStartFrameOffset;\n\t\t\tlet segDurationFrames = 0;\n\t\t\tif (seg) segDurationFrames = Math.max(1, Math.round(((seg.endSec ?? 0) - seg.startSec) * fps));\n\t\t\telse segDurationFrames = nodeDurationFrames;\n\t\t\tconst actualDurationFrames = inheritedDurationFrames !== null ? Math.min(inheritedDurationFrames, segDurationFrames) : segDurationFrames;\n\t\t\tconst segmentStartSample = Math.round(windowStartFrameOffset / fps * targetSampleRate);\n\t\t\tif (op.op === \"source\") {\n\t\t\t\tconst mediaType = getMediaType(node);\n\t\t\t\tconst params = computeRenderParams(node);\n\t\t\t\tif (params.sourceUrl && (mediaType === \"Audio\" || mediaType === \"Video\") && volume > 0) {\n\t\t\t\t\tconst finalSpeed = Math.max(.5, speedMultiplier * (Number(params.speed) || 1));\n\t\t\t\t\tconst effectiveTrimSec = Math.max(0, (Number(params.trimStartSec) || 0) + totalSeekSec);\n\t\t\t\t\tlet decoded = decodedCache.get(params.sourceUrl);\n\t\t\t\t\tif (decoded === void 0) {\n\t\t\t\t\t\tdecoded = await decodeAudioSource(params.sourceUrl);\n\t\t\t\t\t\tdecodedCache.set(params.sourceUrl, decoded);\n\t\t\t\t\t}\n\t\t\t\t\tif (decoded) {\n\t\t\t\t\t\tconst clipDurationSec = actualDurationFrames / fps;\n\t\t\t\t\t\tconst clipSamplesCount = Math.min(localSamplesCount - segmentStartSample, Math.ceil(clipDurationSec * targetSampleRate));\n\t\t\t\t\t\tif (clipSamplesCount > 0 && segmentStartSample < localSamplesCount) {\n\t\t\t\t\t\t\tconst trimOffsetSamples = Math.round(effectiveTrimSec * decoded.sampleRate);\n\t\t\t\t\t\t\tconst srcLeft = decoded.channels[0];\n\t\t\t\t\t\t\tconst srcRight = decoded.channels.length > 1 ? decoded.channels[1] : decoded.channels[0];\n\t\t\t\t\t\t\tconst stretchedLeft = await resampleAndStretchPCM(srcLeft, decoded.sampleRate, targetSampleRate, finalSpeed, clipSamplesCount, trimOffsetSamples);\n\t\t\t\t\t\t\tconst stretchedRight = await resampleAndStretchPCM(srcRight, decoded.sampleRate, targetSampleRate, finalSpeed, clipSamplesCount, trimOffsetSamples);\n\t\t\t\t\t\t\tfor (let i = 0; i < clipSamplesCount; i++) {\n\t\t\t\t\t\t\t\tconst outIndex = segmentStartSample + i;\n\t\t\t\t\t\t\t\tlocalLeft[outIndex] += stretchedLeft[i] * volume;\n\t\t\t\t\t\t\t\tlocalRight[outIndex] += stretchedRight[i] * volume;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tawait yieldToMain$1();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (node.children) for (const child of node.children) {\n\t\t\t\tconst childChannels = await traverse(child, totalSeekSec, totalClockFrames, volume, speedMultiplier, actualDurationFrames);\n\t\t\t\tif (childChannels) {\n\t\t\t\t\tconst childOp = child.operation;\n\t\t\t\t\tconst childStartFrame = childOp?.startFrame ?? childOp?.timeline?.startFrame ?? 0;\n\t\t\t\t\tconst destStartSample = segmentStartSample + Math.round(childStartFrame / fps * targetSampleRate);\n\t\t\t\t\tfor (let c = 0; c < 2; c++) {\n\t\t\t\t\t\tconst dest = localChannels[c];\n\t\t\t\t\t\tconst src = childChannels[c];\n\t\t\t\t\t\tconst len = Math.min(src.length, dest.length - destStartSample);\n\t\t\t\t\t\tfor (let i = 0; i < len; i++) if (destStartSample + i >= 0) dest[destStartSample + i] += src[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst pluginProcessor = audioRegistry.get(op.op);\n\t\t\tif (pluginProcessor) try {\n\t\t\t\tconst clipDurationSec = actualDurationFrames / fps;\n\t\t\t\tconst clipSamplesCount = Math.min(localSamplesCount - segmentStartSample, Math.ceil(clipDurationSec * targetSampleRate));\n\t\t\t\tif (clipSamplesCount > 0 && segmentStartSample < localSamplesCount && segmentStartSample >= 0) await pluginProcessor(localChannels.map((ch) => ch.subarray(segmentStartSample, segmentStartSample + clipSamplesCount)), targetSampleRate, node, {\n\t\t\t\t\tdevice,\n\t\t\t\t\tframe: totalClockFrames,\n\t\t\t\t\tfps,\n\t\t\t\t\trenderId,\n\t\t\t\t\telapsedMs: (totalClockFrames / fps + totalSeekSec) * 1e3,\n\t\t\t\t\tdurationMs: getActiveMediaMetadata(node)?.durationMs ?? void 0\n\t\t\t\t});\n\t\t\t} catch (pluginErr) {\n\t\t\t\tmediaLogger.error({ err: pluginErr }, `[AudioExtractor] Custom plugin for operation '${op.op}' failed`);\n\t\t\t}\n\t\t};\n\t\tif (segments.length > 0) {\n\t\t\tlet currentStart = 0;\n\t\t\tfor (const seg of segments) {\n\t\t\t\tconst durSec = (seg.endSec ?? 0) - seg.startSec;\n\t\t\t\tconst durFrames = Math.max(1, Math.round(durSec * fps));\n\t\t\t\tawait processSegment(seg, currentStart);\n\t\t\t\tcurrentStart += durFrames;\n\t\t\t}\n\t\t} else await processSegment(null, 0);\n\t\treturn localChannels;\n\t}\n\tconst rootChannels = await traverse(normalizeTimeline(virtualMedia, fps), 0, 0, 1, 1, null);\n\tif (rootChannels) for (let c = 0; c < 2; c++) {\n\t\tconst dest = mixedChannels[c];\n\t\tconst src = rootChannels[c];\n\t\tconst len = Math.min(src.length, dest.length);\n\t\tfor (let i = 0; i < len; i++) dest[i] = src[i];\n\t}\n\tdecodedCache.clear();\n\tlet mixPeak = 0;\n\tfor (let i = 0; i < totalTargetSamples; i++) {\n\t\tconst l = Math.abs(outputLeft[i] ?? 0);\n\t\tconst r = Math.abs(outputRight[i] ?? 0);\n\t\tif (l > mixPeak) mixPeak = l;\n\t\tif (r > mixPeak) mixPeak = r;\n\t}\n\tconst autoGain = mixPeak > .95 ? .92 / mixPeak : 1;\n\tfor (let i = 0; i < totalTargetSamples; i++) {\n\t\tconst l = (outputLeft[i] ?? 0) * autoGain;\n\t\tconst r = (outputRight[i] ?? 0) * autoGain;\n\t\toutputLeft[i] = Number.isFinite(l) ? Math.tanh(l) : 0;\n\t\toutputRight[i] = Number.isFinite(r) ? Math.tanh(r) : 0;\n\t}\n\treturn {\n\t\tchannels: mixedChannels,\n\t\tsampleRate: targetSampleRate\n\t};\n}\n\n//#endregion\n//#region src/compositions/timeline-context.tsx\nconst RenderTimelineContext = createContext({\n\taccumulatedSeekOffsetSec: 0,\n\taccumulatedClockOffsetSec: 0\n});\nconst RenderTimelineProvider = RenderTimelineContext.Provider;\nconst useRenderTimeline = () => useContext(RenderTimelineContext);\n\n//#endregion\n//#region src/compositions/scene.tsx\nconst AudioProcessorContext = React.createContext({ processors: [] });\nlet globalAudioCtx = null;\nconst getGlobalAudioContext = () => {\n\tif (typeof window === \"undefined\") return null;\n\tif (!globalAudioCtx) globalAudioCtx = new (window.AudioContext || window.webkitAudioContext)();\n\treturn globalAudioCtx;\n};\nconst NativeAudioClip = ({ sourceUrl, renderId, clipId, frame, fps, playbackRate, volume, startFrame, trimStartSec }) => {\n\tconst isPlaying = useCompositionState(renderId).isPlaying;\n\tconst activeProcessors = React.useContext(AudioProcessorContext);\n\tconst activeProcessorsRef = useRef(activeProcessors);\n\tactiveProcessorsRef.current = activeProcessors;\n\tconst { accumulatedSeekOffsetSec } = useRenderTimeline();\n\tconst accumulatedSeekOffsetSecRef = useRef(accumulatedSeekOffsetSec);\n\taccumulatedSeekOffsetSecRef.current = accumulatedSeekOffsetSec;\n\tconst audioCtx = getGlobalAudioContext();\n\tconst decoderRef = useRef(null);\n\tconst isPlayingRef = useRef(isPlaying);\n\tisPlayingRef.current = isPlaying;\n\tconst activeNodesRef = useRef(/* @__PURE__ */ new Set());\n\tconst gainNodeRef = useRef(null);\n\tconst currentGeneratorRef = useRef(null);\n\tconst nextScheduleTimeRef = useRef(0);\n\tconst lastStartFrameRef = useRef(null);\n\tconst playbackStartTimeRef = useRef(null);\n\tconst playbackStartFrameRef = useRef(0);\n\tconst lastTrimStartSecRef = useRef(null);\n\tconst lastStartFramePropRef = useRef(null);\n\tconst lastPlaybackRateRef = useRef(null);\n\tuseEffect(() => {\n\t\tif (!audioCtx) return;\n\t\tconst gainNode = audioCtx.createGain();\n\t\tgainNode.gain.setValueAtTime(volume, audioCtx.currentTime);\n\t\tgainNode.connect(audioCtx.destination);\n\t\tgainNodeRef.current = gainNode;\n\t\treturn () => {\n\t\t\tgainNode.disconnect();\n\t\t\tgainNodeRef.current = null;\n\t\t};\n\t}, [audioCtx]);\n\tuseEffect(() => {\n\t\tif (gainNodeRef.current && audioCtx) gainNodeRef.current.gain.setValueAtTime(volume, audioCtx.currentTime);\n\t}, [volume, audioCtx]);\n\tuseEffect(() => {\n\t\tconst decoderKey = clipId || renderId;\n\t\tdecoderRef.current = mediaDecoderCache.getAudio(sourceUrl, decoderKey);\n\t\tif (isPlayingRef.current) startPlayback(frame);\n\t\treturn () => {\n\t\t\tstopAllNodes();\n\t\t\tdecoderRef.current = null;\n\t\t};\n\t}, [\n\t\tsourceUrl,\n\t\trenderId,\n\t\tclipId\n\t]);\n\tconst stopAllNodes = () => {\n\t\tactiveNodesRef.current.forEach((node) => {\n\t\t\ttry {\n\t\t\t\tnode.stop();\n\t\t\t} catch (_) {}\n\t\t\ttry {\n\t\t\t\tnode.disconnect();\n\t\t\t} catch (_) {}\n\t\t});\n\t\tactiveNodesRef.current.clear();\n\t\tcurrentGeneratorRef.current = null;\n\t\tplaybackStartTimeRef.current = null;\n\t};\n\tconst startPlayback = async (targetFrame) => {\n\t\tstopAllNodes();\n\t\tconst decoder = decoderRef.current;\n\t\tconst audioCtx$1 = getGlobalAudioContext();\n\t\tconst gainNode = gainNodeRef.current;\n\t\tif (!decoder || !audioCtx$1 || !gainNode) return;\n\t\tif (audioCtx$1.state === \"suspended\") await audioCtx$1.resume();\n\t\tconst mediaTimeSec = (targetFrame - startFrame) / fps * playbackRate + trimStartSec;\n\t\tconst startTimestamp = Math.max(0, mediaTimeSec);\n\t\tconst generator = decoder.getBuffers(startTimestamp);\n\t\tcurrentGeneratorRef.current = generator;\n\t\tnextScheduleTimeRef.current = audioCtx$1.currentTime + .15;\n\t\tlastStartFrameRef.current = targetFrame;\n\t\tlastTrimStartSecRef.current = trimStartSec;\n\t\tlastStartFramePropRef.current = startFrame;\n\t\tlastPlaybackRateRef.current = playbackRate;\n\t\tconst scheduleLoop = async () => {\n\t\t\ttry {\n\t\t\t\tfor await (const wrapped of generator) {\n\t\t\t\t\tif (!isPlayingRef.current || currentGeneratorRef.current !== generator) break;\n\t\t\t\t\tif (playbackStartTimeRef.current === null) {\n\t\t\t\t\t\tplaybackStartTimeRef.current = audioCtx$1.currentTime + .15;\n\t\t\t\t\t\tnextScheduleTimeRef.current = audioCtx$1.currentTime + .15;\n\t\t\t\t\t\tplaybackStartFrameRef.current = targetFrame;\n\t\t\t\t\t}\n\t\t\t\t\tconst scheduledTime = nextScheduleTimeRef.current;\n\t\t\t\t\tconst durationSec = wrapped.duration / playbackRate;\n\t\t\t\t\tconst buffer = wrapped.buffer;\n\t\t\t\t\tlet finalBuffer = buffer;\n\t\t\t\t\tif (buffer.numberOfChannels === 1) {\n\t\t\t\t\t\tconst stereoBuffer = audioCtx$1.createBuffer(2, buffer.length, buffer.sampleRate);\n\t\t\t\t\t\tconst monoData = buffer.getChannelData(0);\n\t\t\t\t\t\tstereoBuffer.getChannelData(0).set(monoData);\n\t\t\t\t\t\tstereoBuffer.getChannelData(1).set(monoData);\n\t\t\t\t\t\tfinalBuffer = stereoBuffer;\n\t\t\t\t\t}\n\t\t\t\t\tconst channels = [];\n\t\t\t\t\tfor (let c = 0; c < finalBuffer.numberOfChannels; c++) channels.push(finalBuffer.getChannelData(c));\n\t\t\t\t\tconst device = getDevice();\n\t\t\t\t\tconst elapsedSec = Math.max(0, scheduledTime - (playbackStartTimeRef.current ?? scheduledTime));\n\t\t\t\t\tconst chunkFrame = playbackStartFrameRef.current + elapsedSec * fps / playbackRate;\n\t\t\t\t\tfor (const procInfo of activeProcessorsRef.current.processors) {\n\t\t\t\t\t\tconst proc = audioRegistry.get(procInfo.opType);\n\t\t\t\t\t\tif (proc) {\n\t\t\t\t\t\t\tconst elapsedMs = (chunkFrame + accumulatedSeekOffsetSecRef.current * fps - (procInfo.virtualMedia.operation?.startFrame ?? 0)) / fps * 1e3;\n\t\t\t\t\t\t\tconst durationMs = getActiveMediaMetadata(procInfo.virtualMedia)?.durationMs ?? 0;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait proc(channels, finalBuffer.sampleRate, procInfo.virtualMedia, {\n\t\t\t\t\t\t\t\t\tdevice,\n\t\t\t\t\t\t\t\t\tframe: chunkFrame + accumulatedSeekOffsetSecRef.current * fps,\n\t\t\t\t\t\t\t\t\tfps,\n\t\t\t\t\t\t\t\t\telapsedMs,\n\t\t\t\t\t\t\t\t\tdurationMs\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tconsole.error(`Error in audio plugin ${procInfo.opType}:`, err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst sourceNode = audioCtx$1.createBufferSource();\n\t\t\t\t\tsourceNode.buffer = finalBuffer;\n\t\t\t\t\tsourceNode.playbackRate.value = playbackRate;\n\t\t\t\t\tsourceNode.connect(gainNode);\n\t\t\t\t\tconst now = audioCtx$1.currentTime;\n\t\t\t\t\tconst playTime = Math.max(now + .02, scheduledTime);\n\t\t\t\t\tsourceNode.start(playTime);\n\t\t\t\t\tactiveNodesRef.current.add(sourceNode);\n\t\t\t\t\tsourceNode.onended = () => {\n\t\t\t\t\t\tactiveNodesRef.current.delete(sourceNode);\n\t\t\t\t\t};\n\t\t\t\t\tnextScheduleTimeRef.current = playTime + durationSec;\n\t\t\t\t\twhile (nextScheduleTimeRef.current - audioCtx$1.currentTime > .4) {\n\t\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, 50));\n\t\t\t\t\t\tif (!isPlayingRef.current || currentGeneratorRef.current !== generator) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(\"NativeAudioClip scheduleLoop error:\", e);\n\t\t\t}\n\t\t};\n\t\tscheduleLoop();\n\t};\n\tuseEffect(() => {\n\t\tif (!decoderRef.current || !audioCtx) return;\n\t\tconst decoderKey = clipId || renderId;\n\t\tdecoderRef.current = mediaDecoderCache.getAudio(sourceUrl, decoderKey);\n\t\tif (isPlaying) {\n\t\t\tconst elapsedSec = Math.max(0, audioCtx.currentTime - (playbackStartTimeRef.current ?? audioCtx.currentTime));\n\t\t\tconst expectedFrame = playbackStartFrameRef.current + elapsedSec * fps / playbackRate;\n\t\t\tconst hasSeekedWhilePlaying = playbackStartTimeRef.current !== null && Math.abs(frame - expectedFrame) > 15;\n\t\t\tconst hasParamsChanged = lastTrimStartSecRef.current !== trimStartSec || lastStartFramePropRef.current !== startFrame || lastPlaybackRateRef.current !== playbackRate;\n\t\t\tif (currentGeneratorRef.current === null || hasSeekedWhilePlaying || hasParamsChanged) startPlayback(frame);\n\t\t} else {\n\t\t\tstopAllNodes();\n\t\t\tplaybackStartTimeRef.current = null;\n\t\t\tlastStartFrameRef.current = null;\n\t\t}\n\t}, [\n\t\tisPlaying,\n\t\tframe,\n\t\tfps,\n\t\tplaybackRate,\n\t\ttrimStartSec,\n\t\tstartFrame\n\t]);\n\treturn null;\n};\nconst AudioCompositionClip = (props) => {\n\tconst { renderId, rootRenderId = props.renderId, virtualMedia: rawVirtualMedia, volume = 1, playbackRateOverride, trimStartOverride, trimEndOverride: _trimEndOverride } = props;\n\tconst rawFrame = props.frame;\n\tlet fps = props.fps;\n\tif (!fps) {\n\t\tconsole.warn(\"FPS is missing or smaller than 1. Defaulting to 24.\");\n\t\tfps = 24;\n\t}\n\tconst { virtualMedia } = React.useMemo(() => {\n\t\treturn { virtualMedia: normalizeTimeline(rawVirtualMedia, fps) };\n\t}, [rawVirtualMedia, fps]);\n\tconst state = useCompositionState(renderId);\n\tconst frame = rawFrame ?? state.frame;\n\tconst op = virtualMedia?.operation;\n\tconst parentAudioContext = React.useContext(AudioProcessorContext);\n\tconst activeProcessors = React.useMemo(() => {\n\t\tif (op && audioRegistry.get(op.op) !== null && op) return { processors: [{\n\t\t\topType: op.op,\n\t\t\tvirtualMedia\n\t\t}, ...parentAudioContext.processors] };\n\t\treturn parentAudioContext;\n\t}, [\n\t\tparentAudioContext,\n\t\top,\n\t\tvirtualMedia\n\t]);\n\tif (!op) return null;\n\tconst effectiveVolume = volume * (op.volume ?? 1);\n\tconst nodeStartFrame = op.startFrame ?? op.timeline?.startFrame ?? 0;\n\tconst localFrame = frame - nodeStartFrame;\n\tconst segments = op.timeline?.segments || [];\n\tconst { accumulatedSeekOffsetSec: inheritedSeekOffset, accumulatedClockOffsetSec: inheritedClockOffset } = useRenderTimeline();\n\tconst renderSegmentInstance = (seg, windowStartFrame, instanceId) => {\n\t\tconst segmentSeekOffset = seg ? seg.startSec : 0;\n\t\tconst segmentLocalFrame = localFrame - windowStartFrame;\n\t\tconst renderChild = (childVirtualMedia, overrideProps = {}) => {\n\t\t\tconst childId = overrideProps.renderId || `${instanceId}-child`;\n\t\t\tif (!childVirtualMedia) return null;\n\t\t\tconst childOp = childVirtualMedia.operation;\n\t\t\tconst childStartFrame = childOp?.startFrame ?? childOp?.timeline?.startFrame ?? 0;\n\t\t\tconst childDurationMs = getActiveMediaMetadata(childVirtualMedia)?.durationMs ?? 0;\n\t\t\tconst childDurationFrames = childDurationMs > 0 ? Math.round(childDurationMs / 1e3 * fps) : null;\n\t\t\tconst currentFrame = segmentLocalFrame + Math.round(segmentSeekOffset * (fps || 30));\n\t\t\tif (currentFrame < childStartFrame) return null;\n\t\t\tif (childDurationFrames !== null && currentFrame >= childStartFrame + childDurationFrames) return null;\n\t\t\treturn /* @__PURE__ */ jsx(AudioCompositionClip, {\n\t\t\t\t...props,\n\t\t\t\t...overrideProps,\n\t\t\t\tframe: overrideProps.frame ?? currentFrame,\n\t\t\t\tfps: overrideProps.fps ?? fps,\n\t\t\t\trenderId: childId,\n\t\t\t\trootRenderId,\n\t\t\t\tvirtualMedia: childVirtualMedia,\n\t\t\t\trenderingContext: overrideProps.renderingContext ?? \"audio\",\n\t\t\t\tvolume: overrideProps.volume ?? effectiveVolume\n\t\t\t});\n\t\t};\n\t\tconst accumulatedSeekOffsetSec = op.op === \"Compositor\" ? 0 : inheritedSeekOffset + segmentSeekOffset;\n\t\tconst accumulatedClockOffsetSec = inheritedClockOffset + windowStartFrame / (fps || 30);\n\t\tconst totalEffectiveFrame = localFrame;\n\t\tconst renderContent = () => {\n\t\t\tif (!seg) {\n\t\t\t\tconst durationMs = getActiveMediaMetadata(virtualMedia)?.durationMs ?? 0;\n\t\t\t\tconst durationFrames = Math.round(durationMs / 1e3 * fps);\n\t\t\t\tif (totalEffectiveFrame < 0 || totalEffectiveFrame >= durationFrames) return null;\n\t\t\t} else {\n\t\t\t\tconst durSec = (seg.endSec ?? 0) - seg.startSec;\n\t\t\t\tconst durFrames = Math.max(1, Math.round(durSec * fps));\n\t\t\t\tif (totalEffectiveFrame < windowStartFrame || totalEffectiveFrame >= windowStartFrame + durFrames) return null;\n\t\t\t}\n\t\t\tif (op.op === \"source\") {\n\t\t\t\tconst mediaType = getMediaType(virtualMedia);\n\t\t\t\tconst params = computeRenderParams(virtualMedia);\n\t\t\t\tif (!params.sourceUrl) return null;\n\t\t\t\tconst finalPlaybackRate = Math.max(.01, (Number(playbackRateOverride) || 1) * (Number(params.speed) || 1));\n\t\t\t\tconst effectiveTrimSec = Math.max(0, (Number(trimStartOverride) || 0) + (Number(params.trimStartSec) || 0) + accumulatedSeekOffsetSec);\n\t\t\t\tif (mediaType === \"Audio\" || mediaType === \"Video\") return /* @__PURE__ */ jsx(NativeAudioClip, {\n\t\t\t\t\tsourceUrl: params.sourceUrl,\n\t\t\t\t\trenderId: rootRenderId,\n\t\t\t\t\tclipId: instanceId,\n\t\t\t\t\tframe: frame - Math.round(accumulatedSeekOffsetSec * (fps || 30)),\n\t\t\t\t\tfps,\n\t\t\t\t\tplaybackRate: finalPlaybackRate,\n\t\t\t\t\tvolume: effectiveVolume * (op.opacity === 0 ? 0 : 1),\n\t\t\t\t\tstartFrame: nodeStartFrame,\n\t\t\t\t\ttrimStartSec: effectiveTrimSec\n\t\t\t\t});\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif (virtualMedia.children && virtualMedia.children.length > 0) return /* @__PURE__ */ jsx(Fragment, { children: virtualMedia.children.map((child, index) => /* @__PURE__ */ jsx(React.Fragment, { children: renderChild?.(child, { renderId: `${instanceId}-c${index}` }) }, index)) });\n\t\t\treturn null;\n\t\t};\n\t\treturn /* @__PURE__ */ jsx(RenderTimelineProvider, {\n\t\t\tvalue: {\n\t\t\t\taccumulatedSeekOffsetSec,\n\t\t\t\taccumulatedClockOffsetSec\n\t\t\t},\n\t\t\tchildren: renderContent()\n\t\t});\n\t};\n\tif (segments.length > 0) {\n\t\tlet activeSeg = null;\n\t\tlet windowStartFrame = 0;\n\t\tlet currentStart = 0;\n\t\tfor (const seg of segments) {\n\t\t\tconst durSec = (seg.endSec ?? 0) - seg.startSec;\n\t\t\tconst durFrames = Math.max(1, Math.round(durSec * fps));\n\t\t\tconst start = currentStart;\n\t\t\tcurrentStart += durFrames;\n\t\t\tif (localFrame >= start && localFrame < start + durFrames) {\n\t\t\t\tactiveSeg = seg;\n\t\t\t\twindowStartFrame = start;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!activeSeg) return null;\n\t\treturn /* @__PURE__ */ jsx(AudioProcessorContext.Provider, {\n\t\t\tvalue: activeProcessors,\n\t\t\tchildren: renderSegmentInstance(activeSeg, windowStartFrame, `${renderId}-active-seg`)\n\t\t});\n\t}\n\treturn /* @__PURE__ */ jsx(AudioProcessorContext.Provider, {\n\t\tvalue: activeProcessors,\n\t\tchildren: renderSegmentInstance(null, 0, renderId)\n\t});\n};\nconst DEFAULT_STATE = {\n\tframe: 0,\n\tfps: 30,\n\tisPlaying: false\n};\nvar CompositionStateStore = class {\n\tstates = /* @__PURE__ */ new Map();\n\tlisteners = /* @__PURE__ */ new Map();\n\tsetState(key, frame, fps, isPlaying) {\n\t\tconst current = this.states.get(key);\n\t\tconst resolvedPlaying = isPlaying !== void 0 ? isPlaying : current?.isPlaying ?? false;\n\t\tif (current?.frame === frame && current?.fps === fps && current?.isPlaying === resolvedPlaying) return;\n\t\tthis.states.set(key, {\n\t\t\tframe,\n\t\t\tfps,\n\t\t\tisPlaying: resolvedPlaying\n\t\t});\n\t\tthis.notify(key);\n\t}\n\tgetState(key) {\n\t\tif (this.states.has(key)) return this.states.get(key);\n\t\tfor (const [storeKey, value] of this.states.entries()) if (key.startsWith(storeKey)) return value;\n\t\treturn DEFAULT_STATE;\n\t}\n\tsubscribe(key, listener) {\n\t\tif (!this.listeners.has(key)) this.listeners.set(key, /* @__PURE__ */ new Set());\n\t\tthis.listeners.get(key).add(listener);\n\t\treturn () => {\n\t\t\tconst set = this.listeners.get(key);\n\t\t\tset?.delete(listener);\n\t\t\tif (set?.size === 0) {\n\t\t\t\tthis.listeners.delete(key);\n\t\t\t\tthis.states.delete(key);\n\t\t\t}\n\t\t};\n\t}\n\tclearKey(key) {\n\t\tthis.states.delete(key);\n\t}\n\tnotify(key) {\n\t\tfor (const [listenerKey, set] of this.listeners.entries()) if (listenerKey === key || listenerKey.startsWith(key)) set.forEach((l) => l());\n\t}\n};\nconst compositionStateStore = new CompositionStateStore();\nconst useCompositionState = (renderId) => {\n\tif (typeof globalThis !== \"undefined\" && globalThis.__IS_HEADLESS_RENDERER__ === true) return compositionStateStore.getState(renderId);\n\treturn useSyncExternalStore(useCallback((onStoreChange) => compositionStateStore.subscribe(renderId, onStoreChange), [renderId]), () => compositionStateStore.getState(renderId), () => DEFAULT_STATE);\n};\nconst noopRenderChild = () => null;\nconst CompositionSceneInner = ({ viewportWidth, viewportHeight, virtualMedia, type, backgroundColor = \"#00000000\", renderId: propRenderId, frame: propFrame, fps: propFps, ...props }) => {\n\tconst containerRef = useRef(null);\n\tconst sceneId = useId();\n\tconst finalRenderId = propRenderId || `${sceneId}-root-virtual-media`;\n\tconst state = useCompositionState(finalRenderId);\n\tconst fps = propFps ?? state.fps ?? 24;\n\tconst frame = propFrame ?? state.frame ?? 0;\n\tconst isPlaying = state.isPlaying ?? false;\n\tconst resolvedViewportW = viewportWidth || 1080;\n\tconst resolvedViewportH = viewportHeight || 1080;\n\tconst hasAudio = virtualMedia?.operation.dataType === \"Audio\" || virtualMedia?.operation.dataType === \"Video\";\n\tconst renderContent = () => {\n\t\tif (type === \"Audio\") return /* @__PURE__ */ jsx(Fragment, { children: virtualMedia && hasAudio && /* @__PURE__ */ jsx(AudioCompositionClip, {\n\t\t\trenderId: finalRenderId,\n\t\t\tvirtualMedia,\n\t\t\trenderingContext: \"audio\",\n\t\t\tfps,\n\t\t\tframe,\n\t\t\tvolume: props.volume\n\t\t}) });\n\t\treturn /* @__PURE__ */ jsxs(Fragment, { children: [virtualMedia && hasAudio && /* @__PURE__ */ jsx(AudioCompositionClip, {\n\t\t\trenderId: finalRenderId,\n\t\t\tvirtualMedia,\n\t\t\trenderingContext: \"audio\",\n\t\t\tfps,\n\t\t\tframe,\n\t\t\tvolume: props.volume\n\t\t}), /* @__PURE__ */ jsx(\"div\", {\n\t\t\tstyle: {\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: \"100%\",\n\t\t\t\tposition: \"relative\"\n\t\t\t},\n\t\t\tref: containerRef,\n\t\t\tchildren: virtualMedia && virtualMedia.operation.dataType !== \"Audio\" && /* @__PURE__ */ jsx(RenderProvider, {\n\t\t\t\twidth: resolvedViewportW,\n\t\t\t\theight: resolvedViewportH,\n\t\t\t\tchildren: /* @__PURE__ */ jsx(CanvasComposition, {\n\t\t\t\t\trenderChild: noopRenderChild,\n\t\t\t\t\trenderId: finalRenderId,\n\t\t\t\t\tvirtualMedia,\n\t\t\t\t\tcontainerWidth: resolvedViewportW,\n\t\t\t\t\tcontainerHeight: resolvedViewportH,\n\t\t\t\t\tframe,\n\t\t\t\t\tfps,\n\t\t\t\t\tisPlaying\n\t\t\t\t})\n\t\t\t})\n\t\t})] });\n\t};\n\treturn /* @__PURE__ */ jsx(PlaybackProvider, {\n\t\tvalue: {\n\t\t\tframe,\n\t\t\tfps,\n\t\t\tisPlaying\n\t\t},\n\t\tchildren: renderContent()\n\t});\n};\nconst CompositionScene = (props) => {\n\treturn /* @__PURE__ */ jsx(CompositionSceneInner, { ...props });\n};\n\n//#endregion\n//#region src/compositions/canvas-composition.tsx\nconst segmentRangeCache = /* @__PURE__ */ new WeakMap();\nfunction getCachedSegmentRanges(segments, fps) {\n\tconst cached = segmentRangeCache.get(segments);\n\tif (cached && cached.fps === fps) return cached.ranges;\n\tlet currentStart = 0;\n\tconst ranges = segments.map((seg) => {\n\t\tconst durSec = (seg.endSec ?? 0) - seg.startSec;\n\t\tconst durFrames = Math.max(1, Math.round(durSec * fps));\n\t\tconst start = currentStart;\n\t\tcurrentStart += durFrames;\n\t\treturn {\n\t\t\tseg,\n\t\t\tstart,\n\t\t\tduration: durFrames\n\t\t};\n\t});\n\tsegmentRangeCache.set(segments, {\n\t\tfps,\n\t\tranges\n\t});\n\treturn ranges;\n}\nconst frameCtxPool = [];\nfunction acquireFrameContext() {\n\treturn frameCtxPool.pop() ?? {};\n}\n/**\n* Effect operations carry every config field as a signal. Hand node renderers\n* the plain value for this frame (nested objects/arrays included), keeping only\n* GPU-bound signals intact since those are consumed as textures.\n*/\nfunction resolveSignalOperation(virtualMedia, frameCtx) {\n\tconst op = virtualMedia.operation;\n\tconst resolved = { ...op };\n\tfor (const [key, sig] of Object.entries(op.signals)) if (isSignal(sig) && !sig.gpuBinding) resolved[key] = sig.get(frameCtx);\n\treturn {\n\t\t...virtualMedia,\n\t\toperation: resolved\n\t};\n}\nasync function drawCompositionTree(ctx, encoder, targetView, targetTexture, targetWidth, targetHeight, virtualMedia, props, inheritedSeekOffset = 0, inheritedClockOffset = 0) {\n\tconst fps = props.fps ?? 24;\n\tconst op = virtualMedia.operation;\n\tif (!op) return;\n\tconst isCompositor = op.op === \"Compositor\";\n\tconst frame = props.frame ?? 0;\n\tconst segments = op.timeline?.segments || [];\n\tconst localFrame = frame - (op.startFrame ?? op.timeline?.startFrame ?? 0);\n\tconst isTimelineProvider = op.timeline !== void 0 || op.startFrame !== void 0 || op.op === \"compose\";\n\tconst resolvedDurationMs = isTimelineProvider ? getActiveMediaMetadata(virtualMedia)?.durationMs ?? props.durationMs ?? void 0 : props.durationMs ?? getActiveMediaMetadata(virtualMedia)?.durationMs ?? void 0;\n\tif (!(op.op === \"source\" || op.op === \"text\" || op.op === \"caption\")) updateClockSignals(frame, fps, resolvedDurationMs);\n\tconst frameCtx = acquireFrameContext();\n\tframeCtx.frame = frame;\n\tframeCtx.fps = fps;\n\tframeCtx.time = fps > 0 ? frame / fps : 0;\n\tframeCtx.duration = (resolvedDurationMs ?? 0) / 1e3;\n\tframeCtx.durationMs = resolvedDurationMs ?? 0;\n\tframeCtx.progress = resolvedDurationMs && resolvedDurationMs > 0 ? Math.max(0, Math.min(1, frame / fps * 1e3 / resolvedDurationMs)) : 0;\n\tframeCtx.deltaTime = fps > 0 ? 1 / fps : 0;\n\tconst resolvedElapsedMs = isTimelineProvider ? (localFrame !== void 0 && fps !== void 0 ? localFrame / fps * 1e3 : void 0) ?? props.elapsedMs : props.elapsedMs ?? (localFrame !== void 0 && fps !== void 0 ? localFrame / fps * 1e3 : void 0);\n\tconst effectiveLocalFrame = localFrame + Math.round(inheritedSeekOffset * fps);\n\tlet activeSeg = null;\n\tlet windowStartFrame = 0;\n\tif (segments.length > 0) {\n\t\tconst active = getCachedSegmentRanges(segments, fps).find(({ start, duration }) => effectiveLocalFrame >= start && effectiveLocalFrame < start + duration);\n\t\tif (active) {\n\t\t\tactiveSeg = active.seg;\n\t\t\twindowStartFrame = active.start;\n\t\t} else return;\n\t}\n\tconst segmentLocalFrame = localFrame - windowStartFrame;\n\tconst accumulatedSeekOffsetSec = inheritedSeekOffset + (activeSeg ? activeSeg.startSec - windowStartFrame / fps : 0);\n\tconst accumulatedClockOffsetSec = inheritedClockOffset + windowStartFrame / fps;\n\tif (typeof op.onRequestFrame === \"function\") op.onRequestFrame(frameCtx);\n\telse if (op.effect && typeof op.effect.notifyFrame === \"function\") op.effect.notifyFrame(frameCtx);\n\tconst CustomRenderer = webgpuRegistry.get(op.op);\n\tif (CustomRenderer) {\n\t\tif (op.signals) virtualMedia = resolveSignalOperation(virtualMedia, frameCtx);\n\t\tconst inputs = op?.inputs;\n\t\tif (inputs) {\n\t\t\tfor (const entry of Object.values(inputs)) if (entry?.connectionValid && entry?.outputItem?.type === \"LUT\") {\n\t\t\t\tconst lutVirtualMedia = entry.outputItem.data;\n\t\t\t\tif (lutVirtualMedia && typeof lutVirtualMedia === \"object\" && lutVirtualMedia.operation) {\n\t\t\t\t\tconst lutW = lutVirtualMedia.metadata?.width ?? targetWidth;\n\t\t\t\t\tconst lutH = lutVirtualMedia.metadata?.height ?? targetHeight;\n\t\t\t\t\tconst dummyTex = ctx.renderer.getTemporaryTexture(lutW, lutH);\n\t\t\t\t\tawait drawCompositionTree(ctx, encoder, dummyTex.createView(), dummyTex, lutW, lutH, lutVirtualMedia, {\n\t\t\t\t\t\t...props,\n\t\t\t\t\t\tvirtualMedia: lutVirtualMedia\n\t\t\t\t\t}, accumulatedSeekOffsetSec, accumulatedClockOffsetSec);\n\t\t\t\t}\n\t\t\t} else if (entry?.connectionValid && entry?.outputItem?.type === \"Signal\") {\n\t\t\t\tconst sigData = entry.outputItem.data;\n\t\t\t\tif (sigData && typeof sigData === \"object\") await signalRegistry.ensureAudioSourcesExtracted(ctx.device, sigData.signalConfig ?? sigData, fps, props.renderId);\n\t\t\t}\n\t\t}\n\t\tconst pass = ctx.renderer.beginFrame(encoder, targetView, {\n\t\t\tr: 0,\n\t\t\tg: 0,\n\t\t\tb: 0,\n\t\t\ta: 0\n\t\t}, targetWidth, targetHeight, \"load\");\n\t\tlet passEnded = false;\n\t\tconst originalEnd = pass.end.bind(pass);\n\t\tpass.end = () => {\n\t\t\tif (!passEnded) {\n\t\t\t\toriginalEnd();\n\t\t\t\tpassEnded = true;\n\t\t\t}\n\t\t};\n\t\tconst renderArgs = {\n\t\t\tctx,\n\t\t\tencoder,\n\t\t\tpass,\n\t\t\ttargetView,\n\t\t\ttargetTexture,\n\t\t\ttargetWidth,\n\t\t\ttargetHeight,\n\t\t\tprops: {\n\t\t\t\t...props,\n\t\t\t\tvirtualMedia,\n\t\t\t\tinheritedSeekOffset: accumulatedSeekOffsetSec,\n\t\t\t\tinheritedClockOffset: accumulatedClockOffsetSec,\n\t\t\t\tdurationMs: resolvedDurationMs,\n\t\t\t\telapsedMs: resolvedElapsedMs\n\t\t\t},\n\t\t\tdrawChild: async (child, overrides, targetViewOverride, targetTextureOverride, targetWidthOverride, targetHeightOverride) => {\n\t\t\t\tawait drawCompositionTree(ctx, encoder, targetViewOverride ?? targetView, targetTextureOverride ?? targetTexture, targetWidthOverride ?? targetWidth, targetHeightOverride ?? targetHeight, child, {\n\t\t\t\t\t...props,\n\t\t\t\t\tdurationMs: resolvedDurationMs,\n\t\t\t\t\telapsedMs: resolvedElapsedMs,\n\t\t\t\t\tvirtualMedia: child,\n\t\t\t\t\t...overrides,\n\t\t\t\t\texcludeTextures: [\n\t\t\t\t\t\t...props.excludeTextures || [],\n\t\t\t\t\t\t...overrides?.excludeTextures || [],\n\t\t\t\t\t\ttargetTextureOverride ?? targetTexture\n\t\t\t\t\t]\n\t\t\t\t}, isCompositor ? 0 : accumulatedSeekOffsetSec, accumulatedClockOffsetSec);\n\t\t\t}\n\t\t};\n\t\tawait CustomRenderer(renderArgs);\n\t\trenderArgs.pass.end();\n\t\treturn;\n\t}\n\tif (op.op === \"LUT\") return;\n\tif (op.op === \"Signal\" || op.op === \"SignalMath\" || op.dataType === \"Signal\") {\n\t\tconst pass = ctx.renderer.beginFrame(encoder, targetView, {\n\t\t\tr: 0,\n\t\t\tg: 0,\n\t\t\tb: 0,\n\t\t\ta: 0\n\t\t}, targetWidth, targetHeight, \"load\");\n\t\tawait drawSignalNode(ctx, encoder, pass, {\n\t\t\tnodeId: op.nodeId || op.signalConfig?.nodeId || props.renderId,\n\t\t\tfunc: op.func,\n\t\t\tamplitude: Number(op.amplitude ?? 1),\n\t\t\tfrequency: Number(op.frequency ?? 1),\n\t\t\tphase: Number(op.phase ?? 0),\n\t\t\toffset: Number(op.offset ?? 0),\n\t\t\tsignalConfig: {\n\t\t\t\t...op.signalConfig,\n\t\t\t\t...op\n\t\t\t},\n\t\t\tframe,\n\t\t\tfps,\n\t\t\telapsedMs: resolvedElapsedMs,\n\t\t\tdurationMs: resolvedDurationMs ?? 0,\n\t\t\twidth: targetWidth,\n\t\t\theight: targetHeight,\n\t\t\tdrawChild: async (child, childProps, childView, childTex, childW, childH) => {\n\t\t\t\tawait drawCompositionTree(ctx, encoder, childView, childTex, childW, childH, child, {\n\t\t\t\t\t...props,\n\t\t\t\t\tdurationMs: resolvedDurationMs,\n\t\t\t\t\telapsedMs: resolvedElapsedMs,\n\t\t\t\t\t...childProps,\n\t\t\t\t\texcludeTextures: [\n\t\t\t\t\t\t...props.excludeTextures || [],\n\t\t\t\t\t\t...childProps?.excludeTextures || [],\n\t\t\t\t\t\tchildTex\n\t\t\t\t\t]\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\tpass.end();\n\t\treturn;\n\t}\n\tif (op.op === \"source\" || op.op === \"text\" || op.op === \"caption\") {\n\t\tconst pass = ctx.renderer.beginFrame(encoder, targetView, {\n\t\t\tr: 0,\n\t\t\tg: 0,\n\t\t\tb: 0,\n\t\t\ta: 0\n\t\t}, targetWidth, targetHeight, \"load\");\n\t\tif (op.op === \"source\") {\n\t\t\tconst mediaType = getMediaType(virtualMedia);\n\t\t\tconst params = computeRenderParams(virtualMedia);\n\t\t\tif (params.sourceUrl) {\n\t\t\t\tconst containerWidth = props.containerWidth ?? ctx.surface.width;\n\t\t\t\tconst containerHeight = props.containerHeight ?? ctx.surface.height;\n\t\t\t\tif (mediaType === \"Image\") await drawImageNode(ctx, pass, {\n\t\t\t\t\tsrc: params.sourceUrl,\n\t\t\t\t\tdstRect: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\twidth: containerWidth,\n\t\t\t\t\t\theight: containerHeight\n\t\t\t\t\t},\n\t\t\t\t\topacity: Number(op.opacity ?? 1) * Number(props.opacity ?? 1),\n\t\t\t\t\tisHeadless: props.isHeadless\n\t\t\t\t});\n\t\t\t\telse if (mediaType === \"SVG\") await drawSvgNode(ctx, pass, {\n\t\t\t\t\tsrc: params.sourceUrl,\n\t\t\t\t\tdstRect: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\twidth: containerWidth,\n\t\t\t\t\t\theight: containerHeight\n\t\t\t\t\t},\n\t\t\t\t\topacity: Number(op.opacity ?? 1),\n\t\t\t\t\tisHeadless: props.isHeadless\n\t\t\t\t});\n\t\t\t\telse if (mediaType === \"Lottie\") await drawLottieNode(ctx, pass, {\n\t\t\t\t\tsrc: params.sourceUrl,\n\t\t\t\t\tdstRect: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\twidth: containerWidth,\n\t\t\t\t\t\theight: containerHeight\n\t\t\t\t\t},\n\t\t\t\t\tframe: segmentLocalFrame + Math.round(accumulatedSeekOffsetSec * fps),\n\t\t\t\t\tfps,\n\t\t\t\t\topacity: Number(op.opacity ?? 1) * Number(props.opacity ?? 1),\n\t\t\t\t\tisHeadless: props.isHeadless\n\t\t\t\t});\n\t\t\t\telse if (mediaType === \"GIF\") await drawGifNode(ctx, pass, {\n\t\t\t\t\tsrc: params.sourceUrl,\n\t\t\t\t\tdstRect: {\n\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\twidth: containerWidth,\n\t\t\t\t\t\theight: containerHeight\n\t\t\t\t\t},\n\t\t\t\t\tframe: segmentLocalFrame + Math.round(accumulatedSeekOffsetSec * fps),\n\t\t\t\t\tfps,\n\t\t\t\t\topacity: Number(op.opacity ?? 1) * Number(props.opacity ?? 1),\n\t\t\t\t\tisHeadless: props.isHeadless\n\t\t\t\t});\n\t\t\t\telse if (mediaType === \"Text\") {\n\t\t\t\t\tconst opText = { ...op };\n\t\t\t\t\tdrawParagraphNode(ctx, pass, {\n\t\t\t\t\t\ttext: opText.text || \"\",\n\t\t\t\t\t\tdstRect: {\n\t\t\t\t\t\t\tx: Number(opText.x ?? 0),\n\t\t\t\t\t\t\ty: Number(opText.y ?? 0),\n\t\t\t\t\t\t\twidth: Number(opText.width ?? containerWidth),\n\t\t\t\t\t\t\theight: Number(opText.height ?? containerHeight)\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfontFamily: opText.fontFamily,\n\t\t\t\t\t\tfontSize: Number(opText.fontSize ?? 48),\n\t\t\t\t\t\tcolor: opText.fill ?? opText.color ?? \"white\",\n\t\t\t\t\t\twidth: opText.width ? Number(opText.width) : void 0,\n\t\t\t\t\t\theight: opText.height ? Number(opText.height) : void 0,\n\t\t\t\t\t\tlineHeight: Number(opText.lineHeight ?? 1.2),\n\t\t\t\t\t\talign: opText.align,\n\t\t\t\t\t\tfontWeight: opText.fontWeight,\n\t\t\t\t\t\tfontStyle: opText.fontStyle,\n\t\t\t\t\t\tletterSpacing: opText.letterSpacing,\n\t\t\t\t\t\tshadows: opText.shadows,\n\t\t\t\t\t\ttextBackgroundColor: opText.textBackgroundColor,\n\t\t\t\t\t\tborderRadius: opText.borderRadius != null ? Number(opText.borderRadius) : void 0,\n\t\t\t\t\t\tpadding: opText.padding != null ? Number(opText.padding) : void 0,\n\t\t\t\t\t\tstroke: opText.stroke,\n\t\t\t\t\t\tstrokeWidth: opText.strokeWidth ?? opText.strokeThickness ? Number(opText.strokeWidth ?? opText.strokeThickness) : void 0,\n\t\t\t\t\t\tstrokeAlign: opText.strokeAlign,\n\t\t\t\t\t\topacity: Number(opText.opacity ?? 1) * Number(props.opacity ?? 1),\n\t\t\t\t\t\tisHeadless: props.isHeadless,\n\t\t\t\t\t\tanimation: opText.animation ?? opText.textAnimation,\n\t\t\t\t\t\tanimators: opText.animators,\n\t\t\t\t\t\tpathOptions: opText.pathOptions,\n\t\t\t\t\t\ttypewriter: opText.typewriter,\n\t\t\t\t\t\tmarquee: opText.marquee,\n\t\t\t\t\t\ttextProgress: opText.textProgress != null ? Number(opText.textProgress) : void 0,\n\t\t\t\t\t\tsignals: props.signals ?? opText.signals,\n\t\t\t\t\t\tfirstMargin: opText.firstMargin != null ? Number(opText.firstMargin) : void 0,\n\t\t\t\t\t\tlastMargin: opText.lastMargin != null ? Number(opText.lastMargin) : void 0,\n\t\t\t\t\t\tbaselineShift: opText.baselineShift != null ? Number(opText.baselineShift) : void 0,\n\t\t\t\t\t\tframe: localFrame,\n\t\t\t\t\t\tfps,\n\t\t\t\t\t\tdurationMs: resolvedDurationMs,\n\t\t\t\t\t\telapsedMs: resolvedElapsedMs,\n\t\t\t\t\t\tisVideoMode: props.isVideoMode\n\t\t\t\t\t});\n\t\t\t\t} else if (mediaType === \"Video\") {\n\t\t\t\t\tconst finalPlaybackRate = Math.max(.01, (Number(props.playbackRateOverride) || 1) * (Number(params.speed) || 1));\n\t\t\t\t\tconst effectiveTrimSec = Math.max(0, (Number(props.trimStartOverride) || 0) + (Number(params.trimStartSec) || 0) + accumulatedSeekOffsetSec);\n\t\t\t\t\tconst rawTimestampSec = segmentLocalFrame / fps * finalPlaybackRate + effectiveTrimSec;\n\t\t\t\t\tconst timestampSec = Math.max(0, Number.isFinite(rawTimestampSec) ? rawTimestampSec : 0);\n\t\t\t\t\tawait drawVideoNode(ctx, pass, {\n\t\t\t\t\t\tnodeId: props.renderId,\n\t\t\t\t\t\tframeKey: `${props.renderId ?? \"video\"}-${params.sourceUrl}-${Math.round(timestampSec * fps)}`,\n\t\t\t\t\t\tsourceUrl: params.sourceUrl,\n\t\t\t\t\t\ttimestampSec,\n\t\t\t\t\t\tdstRect: {\n\t\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\twidth: containerWidth,\n\t\t\t\t\t\t\theight: containerHeight\n\t\t\t\t\t\t},\n\t\t\t\t\t\topacity: Number(op.opacity ?? 1) * Number(props.opacity ?? 1),\n\t\t\t\t\t\tisHeadless: props.isHeadless,\n\t\t\t\t\t\tisPlaying: props.isPlaying,\n\t\t\t\t\t\tforceWait: props.forceWait\n\t\t\t\t\t});\n\t\t\t\t} else if (mediaType === \"Caption\") {\n\t\t\t\t\tconst opCap = {\n\t\t\t\t\t\t...op,\n\t\t\t\t\t\t...props\n\t\t\t\t\t};\n\t\t\t\t\tawait drawCaptionNode(ctx, pass, {\n\t\t\t\t\t\trenderId: props.renderId,\n\t\t\t\t\t\tsrc: params.sourceUrl,\n\t\t\t\t\t\tdstRect: {\n\t\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\twidth: containerWidth,\n\t\t\t\t\t\t\theight: containerHeight\n\t\t\t\t\t\t},\n\t\t\t\t\t\tframe: localFrame,\n\t\t\t\t\t\tfps,\n\t\t\t\t\t\tfontFamily: opCap.fontFamily,\n\t\t\t\t\t\tfontSize: Number(opCap.fontSize ?? 48),\n\t\t\t\t\t\tcolor: opCap.fill ?? opCap.color ?? \"white\",\n\t\t\t\t\t\tlineHeight: Number(opCap.lineHeight ?? 1.2),\n\t\t\t\t\t\talign: opCap.align === \"start\" ? \"left\" : opCap.align === \"end\" ? \"right\" : opCap.align ?? \"center\",\n\t\t\t\t\t\ttextAlignVertical: opCap.verticalAlign ?? opCap.textAlignVertical,\n\t\t\t\t\t\tfontWeight: opCap.fontWeight,\n\t\t\t\t\t\tfontStyle: opCap.fontStyle,\n\t\t\t\t\t\tletterSpacing: opCap.letterSpacing,\n\t\t\t\t\t\tshadows: opCap.shadows,\n\t\t\t\t\t\ttextBackgroundColor: opCap.background ?? opCap.textBackgroundColor,\n\t\t\t\t\t\tborderRadius: (opCap.borderRadius ?? opCap.strokeRadius) != null ? Number(opCap.borderRadius ?? opCap.strokeRadius) : void 0,\n\t\t\t\t\t\tstrokeRadius: (opCap.strokeRadius ?? opCap.borderRadius) != null ? Number(opCap.strokeRadius ?? opCap.borderRadius) : void 0,\n\t\t\t\t\t\tstroke: opCap.stroke,\n\t\t\t\t\t\tstrokeWidth: (opCap.strokeWidth ?? opCap.strokeThickness) != null ? Number(opCap.strokeWidth ?? opCap.strokeThickness) : void 0,\n\t\t\t\t\t\tmaxWidth: opCap.maxWidth,\n\t\t\t\t\t\tpadding: opCap.padding != null ? Number(opCap.padding) : void 0,\n\t\t\t\t\t\topacity: Number(opCap.opacity ?? 1) * Number(props.opacity ?? 1),\n\t\t\t\t\t\tisHeadless: props.isHeadless,\n\t\t\t\t\t\tisVideoMode: props.isVideoMode\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (op.op === \"text\") {\n\t\t\tconst opText = { ...op };\n\t\t\tconst containerWidth = props.containerWidth ?? ctx.surface.width;\n\t\t\tconst containerHeight = props.containerHeight ?? ctx.surface.height;\n\t\t\tdrawParagraphNode(ctx, pass, {\n\t\t\t\trenderId: props.renderId,\n\t\t\t\ttext: opText.text || \"\",\n\t\t\t\tdstRect: {\n\t\t\t\t\tx: Number(opText.x ?? 0),\n\t\t\t\t\ty: Number(opText.y ?? 0),\n\t\t\t\t\twidth: Number(opText.width ?? containerWidth),\n\t\t\t\t\theight: Number(opText.height ?? containerHeight)\n\t\t\t\t},\n\t\t\t\tspans: opText.spans,\n\t\t\t\tfontFamily: opText.fontFamily,\n\t\t\t\tfontSize: Number(opText.fontSize ?? 48),\n\t\t\t\tcolor: opText.fill ?? opText.color ?? \"white\",\n\t\t\t\twidth: opText.width ? Number(opText.width) : void 0,\n\t\t\t\theight: opText.height ? Number(opText.height) : void 0,\n\t\t\t\tlineHeight: Number(opText.lineHeight ?? 1.2),\n\t\t\t\talign: opText.align,\n\t\t\t\tfontWeight: opText.fontWeight,\n\t\t\t\tfontStyle: opText.fontStyle,\n\t\t\t\tletterSpacing: opText.letterSpacing,\n\t\t\t\tshadows: opText.shadows,\n\t\t\t\ttextBackgroundColor: opText.textBackgroundColor,\n\t\t\t\tborderRadius: (opText.borderRadius ?? opText.strokeRadius) != null ? Number(opText.borderRadius ?? opText.strokeRadius) : void 0,\n\t\t\t\tstrokeRadius: (opText.strokeRadius ?? opText.borderRadius) != null ? Number(opText.strokeRadius ?? opText.borderRadius) : void 0,\n\t\t\t\tpadding: opText.padding != null ? Number(opText.padding) : void 0,\n\t\t\t\tstroke: opText.stroke,\n\t\t\t\tstrokeWidth: opText.strokeWidth ?? opText.strokeThickness ? Number(opText.strokeWidth ?? opText.strokeThickness) : void 0,\n\t\t\t\tstrokeAlign: opText.strokeAlign,\n\t\t\t\topacity: Number(opText.opacity ?? 1) * Number(props.opacity ?? 1),\n\t\t\t\tisHeadless: props.isHeadless,\n\t\t\t\tanimation: opText.animation ?? opText.textAnimation,\n\t\t\t\tanimators: opText.animators,\n\t\t\t\tpathOptions: opText.pathOptions,\n\t\t\t\ttypewriter: opText.typewriter,\n\t\t\t\tmarquee: opText.marquee,\n\t\t\t\tsignals: props.signals ?? opText.signals,\n\t\t\t\tfirstMargin: opText.firstMargin != null ? Number(opText.firstMargin) : void 0,\n\t\t\t\tlastMargin: opText.lastMargin != null ? Number(opText.lastMargin) : void 0,\n\t\t\t\tbaselineShift: opText.baselineShift != null ? Number(opText.baselineShift) : void 0,\n\t\t\t\tframe: localFrame,\n\t\t\t\tfps,\n\t\t\t\tdurationMs: resolvedDurationMs,\n\t\t\t\telapsedMs: resolvedElapsedMs,\n\t\t\t\tisVideoMode: props.isVideoMode\n\t\t\t});\n\t\t}\n\t\tpass.end();\n\t}\n\tif (virtualMedia.children && virtualMedia.children.length > 0) for (let i = 0; i < virtualMedia.children.length; i++) {\n\t\tconst child = virtualMedia.children[i];\n\t\tif (child) await drawCompositionTree(ctx, encoder, targetView, targetTexture, targetWidth, targetHeight, child, {\n\t\t\t...props,\n\t\t\tdurationMs: resolvedDurationMs,\n\t\t\telapsedMs: resolvedElapsedMs,\n\t\t\tvirtualMedia: child,\n\t\t\trenderId: `${props.renderId}-c${i}`\n\t\t}, isCompositor ? 0 : accumulatedSeekOffsetSec, accumulatedClockOffsetSec);\n\t}\n}\nconst CanvasComposition = memo((props) => {\n\tconst ctx = useRenderContext();\n\tconst { renderId, virtualMedia: rawVirtualMedia } = props;\n\tconst state = useCompositionState(renderId);\n\tconst { virtualMedia, fps } = React.useMemo(() => {\n\t\tconst fpsValue = props.fps ?? state.fps;\n\t\treturn {\n\t\t\tvirtualMedia: normalizeTimeline(rawVirtualMedia, fpsValue),\n\t\t\tfps: fpsValue\n\t\t};\n\t}, [\n\t\trawVirtualMedia,\n\t\tstate.fps,\n\t\tprops.fps\n\t]);\n\tconst frame = props.frame ?? state.frame;\n\tconst isMountedRef = React.useRef(false);\n\tconst latestTaskRef = React.useRef(null);\n\tconst isRenderingRef = React.useRef(false);\n\tconst [fontUpdateTick, forceUpdate] = React.useState(0);\n\tReact.useEffect(() => {\n\t\treturn SlugFontCache.addListener(() => {\n\t\t\tif (isMountedRef.current) forceUpdate((t) => t + 1);\n\t\t});\n\t}, []);\n\tReact.useEffect(() => {\n\t\tconst cdnDomain = getEnv(\"R2_CUSTOM_DOMAIN\");\n\t\tif (!cdnDomain) {\n\t\t\tconsole.error(\"[CanvasComposition] R2_CUSTOM_DOMAIN is not defined.\");\n\t\t\treturn;\n\t\t}\n\t\tconst url = `https://${cdnDomain}/static/NotoColorEmoji.ttf`;\n\t\tSlugFontCache.preloadEmojiFontFace(url).catch((err) => {\n\t\t\tconsole.error(\"[CanvasComposition] Failed to preload emoji font:\", err);\n\t\t});\n\t}, []);\n\tconst [lutUpdateTick, setLutUpdateTick] = React.useState(0);\n\tReact.useEffect(() => {\n\t\treturn lutStore.onChange(() => {\n\t\t\tif (isMountedRef.current) setLutUpdateTick((t) => t + 1);\n\t\t});\n\t}, []);\n\tReact.useLayoutEffect(() => {\n\t\tisMountedRef.current = true;\n\t\treturn () => {\n\t\t\tisMountedRef.current = false;\n\t\t\tmediaDecoderCache.clearNode(renderId);\n\t\t\tclearVideoNodeState(renderId, ctx?.device);\n\t\t\tif (typeof globalThis !== \"undefined\" && globalThis.__GATEWAI_DELAYS__) {\n\t\t\t\tconst delays = globalThis.__GATEWAI_DELAYS__;\n\t\t\t\tif (delays instanceof Set) {\n\t\t\t\t\tfor (const handle of delays) if (typeof handle === \"string\" && handle.startsWith(renderId)) delays.delete(handle);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof window !== \"undefined\" && window.renderer_delayRenderHandles) {\n\t\t\t\tconst handles = window.renderer_delayRenderHandles;\n\t\t\t\tif (Array.isArray(handles)) {\n\t\t\t\t\tconst filtered = handles.filter((handle) => !(typeof handle === \"string\" && handle.startsWith(renderId)));\n\t\t\t\t\twindow.renderer_delayRenderHandles = filtered;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}, [renderId, ctx]);\n\tReact.useLayoutEffect(() => {\n\t\tif (!ctx || !virtualMedia) return;\n\t\tlatestTaskRef.current = {\n\t\t\tctx,\n\t\t\tvirtualMedia,\n\t\t\tframe,\n\t\t\tfps,\n\t\t\tprops\n\t\t};\n\t\tconst triggerRender = async () => {\n\t\t\tif (isRenderingRef.current) return;\n\t\t\tisRenderingRef.current = true;\n\t\t\twhile (latestTaskRef.current && isMountedRef.current) {\n\t\t\t\tconst task = latestTaskRef.current;\n\t\t\t\tif (task.ctx !== ctx) break;\n\t\t\t\tlatestTaskRef.current = null;\n\t\t\t\ttry {\n\t\t\t\t\tconst { device, surface, renderer } = task.ctx;\n\t\t\t\t\tconst targetW = surface.width;\n\t\t\t\t\tconst targetH = surface.height;\n\t\t\t\t\tif (targetW === 0 || targetH === 0) continue;\n\t\t\t\t\tconst encoder = device.createCommandEncoder();\n\t\t\t\t\tconst stableTex = renderer.getTemporaryTexture(targetW, targetH);\n\t\t\t\t\tconst stableView = stableTex.createView();\n\t\t\t\t\trenderer.beginFrame(encoder, stableView, {\n\t\t\t\t\t\tr: 0,\n\t\t\t\t\t\tg: 0,\n\t\t\t\t\t\tb: 0,\n\t\t\t\t\t\ta: 0\n\t\t\t\t\t}, targetW, targetH, \"clear\").end();\n\t\t\t\t\tawait drawCompositionTree(task.ctx, encoder, stableView, stableTex, targetW, targetH, task.virtualMedia, {\n\t\t\t\t\t\t...task.props,\n\t\t\t\t\t\tframe: task.frame,\n\t\t\t\t\t\tfps: task.fps,\n\t\t\t\t\t\tisPlaying: task.props.isPlaying ?? state.isPlaying,\n\t\t\t\t\t\tisVideoMode: task.virtualMedia.operation.dataType === \"Video\",\n\t\t\t\t\t\texcludeTextures: [stableTex]\n\t\t\t\t\t});\n\t\t\t\t\tif (latestTaskRef.current !== null) continue;\n\t\t\t\t\tif (isMountedRef.current && !renderer.isDestroyed) {\n\t\t\t\t\t\tconst blitW = surface.width;\n\t\t\t\t\t\tconst blitH = surface.height;\n\t\t\t\t\t\tif (blitW > 0 && blitH > 0) {\n\t\t\t\t\t\t\tconst canvasView = surface.getCurrentTextureView();\n\t\t\t\t\t\t\tconst blitPass = renderer.beginFrame(encoder, canvasView, {\n\t\t\t\t\t\t\t\tr: 0,\n\t\t\t\t\t\t\t\tg: 0,\n\t\t\t\t\t\t\t\tb: 0,\n\t\t\t\t\t\t\t\ta: 0\n\t\t\t\t\t\t\t}, blitW, blitH, \"clear\");\n\t\t\t\t\t\t\trenderer.drawTexture(blitPass, stableTex, {\n\t\t\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t\twidth: blitW,\n\t\t\t\t\t\t\t\theight: blitH\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tblitPass.end();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdevice.queue.submit([encoder.finish()]);\n\t\t\t\t\t\tsurface.present();\n\t\t\t\t\t\tconst key = `${task.props.renderId}-${task.frame}`;\n\t\t\t\t\t\tif (!window.__frameRenderResolvers) window.__frameRenderResolvers = /* @__PURE__ */ new Map();\n\t\t\t\t\t\tconst status = window.__frameRenderResolvers.get(key);\n\t\t\t\t\t\tif (status) {\n\t\t\t\t\t\t\tstatus.rendered = true;\n\t\t\t\t\t\t\tif (status.resolver) status.resolver();\n\t\t\t\t\t\t} else window.__frameRenderResolvers.set(key, { rendered: true });\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconsole.error(\"Error drawing WebGPU composition tree:\", err);\n\t\t\t\t}\n\t\t\t}\n\t\t\tisRenderingRef.current = false;\n\t\t\tif (latestTaskRef.current && isMountedRef.current) triggerRender();\n\t\t};\n\t\ttriggerRender();\n\t}, [\n\t\tctx,\n\t\tvirtualMedia,\n\t\tframe,\n\t\tfps,\n\t\tprops,\n\t\tfontUpdateTick,\n\t\tlutUpdateTick\n\t]);\n\treturn null;\n});\n\n//#endregion\n//#region src/compositions/browser-render.tsx\n/**\n* browser-video-renderer.tsx\n*\n* Architecture\n* ────────────\n* ┌─────────────────────────────────────────────────────────────────┐\n* │ AudioMuxer (no React deps) │\n* │ · subscribe / getSnapshot → useSyncExternalStore contract │\n* │ · run() → mixing + encoding with cooperative yielding │\n* │ · abort() → AbortSignal cancellation │\n* └─────────────────────────────────────────────────────────────────┘\n* ▲ useSyncExternalStore\n* ┌─────────────────────────────────────────────────────────────────┐\n* │ BrowserVideoRendererInner │\n* │ Effect 1: muxer init (output, sources, OPFS target) │\n* │ Effect 2: video frame loop → setVideoFramesDone(true) │\n* │ Effect 3: audio kick-off when videoFramesDone │\n* │ Effect 4: finalization when audioState.phase === \"done\" │\n* │ Effect 5: progress bridge audioState → onProgress prop │\n* │ Effect 6: error bridge audioState → onError prop │\n* └─────────────────────────────────────────────────────────────────┘\n*\n* Why FPS dropped to 2-3 during audio processing (and how it's fixed)\n* ────────────────────────────────────────────────────────────────────\n*\n* ROOT CAUSE 1 — Main-thread monopoly\n* The old audio chunk loop ran entirely on the JS main thread. Each\n* iteration allocated a Float32Array, interleaved channel data, and\n* called `await audioSource.add()`. Consecutive microtask continuations\n* never returned control to the browser's rendering pipeline; the\n* compositor thread was starved waiting for a JS task to complete before\n* it could issue a new paint frame.\n*\n* ROOT CAUSE 2 — React scheduler saturation\n* `onProgress(\"audio\", pct)` was called on every chunk (up to ~100×/sec\n* for long clips). Each call triggered a parent setState, enqueuing a\n* React reconciliation. When updates arrived faster than the reconciler\n* could drain them, React degraded to synchronous rendering to clear the\n* backlog — which blocked the main thread even longer.\n*\n* ROOT CAUSE 3 — AudioEncoder backpressure\n* mediabunny's AudioSampleSource.add() awaits the encoder's internal\n* queue. Under load it parks the caller in a microtask continuation and\n* immediately resumes on the same task. The browser task scheduler never\n* saw an idle slot to run its rendering pipeline.\n*\n* ROOT CAUSE 4 — Entangled concerns\n* Audio encoding lived inside the video frame useEffect. The render loop\n* and the encoder competed for the same task slot and the same React\n* reconciliation pass.\n*\n* FIX — yieldToMain() between every audio chunk\n* `scheduler.yield()` (Chrome 115+) is the correct primitive: it\n* explicitly yields to the browser's task queue at \"user-blocking\"\n* priority, guaranteeing a paint opportunity between chunks. The\n* `setTimeout(0)` fallback provides equivalent semantics on older\n* browsers (>4 ms clamped, sufficient for ~60 FPS).\n* Progress notifications are throttled to ≤12 updates/sec to avoid\n* overwhelming the React scheduler.\n*/\nconst isNode = typeof process !== \"undefined\" && Boolean(process.versions?.node);\nif (typeof window !== \"undefined\" && !isNode) canEncodeAudio(\"mp3\").then((supported) => {\n\tif (!supported) registerMp3Encoder();\n}).catch(() => {});\n/**\n* Blocks until all delayRender handles are cleared, or the timeout\n* expires. The initial 100 ms sleep gives React one full render cycle to\n* register any new handles before we start polling.\n*\n* NOTE: The 100 ms floor sets a hard upper bound on video encoding throughput\n* (~10 FPS maximum) when delayRender handles are not in use. If you control the\n* config, consider reducing this to 0 ms after verifying no handles\n* are ever registered synchronously before the first poll.\n*/\nconst waitForDelayRender = async (timeoutMs = 3e4) => {\n\tawait new Promise((resolve) => setTimeout(resolve, 100));\n\tconst start = Date.now();\n\treturn new Promise((resolve) => {\n\t\tconst check = () => {\n\t\t\tconst handles = typeof window !== \"undefined\" && window.renderer_delayRenderHandles ? window.renderer_delayRenderHandles : [];\n\t\t\tconst globalDelays = typeof globalThis !== \"undefined\" ? globalThis.__GATEWAI_DELAYS__ : null;\n\t\t\tconst hasBrowserDelays = handles.length > 0;\n\t\t\tconst hasGlobalDelays = globalDelays instanceof Set && globalDelays.size > 0;\n\t\t\tif (!hasBrowserDelays && !hasGlobalDelays) {\n\t\t\t\tresolve();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (Date.now() - start > timeoutMs) {\n\t\t\t\tconsole.warn(\"[BrowserRenderer] waitForDelayRender timed out:\", {\n\t\t\t\t\tbrowserHandles: handles,\n\t\t\t\t\tglobalDelays: globalDelays ? Array.from(globalDelays) : []\n\t\t\t\t});\n\t\t\t\tresolve();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetTimeout(check, 50);\n\t\t};\n\t\tcheck();\n\t});\n};\nconst checkBrowserRenderSupport = async (format, isAudioOnly = false, audioCodecOverride) => {\n\tif (typeof window === \"undefined\") return {\n\t\tsupported: false,\n\t\treason: \"Server-side context\"\n\t};\n\tif (!(\"VideoEncoder\" in window) || !(\"AudioEncoder\" in window)) return {\n\t\tsupported: false,\n\t\treason: \"Browser does not support WebCodecs (VideoEncoder/AudioEncoder).\"\n\t};\n\tif (format === \"gif\") return {\n\t\tsupported: false,\n\t\treason: `${format.toUpperCase()} export format is not supported for Browser rendering.`\n\t};\n\tconst resolvedQuality = QUALITY_VERY_HIGH;\n\tconst isWebM = format === \"webm\";\n\tconst isMp3 = format === \"mp3\";\n\tconst videoCodec = isWebM ? \"vp8\" : \"avc\";\n\tconst audioCodec = audioCodecOverride ?? (isMp3 ? \"mp3\" : isWebM ? \"opus\" : \"aac\");\n\ttry {\n\t\tif (!await canEncodeAudio(audioCodec, {\n\t\t\tnumberOfChannels: 2,\n\t\t\tsampleRate: 48e3,\n\t\t\tbitrate: resolvedQuality\n\t\t})) if (audioCodec === \"aac\") {\n\t\t\tif (!await canEncodeAudio(\"opus\", {\n\t\t\t\tnumberOfChannels: 2,\n\t\t\t\tsampleRate: 48e3,\n\t\t\t\tbitrate: resolvedQuality\n\t\t\t})) return {\n\t\t\t\tsupported: false,\n\t\t\t\treason: \"Neither AAC nor Opus audio encoding is supported by this browser.\"\n\t\t\t};\n\t\t} else return {\n\t\t\tsupported: false,\n\t\t\treason: `${audioCodec.toUpperCase()} audio encoding is not supported by this browser.`\n\t\t};\n\t} catch (e) {\n\t\treturn {\n\t\t\tsupported: false,\n\t\t\treason: `Failed to verify audio encoder support for ${audioCodec}: ${e instanceof Error ? e.message : String(e)}`\n\t\t};\n\t}\n\tif (!isMp3 && !isAudioOnly) try {\n\t\tif (!await canEncodeVideo(videoCodec, {\n\t\t\twidth: 1920,\n\t\t\theight: 1080,\n\t\t\tbitrate: resolvedQuality\n\t\t})) return {\n\t\t\tsupported: false,\n\t\t\treason: `${videoCodec.toUpperCase()} video encoding is not supported by your browser/hardware.`\n\t\t};\n\t} catch (e) {\n\t\tconsole.warn(\"[BrowserRenderer] VideoEncoder support check failed, assuming supported:\", e);\n\t}\n\treturn { supported: true };\n};\nconst yieldToMain = () => {\n\tconst sched = globalThis.scheduler;\n\treturn typeof sched?.yield === \"function\" ? sched.yield() : new Promise((resolve) => setTimeout(resolve, 0));\n};\n/**\n* Self-contained audio mixing + encoding engine.\n*\n* Exposes the `useSyncExternalStore` contract (subscribe / getSnapshot) so\n* the component can react to state changes without prop-drilling callbacks\n* into the async pipeline.\n*\n* Usage:\n* const muxer = useMemo(() => new AudioMuxer(), []);\n* const state = useSyncExternalStore(muxer.subscribe, muxer.getSnapshot);\n* useEffect(() => { void muxer.run(...) }, [videoFramesDone]);\n* useEffect(() => () => muxer.abort(), []);\n*/\nvar AudioMuxer = class {\n\t#state = {\n\t\tphase: \"idle\",\n\t\tprogress: 0,\n\t\terror: null\n\t};\n\t#listeners = /* @__PURE__ */ new Set();\n\t#abortController = null;\n\tsubscribe = (listener) => {\n\t\tthis.#listeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.#listeners.delete(listener);\n\t\t};\n\t};\n\tgetSnapshot = () => this.#state;\n\t/** Cancel any in-flight run and reset to idle. Safe to call multiple times. */\n\tabort() {\n\t\tthis.#abortController?.abort(new DOMException(\"AudioMuxer aborted\", \"AbortError\"));\n\t\tthis.#abortController = null;\n\t\tif (this.#state.phase !== \"error\") this.#setState({\n\t\t\tphase: \"idle\",\n\t\t\tprogress: 0,\n\t\t\terror: null\n\t\t});\n\t}\n\t/**\n\t* Mix virtual media audio and feed it into the provided AudioSampleSource.\n\t*\n\t* Calling run() while a previous run is in-flight cancels the previous\n\t* run before starting. Throws on error (error state is also written to\n\t* the snapshot for the component to observe).\n\t*/\n\tasync run(virtualMedia, fps, sampleRate, device, audioSource) {\n\t\tthis.#abortController?.abort();\n\t\tthis.#abortController = new AbortController();\n\t\tconst { signal } = this.#abortController;\n\t\tthis.#setState({\n\t\t\tphase: \"mixing\",\n\t\t\tprogress: 0,\n\t\t\terror: null\n\t\t});\n\t\ttry {\n\t\t\tawait this.#execute(virtualMedia, fps, sampleRate, device, audioSource, signal);\n\t\t} catch (err) {\n\t\t\tif (signal.aborted) return;\n\t\t\tconst error = err instanceof Error ? err : new Error(String(err));\n\t\t\tthis.#setState({\n\t\t\t\tphase: \"error\",\n\t\t\t\terror\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\t#setState(patch) {\n\t\tthis.#state = {\n\t\t\t...this.#state,\n\t\t\t...patch\n\t\t};\n\t\tfor (const listener of this.#listeners) listener();\n\t}\n\tasync #execute(virtualMedia, fps, sampleRate, device, audioSource, signal) {\n\t\tawait yieldToMain();\n\t\tif (signal.aborted) return;\n\t\tlet channels;\n\t\tlet actualSampleRate;\n\t\ttry {\n\t\t\tconst mixed = await mixAudioTracks(virtualMedia, fps, sampleRate, device);\n\t\t\tchannels = mixed.channels;\n\t\t\tactualSampleRate = mixed.sampleRate;\n\t\t} catch (err) {\n\t\t\tthrow new Error(`Audio track mixing failed: ${err instanceof Error ? err.message : String(err)}`);\n\t\t}\n\t\tif (signal.aborted) return;\n\t\tif (channels.length === 0) {\n\t\t\tthis.#setState({\n\t\t\t\tphase: \"done\",\n\t\t\t\tprogress: 100\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tthis.#setState({\n\t\t\tphase: \"encoding\",\n\t\t\tprogress: 0\n\t\t});\n\t\tawait this.#encodeChunks(channels, actualSampleRate, audioSource, signal);\n\t}\n\tasync #encodeChunks(channels, sampleRate, audioSource, signal) {\n\t\tconst numChannels = channels.length;\n\t\tconst totalSamples = channels[0].length;\n\t\tconst chunkSize = Math.round(.1 * sampleRate);\n\t\tconst PROGRESS_INTERVAL_MS = 80;\n\t\tlet lastProgressAt = 0;\n\t\tfor (let offset = 0; offset < totalSamples; offset += chunkSize) {\n\t\t\tif (signal.aborted) return;\n\t\t\tawait yieldToMain();\n\t\t\tif (signal.aborted) return;\n\t\t\tconst chunkLen = Math.min(chunkSize, totalSamples - offset);\n\t\t\tconst interleaved = new Float32Array(chunkLen * numChannels);\n\t\t\tfor (let i = 0; i < chunkLen; i++) for (let ch = 0; ch < numChannels; ch++) interleaved[i * numChannels + ch] = channels[ch]?.[offset + i] ?? 0;\n\t\t\tconst sample = new AudioSample({\n\t\t\t\tdata: interleaved,\n\t\t\t\tformat: \"f32\",\n\t\t\t\tnumberOfChannels: numChannels,\n\t\t\t\tsampleRate,\n\t\t\t\ttimestamp: offset / sampleRate\n\t\t\t});\n\t\t\ttry {\n\t\t\t\tawait audioSource.add(sample);\n\t\t\t} finally {\n\t\t\t\tsample.close();\n\t\t\t}\n\t\t\tconst now = performance.now();\n\t\t\tif (now - lastProgressAt >= PROGRESS_INTERVAL_MS) {\n\t\t\t\tthis.#setState({\n\t\t\t\t\tphase: \"encoding\",\n\t\t\t\t\tprogress: Math.round((offset + chunkLen) / totalSamples * 100)\n\t\t\t\t});\n\t\t\t\tlastProgressAt = now;\n\t\t\t}\n\t\t}\n\t\tthis.#setState({\n\t\t\tphase: \"done\",\n\t\t\tprogress: 100\n\t\t});\n\t}\n};\nconst BrowserVideoRendererInner = ({ nodeId, virtualMedia, format, audioCodec: audioCodecProp, fps, width, height, onProgress, onComplete, onError }) => {\n\tconst ctx = useRenderContext();\n\tconst [frame, setFrame] = useState(-1);\n\tconst [videoFramesDone, setVideoFramesDone] = useState(false);\n\tconst activeRef = useRef(true);\n\tconst isAudioOnly = getMediaType(virtualMedia) === \"Audio\";\n\tconst isMp3 = format === \"mp3\";\n\tconst skipVideo = isMp3 || isAudioOnly;\n\tconst onProgressRef = useRef(onProgress);\n\tconst onCompleteRef = useRef(onComplete);\n\tconst onErrorRef = useRef(onError);\n\tuseEffect(() => {\n\t\tonProgressRef.current = onProgress;\n\t\tonCompleteRef.current = onComplete;\n\t\tonErrorRef.current = onError;\n\t});\n\tconst audioMuxerRef = useRef(null);\n\tif (!audioMuxerRef.current) audioMuxerRef.current = new AudioMuxer();\n\tconst audioState = useSyncExternalStore(audioMuxerRef.current.subscribe, audioMuxerRef.current.getSnapshot);\n\tconst stateRef = useRef({\n\t\tinitialized: false,\n\t\tfinalized: false,\n\t\toutput: null,\n\t\tvideoSource: null,\n\t\taudioSource: null,\n\t\ttarget: null,\n\t\tfileHandle: null,\n\t\ttotalFrames: 0,\n\t\tframeIndex: 0\n\t});\n\tconst cleanup = async () => {\n\t\taudioMuxerRef.current.abort();\n\t\tconst state = stateRef.current;\n\t\tif (state.output && !state.finalized) {\n\t\t\tstate.finalized = true;\n\t\t\ttry {\n\t\t\t\tawait state.output.finalize();\n\t\t\t} catch (_) {}\n\t\t}\n\t\tstate.output = null;\n\t\tstate.videoSource = null;\n\t\tstate.audioSource = null;\n\t\tstate.target = null;\n\t\tif (state.fileHandle) {\n\t\t\ttry {\n\t\t\t\tawait (await navigator.storage.getDirectory()).removeEntry(state.fileHandle.name);\n\t\t\t} catch (_) {}\n\t\t\tstate.fileHandle = null;\n\t\t}\n\t};\n\tuseEffect(() => {\n\t\tactiveRef.current = true;\n\t\treturn () => {\n\t\t\tactiveRef.current = false;\n\t\t\tcleanup();\n\t\t};\n\t}, []);\n\tuseEffect(() => {\n\t\tif (!ctx || stateRef.current.initialized || !activeRef.current) return;\n\t\tlet effectActive = true;\n\t\tconst init = async () => {\n\t\t\ttry {\n\t\t\t\tawait waitForDelayRender();\n\t\t\t\tif (!effectActive || !activeRef.current) return;\n\t\t\t\tconst durationMs = virtualMedia.metadata?.durationMs ?? 1e3;\n\t\t\t\tconst totalFrames = Math.max(1, Math.round(durationMs / 1e3 * fps));\n\t\t\t\tif (format === \"gif\") throw new Error(`${format.toUpperCase()} export is not supported for Browser rendering. Please select MP4 or WebM, or switch to Server rendering.`);\n\t\t\t\tconst resolvedQuality = QUALITY_VERY_HIGH;\n\t\t\t\tconst isWebM = format === \"webm\";\n\t\t\t\tconst videoCodec = isWebM ? \"vp8\" : \"avc\";\n\t\t\t\tlet audioCodec = audioCodecProp ?? (isMp3 ? \"mp3\" : isWebM ? \"opus\" : \"aac\");\n\t\t\t\tif (audioCodec === \"aac\") try {\n\t\t\t\t\tif (!await canEncodeAudio(\"aac\", {\n\t\t\t\t\t\tnumberOfChannels: 2,\n\t\t\t\t\t\tsampleRate: 48e3,\n\t\t\t\t\t\tbitrate: resolvedQuality\n\t\t\t\t\t})) {\n\t\t\t\t\t\tconsole.warn(\"[BrowserRenderer] AAC not supported, falling back to Opus.\");\n\t\t\t\t\t\taudioCodec = \"opus\";\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\tconsole.warn(\"[BrowserRenderer] AAC check failed, falling back to Opus.\");\n\t\t\t\t\taudioCodec = \"opus\";\n\t\t\t\t}\n\t\t\t\tif (!effectActive || !activeRef.current) return;\n\t\t\t\tonProgressRef.current(\"initializing\", 0);\n\t\t\t\tlet target;\n\t\t\t\tlet fileHandle = null;\n\t\t\t\tif (typeof navigator !== \"undefined\" && typeof navigator.storage?.getDirectory === \"function\") try {\n\t\t\t\t\tconst root = await navigator.storage.getDirectory();\n\t\t\t\t\tconst filename = `export-${nodeId}-${Math.random().toString(36).slice(2)}.tmp`;\n\t\t\t\t\tfileHandle = await root.getFileHandle(filename, { create: true });\n\t\t\t\t\tconst writable = await fileHandle.createWritable();\n\t\t\t\t\ttarget = new StreamTarget(new WritableStream({\n\t\t\t\t\t\tasync write(chunk) {\n\t\t\t\t\t\t\tconst c = chunk;\n\t\t\t\t\t\t\tawait writable.write({\n\t\t\t\t\t\t\t\ttype: \"write\",\n\t\t\t\t\t\t\t\tposition: c.position,\n\t\t\t\t\t\t\t\tdata: c.data\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t},\n\t\t\t\t\t\tasync close() {\n\t\t\t\t\t\t\tawait writable.close();\n\t\t\t\t\t\t},\n\t\t\t\t\t\tasync abort(reason) {\n\t\t\t\t\t\t\tawait writable.abort(reason);\n\t\t\t\t\t\t}\n\t\t\t\t\t}), { chunked: true });\n\t\t\t\t} catch (e) {\n\t\t\t\t\tconsole.warn(\"[BrowserRenderer] OPFS unavailable, falling back to BufferTarget:\", e);\n\t\t\t\t\ttarget = new BufferTarget();\n\t\t\t\t}\n\t\t\t\telse target = new BufferTarget();\n\t\t\t\tif (!effectActive || !activeRef.current) return;\n\t\t\t\tconst output = new Output({\n\t\t\t\t\tformat: isMp3 ? new Mp3OutputFormat() : isWebM ? new WebMOutputFormat() : new Mp4OutputFormat(),\n\t\t\t\t\ttarget\n\t\t\t\t});\n\t\t\t\tlet videoSource = null;\n\t\t\t\tif (!skipVideo) {\n\t\t\t\t\tvideoSource = new VideoSampleSource({\n\t\t\t\t\t\tcodec: videoCodec,\n\t\t\t\t\t\tbitrate: resolvedQuality\n\t\t\t\t\t});\n\t\t\t\t\toutput.addVideoTrack(videoSource);\n\t\t\t\t}\n\t\t\t\tconst audioSource = new AudioSampleSource({\n\t\t\t\t\tcodec: audioCodec,\n\t\t\t\t\tbitrate: resolvedQuality\n\t\t\t\t});\n\t\t\t\toutput.addAudioTrack(audioSource);\n\t\t\t\tawait output.start();\n\t\t\t\tif (!effectActive || !activeRef.current) {\n\t\t\t\t\tawait output.finalize();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tstateRef.current = {\n\t\t\t\t\tinitialized: true,\n\t\t\t\t\tfinalized: false,\n\t\t\t\t\toutput,\n\t\t\t\t\tvideoSource,\n\t\t\t\t\taudioSource,\n\t\t\t\t\ttarget,\n\t\t\t\t\tfileHandle,\n\t\t\t\t\ttotalFrames,\n\t\t\t\t\tframeIndex: 0\n\t\t\t\t};\n\t\t\t\tif (skipVideo) setVideoFramesDone(true);\n\t\t\t\telse setFrame(0);\n\t\t\t} catch (err) {\n\t\t\t\tif (effectActive && activeRef.current) onErrorRef.current(err instanceof Error ? err : new Error(String(err)));\n\t\t\t}\n\t\t};\n\t\tinit();\n\t\treturn () => {\n\t\t\teffectActive = false;\n\t\t\tclearAllVideoCache(ctx?.device);\n\t\t};\n\t}, [\n\t\tctx,\n\t\tnodeId,\n\t\tformat,\n\t\tfps,\n\t\tvirtualMedia\n\t]);\n\tuseEffect(() => {\n\t\tconst state = stateRef.current;\n\t\tif (!ctx || !state.initialized || frame !== state.frameIndex || !activeRef.current || skipVideo) return;\n\t\tlet frameActive = true;\n\t\tconst processFrame = async () => {\n\t\t\ttry {\n\t\t\t\tconst renderKey = `browser-render-${nodeId}-${frame}`;\n\t\t\t\tconst renderPromise = new Promise((resolve) => {\n\t\t\t\t\tconst resolvers = window.__frameRenderResolvers ??= /* @__PURE__ */ new Map();\n\t\t\t\t\tconst existing = resolvers.get(renderKey);\n\t\t\t\t\tif (existing?.rendered) {\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t\tresolvers.delete(renderKey);\n\t\t\t\t\t} else if (existing) existing.resolver = resolve;\n\t\t\t\t\telse resolvers.set(renderKey, {\n\t\t\t\t\t\trendered: false,\n\t\t\t\t\t\tresolver: resolve\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tawait waitForDelayRender();\n\t\t\t\tawait renderPromise;\n\t\t\t\tif (!frameActive || !activeRef.current) return;\n\t\t\t\tlet pixels;\n\t\t\t\ttry {\n\t\t\t\t\tconst surfacePixels = await ctx.surface.readPixels();\n\t\t\t\t\tpixels = new Uint8Array(surfacePixels.buffer, surfacePixels.byteOffset, surfacePixels.byteLength);\n\t\t\t\t} catch (pixelErr) {\n\t\t\t\t\tthrow new Error(`WebGPU readPixels failed: ${pixelErr instanceof Error ? pixelErr.message : String(pixelErr)}. Your GPU may be out of memory — try Server rendering.`);\n\t\t\t\t}\n\t\t\t\tif (!frameActive || !activeRef.current) return;\n\t\t\t\tlet vf;\n\t\t\t\ttry {\n\t\t\t\t\tvf = new window.VideoFrame(pixels, {\n\t\t\t\t\t\tformat: \"RGBA\",\n\t\t\t\t\t\tcodedWidth: width,\n\t\t\t\t\t\tcodedHeight: height,\n\t\t\t\t\t\ttimestamp: frame / fps * 1e6\n\t\t\t\t\t});\n\t\t\t\t} catch (vfErr) {\n\t\t\t\t\tthrow new Error(\"Failed to construct VideoFrame — browser may be out of memory. Try reducing resolution/FPS or switch to Server rendering.\");\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst sample = new VideoSample(vf, {\n\t\t\t\t\t\tduration: 1 / fps,\n\t\t\t\t\t\ttimestamp: frame / fps\n\t\t\t\t\t});\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait state.videoSource.add(sample);\n\t\t\t\t\t} catch (encErr) {\n\t\t\t\t\t\tthrow new Error(`Video frame encoding failed: ${encErr instanceof Error ? encErr.message : String(encErr)}`);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tsample.close();\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tvf.close();\n\t\t\t\t}\n\t\t\t\tif (!frameActive || !activeRef.current) return;\n\t\t\t\tconst nextFrame = frame + 1;\n\t\t\t\tstate.frameIndex = nextFrame;\n\t\t\t\tif (nextFrame < state.totalFrames) {\n\t\t\t\t\tonProgressRef.current(\"rendering\", Math.round(nextFrame / state.totalFrames * 100));\n\t\t\t\t\tsetFrame(nextFrame);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"[BrowserRenderer] All video frames encoded, handing off to AudioMuxer.\");\n\t\t\t\t\tsetVideoFramesDone(true);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tif (frameActive && activeRef.current) onErrorRef.current(err instanceof Error ? err : new Error(String(err)));\n\t\t\t}\n\t\t};\n\t\tprocessFrame();\n\t\treturn () => {\n\t\t\tframeActive = false;\n\t\t};\n\t}, [\n\t\tframe,\n\t\tctx,\n\t\tfps,\n\t\tformat,\n\t\twidth,\n\t\theight,\n\t\tnodeId,\n\t\tskipVideo\n\t]);\n\tuseEffect(() => {\n\t\tif (!videoFramesDone || !ctx || !activeRef.current) return;\n\t\tconst { audioSource, initialized } = stateRef.current;\n\t\tif (!initialized || !audioSource) return;\n\t\tconsole.log(\"[BrowserRenderer] Starting AudioMuxer.run()\");\n\t\taudioMuxerRef.current.run(virtualMedia, fps, 48e3, ctx.device, audioSource).catch((err) => {\n\t\t\tconsole.error(\"[BrowserRenderer] AudioMuxer.run() threw:\", err);\n\t\t});\n\t}, [videoFramesDone]);\n\tuseEffect(() => {\n\t\tif (audioState.phase !== \"done\" || !activeRef.current) return;\n\t\tconst finalize = async () => {\n\t\t\tconst state = stateRef.current;\n\t\t\tif (!state.output || state.finalized) return;\n\t\t\tstate.finalized = true;\n\t\t\tonProgressRef.current(\"finalizing\", 100);\n\t\t\ttry {\n\t\t\t\tawait state.output.finalize();\n\t\t\t} catch (finalErr) {\n\t\t\t\tif (activeRef.current) onErrorRef.current(/* @__PURE__ */ new Error(`Finalizing output muxer failed: ${finalErr instanceof Error ? finalErr.message : String(finalErr)}. This is typically caused by insufficient system memory — please switch to Server rendering.`));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!activeRef.current) return;\n\t\t\tconst mimeType = isAudioOnly ? format === \"webm\" ? \"audio/webm\" : \"audio/mp4\" : isMp3 ? \"audio/mpeg\" : format === \"webm\" ? \"video/webm\" : \"video/mp4\";\n\t\t\tlet blob;\n\t\t\tif (state.fileHandle) {\n\t\t\t\tconst raw = await state.fileHandle.getFile();\n\t\t\t\tblob = new File([raw], `export-${nodeId}.${format}`, { type: mimeType });\n\t\t\t} else {\n\t\t\t\tconst bufferTarget = state.target;\n\t\t\t\tif (!bufferTarget.buffer) {\n\t\t\t\t\tonErrorRef.current(/* @__PURE__ */ new Error(\"Muxing completed but output buffer is empty — browser may be out of memory.\"));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tblob = new Blob([bufferTarget.buffer], { type: mimeType });\n\t\t\t}\n\t\t\tonCompleteRef.current(blob);\n\t\t};\n\t\tfinalize();\n\t}, [audioState.phase]);\n\tuseEffect(() => {\n\t\tswitch (audioState.phase) {\n\t\t\tcase \"mixing\":\n\t\t\t\tonProgressRef.current(\"audio\", 0);\n\t\t\t\tbreak;\n\t\t\tcase \"encoding\":\n\t\t\t\tonProgressRef.current(\"audio\", audioState.progress);\n\t\t\t\tbreak;\n\t\t}\n\t}, [audioState.phase, audioState.progress]);\n\tuseEffect(() => {\n\t\tif (audioState.phase === \"error\" && audioState.error && activeRef.current) onErrorRef.current(audioState.error);\n\t}, [audioState.phase, audioState.error]);\n\tif (skipVideo) return null;\n\tif (frame < 0) return null;\n\treturn /* @__PURE__ */ jsx(CanvasComposition, {\n\t\trenderId: `browser-render-${nodeId}`,\n\t\tvirtualMedia,\n\t\tcontainerWidth: width,\n\t\tcontainerHeight: height,\n\t\tframe,\n\t\tfps\n\t});\n};\nconst BrowserVideoRenderer = (props) => {\n\tconst containerRef = useRef(null);\n\treturn /* @__PURE__ */ jsx(\"div\", {\n\t\tref: containerRef,\n\t\tstyle: {\n\t\t\tposition: \"fixed\",\n\t\t\ttop: -1e4,\n\t\t\tleft: -1e4,\n\t\t\twidth: props.width,\n\t\t\theight: props.height,\n\t\t\tpointerEvents: \"none\"\n\t\t},\n\t\tchildren: /* @__PURE__ */ jsx(RenderProvider, {\n\t\t\tcontainerRef,\n\t\t\twidth: props.width,\n\t\t\theight: props.height,\n\t\t\tchildren: /* @__PURE__ */ jsx(BrowserVideoRendererInner, { ...props })\n\t\t})\n\t});\n};\n\n//#endregion\n//#region src/compositions/lut-renderer.tsx\n/**\n* Precision viewport-marker brackets, like a professional camera viewfinder.\n*/\nconst CornerBrackets = () => {\n\treturn /* @__PURE__ */ jsx(Fragment, { children: [\n\t\t{\n\t\t\tstyle: {\n\t\t\t\ttop: 10,\n\t\t\t\tleft: 10\n\t\t\t},\n\t\t\trotate: \"0deg\"\n\t\t},\n\t\t{\n\t\t\tstyle: {\n\t\t\t\ttop: 10,\n\t\t\t\tright: 10\n\t\t\t},\n\t\t\trotate: \"90deg\"\n\t\t},\n\t\t{\n\t\t\tstyle: {\n\t\t\t\tbottom: 10,\n\t\t\t\tright: 10\n\t\t\t},\n\t\t\trotate: \"180deg\"\n\t\t},\n\t\t{\n\t\t\tstyle: {\n\t\t\t\tbottom: 10,\n\t\t\t\tleft: 10\n\t\t\t},\n\t\t\trotate: \"270deg\"\n\t\t}\n\t].map((p, i) => /* @__PURE__ */ jsx(\"svg\", {\n\t\twidth: 14,\n\t\theight: 14,\n\t\tviewBox: \"0 0 14 14\",\n\t\tfill: \"none\",\n\t\tstyle: {\n\t\t\tposition: \"absolute\",\n\t\t\t...p.style,\n\t\t\ttransform: `rotate(${p.rotate})`,\n\t\t\topacity: .22,\n\t\t\tpointerEvents: \"none\"\n\t\t},\n\t\tchildren: /* @__PURE__ */ jsx(\"path\", {\n\t\t\td: \"M1 11 L1 1 L11 1\",\n\t\t\tstroke: \"white\",\n\t\t\tstrokeWidth: \"1.5\",\n\t\t\tstrokeLinecap: \"square\"\n\t\t})\n\t}, i)) });\n};\n/**\n* Animated loading state — a pulsing orbit rings + scanning grid aesthetic,\n* evoking a scope warming up to render the color space.\n*/\nconst LoadingOverlay = () => /* @__PURE__ */ jsxs(\"div\", {\n\tstyle: {\n\t\tposition: \"absolute\",\n\t\tinset: 0,\n\t\tbackground: \"#0d0d0f\",\n\t\tdisplay: \"flex\",\n\t\tflexDirection: \"column\",\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t\tgap: 16\n\t},\n\tchildren: [/* @__PURE__ */ jsxs(\"div\", {\n\t\tstyle: {\n\t\t\tposition: \"relative\",\n\t\t\twidth: 52,\n\t\t\theight: 52\n\t\t},\n\t\tchildren: [[\n\t\t\t0,\n\t\t\t1,\n\t\t\t2\n\t\t].map((i) => /* @__PURE__ */ jsx(\"div\", { style: {\n\t\t\tposition: \"absolute\",\n\t\t\tinset: `${i * 9}px`,\n\t\t\tborderRadius: \"50%\",\n\t\t\tborder: \"1px solid rgba(255,255,255,0.12)\",\n\t\t\tanimation: `lutPulse ${1.6 + i * .35}s ease-in-out infinite`,\n\t\t\tanimationDelay: `${i * .25}s`\n\t\t} }, i)), /* @__PURE__ */ jsx(\"div\", {\n\t\t\tstyle: {\n\t\t\t\tposition: \"absolute\",\n\t\t\t\tinset: 0,\n\t\t\t\tdisplay: \"flex\",\n\t\t\t\talignItems: \"center\",\n\t\t\t\tjustifyContent: \"center\"\n\t\t\t},\n\t\t\tchildren: /* @__PURE__ */ jsx(\"div\", { style: {\n\t\t\t\twidth: 5,\n\t\t\t\theight: 5,\n\t\t\t\tborderRadius: \"50%\",\n\t\t\t\tbackground: \"rgba(255,255,255,0.35)\",\n\t\t\t\tanimation: \"lutPulse 1.1s ease-in-out infinite\"\n\t\t\t} })\n\t\t})]\n\t}), /* @__PURE__ */ jsx(\"span\", {\n\t\tstyle: {\n\t\t\tfontFamily: \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\",\n\t\t\tfontSize: \"9.5px\",\n\t\t\tletterSpacing: \"0.14em\",\n\t\t\tcolor: \"rgba(255,255,255,0.18)\",\n\t\t\ttextTransform: \"uppercase\"\n\t\t},\n\t\tchildren: \"Initialising LUT\"\n\t})]\n});\n/**\n* Error state — minimal, icon-anchored, no heavy red backgrounds.\n*/\nconst ErrorOverlay = ({ message }) => /* @__PURE__ */ jsxs(\"div\", {\n\tstyle: {\n\t\tposition: \"absolute\",\n\t\tinset: 0,\n\t\tbackground: \"#0d0d0f\",\n\t\tdisplay: \"flex\",\n\t\tflexDirection: \"column\",\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t\tpadding: \"2rem\",\n\t\tgap: 10\n\t},\n\tchildren: [\n\t\t/* @__PURE__ */ jsx(\"div\", {\n\t\t\tstyle: {\n\t\t\t\twidth: 38,\n\t\t\t\theight: 38,\n\t\t\t\tborderRadius: \"50%\",\n\t\t\t\tborder: \"1px solid rgba(239,68,68,0.2)\",\n\t\t\t\tbackground: \"rgba(239,68,68,0.04)\",\n\t\t\t\tdisplay: \"flex\",\n\t\t\t\talignItems: \"center\",\n\t\t\t\tjustifyContent: \"center\"\n\t\t\t},\n\t\t\tchildren: /* @__PURE__ */ jsxs(\"svg\", {\n\t\t\t\twidth: \"14\",\n\t\t\t\theight: \"14\",\n\t\t\t\tviewBox: \"0 0 14 14\",\n\t\t\t\tfill: \"none\",\n\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"circle\", {\n\t\t\t\t\tcx: \"7\",\n\t\t\t\t\tcy: \"7\",\n\t\t\t\t\tr: \"6\",\n\t\t\t\t\tstroke: \"rgba(239,68,68,0.4)\",\n\t\t\t\t\tstrokeWidth: \"1\"\n\t\t\t\t}), /* @__PURE__ */ jsx(\"path\", {\n\t\t\t\t\td: \"M7 3.5V7.5M7 9.5H7.01\",\n\t\t\t\t\tstroke: \"rgba(239,68,68,0.55)\",\n\t\t\t\t\tstrokeWidth: \"1.4\",\n\t\t\t\t\tstrokeLinecap: \"round\"\n\t\t\t\t})]\n\t\t\t})\n\t\t}),\n\t\t/* @__PURE__ */ jsx(\"span\", {\n\t\t\tstyle: {\n\t\t\t\tfontFamily: \"-apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif\",\n\t\t\t\tfontSize: \"11.5px\",\n\t\t\t\tfontWeight: 500,\n\t\t\t\tcolor: \"rgba(255,255,255,0.35)\",\n\t\t\t\tletterSpacing: \"-0.01em\"\n\t\t\t},\n\t\t\tchildren: \"Render unavailable\"\n\t\t}),\n\t\t/* @__PURE__ */ jsx(\"span\", {\n\t\t\tstyle: {\n\t\t\t\tfontFamily: \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\",\n\t\t\t\tfontSize: \"9px\",\n\t\t\t\tcolor: \"rgba(255,255,255,0.14)\",\n\t\t\t\ttextAlign: \"center\",\n\t\t\t\tmaxWidth: 220,\n\t\t\t\tlineHeight: 1.65,\n\t\t\t\tletterSpacing: \"0.01em\"\n\t\t\t},\n\t\t\tchildren: message\n\t\t})\n\t]\n});\nconst STYLES = `\n @keyframes lutPulse {\n 0%, 100% { opacity: 0.25; }\n 50% { opacity: 0.85; }\n }\n @keyframes lutFadeUp {\n from { opacity: 0; transform: translateY(3px); }\n to { opacity: 1; transform: translateY(0); }\n }\n .lut-hud-item {\n transition: opacity 0.22s ease;\n }\n .lut-viewport:not(:hover) .lut-hud-item {\n opacity: 0;\n }\n .lut-viewport:hover .lut-hud-item {\n opacity: 1;\n }\n .lut-reset-btn:hover {\n background: rgba(255,255,255,0.1) !important;\n color: rgba(255,255,255,0.65) !important;\n }\n`;\nconst LutRenderer = ({ src, viewportWidth, viewportHeight }) => {\n\tconst canvasRef = useRef(null);\n\tconst [error, setError] = useState(null);\n\tconst [loading, setLoading] = useState(true);\n\tconst [isDragging, setIsDragging] = useState(false);\n\tconst [zoomDisplay, setZoomDisplay] = useState(2.2);\n\tconst rotationRef = useRef([.5, -.4]);\n\tconst zoomRef = useRef(2.2);\n\tconst isDraggingRef = useRef(false);\n\tconst lastMousePosRef = useRef([0, 0]);\n\tconst lastTouchRef = useRef([0, 0]);\n\tconst lutName = src.split(\"/\").pop()?.replace(/\\.[^.]+$/, \"\").toUpperCase() ?? \"LUT\";\n\tconst handleReset = useCallback(() => {\n\t\trotationRef.current = [.5, -.4];\n\t\tzoomRef.current = 2.2;\n\t\tsetZoomDisplay(2.2);\n\t}, []);\n\tconst currentLutRef = useRef(null);\n\tconst latestSrcRef = useRef(src);\n\tlatestSrcRef.current = src;\n\tuseEffect(() => {\n\t\tlet active = true;\n\t\tlet cleanupWebGPU;\n\t\tasync function initWebGPU() {\n\t\t\ttry {\n\t\t\t\tconst canvas = canvasRef.current;\n\t\t\t\tif (!canvas) return;\n\t\t\t\tconst device = await ensureDevice();\n\t\t\t\tif (!active) return;\n\t\t\t\tconst context = canvas.getContext(\"webgpu\");\n\t\t\t\tif (!context) throw new Error(\"Failed to create WebGPU context.\");\n\t\t\t\tconst format = navigator.gpu.getPreferredCanvasFormat();\n\t\t\t\tcontext.configure({\n\t\t\t\t\tdevice,\n\t\t\t\t\tformat,\n\t\t\t\t\talphaMode: \"premultiplied\"\n\t\t\t\t});\n\t\t\t\tconst shaderModule = device.createShaderModule({ code: lutViewerWgsl });\n\t\t\t\tconst uniformBuffer = device.createBuffer({\n\t\t\t\t\tsize: 20,\n\t\t\t\t\tusage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST\n\t\t\t\t});\n\t\t\t\tconst bindGroupLayout = device.createBindGroupLayout({ entries: [{\n\t\t\t\t\tbinding: 0,\n\t\t\t\t\tvisibility: GPUShaderStage.VERTEX,\n\t\t\t\t\tbuffer: {}\n\t\t\t\t}] });\n\t\t\t\tconst bindGroup = device.createBindGroup({\n\t\t\t\t\tlayout: bindGroupLayout,\n\t\t\t\t\tentries: [{\n\t\t\t\t\t\tbinding: 0,\n\t\t\t\t\t\tresource: { buffer: uniformBuffer }\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\tlet depthTexture = device.createTexture({\n\t\t\t\t\tsize: [canvas.width || 800, canvas.height || 600],\n\t\t\t\t\tformat: \"depth24plus\",\n\t\t\t\t\tusage: GPUTextureUsage.RENDER_ATTACHMENT\n\t\t\t\t});\n\t\t\t\tconst pipelineLayout = device.createPipelineLayout({ bindGroupLayouts: [bindGroupLayout] });\n\t\t\t\tconst blendState = {\n\t\t\t\t\tcolor: {\n\t\t\t\t\t\tsrcFactor: \"src-alpha\",\n\t\t\t\t\t\tdstFactor: \"one-minus-src-alpha\"\n\t\t\t\t\t},\n\t\t\t\t\talpha: {}\n\t\t\t\t};\n\t\t\t\tconst depthState = {\n\t\t\t\t\tdepthWriteEnabled: true,\n\t\t\t\t\tdepthCompare: \"less\",\n\t\t\t\t\tformat: \"depth24plus\"\n\t\t\t\t};\n\t\t\t\tconst pipeline = device.createRenderPipeline({\n\t\t\t\t\tlayout: pipelineLayout,\n\t\t\t\t\tvertex: {\n\t\t\t\t\t\tmodule: shaderModule,\n\t\t\t\t\t\tentryPoint: \"vs_main\",\n\t\t\t\t\t\tbuffers: [{\n\t\t\t\t\t\t\tarrayStride: 24,\n\t\t\t\t\t\t\tstepMode: \"instance\",\n\t\t\t\t\t\t\tattributes: [{\n\t\t\t\t\t\t\t\tshaderLocation: 0,\n\t\t\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\t\t\tformat: \"float32x3\"\n\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\tshaderLocation: 1,\n\t\t\t\t\t\t\t\toffset: 12,\n\t\t\t\t\t\t\t\tformat: \"float32x3\"\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\tfragment: {\n\t\t\t\t\t\tmodule: shaderModule,\n\t\t\t\t\t\tentryPoint: \"fs_main\",\n\t\t\t\t\t\ttargets: [{\n\t\t\t\t\t\t\tformat,\n\t\t\t\t\t\t\tblend: blendState\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\tprimitive: { topology: \"triangle-list\" },\n\t\t\t\t\tdepthStencil: depthState\n\t\t\t\t});\n\t\t\t\tconst wireframePipeline = device.createRenderPipeline({\n\t\t\t\t\tlayout: pipelineLayout,\n\t\t\t\t\tvertex: {\n\t\t\t\t\t\tmodule: shaderModule,\n\t\t\t\t\t\tentryPoint: \"vs_wireframe\"\n\t\t\t\t\t},\n\t\t\t\t\tfragment: {\n\t\t\t\t\t\tmodule: shaderModule,\n\t\t\t\t\t\tentryPoint: \"fs_wireframe\",\n\t\t\t\t\t\ttargets: [{\n\t\t\t\t\t\t\tformat,\n\t\t\t\t\t\t\tblend: blendState\n\t\t\t\t\t\t}]\n\t\t\t\t\t},\n\t\t\t\t\tprimitive: { topology: \"line-list\" },\n\t\t\t\t\tdepthStencil: depthState\n\t\t\t\t});\n\t\t\t\tlet animFrameId = 0;\n\t\t\t\tfunction frame() {\n\t\t\t\t\tif (!active) return;\n\t\t\t\t\tconst c = canvasRef.current;\n\t\t\t\t\tif (!c) return;\n\t\t\t\t\tconst rect = c.getBoundingClientRect();\n\t\t\t\t\tconst w = Math.max(1, Math.round(rect.width * window.devicePixelRatio));\n\t\t\t\t\tconst h = Math.max(1, Math.round(rect.height * window.devicePixelRatio));\n\t\t\t\t\tif (c.width !== w || c.height !== h) {\n\t\t\t\t\t\tc.width = w;\n\t\t\t\t\t\tc.height = h;\n\t\t\t\t\t\tdepthTexture.destroy();\n\t\t\t\t\t\tdepthTexture = device.createTexture({\n\t\t\t\t\t\t\tsize: [w, h],\n\t\t\t\t\t\t\tformat: \"depth24plus\",\n\t\t\t\t\t\t\tusage: GPUTextureUsage.RENDER_ATTACHMENT\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tdevice.queue.writeBuffer(uniformBuffer, 0, new Float32Array([\n\t\t\t\t\t\trotationRef.current[0],\n\t\t\t\t\t\trotationRef.current[1],\n\t\t\t\t\t\tzoomRef.current,\n\t\t\t\t\t\tw / h\n\t\t\t\t\t]));\n\t\t\t\t\tconst enc = device.createCommandEncoder();\n\t\t\t\t\tconst pass = enc.beginRenderPass({\n\t\t\t\t\t\tcolorAttachments: [{\n\t\t\t\t\t\t\tview: context.getCurrentTexture().createView(),\n\t\t\t\t\t\t\tclearValue: {\n\t\t\t\t\t\t\t\tr: .07,\n\t\t\t\t\t\t\t\tg: .07,\n\t\t\t\t\t\t\t\tb: .08,\n\t\t\t\t\t\t\t\ta: 1\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tloadOp: \"clear\",\n\t\t\t\t\t\t\tstoreOp: \"store\"\n\t\t\t\t\t\t}],\n\t\t\t\t\t\tdepthStencilAttachment: {\n\t\t\t\t\t\t\tview: depthTexture.createView(),\n\t\t\t\t\t\t\tdepthClearValue: 1,\n\t\t\t\t\t\t\tdepthLoadOp: \"clear\",\n\t\t\t\t\t\t\tdepthStoreOp: \"store\"\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tpass.setPipeline(wireframePipeline);\n\t\t\t\t\tpass.setBindGroup(0, bindGroup);\n\t\t\t\t\tpass.draw(24, 1, 0, 0);\n\t\t\t\t\tconst lut = currentLutRef.current;\n\t\t\t\t\tif (lut) {\n\t\t\t\t\t\tpass.setPipeline(pipeline);\n\t\t\t\t\t\tpass.setBindGroup(0, bindGroup);\n\t\t\t\t\t\tpass.setVertexBuffer(0, lut.vertexBuffer);\n\t\t\t\t\t\tpass.draw(6, lut.vertexCount, 0, 0);\n\t\t\t\t\t}\n\t\t\t\t\tpass.end();\n\t\t\t\t\tdevice.queue.submit([enc.finish()]);\n\t\t\t\t\tanimFrameId = requestAnimationFrame(frame);\n\t\t\t\t}\n\t\t\t\tanimFrameId = requestAnimationFrame(frame);\n\t\t\t\tcleanupWebGPU = () => {\n\t\t\t\t\tcancelAnimationFrame(animFrameId);\n\t\t\t\t\tuniformBuffer.destroy();\n\t\t\t\t\tdepthTexture.destroy();\n\t\t\t\t};\n\t\t\t} catch (err) {\n\t\t\t\tif (active) {\n\t\t\t\t\tsetError(err instanceof Error ? err.message : \"Error loading LUT\");\n\t\t\t\t\tsetLoading(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tinitWebGPU();\n\t\treturn () => {\n\t\t\tactive = false;\n\t\t\tcleanupWebGPU?.();\n\t\t};\n\t}, []);\n\tuseEffect(() => {\n\t\tlet active = true;\n\t\tasync function loadLut() {\n\t\t\ttry {\n\t\t\t\tconst device = await ensureDevice();\n\t\t\t\tif (!active) return;\n\t\t\t\tconst cached = lutStore.get(src, device);\n\t\t\t\tif (cached) {\n\t\t\t\t\tcurrentLutRef.current = cached;\n\t\t\t\t\tsetLoading(false);\n\t\t\t\t\tsetError(null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (src.startsWith(\"runtime://lut/\")) {\n\t\t\t\t\tconst prefix = src.substring(0, src.lastIndexOf(\"-\") + 1);\n\t\t\t\t\tif (prefix) {\n\t\t\t\t\t\tconst fallback = lutStore.getAnyMatching(prefix, device);\n\t\t\t\t\t\tif (fallback) {\n\t\t\t\t\t\t\tcurrentLutRef.current = fallback;\n\t\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!currentLutRef.current) setLoading(true);\n\t\t\t\tsetError(null);\n\t\t\t\tconst loaded = await lutStore.getOrLoad(src, device);\n\t\t\t\tif (!active) return;\n\t\t\t\tif (latestSrcRef.current === src) {\n\t\t\t\t\tcurrentLutRef.current = loaded;\n\t\t\t\t\tsetLoading(false);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tif (active && latestSrcRef.current === src) {\n\t\t\t\t\tsetError(err instanceof Error ? err.message : \"Error loading LUT\");\n\t\t\t\t\tsetLoading(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tloadLut();\n\t\treturn () => {\n\t\t\tactive = false;\n\t\t};\n\t}, [src]);\n\tconst handleMouseDown = (e) => {\n\t\tisDraggingRef.current = true;\n\t\tsetIsDragging(true);\n\t\tlastMousePosRef.current = [e.clientX, e.clientY];\n\t};\n\tconst handleMouseMove = (e) => {\n\t\tif (!isDraggingRef.current) return;\n\t\tconst dx = e.clientX - lastMousePosRef.current[0];\n\t\tconst dy = e.clientY - lastMousePosRef.current[1];\n\t\tlastMousePosRef.current = [e.clientX, e.clientY];\n\t\trotationRef.current[0] += dx * .005;\n\t\trotationRef.current[1] = Math.max(-Math.PI / 2.1, Math.min(Math.PI / 2.1, rotationRef.current[1] + dy * .005));\n\t};\n\tconst handleMouseUp = () => {\n\t\tisDraggingRef.current = false;\n\t\tsetIsDragging(false);\n\t};\n\tconst handleWheel = (e) => {\n\t\tconst next = Math.max(1.1, Math.min(5, zoomRef.current + e.deltaY * .002));\n\t\tzoomRef.current = next;\n\t\tsetZoomDisplay(Math.round(next * 10) / 10);\n\t};\n\tconst handleTouchStart = (e) => {\n\t\tif (e.touches.length === 1) {\n\t\t\tisDraggingRef.current = true;\n\t\t\tlastTouchRef.current = [e.touches[0].clientX, e.touches[0].clientY];\n\t\t}\n\t};\n\tconst handleTouchMove = (e) => {\n\t\tif (!isDraggingRef.current || e.touches.length !== 1) return;\n\t\tconst dx = e.touches[0].clientX - lastTouchRef.current[0];\n\t\tconst dy = e.touches[0].clientY - lastTouchRef.current[1];\n\t\tlastTouchRef.current = [e.touches[0].clientX, e.touches[0].clientY];\n\t\trotationRef.current[0] += dx * .005;\n\t\trotationRef.current[1] = Math.max(-Math.PI / 2.1, Math.min(Math.PI / 2.1, rotationRef.current[1] + dy * .005));\n\t};\n\tconst handleTouchEnd = () => {\n\t\tisDraggingRef.current = false;\n\t};\n\tconst isActive = !loading && !error;\n\treturn /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(\"style\", { children: STYLES }), /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: \"lut-viewport nowheel\",\n\t\tstyle: {\n\t\t\tposition: \"relative\",\n\t\t\twidth: \"100%\",\n\t\t\taspectRatio: `${viewportWidth} / ${viewportHeight}`,\n\t\t\tbackground: \"#0d0d0f\",\n\t\t\tborderRadius: 10,\n\t\t\toverflow: \"hidden\",\n\t\t\tborder: isDragging ? \"1px solid rgba(255,255,255,0.14)\" : \"1px solid rgba(255,255,255,0.06)\",\n\t\t\tboxShadow: \"inset 0 0 0 1px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.45)\",\n\t\t\ttransition: \"border-color 0.18s ease\",\n\t\t\tuserSelect: \"none\"\n\t\t},\n\t\tonMouseDown: handleMouseDown,\n\t\tonMouseMove: handleMouseMove,\n\t\tonMouseUp: handleMouseUp,\n\t\tonMouseLeave: handleMouseUp,\n\t\tonWheel: handleWheel,\n\t\tonTouchStart: handleTouchStart,\n\t\tonTouchMove: handleTouchMove,\n\t\tonTouchEnd: handleTouchEnd,\n\t\tchildren: [\n\t\t\t/* @__PURE__ */ jsx(\"canvas\", {\n\t\t\t\tref: canvasRef,\n\t\t\t\tstyle: {\n\t\t\t\t\tdisplay: \"block\",\n\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\theight: \"100%\",\n\t\t\t\t\tcursor: isDragging ? \"grabbing\" : \"grab\",\n\t\t\t\t\ttouchAction: \"none\"\n\t\t\t\t}\n\t\t\t}),\n\t\t\tisActive && /* @__PURE__ */ jsx(CornerBrackets, {}),\n\t\t\tisActive && /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\tclassName: \"lut-hud-item\",\n\t\t\t\tstyle: {\n\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\ttop: 12,\n\t\t\t\t\tleft: 12,\n\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\talignItems: \"center\",\n\t\t\t\t\tgap: 5,\n\t\t\t\t\tbackground: \"rgba(0,0,0,0.5)\",\n\t\t\t\t\tbackdropFilter: \"blur(10px)\",\n\t\t\t\t\tWebkitBackdropFilter: \"blur(10px)\",\n\t\t\t\t\tborder: \"1px solid rgba(255,255,255,0.07)\",\n\t\t\t\t\tborderRadius: 5,\n\t\t\t\t\tpadding: \"3px 9px 3px 7px\",\n\t\t\t\t\tanimation: \"lutFadeUp 0.35s ease\"\n\t\t\t\t},\n\t\t\t\tchildren: [/* @__PURE__ */ jsxs(\"svg\", {\n\t\t\t\t\twidth: \"9\",\n\t\t\t\t\theight: \"9\",\n\t\t\t\t\tviewBox: \"0 0 9 9\",\n\t\t\t\t\tfill: \"none\",\n\t\t\t\t\t\"aria-hidden\": true,\n\t\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"path\", {\n\t\t\t\t\t\td: \"M4.5 0.5L8.5 2.5V6.5L4.5 8.5L0.5 6.5V2.5L4.5 0.5Z\",\n\t\t\t\t\t\tstroke: \"rgba(255,255,255,0.28)\",\n\t\t\t\t\t\tstrokeWidth: \"0.8\"\n\t\t\t\t\t}), /* @__PURE__ */ jsx(\"path\", {\n\t\t\t\t\t\td: \"M4.5 0.5V4.5M4.5 4.5L8.5 2.5M4.5 4.5L0.5 2.5\",\n\t\t\t\t\t\tstroke: \"rgba(255,255,255,0.14)\",\n\t\t\t\t\t\tstrokeWidth: \"0.8\"\n\t\t\t\t\t})]\n\t\t\t\t}), /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tfontFamily: \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\",\n\t\t\t\t\t\tfontSize: \"9.5px\",\n\t\t\t\t\t\tletterSpacing: \"0.1em\",\n\t\t\t\t\t\tcolor: \"rgba(255,255,255,0.4)\",\n\t\t\t\t\t\ttextTransform: \"uppercase\"\n\t\t\t\t\t},\n\t\t\t\t\tchildren: lutName\n\t\t\t\t})]\n\t\t\t}),\n\t\t\tisActive && /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\tclassName: \"lut-hud-item\",\n\t\t\t\tstyle: {\n\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\tbottom: 0,\n\t\t\t\t\tleft: 0,\n\t\t\t\t\tright: 0,\n\t\t\t\t\tpadding: \"14px 12px 10px\",\n\t\t\t\t\tbackground: \"linear-gradient(to top, rgba(0,0,0,0.55), transparent)\",\n\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\talignItems: \"center\",\n\t\t\t\t\tjustifyContent: \"space-between\",\n\t\t\t\t\tpointerEvents: \"none\"\n\t\t\t\t},\n\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tfontFamily: \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\",\n\t\t\t\t\t\tfontSize: \"9px\",\n\t\t\t\t\t\tletterSpacing: \"0.1em\",\n\t\t\t\t\t\tcolor: \"rgba(255,255,255,0.2)\",\n\t\t\t\t\t\ttextTransform: \"uppercase\"\n\t\t\t\t\t},\n\t\t\t\t\tchildren: \"Drag to Rotate · Scroll to Zoom\"\n\t\t\t\t}), /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\t\talignItems: \"center\",\n\t\t\t\t\t\tgap: 6,\n\t\t\t\t\t\tpointerEvents: \"auto\"\n\t\t\t\t\t},\n\t\t\t\t\tchildren: [/* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tbackground: \"rgba(255,255,255,0.05)\",\n\t\t\t\t\t\t\tborder: \"1px solid rgba(255,255,255,0.09)\",\n\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\tpadding: \"2px 8px\",\n\t\t\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\t\t\talignItems: \"baseline\",\n\t\t\t\t\t\t\tgap: 3\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\tfontFamily: \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\",\n\t\t\t\t\t\t\t\tfontSize: \"8.5px\",\n\t\t\t\t\t\t\t\tcolor: \"rgba(255,255,255,0.22)\",\n\t\t\t\t\t\t\t\tletterSpacing: \"0.06em\",\n\t\t\t\t\t\t\t\ttextTransform: \"uppercase\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tchildren: \"Z\"\n\t\t\t\t\t\t}), /* @__PURE__ */ jsxs(\"span\", {\n\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\tfontFamily: \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\",\n\t\t\t\t\t\t\t\tfontSize: \"10.5px\",\n\t\t\t\t\t\t\t\tcolor: \"rgba(255,255,255,0.5)\",\n\t\t\t\t\t\t\t\tletterSpacing: \"0.02em\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tchildren: [zoomDisplay.toFixed(1), \"×\"]\n\t\t\t\t\t\t})]\n\t\t\t\t\t}), /* @__PURE__ */ jsx(\"button\", {\n\t\t\t\t\t\tclassName: \"lut-reset-btn\",\n\t\t\t\t\t\tonClick: (e) => {\n\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\thandleReset();\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttitle: \"Reset camera to default view\",\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tbackground: \"rgba(255,255,255,0.04)\",\n\t\t\t\t\t\t\tborder: \"1px solid rgba(255,255,255,0.09)\",\n\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\tpadding: \"3px 8px\",\n\t\t\t\t\t\t\tcursor: \"pointer\",\n\t\t\t\t\t\t\tfontFamily: \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\",\n\t\t\t\t\t\t\tfontSize: \"9px\",\n\t\t\t\t\t\t\tletterSpacing: \"0.08em\",\n\t\t\t\t\t\t\ttextTransform: \"uppercase\",\n\t\t\t\t\t\t\tcolor: \"rgba(255,255,255,0.3)\",\n\t\t\t\t\t\t\ttransition: \"background 0.15s, color 0.15s\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: \"Reset\"\n\t\t\t\t\t})]\n\t\t\t\t})]\n\t\t\t}),\n\t\t\tloading && /* @__PURE__ */ jsx(LoadingOverlay, {}),\n\t\t\terror && /* @__PURE__ */ jsx(ErrorOverlay, { message: error })\n\t\t]\n\t})] });\n};\n\n//#endregion\nexport { AudioCompositionClip, AudioMuxer, AudioProcessorContext, BrowserVideoRenderer, CanvasComposition, CompositionScene, LutRenderer, NativeAudioClip, RenderTimelineProvider, calculateLayerTransform, checkBrowserRenderSupport, compositionStateStore, computeRenderParams, decodeAudioSource, drawCompositionTree, formatTimecode, framesToSeconds, getFontUrl, isStaticVisualMedia, mixAudioTracks, normalizeTimeline, resolveLayerDuration, second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