@spatial-elements/core 1.0.0-beta.3 → 1.0.0-beta.5
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.
- package/README.md +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.d.ts +1 -0
- package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -1
- package/dist/catalog/CatalogSpatialElementLayer.js +13 -1
- package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -1
- package/dist/catalog/carouselMotion.d.ts +39 -0
- package/dist/catalog/carouselMotion.d.ts.map +1 -0
- package/dist/catalog/carouselMotion.js +104 -0
- package/dist/catalog/carouselMotion.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.d.ts +1 -1
- package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -1
- package/dist/spatial-element/SpatialElementDockController.js +29 -2
- package/dist/spatial-element/SpatialElementDockController.js.map +1 -1
- package/dist/spatial-element/messages.d.ts +34 -0
- package/dist/spatial-element/messages.d.ts.map +1 -0
- package/dist/spatial-element/messages.js +34 -0
- package/dist/spatial-element/messages.js.map +1 -0
- package/dist/spatial-element/spatialTheme.d.ts.map +1 -1
- package/dist/spatial-element/spatialTheme.js +1 -0
- package/dist/spatial-element/spatialTheme.js.map +1 -1
- package/dist/spatial-element/types.d.ts +2 -0
- package/dist/spatial-element/types.d.ts.map +1 -1
- package/dist/spatial-element/types.js.map +1 -1
- package/dist/stage/LiquidGlassPanel.d.ts +2 -0
- package/dist/stage/LiquidGlassPanel.d.ts.map +1 -1
- package/dist/stage/LiquidGlassPanel.js +11 -2
- package/dist/stage/LiquidGlassPanel.js.map +1 -1
- package/dist/stage/MinimapController.d.ts +3 -1
- package/dist/stage/MinimapController.d.ts.map +1 -1
- package/dist/stage/MinimapController.js +23 -20
- package/dist/stage/MinimapController.js.map +1 -1
- package/dist/stage/ModelPointerPreview.d.ts +22 -0
- package/dist/stage/ModelPointerPreview.d.ts.map +1 -0
- package/dist/stage/ModelPointerPreview.js +71 -0
- package/dist/stage/ModelPointerPreview.js.map +1 -0
- package/dist/stage/PageBindingController.d.ts +4 -0
- package/dist/stage/PageBindingController.d.ts.map +1 -1
- package/dist/stage/PageBindingController.js +17 -4
- package/dist/stage/PageBindingController.js.map +1 -1
- package/dist/stage/PanelPresentationController.d.ts +4 -1
- package/dist/stage/PanelPresentationController.d.ts.map +1 -1
- package/dist/stage/PanelPresentationController.js +91 -12
- package/dist/stage/PanelPresentationController.js.map +1 -1
- package/dist/stage/SpatialElementInteractionController.d.ts +12 -0
- package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
- package/dist/stage/SpatialElementInteractionController.js +125 -11
- package/dist/stage/SpatialElementInteractionController.js.map +1 -1
- package/dist/stage/StageExperience.d.ts +30 -1
- package/dist/stage/StageExperience.d.ts.map +1 -1
- package/dist/stage/StageExperience.js +214 -55
- package/dist/stage/StageExperience.js.map +1 -1
- package/dist/stage/StageFullscreenController.d.ts +17 -0
- package/dist/stage/StageFullscreenController.d.ts.map +1 -0
- package/dist/stage/StageFullscreenController.js +90 -0
- package/dist/stage/StageFullscreenController.js.map +1 -0
- package/dist/stage/StagePanelRuntime.d.ts +2 -1
- package/dist/stage/StagePanelRuntime.d.ts.map +1 -1
- package/dist/stage/StagePanelRuntime.js.map +1 -1
- package/dist/stage/StageRenderPipeline.d.ts +6 -0
- package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
- package/dist/stage/StageRenderPipeline.js +41 -9
- package/dist/stage/StageRenderPipeline.js.map +1 -1
- package/dist/stage/VirtualScrollController.d.ts.map +1 -1
- package/dist/stage/VirtualScrollController.js +6 -0
- package/dist/stage/VirtualScrollController.js.map +1 -1
- package/dist/stage/interactionGuidance.d.ts +22 -0
- package/dist/stage/interactionGuidance.d.ts.map +1 -0
- package/dist/stage/interactionGuidance.js +53 -0
- package/dist/stage/interactionGuidance.js.map +1 -0
- package/dist/stage/minimap/MinimapProjection.d.ts +7 -0
- package/dist/stage/minimap/MinimapProjection.d.ts.map +1 -1
- package/dist/stage/minimap/MinimapProjection.js +14 -13
- package/dist/stage/minimap/MinimapProjection.js.map +1 -1
- package/dist/stage/mouseHover.d.ts +9 -0
- package/dist/stage/mouseHover.d.ts.map +1 -0
- package/dist/stage/mouseHover.js +55 -0
- package/dist/stage/mouseHover.js.map +1 -0
- package/dist/stage/panelContext.d.ts +15 -1
- package/dist/stage/panelContext.d.ts.map +1 -1
- package/dist/stage/panelContext.js.map +1 -1
- package/dist/stage/scrollFrame.d.ts +2 -0
- package/dist/stage/scrollFrame.d.ts.map +1 -1
- package/dist/stage/scrollFrame.js +18 -5
- package/dist/stage/scrollFrame.js.map +1 -1
- package/dist/stage/stageConstants.d.ts +3 -3
- package/dist/stage/stageConstants.d.ts.map +1 -1
- package/dist/stage/stageConstants.js +3 -3
- package/dist/stage/stageConstants.js.map +1 -1
- package/dist/stage/stageDom.d.ts +2 -0
- package/dist/stage/stageDom.d.ts.map +1 -1
- package/dist/stage/stageDom.js +4 -0
- package/dist/stage/stageDom.js.map +1 -1
- package/dist/stage/stageMath.d.ts +6 -7
- package/dist/stage/stageMath.d.ts.map +1 -1
- package/dist/stage/stageMath.js +12 -11
- package/dist/stage/stageMath.js.map +1 -1
- package/dist/stage/stageTypes.d.ts +12 -2
- package/dist/stage/stageTypes.d.ts.map +1 -1
- package/dist/stage/stageTypes.js.map +1 -1
- package/dist/stage/stageVisualTest.d.ts +5 -1
- package/dist/stage/stageVisualTest.d.ts.map +1 -1
- package/dist/stage/stageVisualTest.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageRenderPipeline.js","sourceRoot":"","sources":["../../src/stage/StageRenderPipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,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,CAAC,KAAK,EAAE,CAAC;gBAC7B,CAAC;YACF,CAAC;iBAAM,CAAC;gBACP,IAAI,CAAC,IAAI,CAAC,oBAAoB;oBAAE,OAAO;gBACvC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;gBAC5E,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;gBACzB,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;gBACxD,IAAI,OAAO;oBAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;gBAChF,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAC1B,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAC/B,CAAC;YACD,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC1B,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC9B,CAAC,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["import { getRefinementSize } from './SpatialElementRefinement.js';\nimport { getMinimapMeasurementMode } from './minimapMeasurement.js';\nimport { parseRenderMeasurement } from './renderMeasurement.js';\nimport type { PreparedHigh } from '../catalog/CatalogPreparation.js';\nimport { gaussianTargets } from './renderTargetInventory.js';\nimport { withRendererState, withVisibility } from './rendererState.js';\n\nimport type { StagePanelRuntime } from './StagePanelRuntime.js';\n\nimport * as THREE from 'three/webgpu';\n\nimport { CatalogSpatialElementLayer } from '../catalog/CatalogSpatialElementLayer.js';\nimport { SpatialGeometryCapture } from '../catalog/SpatialGeometryCapture.js';\n\nimport { gaussianBlur } from 'three/addons/tsl/display/GaussianBlurNode.js';\nimport {\n\tFn,\n\tfloat,\n\tIf,\n\tmix,\n\tcolor,\n\tmax as tslMax,\n\tmin as tslMin,\n\tpremultiplyAlpha,\n\ttexture,\n\tuniform,\n\tuv,\n\tvec2,\n\tvec4\n} from 'three/tsl';\nimport type { Mesh, Object3D } from 'three';\nimport {\n\tinverseAcesToneMapping,\n\tSTAGE_TONE_MAPPING_EXPOSURE,\n\ttype LiquidGlassPanelOptions\n} from './LiquidGlassPanel.js';\n\nimport type { StageMinimapState } from './minimap/MinimapState.js';\nimport { isMesh } from './stageSceneUtils.js';\nimport type { StageInteractionTheme, StageRenderSettings } from './stageTypes.js';\nimport { getStageRenderPixelRatio, resolveStageRenderSettings } from './renderSettings.js';\ninterface PanelBlurCapture {\n\t/** Intermediate pixels per CSS pixel; independent of output DPR/scroll quality. */\n\tresolutionScale: number;\n\teffect?: ReturnType<typeof gaussianBlur>;\n\tmaterial: THREE.NodeMaterial;\n\tquad: THREE.QuadMesh;\n\ttarget: THREE.RenderTarget;\n}\ninterface StageRenderTargetSet {\n\tscale: number;\n\tsceneCapture: THREE.RenderTarget;\n\tpanelBlurCaptures: Map<number, PanelBlurCapture>;\n}\nconst SCROLL_RENDER_SCALE = 0.82;\n\nexport interface StageRenderPorts {\n\tpageBackground?: string;\n\trenderSettings?: StageRenderSettings;\n\trenderer: THREE.WebGPURenderer;\n\tcontainer: HTMLElement;\n\tbackgroundCanvas: HTMLCanvasElement;\n\tbackgroundCanvasTarget: THREE.CanvasTarget;\n\tscene: THREE.Scene;\n\tbackgroundScene: THREE.Scene;\n\ttintScene: THREE.Scene;\n\tpanelScene: THREE.Scene;\n\tcamera: THREE.PerspectiveCamera;\n\tpanelCamera: THREE.PerspectiveCamera;\n\ttintCamera: THREE.OrthographicCamera;\n\tpanelRuntimes(): readonly StagePanelRuntime[];\n\tminimaps(): ReadonlyMap<number, StageMinimapState>;\n\tminimapScene(): THREE.Scene;\n\tcatalogLayer(): Pick<CatalogSpatialElementLayer, 'hasCarousel' | 'renderRear' | 'draw'> | undefined;\n\tspatialCapture(): SpatialGeometryCapture | undefined;\n\texitingMinimaps(): readonly { capture: SpatialGeometryCapture; minimap: StageMinimapState }[];\n\tcontentSecondaries(): readonly { capture: SpatialGeometryCapture }[];\n\tfallbackPanelOptions(): readonly LiquidGlassPanelOptions[];\n\tinteractionTheme(): StageInteractionTheme;\n\tframe(): Readonly<{\n\t\toutgoingBackground: boolean;\n\t\tcatalogDockTarget: boolean;\n\t\tcatalogHandoff: boolean;\n\t\tcatalogMotionComplete: boolean;\n\t\tstageViewportVisible: boolean;\n\t\tmodelHover: boolean;\n\t\tmodelInteractionActive: boolean;\n\t\tcatalog: boolean;\n\t\tpageModelReady: boolean;\n\t\tbackgroundReveal: number;\n\t}>;\n\trenderStage(): void;\n\trenderMinimapBlur(minimap: StageMinimapState): void;\n\trenderMinimapPanelCapture(minimap: StageMinimapState): void;\n\tgetPanelTransitionOpacity(panel?: StagePanelRuntime): number;\n\tisInteractionMesh(mesh: Mesh): boolean;\n}\n\n/** Owns GPU output bands, passes and target lifetimes; never schedules frames or navigation. */\nexport class StageRenderPipeline {\n\tprivate readonly measurementMode = getMinimapMeasurementMode();\n\tprivate readonly renderMeasurement = parseRenderMeasurement(\n\t\ttypeof window === 'undefined' ? '' : (window.location?.search ?? '')\n\t);\n\tprivate readonly fuseOutline = ![\n\t\t'halo-separate',\n\t\t'halo-mask-only',\n\t\t'halo-frozen-mask',\n\t\t'halo-half-mask'\n\t].includes(this.renderMeasurement);\n\tprivate readonly measuredBackdropSeeds = new WeakMap<THREE.RenderTarget, string>();\n\tprivate readonly preparedZoomViews = new WeakSet<StageMinimapState>();\n\tprivate disposed = false;\n\tprivate renderSettings = resolveStageRenderSettings();\n\t/** Retain the last DETAIL background while its geometry is owned by a transition. */\n\tfreezeBackground() {\n\t\tconst targets = this._activeRenderTargets;\n\t\tif (!targets) return false;\n\t\twithRendererState(this.ports.renderer, () => {\n\t\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\t\tthis.ports.renderer.setRenderTarget(targets.sceneCapture);\n\t\t\tthis.renderStageContents();\n\t\t\tthis.renderStageDisplay();\n\t\t\tthis.renderBackgroundPanels();\n\t\t});\n\t\treturn true;\n\t}\n\tasync warmHigh(high: PreparedHigh, environment: THREE.Texture, drawLow: () => void) {\n\t\tconst scene = new THREE.Scene();\n\t\tscene.environment = environment;\n\t\tscene.environmentIntensity = 0.5;\n\t\tscene.add(high.pose);\n\t\tconst camera = new THREE.PerspectiveCamera(\n\t\t\t45,\n\t\t\twindow.innerWidth / window.innerHeight,\n\t\t\t0.01,\n\t\t\t100\n\t\t);\n\t\tcamera.position.z = 5;\n\t\tconst size = this.ports.renderer.getDrawingBufferSize(new THREE.Vector2());\n\t\tconst warmSize = getRefinementSize(size.x, size.y);\n\t\tconst target = new THREE.RenderTarget(warmSize.width, warmSize.height, {\n\t\t\ttype: THREE.HalfFloatType,\n\t\t\tsamples: 4\n\t\t});\n\t\tconst destination = this.ports.renderer.getRenderTarget();\n\t\tconst clear = this.ports.renderer.getClearColor(new THREE.Color());\n\t\tconst alpha = this.ports.renderer.getClearAlpha();\n\t\ttry {\n\t\t\tthis.ports.renderer.setRenderTarget(target);\n\t\t\tthis.ports.renderer.setClearColor(0, 0);\n\t\t\thigh.blend.render(\n\t\t\t\tthis.ports.renderer,\n\t\t\t\t(useHigh) => {\n\t\t\t\t\tthis.ports.renderer.clear();\n\t\t\t\t\tif (useHigh) this.ports.renderer.render(scene, camera);\n\t\t\t\t\telse drawLow();\n\t\t\t\t},\n\t\t\t\tfalse,\n\t\t\t\t0\n\t\t\t);\n\t\t} finally {\n\t\t\tthis.ports.renderer.setRenderTarget(destination);\n\t\t\tthis.ports.renderer.setClearColor(clear, alpha);\n\t\t\thigh.pose.removeFromParent();\n\t\t\ttarget.dispose();\n\t\t}\n\t\tconst device = (this.ports.renderer.backend as unknown as { device?: GPUDevice }).device;\n\t\tawait device?.queue.onSubmittedWorkDone();\n\t}\n\n\tgetRenderTargets() {\n\t\treturn [\n\t\t\t...(this.outlineMaskTarget ? [this.outlineMaskTarget] : []),\n\t\t\t...[this.fullQualityTargets, this.scrollQualityTargets].flatMap((set) =>\n\t\t\t\tset\n\t\t\t\t\t? [\n\t\t\t\t\t\t\tset.sceneCapture,\n\t\t\t\t\t\t\t...[...set.panelBlurCaptures.values()].flatMap((blur) => [\n\t\t\t\t\t\t\t\tblur.target,\n\t\t\t\t\t\t\t\t...gaussianTargets(blur.effect)\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)\n\t\t];\n\t}\n\tgetCanvasOutputs() {\n\t\treturn [\n\t\t\tthis.ports.backgroundCanvasTarget,\n\t\t\tthis.foregroundCanvasTarget,\n\t\t\tthis.carouselRearTarget\n\t\t].flatMap((target, index) => {\n\t\t\tif (!target) return [];\n\t\t\tconst size = target.getDrawingBufferSize(new THREE.Vector2());\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tband: ['background', 'foreground', 'carousel-rear'][index],\n\t\t\t\t\twidth: size.x,\n\t\t\t\t\theight: size.y,\n\t\t\t\t\tcolorAttachments: 1,\n\t\t\t\t\tdepthAttachments: 1\n\t\t\t\t}\n\t\t\t];\n\t\t});\n\t}\n\tconstructor(private readonly ports: StageRenderPorts) {\n\t\tthis.setRenderSettings(ports.renderSettings);\n\t\tthis.setPageBackground(ports.pageBackground ?? '#ffffff');\n\t\tthis.backgroundCoverMaterial.fragmentNode = premultiplyAlpha(\n\t\t\tvec4(inverseAcesToneMapping(this.backgroundCoverColor), this.backgroundCoverOpacity)\n\t\t);\n\t\tthis.backgroundCoverMaterial.depthTest = this.backgroundCoverMaterial.depthWrite = false;\n\t\tthis.backgroundCoverMaterial.transparent =\n\t\t\tthis.backgroundCoverMaterial.premultipliedAlpha = true;\n\t\tthis.backgroundCoverMaterial.toneMapped = false;\n\t}\n\tprivate readonly backgroundCoverOpacity = uniform(0);\n\tprivate readonly backgroundCoverColor = uniform(new THREE.Vector3(1, 1, 1));\n\tsetPageBackground(value: string) {\n\t\tconst color = new THREE.Color(value);\n\t\tthis.backgroundCoverColor.value.set(color.r, color.g, color.b);\n\t}\n\tprivate readonly backgroundCoverMaterial = new THREE.NodeMaterial();\n\tprivate readonly backgroundCover = new THREE.QuadMesh(this.backgroundCoverMaterial);\n\tprivate readonly outlineMaskScene = new THREE.Scene();\n\tprivate _minimapOverlayCapturePasses = 0;\n\tprivate _renderTargetSetCreations = 0;\n\tprivate _renderTargetSetResizes = 0;\n\tprivate _renderTargetSetWarmups = 0;\n\tprivate _stageModelRenderPasses = 0;\n\tprivate _panelBlurRenderPasses = 0;\n\tprivate _panelSceneRenderPasses = 0;\n\tprivate _minimapSceneRenderPasses = 0;\n\tprivate outlineMaskModel?: Object3D;\n\tprivate outlineMaskMaterial?: THREE.MeshBasicMaterial;\n\tprivate outlineCompositeMaterial?: THREE.MeshBasicNodeMaterial;\n\tprivate outlineQuad?: THREE.QuadMesh;\n\tprivate outlineMaskTarget?: THREE.RenderTarget;\n\tprivate outlineMaskValid = false;\n\tprivate readonly emptyOutlineMask = new THREE.DataTexture(new Uint8Array(4), 1, 1);\n\tprivate readonly displayOutlineMask = texture(this.emptyOutlineMask);\n\tprivate readonly displayOutlineOpacity = uniform(0);\n\tprivate outlineWidth = 1;\n\tprivate outlineHeight = 1;\n\tprivate outlineTexel = uniform(new THREE.Vector2(1, 1));\n\tprivate outlineGlowTexel = uniform(new THREE.Vector2(1, 1));\n\tprivate outlineOpacityScale = uniform(1);\n\tprivate fullQualityTargets?: StageRenderTargetSet;\n\tprivate scrollQualityTargets?: StageRenderTargetSet;\n\tprivate _activeRenderTargets?: StageRenderTargetSet;\n\tprivate stageDisplayMaterial?: THREE.NodeMaterial;\n\tprivate _stageDisplayQuad?: THREE.QuadMesh;\n\tprivate stageDisplayTextureNode?: THREE.TextureNode;\n\tprivate foregroundCanvasTarget?: THREE.CanvasTarget;\n\tprivate carouselRearTarget?: THREE.CanvasTarget;\n\tprivate carouselRearCanvas?: HTMLCanvasElement;\n\tprivate carouselRearSize = new THREE.Vector3();\n\tprivate foregroundCanvas?: HTMLCanvasElement;\n\tconfigureRenderer() {\n\t\tthis.ports.renderer.toneMapping = THREE.ACESFilmicToneMapping;\n\t\tthis.ports.renderer.toneMappingExposure = STAGE_TONE_MAPPING_EXPOSURE;\n\t\tthis.ports.renderer.setClearColor(0xffffff, 1);\n\t\tthis.ports.renderer.autoClear = false;\n\t\tthis.ports.backgroundCanvas.tabIndex = -1;\n\t\tthis.ports.backgroundCanvas.style.touchAction = 'pan-y';\n\t}\n\trenderCarouselRear() {\n\t\tif (!this.carouselRearTarget && !this.ports.catalogLayer()?.hasCarousel()) return;\n\t\tif (!this.carouselRearTarget) {\n\t\t\tconst canvas = document.createElement('canvas');\n\t\t\tcanvas.className = 'stage-webgpu-carousel-rear';\n\t\t\tcanvas.setAttribute('aria-hidden', 'true');\n\t\t\tthis.carouselRearCanvas = canvas;\n\t\t\tthis.carouselRearTarget = new THREE.CanvasTarget(canvas);\n\t\t\tthis.ports.container.appendChild(canvas);\n\t\t}\n\t\tconst target = this.carouselRearTarget;\n\t\tconst width = window.innerWidth,\n\t\t\theight = window.innerHeight,\n\t\t\tratio = this.getFullPixelRatio();\n\t\tif (\n\t\t\tthis.carouselRearSize.x !== width ||\n\t\t\tthis.carouselRearSize.y !== height ||\n\t\t\tthis.carouselRearSize.z !== ratio\n\t\t) {\n\t\t\tthis.resizeCanvasTarget(target, width, height, ratio);\n\t\t\tthis.carouselRearSize.set(width, height, ratio);\n\t\t}\n\t\tthis.ports.renderer.setCanvasTarget(target);\n\t\tthis.ports.renderer.setRenderTarget(null);\n\t\tthis.ports.renderer.setClearColor(0x000000, 0);\n\t\tthis.ports.renderer.clear();\n\t\tthis.ports.catalogLayer()?.renderRear(this.ports.renderer);\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t}\n\tcreateForegroundCanvas() {\n\t\tconst canvas = document.createElement('canvas');\n\t\tcanvas.className = 'stage-webgpu-foreground';\n\t\tcanvas.setAttribute('aria-hidden', 'true');\n\t\tthis.foregroundCanvas = canvas;\n\t\tthis.foregroundCanvasTarget = new THREE.CanvasTarget(canvas);\n\t\tthis.ports.container.appendChild(canvas);\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t}\n\tcreateModelOutline(model: Object3D) {\n\t\tthis.outlineMaskModel?.removeFromParent();\n\t\tthis.outlineMaskMaterial?.dispose();\n\t\tthis.outlineCompositeMaterial?.dispose();\n\t\tthis.outlineMaskTarget?.dispose();\n\t\tthis.outlineMaskMaterial = new THREE.MeshBasicMaterial({\n\t\t\tcolor: 0xffffff,\n\t\t\tdepthTest: true,\n\t\t\tdepthWrite: true,\n\t\t\tside: THREE.DoubleSide,\n\t\t\ttoneMapped: false\n\t\t});\n\n\t\tconst maskModel = model.clone(true);\n\t\tmaskModel.traverse((child) => {\n\t\t\tif (!isMesh(child)) return;\n\n\t\t\tconst sourceMesh = this.findSourceMeshByName(model, child.name);\n\t\t\tconst include = sourceMesh\n\t\t\t\t? this.ports.isInteractionMesh(sourceMesh)\n\t\t\t\t: this.ports.isInteractionMesh(child);\n\t\t\tchild.visible = include;\n\t\t\tchild.material = this.outlineMaskMaterial!;\n\t\t});\n\n\t\tthis.outlineMaskModel = maskModel;\n\t\tthis.outlineMaskScene.add(maskModel);\n\t\tthis.outlineMaskTarget = new THREE.RenderTarget(1, 1, {\n\t\t\tdepthBuffer: true,\n\t\t\tstencilBuffer: false,\n\t\t\tsamples: 4\n\t\t});\n\t\tthis.outlineMaskTarget.texture.minFilter = THREE.LinearFilter;\n\t\tthis.outlineMaskTarget.texture.magFilter = THREE.LinearFilter;\n\t\tthis.outlineMaskTarget.texture.generateMipmaps = false;\n\t\tthis.displayOutlineMask.value = this.outlineMaskTarget.texture;\n\t\tthis.outlineCompositeMaterial = this.createOutlineCompositeMaterial(\n\t\t\tthis.outlineMaskTarget.texture\n\t\t);\n\t\tthis.outlineQuad = new THREE.QuadMesh(this.outlineCompositeMaterial);\n\t\t// High refinement can replace the silhouette long after the last window resize.\n\t\tthis.resizeOutline(this.outlineWidth, this.outlineHeight);\n\t}\n\tprivate findSourceMeshByName(root: Object3D, name: string) {\n\t\tlet source: Mesh | undefined;\n\t\troot.traverse((child) => {\n\t\t\tif (!source && isMesh(child) && child.name === name) source = child;\n\t\t});\n\n\t\treturn source;\n\t}\n\tprivate createOutlineOpacity(mask: THREE.TextureNode) {\n\t\tconst calculate = () => {\n\t\t\tconst texel = this.outlineTexel;\n\t\t\tconst glowTexel = this.outlineGlowTexel;\n\t\t\tconst sampleMaskRing = (sampleTexel: typeof texel, scale = 1) => {\n\t\t\t\tconst centerUv = uv();\n\t\t\t\tconst sampleX = sampleTexel.x.mul(scale);\n\t\t\t\tconst sampleY = sampleTexel.y.mul(scale);\n\t\t\t\tconst left = mask.sample(centerUv.sub(vec2(sampleX, 0))).r;\n\t\t\t\tconst right = mask.sample(centerUv.add(vec2(sampleX, 0))).r;\n\t\t\t\tconst up = mask.sample(centerUv.add(vec2(0, sampleY))).r;\n\t\t\t\tconst down = mask.sample(centerUv.sub(vec2(0, sampleY))).r;\n\t\t\t\tconst upLeft = mask.sample(centerUv.add(vec2(0, sampleY)).sub(vec2(sampleX, 0))).r;\n\t\t\t\tconst upRight = mask.sample(centerUv.add(vec2(sampleX, sampleY))).r;\n\t\t\t\tconst downLeft = mask.sample(centerUv.sub(vec2(sampleX, sampleY))).r;\n\t\t\t\tconst downRight = mask.sample(centerUv.add(vec2(sampleX, 0)).sub(vec2(0, sampleY))).r;\n\n\t\t\t\treturn {\n\t\t\t\t\taverage: left\n\t\t\t\t\t\t.add(right)\n\t\t\t\t\t\t.add(up)\n\t\t\t\t\t\t.add(down)\n\t\t\t\t\t\t.add(upLeft)\n\t\t\t\t\t\t.add(upRight)\n\t\t\t\t\t\t.add(downLeft)\n\t\t\t\t\t\t.add(downRight)\n\t\t\t\t\t\t.div(8),\n\t\t\t\t\tmax: tslMax(\n\t\t\t\t\t\ttslMax(tslMax(left, right), tslMax(up, down)),\n\t\t\t\t\t\ttslMax(tslMax(upLeft, upRight), tslMax(downLeft, downRight))\n\t\t\t\t\t),\n\t\t\t\t\tmin: tslMin(\n\t\t\t\t\t\ttslMin(tslMin(left, right), tslMin(up, down)),\n\t\t\t\t\t\ttslMin(tslMin(upLeft, upRight), tslMin(downLeft, downRight))\n\t\t\t\t\t)\n\t\t\t\t};\n\t\t\t};\n\t\t\tconst edgeNeighbor = sampleMaskRing(texel);\n\t\t\tconst glowNearNeighbor = sampleMaskRing(glowTexel, 0.45);\n\t\t\tconst glowMidNeighbor = sampleMaskRing(glowTexel, 0.7);\n\t\t\tconst glowFarNeighbor = sampleMaskRing(glowTexel);\n\t\t\tconst center = mask.sample(uv()).r;\n\t\t\tconst outside = center.oneMinus();\n\t\t\tconst edgeGradient = edgeNeighbor.max.sub(center).max(0);\n\t\t\tconst core = edgeGradient.mul(this.ports.interactionTheme().outlineOpacity);\n\t\t\t// Average neighbouring coverage, rather than dilating a solid band. Keep the\n\t\t\t// halo outside the spatialElement so it cannot be mistaken for painted geometry.\n\t\t\tconst glowNear = glowNearNeighbor.average\n\t\t\t\t.mul(outside)\n\t\t\t\t.mul(this.ports.interactionTheme().outlineGlow * 0.6);\n\t\t\tconst glowMid = glowMidNeighbor.average\n\t\t\t\t.mul(outside)\n\t\t\t\t.mul(this.ports.interactionTheme().outlineGlow * 0.3);\n\t\t\tconst glowFar = glowFarNeighbor.average\n\t\t\t\t.mul(outside)\n\t\t\t\t.mul(this.ports.interactionTheme().outlineGlow * 0.1);\n\t\t\tconst opacity = tslMin(core.add(glowNear).add(glowMid).add(glowFar), 1).mul(\n\t\t\t\tthis.outlineOpacityScale\n\t\t\t);\n\n\t\t\treturn opacity;\n\t\t};\n\t\tif (this.renderMeasurement === 'halo-unconditional') return calculate();\n\t\treturn Fn(() => {\n\t\t\tconst opacity = float(0).toVar();\n\t\t\t// A fully covered pixel has zero outer halo. Skip all 32 neighbour taps there.\n\t\t\tIf(mask.sample(uv()).r.lessThan(1), () => {\n\t\t\t\topacity.assign(calculate());\n\t\t\t});\n\t\t\treturn opacity;\n\t\t})();\n\t}\n\tprivate createOutlineCompositeMaterial(maskTexture: THREE.Texture) {\n\t\tconst material = new THREE.MeshBasicNodeMaterial({\n\t\t\tblending: THREE.NormalBlending,\n\t\t\tdepthTest: false,\n\t\t\tdepthWrite: false,\n\t\t\ttransparent: true\n\t\t});\n\t\tmaterial.colorNode = color(new THREE.Color(this.ports.interactionTheme().outlineColor));\n\t\tmaterial.opacityNode = this.createOutlineOpacity(texture(maskTexture));\n\t\tmaterial.toneMapped = false;\n\t\treturn material;\n\t}\n\tdisposeSceneCapture() {\n\t\tthis.disposeRenderTargetSet(this.fullQualityTargets);\n\t\tthis.disposeRenderTargetSet(this.scrollQualityTargets);\n\t\tthis.stageDisplayMaterial?.dispose();\n\t\tthis.fullQualityTargets = undefined;\n\t\tthis.scrollQualityTargets = undefined;\n\t\tthis._activeRenderTargets = undefined;\n\t\tthis.stageDisplayMaterial = undefined;\n\t\tthis._stageDisplayQuad = undefined;\n\t\tthis.stageDisplayTextureNode = undefined;\n\t}\n\tcreateSceneCapture() {\n\t\tconst blurKeys = new Set(\n\t\t\tthis.ports.fallbackPanelOptions().map((options) => this.getPanelBlurKey(options))\n\t\t);\n\t\tthis.fullQualityTargets = this.createRenderTargetSet(1, blurKeys);\n\t\tthis.scrollQualityTargets = this.createRenderTargetSet(SCROLL_RENDER_SCALE, blurKeys);\n\t\tthis._activeRenderTargets = this.fullQualityTargets;\n\n\t\tthis.stageDisplayTextureNode = texture(this.fullQualityTargets.sceneCapture.texture);\n\t\tthis.stageDisplayMaterial = new THREE.NodeMaterial();\n\t\t// CanvasTarget already runs WebGPURenderer's output transform after this\n\t\t// fullscreen copy. Keep the capture linear here so ACES and sRGB are applied\n\t\t// exactly once; using renderOutput() here would wash out the entire stage.\n\t\t// CanvasTarget unpremultiplies before tone mapping and premultiplies afterwards.\n\t\t// Environment visibility is applied before the hero; the composed capture stays opaque.\n\t\tthis.stageDisplayMaterial.fragmentNode = vec4(this.stageDisplayTextureNode.rgb, 1);\n\t\tif (this.fuseOutline) {\n\t\t\tthis.emptyOutlineMask.needsUpdate = true;\n\t\t\tconst source = this.stageDisplayTextureNode;\n\t\t\tconst haloColor = color(new THREE.Color(this.ports.interactionTheme().outlineColor));\n\t\t\tconst haloOpacity = this.createOutlineOpacity(this.displayOutlineMask);\n\t\t\t// Merge into the existing linear display pass before the canvas output transform.\n\t\t\tthis.stageDisplayMaterial.fragmentNode = Fn(() => {\n\t\t\t\tconst rgb = source.rgb.toVar();\n\t\t\t\tIf(this.displayOutlineOpacity.greaterThan(0), () => {\n\t\t\t\t\trgb.assign(mix(rgb, haloColor, haloOpacity.mul(this.displayOutlineOpacity)));\n\t\t\t\t});\n\t\t\t\treturn vec4(rgb, 1);\n\t\t\t})();\n\t\t}\n\t\tthis.stageDisplayMaterial.depthTest = false;\n\t\tthis.stageDisplayMaterial.depthWrite = false;\n\t\tthis.stageDisplayMaterial.blending = THREE.NoBlending;\n\t\tthis.stageDisplayMaterial.toneMapped = false;\n\t\tthis.stageDisplayMaterial.needsUpdate = true;\n\t\tthis._stageDisplayQuad = new THREE.QuadMesh(this.stageDisplayMaterial);\n\t}\n\tprivate createRenderTargetSet(\n\t\tscale: number,\n\t\tblurKeys: ReadonlySet<number>\n\t): StageRenderTargetSet {\n\t\tthis._renderTargetSetCreations += 1;\n\t\tconst sceneCapture = new THREE.RenderTarget(1, 1, {\n\t\t\tdepthBuffer: true,\n\t\t\tstencilBuffer: false,\n\t\t\tsamples: 4,\n\t\t\ttype: THREE.HalfFloatType\n\t\t});\n\t\tsceneCapture.texture.minFilter = THREE.LinearFilter;\n\t\tsceneCapture.texture.magFilter = THREE.LinearFilter;\n\t\tsceneCapture.texture.generateMipmaps = false;\n\t\tsceneCapture.texture.colorSpace = THREE.NoColorSpace;\n\n\t\tconst panelBlurCaptures = new Map<number, PanelBlurCapture>();\n\t\tblurKeys.forEach((blur) => {\n\t\t\tpanelBlurCaptures.set(blur, this.createPanelBlurCapture(sceneCapture.texture, blur, scale));\n\t\t});\n\n\t\treturn { scale, sceneCapture, panelBlurCaptures };\n\t}\n\tprivate disposeRenderTargetSet(targets?: StageRenderTargetSet) {\n\t\tif (!targets) return;\n\t\ttargets.sceneCapture.dispose();\n\t\ttargets.panelBlurCaptures.forEach(({ target, material, effect }) => {\n\t\t\ttarget.dispose();\n\t\t\tmaterial.dispose();\n\t\t\teffect?.dispose();\n\t\t});\n\t\ttargets.panelBlurCaptures.clear();\n\t}\n\tresizeRenderTargets() {\n\t\tconst width = window.innerWidth;\n\t\tconst height = window.innerHeight;\n\t\tconst pixelRatio = this.getFullPixelRatio();\n\t\tif (!this.ports.frame().outgoingBackground)\n\t\t\tthis.resizeCanvasTarget(this.ports.backgroundCanvasTarget, width, height, pixelRatio);\n\t\tif (this.foregroundCanvasTarget) {\n\t\t\tthis.resizeCanvasTarget(this.foregroundCanvasTarget, width, height, pixelRatio);\n\t\t}\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\tthis.resizeRenderTargetSet(this.fullQualityTargets, width, height, pixelRatio);\n\t\tthis.resizeRenderTargetSet(this.scrollQualityTargets, width, height, pixelRatio);\n\t}\n\tprivate resizeRenderTargetSet(\n\t\ttargets: StageRenderTargetSet | undefined,\n\t\twidth: number,\n\t\theight: number,\n\t\tpixelRatio: number\n\t) {\n\t\tif (!targets) return;\n\t\tthis._renderTargetSetResizes += 1;\n\t\tconst captureWidth = Math.max(1, Math.round(width * pixelRatio * targets.scale));\n\t\tconst captureHeight = Math.max(1, Math.round(height * pixelRatio * targets.scale));\n\t\ttargets.sceneCapture.setSize(captureWidth, captureHeight);\n\t\ttargets.panelBlurCaptures.forEach(({ target, effect, resolutionScale }) => {\n\t\t\tif (effect) {\n\t\t\t\tconst effectScale = resolutionScale / (pixelRatio * targets.scale);\n\t\t\t\teffect.resolutionScale = effectScale;\n\t\t\t\teffect.setSize(captureWidth, captureHeight);\n\t\t\t\t// Consumers sample normalized screen UVs. Preserve the blur's actual\n\t\t\t\t// density instead of copying it back to a full-DPR viewport texture.\n\t\t\t\ttarget.setSize(\n\t\t\t\t\tMath.max(1, Math.round(captureWidth * effectScale)),\n\t\t\t\t\tMath.max(1, Math.round(captureHeight * effectScale))\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// A zero-blur backdrop still contains sharp scene detail.\n\t\t\t\ttarget.setSize(captureWidth, captureHeight);\n\t\t\t}\n\t\t});\n\t}\n\tgetFullPixelRatio() {\n\t\treturn getStageRenderPixelRatio(\n\t\t\twindow.innerWidth,\n\t\t\twindow.innerHeight,\n\t\t\twindow.devicePixelRatio,\n\t\t\tthis.renderSettings\n\t\t);\n\t}\n\tsetRenderSettings(settings?: StageRenderSettings) {\n\t\tthis.renderSettings = resolveStageRenderSettings(settings);\n\t}\n\tgetRenderSettings() {\n\t\treturn { ...this.renderSettings };\n\t}\n\tsetScrollRenderQuality(active: boolean) {\n\t\tthis.ports.container.toggleAttribute('data-stage-scroll-rendering', active);\n\t\tconst nextTargets = active ? this.scrollQualityTargets : this.fullQualityTargets;\n\t\tif (!nextTargets || this._activeRenderTargets === nextTargets) return;\n\t\tthis.activateRenderTargetSet(nextTargets);\n\t}\n\tprivate activateRenderTargetSet(nextTargets: StageRenderTargetSet) {\n\t\tthis._activeRenderTargets = nextTargets;\n\t\tif (this.stageDisplayTextureNode) {\n\t\t\tthis.stageDisplayTextureNode.value = nextTargets.sceneCapture.texture;\n\t\t}\n\t\tthis.ports.panelRuntimes().forEach((runtime) => {\n\t\t\truntime.glass?.setBackdropTexture(this.getPanelBlurTexture(runtime.options, nextTargets));\n\t\t});\n\t\tthis.ports.minimaps().forEach((minimap) => {\n\t\t\tminimap.stageCaptureTexture.value = nextTargets.sceneCapture.texture;\n\t\t\tconst panel = this.ports.panelRuntimes()[minimap.panelIndex];\n\t\t\tif (panel) {\n\t\t\t\tminimap.stageBlurTexture.value =\n\t\t\t\t\tpanel.surface === 'solid'\n\t\t\t\t\t\t? nextTargets.sceneCapture.texture\n\t\t\t\t\t\t: this.getPanelBlurTexture(panel.options, nextTargets);\n\t\t\t}\n\t\t\tminimap.overlayCaptureDirty = true;\n\t\t});\n\t}\n\twarmRenderTargetSets() {\n\t\tconst previousTargets = this._activeRenderTargets;\n\t\tconst availableTargets = [this.fullQualityTargets, this.scrollQualityTargets].filter(\n\t\t\t(targets): targets is StageRenderTargetSet => Boolean(targets)\n\t\t);\n\t\tif (!previousTargets || !this._stageDisplayQuad || availableTargets.length !== 2) return;\n\t\t// Finish with the active/full-quality set so the warm-up itself cannot\n\t\t// leave a lower-resolution frame on the visible canvas.\n\t\tconst targetSets = [\n\t\t\t...availableTargets.filter((targets) => targets !== previousTargets),\n\t\t\tpreviousTargets\n\t\t];\n\n\t\ttry {\n\t\t\twithRendererState(this.ports.renderer, () => {\n\t\t\t\ttargetSets.forEach((targets) => {\n\t\t\t\t\tthis.activateRenderTargetSet(targets);\n\t\t\t\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\t\t\t\tthis.ports.renderer.setRenderTarget(targets.sceneCapture);\n\t\t\t\t\tthis.ports.renderStage();\n\t\t\t\t\tthis.renderPanelBlurCaptures(targets, true);\n\t\t\t\t\tthis.renderStageDisplay();\n\t\t\t\t\tthis.renderBackgroundPanels();\n\t\t\t\t\tthis._renderTargetSetWarmups += 1;\n\t\t\t\t});\n\t\t\t});\n\t\t} finally {\n\t\t\tthis.activateRenderTargetSet(previousTargets);\n\t\t}\n\t}\n\tprivate resizeCanvasTarget(\n\t\ttarget: THREE.CanvasTarget,\n\t\twidth: number,\n\t\theight: number,\n\t\tpixelRatio: number\n\t) {\n\t\tthis.ports.renderer.setCanvasTarget(target);\n\t\tthis.ports.renderer.setPixelRatio(pixelRatio);\n\t\tthis.ports.renderer.setSize(width, height, false);\n\t}\n\tprivate createPanelBlurCapture(\n\t\tsceneTexture: THREE.Texture,\n\t\tblur: number,\n\t\trenderScale: number\n\t): PanelBlurCapture {\n\t\tconst target = new THREE.RenderTarget(1, 1, {\n\t\t\tdepthBuffer: false,\n\t\t\tstencilBuffer: false\n\t\t});\n\t\ttarget.texture.minFilter = THREE.LinearFilter;\n\t\ttarget.texture.magFilter = THREE.LinearFilter;\n\t\ttarget.texture.generateMipmaps = false;\n\t\ttarget.texture.colorSpace = THREE.NoColorSpace;\n\n\t\tconst sourceTexture = texture(sceneTexture);\n\t\t// Scale resolution and sample offsets together to retain the CSS blur radius.\n\t\t// The final texture uses the same density and normalized screen-space mapping.\n\t\tconst query = new URLSearchParams(typeof window === 'undefined' ? '' : window.location?.search);\n\t\tconst fullResolutionProbe =\n\t\t\tquery.get('stage-test') === '1' && query.get('stage-backdrop') === 'full';\n\t\tconst blurResolution = blur >= 4 && !fullResolutionProbe ? 0.5 : 1;\n\t\tconst effect =\n\t\t\tblur > 0\n\t\t\t\t? gaussianBlur(sourceTexture, blurResolution, Math.max(1, Math.round(blur)), {\n\t\t\t\t\t\tresolutionScale: blurResolution / (this.getFullPixelRatio() * renderScale)\n\t\t\t\t\t})\n\t\t\t\t: undefined;\n\t\tconst material = new THREE.NodeMaterial();\n\t\tmaterial.colorNode = effect ?? sourceTexture;\n\t\tmaterial.needsUpdate = true;\n\n\t\treturn {\n\t\t\tresolutionScale: blurResolution,\n\t\t\teffect,\n\t\t\tmaterial,\n\t\t\tquad: new THREE.QuadMesh(material),\n\t\t\ttarget\n\t\t};\n\t}\n\tprivate getPanelBlurKey(options: LiquidGlassPanelOptions) {\n\t\tconst value = Number.isFinite(options.backdropBlur) ? (options.backdropBlur ?? 0) : 0;\n\t\treturn Math.round(THREE.MathUtils.clamp(value, 0, 100) * 100) / 100;\n\t}\n\tgetPanelBlurTexture(options: LiquidGlassPanelOptions, targets = this._activeRenderTargets) {\n\t\tconst blur = this.getPanelBlurKey(options);\n\t\tconst capture = targets?.panelBlurCaptures.get(blur);\n\t\tif (!capture) {\n\t\t\tthrow new Error(`No backdrop capture exists for panel blur ${blur}`);\n\t\t}\n\t\treturn capture.target.texture;\n\t}\n\t/** Prepare hidden close-up effects during page binding, never during camera motion.\n\t * Captures stay invalid: the first visible frame must still sample the live element.\n\t * Only compile the foreground scene, so preparation cannot paint an overlay on screen.\n\t */\n\tasync prepareZoomEffects() {\n\t\tif (!this.foregroundCanvasTarget || this.disposed) return;\n\t\tconst views = [...this.ports.minimaps().values()].filter(\n\t\t\t(view) => !this.preparedZoomViews.has(view)\n\t\t);\n\t\tif (!views.length) return;\n\t\tconst pending: Promise<unknown>[] = [];\n\t\tfor (const view of views) {\n\t\t\twithRendererState(this.ports.renderer, () => {\n\t\t\t\tthis.ports.renderMinimapBlur(view);\n\t\t\t\tif (this.ports.panelRuntimes()[view.panelIndex]?.surface === 'glass')\n\t\t\t\t\tthis.ports.renderMinimapPanelCapture(view);\n\t\t\t\tthis.ports.renderer.setCanvasTarget(this.foregroundCanvasTarget!);\n\t\t\t\tthis.ports.renderer.setRenderTarget(null);\n\t\t\t\tconst ringMaterial = view.overlayRing.material;\n\t\t\t\tconst compositeCulled = view.overlayComposite.frustumCulled;\n\t\t\t\tconst ringCulled = view.overlayRing.frustumCulled;\n\t\t\t\ttry {\n\t\t\t\t\t// A newly bound minimap camera may not yet have its screen projection.\n\t\t\t\t\t// Compile the hidden effects even if that initial frustum excludes them.\n\t\t\t\t\tview.overlayComposite.frustumCulled = false;\n\t\t\t\t\tview.overlayRing.frustumCulled = false;\n\t\t\t\t\twithVisibility(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t...[...this.ports.minimaps().values()].map((entry) => entry.layer),\n\t\t\t\t\t\t\tview.overlayComposite,\n\t\t\t\t\t\t\tview.overlayRing\n\t\t\t\t\t\t],\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tfor (const entry of this.ports.minimaps().values())\n\t\t\t\t\t\t\t\tentry.layer.visible = entry === view;\n\t\t\t\t\t\t\tview.overlayComposite.visible = true;\n\t\t\t\t\t\t\tview.overlayRing.visible = true;\n\t\t\t\t\t\t\tfor (const material of [view.ringRestMaterial, view.ringForegroundMaterial]) {\n\t\t\t\t\t\t\t\tview.overlayRing.material = material;\n\t\t\t\t\t\t\t\tpending.push(\n\t\t\t\t\t\t\t\t\tthis.ports.renderer.compileAsync(this.ports.minimapScene(), view.screenCamera)\n\t\t\t\t\t\t\t\t);\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} finally {\n\t\t\t\t\tview.overlayRing.material = ringMaterial;\n\t\t\t\t\tview.overlayComposite.frustumCulled = compositeCulled;\n\t\t\t\t\tview.overlayRing.frustumCulled = ringCulled;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tawait Promise.all(pending);\n\t\tconst device = (this.ports.renderer.backend as unknown as { device?: GPUDevice }).device;\n\t\tawait device?.queue.onSubmittedWorkDone();\n\t\tif (!this.disposed) for (const view of views) this.preparedZoomViews.add(view);\n\t}\n\trenderForegroundLayer() {\n\t\tif (!this.foregroundCanvasTarget) return;\n\n\t\tthis.ports.renderer.setCanvasTarget(this.foregroundCanvasTarget);\n\t\tthis.ports.renderer.setRenderTarget(null);\n\t\tthis.ports.renderer.setClearColor(0x000000, 0);\n\t\tthis.ports.renderer.clear();\n\t\tthis.renderMinimapScene();\n\t\tfor (const entry of this.ports.exitingMinimaps())\n\t\t\tif (entry.minimap.displayOpacity > 0) entry.capture.render(this.ports.renderer);\n\t\tthis.ports.catalogLayer()?.draw(this.ports.renderer, 'front');\n\t\tfor (const entry of this.ports.contentSecondaries()) entry.capture.render(this.ports.renderer);\n\t\tthis.ports.spatialCapture()?.render(this.ports.renderer);\n\t}\n\trenderBackgroundPanels() {\n\t\treturn withVisibility(\n\t\t\tthis.ports.panelRuntimes().map((panel) => panel.group),\n\t\t\t() => {\n\t\t\t\tconst minimaps = Array.from(this.ports.minimaps().values());\n\t\t\t\tconst minimapPanelIndices = new Set(minimaps.map((minimap) => minimap.panelIndex));\n\t\t\t\tconst panelVisibility = this.ports.panelRuntimes().map((panel) => panel.group.visible);\n\t\t\t\tconst visibleMinimaps = minimaps.filter(\n\t\t\t\t\t(minimap) =>\n\t\t\t\t\t\tminimap.viewportVisible &&\n\t\t\t\t\t\tpanelVisibility[minimap.panelIndex] &&\n\t\t\t\t\t\tBoolean(this.ports.panelRuntimes()[minimap.panelIndex]?.glass)\n\t\t\t\t);\n\t\t\t\tconst hasVisibleRegularPanel = this.ports\n\t\t\t\t\t.panelRuntimes()\n\t\t\t\t\t.some(\n\t\t\t\t\t\t(panel, index) =>\n\t\t\t\t\t\t\tBoolean(panel.glass) && panelVisibility[index] && !minimapPanelIndices.has(index)\n\t\t\t\t\t);\n\n\t\t\t\t// Regular panels share the stage camera. Minimap panels use an off-axis\n\t\t\t\t// screen camera, so leave them out of this pass and draw them separately.\n\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\tif (panel.glass) {\n\t\t\t\t\t\tpanel.group.visible = panelVisibility[index] && !minimapPanelIndices.has(index);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (hasVisibleRegularPanel) {\n\t\t\t\t\tthis.ports.renderer.clearDepth();\n\t\t\t\t\tthis.ports.renderer.render(this.ports.panelScene, this.ports.panelCamera);\n\t\t\t\t\tthis._panelSceneRenderPasses += 1;\n\t\t\t\t}\n\n\t\t\t\t// Keep the glass body in the same compositing layer as the other panels,\n\t\t\t\t// but retain the exact camera and transform used by its foreground model.\n\t\t\t\tvisibleMinimaps.forEach((active) => {\n\t\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\t\tif (panel.glass) {\n\t\t\t\t\t\t\tpanel.group.visible = panelVisibility[index] && index === active.panelIndex;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.ports.renderer.clearDepth();\n\t\t\t\t\tthis.ports.renderer.render(this.ports.panelScene, active.screenCamera);\n\t\t\t\t\tthis._panelSceneRenderPasses += 1;\n\t\t\t\t});\n\n\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\tpanel.group.visible = panelVisibility[index];\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t}\n\tprivate renderMinimapScene() {\n\t\treturn withVisibility(\n\t\t\t[\n\t\t\t\t...this.ports.panelRuntimes().map((panel) => panel.group),\n\t\t\t\t...[...this.ports.minimaps().values()].flatMap((view) => [view.layer, view.spatialElementRoot])\n\t\t\t],\n\t\t\t() => {\n\t\t\t\tif (!this.ports.minimaps().size) return;\n\n\t\t\t\tconst minimaps = Array.from(this.ports.minimaps().values());\n\t\t\t\tconst visibleMinimaps = minimaps.filter(\n\t\t\t\t\t(minimap) =>\n\t\t\t\t\t\tminimap.viewportVisible &&\n\t\t\t\t\t\tthis.ports.getPanelTransitionOpacity(this.ports.panelRuntimes()[minimap.panelIndex]) >\n\t\t\t\t\t\t\t0.001\n\t\t\t\t);\n\t\t\t\tif (!visibleMinimaps.length) return;\n\t\t\t\tconst panelVisibility = this.ports.panelRuntimes().map((panel) => panel.group.visible);\n\n\t\t\t\tvisibleMinimaps.forEach((active) => {\n\t\t\t\t\tminimaps.forEach((minimap) => {\n\t\t\t\t\t\tminimap.layer.visible = minimap === active;\n\t\t\t\t\t});\n\t\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\t\tif (panel.glass) panel.group.visible = index === active.panelIndex;\n\t\t\t\t\t});\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tactive.overlayComposite.visible &&\n\t\t\t\t\t\t(!active.overlayCaptureValid ||\n\t\t\t\t\t\t\t(this.measurementMode !== 'reuse-capture' && active.overlayCaptureDirty))\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.ports.renderMinimapBlur(active);\n\t\t\t\t\t\tactive.overlayCaptureDirty = false;\n\t\t\t\t\t\tactive.overlayCaptureValid = true;\n\t\t\t\t\t\tthis._minimapOverlayCapturePasses += 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (\n\t\t\t\t\t\tactive.overlayComposite.visible &&\n\t\t\t\t\t\tthis.ports.panelRuntimes()[active.panelIndex]?.surface === 'glass' &&\n\t\t\t\t\t\t(!active.panelCaptureValid ||\n\t\t\t\t\t\t\t(this.measurementMode !== 'reuse-capture' && active.panelCaptureDirty))\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.ports.renderMinimapPanelCapture(active);\n\t\t\t\t\t\tactive.panelCaptureDirty = false;\n\t\t\t\t\t\tactive.panelCaptureValid = true;\n\t\t\t\t\t}\n\t\t\t\t\tthis.ports.renderer.clearDepth();\n\t\t\t\t\tconst spatialElementVisible = active.spatialElementRoot.visible;\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.ports.frame().catalogDockTarget &&\n\t\t\t\t\t\tthis.ports.frame().catalogHandoff &&\n\t\t\t\t\t\t!this.ports.frame().catalogMotionComplete\n\t\t\t\t\t)\n\t\t\t\t\t\tactive.spatialElementRoot.visible = false;\n\t\t\t\t\tthis.ports.renderer.render(this.ports.minimapScene(), active.screenCamera);\n\t\t\t\t\tactive.spatialElementRoot.visible = spatialElementVisible;\n\t\t\t\t\tthis._minimapSceneRenderPasses += 1;\n\t\t\t\t});\n\n\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\tpanel.group.visible = panelVisibility[index];\n\t\t\t\t});\n\t\t\t\tminimaps.forEach((minimap) => {\n\t\t\t\t\tminimap.layer.visible =\n\t\t\t\t\t\tminimap.viewportVisible &&\n\t\t\t\t\t\tthis.ports.getPanelTransitionOpacity(this.ports.panelRuntimes()[minimap.panelIndex]) >\n\t\t\t\t\t\t\t0.001;\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t}\n\trenderModelOutline(target: THREE.RenderTarget | null, opacity = 1) {\n\t\tthis.displayOutlineOpacity.value = 0;\n\t\tif (this.renderMeasurement === 'no-halo') return;\n\t\tconst opacityBefore = this.outlineOpacityScale.value;\n\t\ttry {\n\t\t\treturn withRendererState(this.ports.renderer, () => {\n\t\t\t\tif (\n\t\t\t\t\t!this.ports.frame().stageViewportVisible ||\n\t\t\t\t\t!(this.ports.frame().modelHover || this.ports.frame().modelInteractionActive) ||\n\t\t\t\t\t!this.outlineMaskTarget ||\n\t\t\t\t\t!this.outlineQuad\n\t\t\t\t)\n\t\t\t\t\treturn;\n\n\t\t\t\tconst previousClearAlpha = this.ports.renderer.getClearAlpha();\n\t\t\t\tconst previousClearColor = this.ports.renderer.getClearColor(new THREE.Color());\n\t\t\t\tconst previousOpacity = this.outlineOpacityScale.value;\n\n\t\t\t\tif (this.renderMeasurement !== 'halo-frozen-mask' || !this.outlineMaskValid) {\n\t\t\t\t\tthis.ports.renderer.setRenderTarget(this.outlineMaskTarget);\n\t\t\t\t\tthis.ports.renderer.setClearColor(0x000000, 0);\n\t\t\t\t\tthis.ports.renderer.clear();\n\t\t\t\t\tthis.ports.renderer.render(this.outlineMaskScene, this.ports.camera);\n\t\t\t\t\tthis.outlineMaskValid = true;\n\t\t\t\t}\n\t\t\t\tthis.ports.renderer.setClearColor(previousClearColor, previousClearAlpha);\n\t\t\t\tthis.ports.renderer.setRenderTarget(target);\n\n\t\t\t\tthis.outlineOpacityScale.value = opacity;\n\t\t\t\t// Glass can refract the sharp scene capture, so keep the halo in that\n\t\t\t\t// capture while a glass surface is visible. Forced fusion is a test probe.\n\t\t\t\tconst fuseThisFrame =\n\t\t\t\t\tthis.fuseOutline &&\n\t\t\t\t\t(this.renderMeasurement === 'halo-fused' ||\n\t\t\t\t\t\t!this.ports\n\t\t\t\t\t\t\t.panelRuntimes()\n\t\t\t\t\t\t\t.some((panel) => panel.surface === 'glass' && panel.group.visible));\n\t\t\t\tif (fuseThisFrame) this.displayOutlineOpacity.value = opacity;\n\t\t\t\telse if (this.renderMeasurement !== 'halo-mask-only')\n\t\t\t\t\tthis.outlineQuad.render(this.ports.renderer);\n\t\t\t\tthis.outlineOpacityScale.value = previousOpacity;\n\t\t\t});\n\t\t} finally {\n\t\t\tthis.outlineOpacityScale.value = opacityBefore;\n\t\t}\n\t}\n\trenderPanelBlurCaptures(renderTargets: StageRenderTargetSet, forceAll = false) {\n\t\tconst visibleBlurKeys = forceAll\n\t\t\t? undefined\n\t\t\t: new Set(\n\t\t\t\t\tthis.ports.panelRuntimes().flatMap((panel, index) => {\n\t\t\t\t\t\tif (!panel.group.visible) return [];\n\t\t\t\t\t\tconst needsGlassCapture = panel.surface === 'glass' && Boolean(panel.glass);\n\t\t\t\t\t\tconst needsFrostedMinimapCapture =\n\t\t\t\t\t\t\tpanel.surface === 'frosted' &&\n\t\t\t\t\t\t\tBoolean(this.ports.minimaps().get(index)?.overlayComposite.visible);\n\t\t\t\t\t\treturn needsGlassCapture || needsFrostedMinimapCapture\n\t\t\t\t\t\t\t? [this.getPanelBlurKey(panel.options)]\n\t\t\t\t\t\t\t: [];\n\t\t\t\t\t})\n\t\t\t\t);\n\t\trenderTargets.panelBlurCaptures.forEach(({ target, quad }, blurKey) => {\n\t\t\tif (visibleBlurKeys && !visibleBlurKeys.has(blurKey)) return;\n\t\t\tconst size = `${target.width}:${target.height}`;\n\t\t\tif (\n\t\t\t\tthis.renderMeasurement === 'frozen-backdrop' &&\n\t\t\t\tthis.measuredBackdropSeeds.get(target) === size\n\t\t\t)\n\t\t\t\treturn;\n\t\t\tthis.ports.renderer.setRenderTarget(target);\n\t\t\tthis.ports.renderer.clear();\n\t\t\tquad.render(this.ports.renderer);\n\t\t\tif (this.renderMeasurement === 'frozen-backdrop')\n\t\t\t\tthis.measuredBackdropSeeds.set(target, size);\n\t\t\tthis._panelBlurRenderPasses += 1;\n\t\t});\n\t}\n\trenderStageDisplay() {\n\t\tif (!this._stageDisplayQuad) return;\n\t\tthis.ports.renderer.setRenderTarget(null);\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\tthis.ports.renderer.setClearColor(0xffffff, 1);\n\t\tthis.ports.renderer.clear();\n\t\tthis._stageDisplayQuad.render(this.ports.renderer);\n\t}\n\trenderStageContents() {\n\t\tthis.ports.renderer.clear();\n\t\tthis.ports.renderer.render(this.ports.backgroundScene, this.ports.camera);\n\t\tthis.ports.renderer.render(this.ports.tintScene, this.ports.tintCamera);\n\t\tthis.backgroundCoverOpacity.value = 1 - this.ports.frame().backgroundReveal;\n\t\tif (this.backgroundCoverOpacity.value > 0) this.backgroundCover.render(this.ports.renderer);\n\t\tif (\n\t\t\tthis.ports.frame().stageViewportVisible &&\n\t\t\t(!this.ports.frame().catalogHandoff || this.ports.frame().catalogMotionComplete) &&\n\t\t\t(!this.ports.frame().catalog || this.ports.frame().pageModelReady)\n\t\t) {\n\t\t\tthis.ports.renderer.clearDepth();\n\t\t\tthis.ports.renderer.render(this.ports.scene, this.ports.camera);\n\t\t\tthis._stageModelRenderPasses += 1;\n\t\t}\n\t}\n\treleaseOutline() {\n\t\tthis.displayOutlineOpacity.value = 0;\n\t\tthis.displayOutlineMask.value = this.emptyOutlineMask;\n\t\tthis.outlineMaskModel?.removeFromParent();\n\t\tthis.outlineMaskMaterial?.dispose();\n\t\tthis.outlineCompositeMaterial?.dispose();\n\t\tthis.outlineMaskTarget?.dispose();\n\t\tthis.outlineMaskModel = undefined;\n\t\tthis.outlineMaskMaterial = undefined;\n\t\tthis.outlineCompositeMaterial = undefined;\n\t\tthis.outlineMaskTarget = undefined;\n\t\tthis.outlineQuad = undefined;\n\t}\n\tresizeOutline(width: number, height: number) {\n\t\tthis.outlineWidth = width;\n\t\tthis.outlineHeight = height;\n\t\tconst scale = this.renderMeasurement === 'halo-half-mask' ? 0.5 : 1;\n\t\tthis.outlineMaskTarget?.setSize(\n\t\t\tMath.max(1, Math.round(width * scale)),\n\t\t\tMath.max(1, Math.round(height * scale))\n\t\t);\n\t\tthis.outlineMaskValid = false;\n\t\tthis.outlineTexel.value.set(\n\t\t\tthis.ports.interactionTheme().outlineThickness / Math.max(width, 1),\n\t\t\tthis.ports.interactionTheme().outlineThickness / Math.max(height, 1)\n\t\t);\n\t\tthis.outlineGlowTexel.value.set(\n\t\t\t(this.ports.interactionTheme().outlineThickness *\n\t\t\t\tthis.ports.interactionTheme().outlineGlowThickness) /\n\t\t\t\tMath.max(width, 1),\n\t\t\t(this.ports.interactionTheme().outlineThickness *\n\t\t\t\tthis.ports.interactionTheme().outlineGlowThickness) /\n\t\t\t\tMath.max(height, 1)\n\t\t);\n\t}\n\tdispose() {\n\t\tif (this.disposed) return;\n\t\tthis.disposed = true;\n\t\tthis.releaseOutline();\n\t\tthis.emptyOutlineMask.dispose();\n\t\tthis.disposeSceneCapture();\n\t\tthis.backgroundCoverMaterial.dispose();\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\tthis.foregroundCanvasTarget?.dispose();\n\t\tthis.foregroundCanvasTarget = undefined;\n\t\tthis.carouselRearTarget?.dispose();\n\t\tthis.carouselRearTarget = undefined;\n\t\tthis.carouselRearCanvas?.remove();\n\t\tthis.foregroundCanvas?.remove();\n\t}\n\n\tget activeRenderTargets() {\n\t\treturn this._activeRenderTargets;\n\t}\n\tget stageDisplayQuad() {\n\t\treturn this._stageDisplayQuad;\n\t}\n\tget minimapOverlayCapturePasses() {\n\t\treturn this._minimapOverlayCapturePasses;\n\t}\n\tget renderTargetSetCreations() {\n\t\treturn this._renderTargetSetCreations;\n\t}\n\tget renderTargetSetResizes() {\n\t\treturn this._renderTargetSetResizes;\n\t}\n\tget renderTargetSetWarmups() {\n\t\treturn this._renderTargetSetWarmups;\n\t}\n\tget stageModelRenderPasses() {\n\t\treturn this._stageModelRenderPasses;\n\t}\n\tget panelBlurRenderPasses() {\n\t\treturn this._panelBlurRenderPasses;\n\t}\n\tget panelSceneRenderPasses() {\n\t\treturn this._panelSceneRenderPasses;\n\t}\n\tget minimapSceneRenderPasses() {\n\t\treturn this._minimapSceneRenderPasses;\n\t}\n\n\t/** The facade advances owners first; this command submits the ordered GPU passes. */\n\trenderFrame(contentOnly: boolean, outline: boolean) {\n\t\tthis.displayOutlineOpacity.value = 0;\n\t\treturn withRendererState(this.ports.renderer, () => {\n\t\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\t\tif (contentOnly) {\n\t\t\t\tthis.ports.renderer.setRenderTarget(null);\n\t\t\t\tif (!this.ports.frame().outgoingBackground) {\n\t\t\t\t\tthis.ports.renderer.setClearColor(0, 0);\n\t\t\t\t\tthis.ports.renderer.clear();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!this._activeRenderTargets) return;\n\t\t\t\tthis.ports.renderer.setRenderTarget(this._activeRenderTargets.sceneCapture);\n\t\t\t\tthis.ports.renderStage();\n\t\t\t\tthis.renderPanelBlurCaptures(this._activeRenderTargets);\n\t\t\t\tif (outline) this.renderModelOutline(this._activeRenderTargets.sceneCapture, 1);\n\t\t\t\tthis.renderStageDisplay();\n\t\t\t\tthis.renderBackgroundPanels();\n\t\t\t}\n\t\t\tthis.renderCarouselRear();\n\t\t\tthis.renderForegroundLayer();\n\t\t});\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StageRenderPipeline.js","sourceRoot":"","sources":["../../src/stage/StageRenderPipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIvE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EACN,EAAE,EACF,KAAK,EACL,EAAE,EACF,GAAG,EACH,GAAG,IAAI,MAAM,EACb,GAAG,IAAI,MAAM,EACb,gBAAgB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e,CAAC,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;gBAC5E,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;gBACzB,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;gBACxD,IAAI,OAAO;oBAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;gBAChF,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAC1B,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAC/B,CAAC;YACD,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC1B,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC9B,CAAC,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["import { getRefinementSize } from './SpatialElementRefinement.js';\nimport { getMinimapMeasurementMode } from './minimapMeasurement.js';\nimport { parseRenderMeasurement } from './renderMeasurement.js';\nimport type { PreparedHigh } from '../catalog/CatalogPreparation.js';\nimport { gaussianTargets } from './renderTargetInventory.js';\nimport { withRendererState, withVisibility } from './rendererState.js';\n\nimport type { StagePanelRuntime } from './StagePanelRuntime.js';\n\nimport * as THREE from 'three/webgpu';\n\nimport { CatalogSpatialElementLayer } from '../catalog/CatalogSpatialElementLayer.js';\nimport { SpatialGeometryCapture } from '../catalog/SpatialGeometryCapture.js';\n\nimport { gaussianBlur } from 'three/addons/tsl/display/GaussianBlurNode.js';\nimport {\n\tFn,\n\tfloat,\n\tIf,\n\tmix,\n\tmax as tslMax,\n\tmin as tslMin,\n\tpremultiplyAlpha,\n\ttexture,\n\tuniform,\n\tuv,\n\tvec2,\n\tvec4\n} from 'three/tsl';\nimport type { Mesh, Object3D } from 'three';\nimport {\n\tinverseAcesToneMapping,\n\tSTAGE_TONE_MAPPING_EXPOSURE,\n\ttype LiquidGlassPanelOptions\n} from './LiquidGlassPanel.js';\n\nimport type { StageMinimapState } from './minimap/MinimapState.js';\nimport { isMesh } from './stageSceneUtils.js';\nimport type { StageInteractionTheme, StageRenderSettings } from './stageTypes.js';\nimport { getStageRenderPixelRatio, resolveStageRenderSettings } from './renderSettings.js';\ninterface PanelBlurCapture {\n\t/** Intermediate pixels per CSS pixel; independent of output DPR/scroll quality. */\n\tresolutionScale: number;\n\teffect?: ReturnType<typeof gaussianBlur>;\n\tmaterial: THREE.NodeMaterial;\n\tquad: THREE.QuadMesh;\n\ttarget: THREE.RenderTarget;\n}\ninterface StageRenderTargetSet {\n\tscale: number;\n\tsceneCapture: THREE.RenderTarget;\n\tpanelBlurCaptures: Map<number, PanelBlurCapture>;\n}\nconst SCROLL_RENDER_SCALE = 0.82;\n\nexport interface StageRenderPorts {\n\tpageBackground?: string;\n\trenderSettings?: StageRenderSettings;\n\trenderer: THREE.WebGPURenderer;\n\tcontainer: HTMLElement;\n\tbackgroundCanvas: HTMLCanvasElement;\n\tbackgroundCanvasTarget: THREE.CanvasTarget;\n\tscene: THREE.Scene;\n\tbackgroundScene: THREE.Scene;\n\ttintScene: THREE.Scene;\n\tpanelScene: THREE.Scene;\n\tcamera: THREE.PerspectiveCamera;\n\tpanelCamera: THREE.PerspectiveCamera;\n\ttintCamera: THREE.OrthographicCamera;\n\tpanelRuntimes(): readonly StagePanelRuntime[];\n\tminimaps(): ReadonlyMap<number, StageMinimapState>;\n\tminimapScene(): THREE.Scene;\n\tcatalogLayer(): Pick<CatalogSpatialElementLayer, 'hasCarousel' | 'renderRear' | 'draw'> | undefined;\n\tspatialCapture(): SpatialGeometryCapture | undefined;\n\texitingMinimaps(): readonly { capture: SpatialGeometryCapture; minimap: StageMinimapState }[];\n\tcontentSecondaries(): readonly { capture: SpatialGeometryCapture }[];\n\tfallbackPanelOptions(): readonly LiquidGlassPanelOptions[];\n\tinteractionTheme(): StageInteractionTheme;\n\tframe(): Readonly<{\n\t\toutgoingBackground: boolean;\n\t\tcatalogDockTarget: boolean;\n\t\tcatalogHandoff: boolean;\n\t\tcatalogMotionComplete: boolean;\n\t\tstageViewportVisible: boolean;\n\t\tmodelHover: boolean;\n\t\tmodelInteractionActive: boolean;\n\t\tcatalog: boolean;\n\t\tpageModelReady: boolean;\n\t\tbackgroundReveal: number;\n\t}>;\n\trenderStage(): void;\n\trenderMinimapBlur(minimap: StageMinimapState): void;\n\trenderMinimapPanelCapture(minimap: StageMinimapState): void;\n\tgetPanelTransitionOpacity(panel?: StagePanelRuntime): number;\n\tisInteractionMesh(mesh: Mesh): boolean;\n}\n\n/** Owns GPU output bands, passes and target lifetimes; never schedules frames or navigation. */\nexport class StageRenderPipeline {\n\tprivate readonly measurementMode = getMinimapMeasurementMode();\n\tprivate readonly renderMeasurement = parseRenderMeasurement(\n\t\ttypeof window === 'undefined' ? '' : (window.location?.search ?? '')\n\t);\n\tprivate readonly fuseOutline = ![\n\t\t'halo-separate',\n\t\t'halo-mask-only',\n\t\t'halo-frozen-mask',\n\t\t'halo-half-mask'\n\t].includes(this.renderMeasurement);\n\tprivate readonly measuredBackdropSeeds = new WeakMap<THREE.RenderTarget, string>();\n\tprivate readonly preparedZoomViews = new WeakSet<StageMinimapState>();\n\tprivate disposed = false;\n\tprivate renderSettings = resolveStageRenderSettings();\n\t/** Retain the last DETAIL background while its geometry is owned by a transition. */\n\tfreezeBackground() {\n\t\tconst targets = this._activeRenderTargets;\n\t\tif (!targets) return false;\n\t\twithRendererState(this.ports.renderer, () => {\n\t\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\t\tthis.ports.renderer.setRenderTarget(targets.sceneCapture);\n\t\t\tthis.renderStageContents();\n\t\t\tthis.renderStageDisplay();\n\t\t\tthis.renderBackgroundPanels();\n\t\t});\n\t\treturn true;\n\t}\n\tasync warmHigh(high: PreparedHigh, environment: THREE.Texture, drawLow: () => void) {\n\t\tconst scene = new THREE.Scene();\n\t\tscene.environment = environment;\n\t\tscene.environmentIntensity = 0.5;\n\t\tscene.add(high.pose);\n\t\tconst camera = new THREE.PerspectiveCamera(\n\t\t\t45,\n\t\t\twindow.innerWidth / window.innerHeight,\n\t\t\t0.01,\n\t\t\t100\n\t\t);\n\t\tcamera.position.z = 5;\n\t\tconst size = this.ports.renderer.getDrawingBufferSize(new THREE.Vector2());\n\t\tconst warmSize = getRefinementSize(size.x, size.y);\n\t\tconst target = new THREE.RenderTarget(warmSize.width, warmSize.height, {\n\t\t\ttype: THREE.HalfFloatType,\n\t\t\tsamples: 4\n\t\t});\n\t\tconst destination = this.ports.renderer.getRenderTarget();\n\t\tconst clear = this.ports.renderer.getClearColor(new THREE.Color());\n\t\tconst alpha = this.ports.renderer.getClearAlpha();\n\t\ttry {\n\t\t\tthis.ports.renderer.setRenderTarget(target);\n\t\t\tthis.ports.renderer.setClearColor(0, 0);\n\t\t\thigh.blend.render(\n\t\t\t\tthis.ports.renderer,\n\t\t\t\t(useHigh) => {\n\t\t\t\t\tthis.ports.renderer.clear();\n\t\t\t\t\tif (useHigh) this.ports.renderer.render(scene, camera);\n\t\t\t\t\telse drawLow();\n\t\t\t\t},\n\t\t\t\tfalse,\n\t\t\t\t0\n\t\t\t);\n\t\t} finally {\n\t\t\tthis.ports.renderer.setRenderTarget(destination);\n\t\t\tthis.ports.renderer.setClearColor(clear, alpha);\n\t\t\thigh.pose.removeFromParent();\n\t\t\ttarget.dispose();\n\t\t}\n\t\tconst device = (this.ports.renderer.backend as unknown as { device?: GPUDevice }).device;\n\t\tawait device?.queue.onSubmittedWorkDone();\n\t}\n\n\tgetRenderTargets() {\n\t\treturn [\n\t\t\t...(this.outlineMaskTarget ? [this.outlineMaskTarget] : []),\n\t\t\t...[this.fullQualityTargets, this.scrollQualityTargets].flatMap((set) =>\n\t\t\t\tset\n\t\t\t\t\t? [\n\t\t\t\t\t\t\tset.sceneCapture,\n\t\t\t\t\t\t\t...[...set.panelBlurCaptures.values()].flatMap((blur) => [\n\t\t\t\t\t\t\t\tblur.target,\n\t\t\t\t\t\t\t\t...gaussianTargets(blur.effect)\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)\n\t\t];\n\t}\n\tgetCanvasOutputs() {\n\t\treturn [\n\t\t\tthis.ports.backgroundCanvasTarget,\n\t\t\tthis.foregroundCanvasTarget,\n\t\t\tthis.carouselRearTarget\n\t\t].flatMap((target, index) => {\n\t\t\tif (!target) return [];\n\t\t\tconst size = target.getDrawingBufferSize(new THREE.Vector2());\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tband: ['background', 'foreground', 'carousel-rear'][index],\n\t\t\t\t\twidth: size.x,\n\t\t\t\t\theight: size.y,\n\t\t\t\t\tcolorAttachments: 1,\n\t\t\t\t\tdepthAttachments: 1\n\t\t\t\t}\n\t\t\t];\n\t\t});\n\t}\n\tconstructor(private readonly ports: StageRenderPorts) {\n\t\tthis.updateInteractionTheme();\n\t\tthis.setRenderSettings(ports.renderSettings);\n\t\tthis.setPageBackground(ports.pageBackground ?? '#ffffff');\n\t\tthis.backgroundCoverMaterial.fragmentNode = premultiplyAlpha(\n\t\t\tvec4(inverseAcesToneMapping(this.backgroundCoverColor), this.backgroundCoverOpacity)\n\t\t);\n\t\tthis.backgroundCoverMaterial.depthTest = this.backgroundCoverMaterial.depthWrite = false;\n\t\tthis.backgroundCoverMaterial.transparent =\n\t\t\tthis.backgroundCoverMaterial.premultipliedAlpha = true;\n\t\tthis.backgroundCoverMaterial.toneMapped = false;\n\t}\n\tprivate readonly backgroundCoverOpacity = uniform(0);\n\tprivate readonly backgroundCoverColor = uniform(new THREE.Vector3(1, 1, 1));\n\tsetPageBackground(value: string) {\n\t\tconst color = new THREE.Color(value);\n\t\tthis.backgroundCoverColor.value.set(color.r, color.g, color.b);\n\t}\n\tprivate readonly backgroundCoverMaterial = new THREE.NodeMaterial();\n\tprivate readonly backgroundCover = new THREE.QuadMesh(this.backgroundCoverMaterial);\n\tprivate readonly outlineMaskScene = new THREE.Scene();\n\tprivate readonly outlineColor = uniform(new THREE.Color());\n\tprivate readonly outlineStrength = uniform(1);\n\tprivate readonly outlineGlow = uniform(1);\n\tupdateInteractionTheme() {\n\t\tconst theme = this.ports.interactionTheme();\n\t\tthis.outlineColor.value.set(theme.outlineColor);\n\t\tthis.outlineStrength.value = theme.outlineOpacity;\n\t\tthis.outlineGlow.value = theme.outlineGlow;\n\t\tthis.resizeOutline(this.outlineWidth, this.outlineHeight);\n\t}\n\tprivate _minimapOverlayCapturePasses = 0;\n\tprivate _renderTargetSetCreations = 0;\n\tprivate _renderTargetSetResizes = 0;\n\tprivate _renderTargetSetWarmups = 0;\n\tprivate _stageModelRenderPasses = 0;\n\tprivate _panelBlurRenderPasses = 0;\n\tprivate _panelSceneRenderPasses = 0;\n\tprivate _minimapSceneRenderPasses = 0;\n\tprivate outlineMaskModel?: Object3D;\n\tprivate outlineMaskMaterial?: THREE.MeshBasicMaterial;\n\tprivate outlineCompositeMaterial?: THREE.MeshBasicNodeMaterial;\n\tprivate outlineQuad?: THREE.QuadMesh;\n\tprivate outlineMaskTarget?: THREE.RenderTarget;\n\tprivate outlineMaskValid = false;\n\tprivate readonly emptyOutlineMask = new THREE.DataTexture(new Uint8Array(4), 1, 1);\n\tprivate readonly displayOutlineMask = texture(this.emptyOutlineMask);\n\tprivate readonly displayOutlineOpacity = uniform(0);\n\tprivate outlineWidth = 1;\n\tprivate outlineHeight = 1;\n\tprivate outlineTexel = uniform(new THREE.Vector2(1, 1));\n\tprivate outlineGlowTexel = uniform(new THREE.Vector2(1, 1));\n\tprivate outlineOpacityScale = uniform(1);\n\tprivate fullQualityTargets?: StageRenderTargetSet;\n\tprivate scrollQualityTargets?: StageRenderTargetSet;\n\tprivate _activeRenderTargets?: StageRenderTargetSet;\n\tprivate stageDisplayMaterial?: THREE.NodeMaterial;\n\tprivate _stageDisplayQuad?: THREE.QuadMesh;\n\tprivate stageDisplayTextureNode?: THREE.TextureNode;\n\tprivate foregroundCanvasTarget?: THREE.CanvasTarget;\n\tprivate carouselRearTarget?: THREE.CanvasTarget;\n\tprivate carouselRearCanvas?: HTMLCanvasElement;\n\tprivate carouselRearSize = new THREE.Vector3();\n\tprivate foregroundCanvas?: HTMLCanvasElement;\n\tconfigureRenderer() {\n\t\tthis.ports.renderer.toneMapping = THREE.ACESFilmicToneMapping;\n\t\tthis.ports.renderer.toneMappingExposure = STAGE_TONE_MAPPING_EXPOSURE;\n\t\tthis.ports.renderer.setClearColor(0xffffff, 1);\n\t\tthis.ports.renderer.autoClear = false;\n\t\tthis.ports.backgroundCanvas.tabIndex = -1;\n\t\tthis.ports.backgroundCanvas.style.touchAction = 'pan-y';\n\t}\n\trenderCarouselRear() {\n\t\tif (!this.carouselRearTarget && !this.ports.catalogLayer()?.hasCarousel()) return;\n\t\tif (!this.carouselRearTarget) {\n\t\t\tconst canvas = document.createElement('canvas');\n\t\t\tcanvas.className = 'stage-webgpu-carousel-rear';\n\t\t\tcanvas.setAttribute('aria-hidden', 'true');\n\t\t\tthis.carouselRearCanvas = canvas;\n\t\t\tthis.carouselRearTarget = new THREE.CanvasTarget(canvas);\n\t\t\tthis.ports.container.appendChild(canvas);\n\t\t}\n\t\tconst target = this.carouselRearTarget;\n\t\tconst width = window.innerWidth,\n\t\t\theight = window.innerHeight,\n\t\t\tratio = this.getFullPixelRatio();\n\t\tif (\n\t\t\tthis.carouselRearSize.x !== width ||\n\t\t\tthis.carouselRearSize.y !== height ||\n\t\t\tthis.carouselRearSize.z !== ratio\n\t\t) {\n\t\t\tthis.resizeCanvasTarget(target, width, height, ratio);\n\t\t\tthis.carouselRearSize.set(width, height, ratio);\n\t\t}\n\t\tthis.ports.renderer.setCanvasTarget(target);\n\t\tthis.ports.renderer.setRenderTarget(null);\n\t\tthis.ports.renderer.setClearColor(0x000000, 0);\n\t\tthis.ports.renderer.clear();\n\t\tthis.ports.catalogLayer()?.renderRear(this.ports.renderer);\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t}\n\tcreateForegroundCanvas() {\n\t\tconst canvas = document.createElement('canvas');\n\t\tcanvas.className = 'stage-webgpu-foreground';\n\t\tcanvas.setAttribute('aria-hidden', 'true');\n\t\tthis.foregroundCanvas = canvas;\n\t\tthis.foregroundCanvasTarget = new THREE.CanvasTarget(canvas);\n\t\tthis.ports.container.appendChild(canvas);\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t}\n\tcreateModelOutline(model: Object3D) {\n\t\tthis.outlineMaskModel?.removeFromParent();\n\t\tthis.outlineMaskMaterial?.dispose();\n\t\tthis.outlineCompositeMaterial?.dispose();\n\t\tthis.outlineMaskTarget?.dispose();\n\t\tthis.outlineMaskMaterial = new THREE.MeshBasicMaterial({\n\t\t\tcolor: 0xffffff,\n\t\t\tdepthTest: true,\n\t\t\tdepthWrite: true,\n\t\t\tside: THREE.DoubleSide,\n\t\t\ttoneMapped: false\n\t\t});\n\n\t\tconst maskModel = model.clone(true);\n\t\tmaskModel.traverse((child) => {\n\t\t\tif (!isMesh(child)) return;\n\n\t\t\tconst sourceMesh = this.findSourceMeshByName(model, child.name);\n\t\t\tconst include = sourceMesh\n\t\t\t\t? this.ports.isInteractionMesh(sourceMesh)\n\t\t\t\t: this.ports.isInteractionMesh(child);\n\t\t\tchild.visible = include;\n\t\t\tchild.material = this.outlineMaskMaterial!;\n\t\t});\n\n\t\tthis.outlineMaskModel = maskModel;\n\t\tthis.outlineMaskScene.add(maskModel);\n\t\tthis.outlineMaskTarget = new THREE.RenderTarget(1, 1, {\n\t\t\tdepthBuffer: true,\n\t\t\tstencilBuffer: false,\n\t\t\tsamples: 4\n\t\t});\n\t\tthis.outlineMaskTarget.texture.minFilter = THREE.LinearFilter;\n\t\tthis.outlineMaskTarget.texture.magFilter = THREE.LinearFilter;\n\t\tthis.outlineMaskTarget.texture.generateMipmaps = false;\n\t\tthis.displayOutlineMask.value = this.outlineMaskTarget.texture;\n\t\tthis.outlineCompositeMaterial = this.createOutlineCompositeMaterial(\n\t\t\tthis.outlineMaskTarget.texture\n\t\t);\n\t\tthis.outlineQuad = new THREE.QuadMesh(this.outlineCompositeMaterial);\n\t\t// High refinement can replace the silhouette long after the last window resize.\n\t\tthis.resizeOutline(this.outlineWidth, this.outlineHeight);\n\t}\n\tprivate findSourceMeshByName(root: Object3D, name: string) {\n\t\tlet source: Mesh | undefined;\n\t\troot.traverse((child) => {\n\t\t\tif (!source && isMesh(child) && child.name === name) source = child;\n\t\t});\n\n\t\treturn source;\n\t}\n\tprivate createOutlineOpacity(mask: THREE.TextureNode) {\n\t\tconst calculate = () => {\n\t\t\tconst texel = this.outlineTexel;\n\t\t\tconst glowTexel = this.outlineGlowTexel;\n\t\t\tconst sampleMaskRing = (sampleTexel: typeof texel, scale = 1) => {\n\t\t\t\tconst centerUv = uv();\n\t\t\t\tconst sampleX = sampleTexel.x.mul(scale);\n\t\t\t\tconst sampleY = sampleTexel.y.mul(scale);\n\t\t\t\tconst left = mask.sample(centerUv.sub(vec2(sampleX, 0))).r;\n\t\t\t\tconst right = mask.sample(centerUv.add(vec2(sampleX, 0))).r;\n\t\t\t\tconst up = mask.sample(centerUv.add(vec2(0, sampleY))).r;\n\t\t\t\tconst down = mask.sample(centerUv.sub(vec2(0, sampleY))).r;\n\t\t\t\tconst upLeft = mask.sample(centerUv.add(vec2(0, sampleY)).sub(vec2(sampleX, 0))).r;\n\t\t\t\tconst upRight = mask.sample(centerUv.add(vec2(sampleX, sampleY))).r;\n\t\t\t\tconst downLeft = mask.sample(centerUv.sub(vec2(sampleX, sampleY))).r;\n\t\t\t\tconst downRight = mask.sample(centerUv.add(vec2(sampleX, 0)).sub(vec2(0, sampleY))).r;\n\n\t\t\t\treturn {\n\t\t\t\t\taverage: left\n\t\t\t\t\t\t.add(right)\n\t\t\t\t\t\t.add(up)\n\t\t\t\t\t\t.add(down)\n\t\t\t\t\t\t.add(upLeft)\n\t\t\t\t\t\t.add(upRight)\n\t\t\t\t\t\t.add(downLeft)\n\t\t\t\t\t\t.add(downRight)\n\t\t\t\t\t\t.div(8),\n\t\t\t\t\tmax: tslMax(\n\t\t\t\t\t\ttslMax(tslMax(left, right), tslMax(up, down)),\n\t\t\t\t\t\ttslMax(tslMax(upLeft, upRight), tslMax(downLeft, downRight))\n\t\t\t\t\t),\n\t\t\t\t\tmin: tslMin(\n\t\t\t\t\t\ttslMin(tslMin(left, right), tslMin(up, down)),\n\t\t\t\t\t\ttslMin(tslMin(upLeft, upRight), tslMin(downLeft, downRight))\n\t\t\t\t\t)\n\t\t\t\t};\n\t\t\t};\n\t\t\tconst edgeNeighbor = sampleMaskRing(texel);\n\t\t\tconst glowNearNeighbor = sampleMaskRing(glowTexel, 0.45);\n\t\t\tconst glowMidNeighbor = sampleMaskRing(glowTexel, 0.7);\n\t\t\tconst glowFarNeighbor = sampleMaskRing(glowTexel);\n\t\t\tconst center = mask.sample(uv()).r;\n\t\t\tconst outside = center.oneMinus();\n\t\t\tconst edgeGradient = edgeNeighbor.max.sub(center).max(0);\n\t\t\tconst core = edgeGradient.mul(this.outlineStrength);\n\t\t\t// Average neighbouring coverage, rather than dilating a solid band. Keep the\n\t\t\t// halo outside the spatialElement so it cannot be mistaken for painted geometry.\n\t\t\tconst glowNear = glowNearNeighbor.average\n\t\t\t\t.mul(outside)\n\t\t\t\t.mul(this.outlineGlow.mul(0.6));\n\t\t\tconst glowMid = glowMidNeighbor.average\n\t\t\t\t.mul(outside)\n\t\t\t\t.mul(this.outlineGlow.mul(0.3));\n\t\t\tconst glowFar = glowFarNeighbor.average\n\t\t\t\t.mul(outside)\n\t\t\t\t.mul(this.outlineGlow.mul(0.1));\n\t\t\tconst opacity = tslMin(core.add(glowNear).add(glowMid).add(glowFar), 1).mul(\n\t\t\t\tthis.outlineOpacityScale\n\t\t\t);\n\n\t\t\treturn opacity;\n\t\t};\n\t\tif (this.renderMeasurement === 'halo-unconditional') return calculate();\n\t\treturn Fn(() => {\n\t\t\tconst opacity = float(0).toVar();\n\t\t\t// A fully covered pixel has zero outer halo. Skip all 32 neighbour taps there.\n\t\t\tIf(mask.sample(uv()).r.lessThan(1), () => {\n\t\t\t\topacity.assign(calculate());\n\t\t\t});\n\t\t\treturn opacity;\n\t\t})();\n\t}\n\tprivate createOutlineCompositeMaterial(maskTexture: THREE.Texture) {\n\t\tconst material = new THREE.MeshBasicNodeMaterial({\n\t\t\tblending: THREE.NormalBlending,\n\t\t\tdepthTest: false,\n\t\t\tdepthWrite: false,\n\t\t\ttransparent: true\n\t\t});\n\t\tmaterial.colorNode = this.outlineColor;\n\t\tmaterial.opacityNode = this.createOutlineOpacity(texture(maskTexture));\n\t\tmaterial.toneMapped = false;\n\t\treturn material;\n\t}\n\tdisposeSceneCapture() {\n\t\tthis.disposeRenderTargetSet(this.fullQualityTargets);\n\t\tthis.disposeRenderTargetSet(this.scrollQualityTargets);\n\t\tthis.stageDisplayMaterial?.dispose();\n\t\tthis.fullQualityTargets = undefined;\n\t\tthis.scrollQualityTargets = undefined;\n\t\tthis._activeRenderTargets = undefined;\n\t\tthis.stageDisplayMaterial = undefined;\n\t\tthis._stageDisplayQuad = undefined;\n\t\tthis.stageDisplayTextureNode = undefined;\n\t}\n\tcreateSceneCapture() {\n\t\tconst blurKeys = new Set(\n\t\t\tthis.ports.fallbackPanelOptions().map((options) => this.getPanelBlurKey(options))\n\t\t);\n\t\tthis.fullQualityTargets = this.createRenderTargetSet(1, blurKeys);\n\t\tthis.scrollQualityTargets = this.createRenderTargetSet(SCROLL_RENDER_SCALE, blurKeys);\n\t\tthis._activeRenderTargets = this.fullQualityTargets;\n\n\t\tthis.stageDisplayTextureNode = texture(this.fullQualityTargets.sceneCapture.texture);\n\t\tthis.stageDisplayMaterial = new THREE.NodeMaterial();\n\t\t// CanvasTarget already runs WebGPURenderer's output transform after this\n\t\t// fullscreen copy. Keep the capture linear here so ACES and sRGB are applied\n\t\t// exactly once; using renderOutput() here would wash out the entire stage.\n\t\t// CanvasTarget unpremultiplies before tone mapping and premultiplies afterwards.\n\t\t// Environment visibility is applied before the hero; the composed capture stays opaque.\n\t\tthis.stageDisplayMaterial.fragmentNode = vec4(this.stageDisplayTextureNode.rgb, 1);\n\t\tif (this.fuseOutline) {\n\t\t\tthis.emptyOutlineMask.needsUpdate = true;\n\t\t\tconst source = this.stageDisplayTextureNode;\n\t\t\tconst haloColor = this.outlineColor;\n\t\t\tconst haloOpacity = this.createOutlineOpacity(this.displayOutlineMask);\n\t\t\t// Merge into the existing linear display pass before the canvas output transform.\n\t\t\tthis.stageDisplayMaterial.fragmentNode = Fn(() => {\n\t\t\t\tconst rgb = source.rgb.toVar();\n\t\t\t\tIf(this.displayOutlineOpacity.greaterThan(0), () => {\n\t\t\t\t\trgb.assign(mix(rgb, haloColor, haloOpacity.mul(this.displayOutlineOpacity)));\n\t\t\t\t});\n\t\t\t\treturn vec4(rgb, 1);\n\t\t\t})();\n\t\t}\n\t\tthis.stageDisplayMaterial.depthTest = false;\n\t\tthis.stageDisplayMaterial.depthWrite = false;\n\t\tthis.stageDisplayMaterial.blending = THREE.NoBlending;\n\t\tthis.stageDisplayMaterial.toneMapped = false;\n\t\tthis.stageDisplayMaterial.needsUpdate = true;\n\t\tthis._stageDisplayQuad = new THREE.QuadMesh(this.stageDisplayMaterial);\n\t}\n\tprivate createRenderTargetSet(\n\t\tscale: number,\n\t\tblurKeys: ReadonlySet<number>\n\t): StageRenderTargetSet {\n\t\tthis._renderTargetSetCreations += 1;\n\t\tconst sceneCapture = new THREE.RenderTarget(1, 1, {\n\t\t\tdepthBuffer: true,\n\t\t\tstencilBuffer: false,\n\t\t\tsamples: 4,\n\t\t\ttype: THREE.HalfFloatType\n\t\t});\n\t\tsceneCapture.texture.minFilter = THREE.LinearFilter;\n\t\tsceneCapture.texture.magFilter = THREE.LinearFilter;\n\t\tsceneCapture.texture.generateMipmaps = false;\n\t\tsceneCapture.texture.colorSpace = THREE.NoColorSpace;\n\n\t\tconst panelBlurCaptures = new Map<number, PanelBlurCapture>();\n\t\tblurKeys.forEach((blur) => {\n\t\t\tpanelBlurCaptures.set(blur, this.createPanelBlurCapture(sceneCapture.texture, blur, scale));\n\t\t});\n\n\t\treturn { scale, sceneCapture, panelBlurCaptures };\n\t}\n\tprivate disposeRenderTargetSet(targets?: StageRenderTargetSet) {\n\t\tif (!targets) return;\n\t\ttargets.sceneCapture.dispose();\n\t\ttargets.panelBlurCaptures.forEach(({ target, material, effect }) => {\n\t\t\ttarget.dispose();\n\t\t\tmaterial.dispose();\n\t\t\teffect?.dispose();\n\t\t});\n\t\ttargets.panelBlurCaptures.clear();\n\t}\n\tresizeRenderTargets() {\n\t\tconst width = window.innerWidth;\n\t\tconst height = window.innerHeight;\n\t\tconst pixelRatio = this.getFullPixelRatio();\n\t\tif (!this.ports.frame().outgoingBackground)\n\t\t\tthis.resizeCanvasTarget(this.ports.backgroundCanvasTarget, width, height, pixelRatio);\n\t\tif (this.foregroundCanvasTarget) {\n\t\t\tthis.resizeCanvasTarget(this.foregroundCanvasTarget, width, height, pixelRatio);\n\t\t}\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\tthis.resizeRenderTargetSet(this.fullQualityTargets, width, height, pixelRatio);\n\t\tthis.resizeRenderTargetSet(this.scrollQualityTargets, width, height, pixelRatio);\n\t}\n\tprivate resizeRenderTargetSet(\n\t\ttargets: StageRenderTargetSet | undefined,\n\t\twidth: number,\n\t\theight: number,\n\t\tpixelRatio: number\n\t) {\n\t\tif (!targets) return;\n\t\tthis._renderTargetSetResizes += 1;\n\t\tconst captureWidth = Math.max(1, Math.round(width * pixelRatio * targets.scale));\n\t\tconst captureHeight = Math.max(1, Math.round(height * pixelRatio * targets.scale));\n\t\ttargets.sceneCapture.setSize(captureWidth, captureHeight);\n\t\ttargets.panelBlurCaptures.forEach(({ target, effect, resolutionScale }) => {\n\t\t\tif (effect) {\n\t\t\t\tconst effectScale = resolutionScale / (pixelRatio * targets.scale);\n\t\t\t\teffect.resolutionScale = effectScale;\n\t\t\t\teffect.setSize(captureWidth, captureHeight);\n\t\t\t\t// Consumers sample normalized screen UVs. Preserve the blur's actual\n\t\t\t\t// density instead of copying it back to a full-DPR viewport texture.\n\t\t\t\ttarget.setSize(\n\t\t\t\t\tMath.max(1, Math.round(captureWidth * effectScale)),\n\t\t\t\t\tMath.max(1, Math.round(captureHeight * effectScale))\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// A zero-blur backdrop still contains sharp scene detail.\n\t\t\t\ttarget.setSize(captureWidth, captureHeight);\n\t\t\t}\n\t\t});\n\t}\n\tgetFullPixelRatio() {\n\t\treturn getStageRenderPixelRatio(\n\t\t\twindow.innerWidth,\n\t\t\twindow.innerHeight,\n\t\t\twindow.devicePixelRatio,\n\t\t\tthis.renderSettings\n\t\t);\n\t}\n\tsetRenderSettings(settings?: StageRenderSettings) {\n\t\tthis.renderSettings = resolveStageRenderSettings(settings);\n\t}\n\tgetRenderSettings() {\n\t\treturn { ...this.renderSettings };\n\t}\n\tsetScrollRenderQuality(active: boolean) {\n\t\tthis.ports.container.toggleAttribute('data-stage-scroll-rendering', active);\n\t\tconst nextTargets = active ? this.scrollQualityTargets : this.fullQualityTargets;\n\t\tif (!nextTargets || this._activeRenderTargets === nextTargets) return;\n\t\tthis.activateRenderTargetSet(nextTargets);\n\t}\n\tprivate activateRenderTargetSet(nextTargets: StageRenderTargetSet) {\n\t\tthis._activeRenderTargets = nextTargets;\n\t\tif (this.stageDisplayTextureNode) {\n\t\t\tthis.stageDisplayTextureNode.value = nextTargets.sceneCapture.texture;\n\t\t}\n\t\tthis.ports.panelRuntimes().forEach((runtime) => {\n\t\t\truntime.glass?.setBackdropTexture(this.getPanelBlurTexture(runtime.options, nextTargets));\n\t\t});\n\t\tthis.ports.minimaps().forEach((minimap) => {\n\t\t\tminimap.stageCaptureTexture.value = nextTargets.sceneCapture.texture;\n\t\t\tconst panel = this.ports.panelRuntimes()[minimap.panelIndex];\n\t\t\tif (panel) {\n\t\t\t\tminimap.stageBlurTexture.value =\n\t\t\t\t\tpanel.surface === 'solid'\n\t\t\t\t\t\t? nextTargets.sceneCapture.texture\n\t\t\t\t\t\t: this.getPanelBlurTexture(panel.options, nextTargets);\n\t\t\t}\n\t\t\tminimap.overlayCaptureDirty = true;\n\t\t});\n\t}\n\twarmRenderTargetSets() {\n\t\tconst previousTargets = this._activeRenderTargets;\n\t\tconst availableTargets = [this.fullQualityTargets, this.scrollQualityTargets].filter(\n\t\t\t(targets): targets is StageRenderTargetSet => Boolean(targets)\n\t\t);\n\t\tif (!previousTargets || !this._stageDisplayQuad || availableTargets.length !== 2) return;\n\t\t// Finish with the active/full-quality set so the warm-up itself cannot\n\t\t// leave a lower-resolution frame on the visible canvas.\n\t\tconst targetSets = [\n\t\t\t...availableTargets.filter((targets) => targets !== previousTargets),\n\t\t\tpreviousTargets\n\t\t];\n\n\t\ttry {\n\t\t\twithRendererState(this.ports.renderer, () => {\n\t\t\t\ttargetSets.forEach((targets) => {\n\t\t\t\t\tthis.activateRenderTargetSet(targets);\n\t\t\t\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\t\t\t\tthis.ports.renderer.setRenderTarget(targets.sceneCapture);\n\t\t\t\t\tthis.ports.renderStage();\n\t\t\t\t\tthis.renderPanelBlurCaptures(targets, true);\n\t\t\t\t\tthis.renderStageDisplay();\n\t\t\t\t\tthis.renderBackgroundPanels();\n\t\t\t\t\tthis._renderTargetSetWarmups += 1;\n\t\t\t\t});\n\t\t\t});\n\t\t} finally {\n\t\t\tthis.activateRenderTargetSet(previousTargets);\n\t\t}\n\t}\n\tprivate resizeCanvasTarget(\n\t\ttarget: THREE.CanvasTarget,\n\t\twidth: number,\n\t\theight: number,\n\t\tpixelRatio: number\n\t) {\n\t\tthis.ports.renderer.setCanvasTarget(target);\n\t\tthis.ports.renderer.setPixelRatio(pixelRatio);\n\t\tthis.ports.renderer.setSize(width, height, false);\n\t}\n\tprivate createPanelBlurCapture(\n\t\tsceneTexture: THREE.Texture,\n\t\tblur: number,\n\t\trenderScale: number\n\t): PanelBlurCapture {\n\t\tconst target = new THREE.RenderTarget(1, 1, {\n\t\t\tdepthBuffer: false,\n\t\t\tstencilBuffer: false\n\t\t});\n\t\ttarget.texture.minFilter = THREE.LinearFilter;\n\t\ttarget.texture.magFilter = THREE.LinearFilter;\n\t\ttarget.texture.generateMipmaps = false;\n\t\ttarget.texture.colorSpace = THREE.NoColorSpace;\n\n\t\tconst sourceTexture = texture(sceneTexture);\n\t\t// Scale resolution and sample offsets together to retain the CSS blur radius.\n\t\t// The final texture uses the same density and normalized screen-space mapping.\n\t\tconst query = new URLSearchParams(typeof window === 'undefined' ? '' : window.location?.search);\n\t\tconst fullResolutionProbe =\n\t\t\tquery.get('stage-test') === '1' && query.get('stage-backdrop') === 'full';\n\t\tconst blurResolution = blur >= 4 && !fullResolutionProbe ? 0.5 : 1;\n\t\tconst effect =\n\t\t\tblur > 0\n\t\t\t\t? gaussianBlur(sourceTexture, blurResolution, Math.max(1, Math.round(blur)), {\n\t\t\t\t\t\tresolutionScale: blurResolution / (this.getFullPixelRatio() * renderScale)\n\t\t\t\t\t})\n\t\t\t\t: undefined;\n\t\tconst material = new THREE.NodeMaterial();\n\t\tmaterial.colorNode = effect ?? sourceTexture;\n\t\tmaterial.needsUpdate = true;\n\n\t\treturn {\n\t\t\tresolutionScale: blurResolution,\n\t\t\teffect,\n\t\t\tmaterial,\n\t\t\tquad: new THREE.QuadMesh(material),\n\t\t\ttarget\n\t\t};\n\t}\n\tprivate getPanelBlurKey(options: LiquidGlassPanelOptions) {\n\t\tconst value = Number.isFinite(options.backdropBlur) ? (options.backdropBlur ?? 0) : 0;\n\t\treturn Math.round(THREE.MathUtils.clamp(value, 0, 100) * 100) / 100;\n\t}\n\t/** Allocate changed blur settings without replacing the scene capture or model resources. */\n\tsyncPanelBlurCaptures() {\n\t\tconst keys = new Set(this.ports.fallbackPanelOptions().map((options) => this.getPanelBlurKey(options)));\n\t\tif (!this._activeRenderTargets && keys.size) this.createSceneCapture();\n\t\tfor (const targets of [this.fullQualityTargets, this.scrollQualityTargets]) {\n\t\t\tif (!targets) continue;\n\t\t\tfor (const key of keys) if (!targets.panelBlurCaptures.has(key))\n\t\t\t\ttargets.panelBlurCaptures.set(key, this.createPanelBlurCapture(targets.sceneCapture.texture, key, targets.scale));\n\t\t\tfor (const [key, capture] of targets.panelBlurCaptures) if (!keys.has(key)) {\n\t\t\t\tcapture.target.dispose(); capture.material.dispose(); capture.effect?.dispose();\n\t\t\t\ttargets.panelBlurCaptures.delete(key);\n\t\t\t}\n\t\t\tthis.resizeRenderTargetSet(targets, window.innerWidth, window.innerHeight, this.getFullPixelRatio());\n\t\t}\n\t}\n\tgetPanelBlurTexture(options: LiquidGlassPanelOptions, targets = this._activeRenderTargets) {\n\t\tconst blur = this.getPanelBlurKey(options);\n\t\tconst capture = targets?.panelBlurCaptures.get(blur);\n\t\tif (!capture) {\n\t\t\tthrow new Error(`No backdrop capture exists for panel blur ${blur}`);\n\t\t}\n\t\treturn capture.target.texture;\n\t}\n\t/** Prepare hidden close-up effects during page binding, never during camera motion.\n\t * Captures stay invalid: the first visible frame must still sample the live element.\n\t * Only compile the foreground scene, so preparation cannot paint an overlay on screen.\n\t */\n\tasync prepareZoomEffects() {\n\t\tif (!this.foregroundCanvasTarget || this.disposed) return;\n\t\tconst views = [...this.ports.minimaps().values()].filter(\n\t\t\t(view) => !this.preparedZoomViews.has(view)\n\t\t);\n\t\tif (!views.length) return;\n\t\tconst pending: Promise<unknown>[] = [];\n\t\tfor (const view of views) {\n\t\t\twithRendererState(this.ports.renderer, () => {\n\t\t\t\tthis.ports.renderMinimapBlur(view);\n\t\t\t\tif (this.ports.panelRuntimes()[view.panelIndex]?.surface === 'glass')\n\t\t\t\t\tthis.ports.renderMinimapPanelCapture(view);\n\t\t\t\tthis.ports.renderer.setCanvasTarget(this.foregroundCanvasTarget!);\n\t\t\t\tthis.ports.renderer.setRenderTarget(null);\n\t\t\t\tconst ringMaterial = view.overlayRing.material;\n\t\t\t\tconst compositeCulled = view.overlayComposite.frustumCulled;\n\t\t\t\tconst ringCulled = view.overlayRing.frustumCulled;\n\t\t\t\ttry {\n\t\t\t\t\t// A newly bound minimap camera may not yet have its screen projection.\n\t\t\t\t\t// Compile the hidden effects even if that initial frustum excludes them.\n\t\t\t\t\tview.overlayComposite.frustumCulled = false;\n\t\t\t\t\tview.overlayRing.frustumCulled = false;\n\t\t\t\t\twithVisibility(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t...[...this.ports.minimaps().values()].map((entry) => entry.layer),\n\t\t\t\t\t\t\tview.overlayComposite,\n\t\t\t\t\t\t\tview.overlayRing\n\t\t\t\t\t\t],\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tfor (const entry of this.ports.minimaps().values())\n\t\t\t\t\t\t\t\tentry.layer.visible = entry === view;\n\t\t\t\t\t\t\tview.overlayComposite.visible = true;\n\t\t\t\t\t\t\tview.overlayRing.visible = true;\n\t\t\t\t\t\t\tfor (const material of [view.ringRestMaterial, view.ringForegroundMaterial]) {\n\t\t\t\t\t\t\t\tview.overlayRing.material = material;\n\t\t\t\t\t\t\t\tpending.push(\n\t\t\t\t\t\t\t\t\tthis.ports.renderer.compileAsync(this.ports.minimapScene(), view.screenCamera)\n\t\t\t\t\t\t\t\t);\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} finally {\n\t\t\t\t\tview.overlayRing.material = ringMaterial;\n\t\t\t\t\tview.overlayComposite.frustumCulled = compositeCulled;\n\t\t\t\t\tview.overlayRing.frustumCulled = ringCulled;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tawait Promise.all(pending);\n\t\tconst device = (this.ports.renderer.backend as unknown as { device?: GPUDevice }).device;\n\t\tawait device?.queue.onSubmittedWorkDone();\n\t\tif (!this.disposed) for (const view of views) this.preparedZoomViews.add(view);\n\t}\n\trenderForegroundLayer() {\n\t\tif (!this.foregroundCanvasTarget) return;\n\n\t\tthis.ports.renderer.setCanvasTarget(this.foregroundCanvasTarget);\n\t\tthis.ports.renderer.setRenderTarget(null);\n\t\tthis.ports.renderer.setClearColor(0x000000, 0);\n\t\tthis.ports.renderer.clear();\n\t\tthis.renderMinimapScene();\n\t\tfor (const entry of this.ports.exitingMinimaps())\n\t\t\tif (entry.minimap.displayOpacity > 0) entry.capture.render(this.ports.renderer);\n\t\tthis.ports.catalogLayer()?.draw(this.ports.renderer, 'front');\n\t\tfor (const entry of this.ports.contentSecondaries()) entry.capture.render(this.ports.renderer);\n\t\tthis.ports.spatialCapture()?.render(this.ports.renderer);\n\t}\n\trenderBackgroundPanels() {\n\t\treturn withVisibility(\n\t\t\tthis.ports.panelRuntimes().map((panel) => panel.group),\n\t\t\t() => {\n\t\t\t\tconst minimaps = Array.from(this.ports.minimaps().values());\n\t\t\t\tconst minimapPanelIndices = new Set(minimaps.map((minimap) => minimap.panelIndex));\n\t\t\t\tconst panelVisibility = this.ports.panelRuntimes().map((panel) => panel.group.visible);\n\t\t\t\tconst visibleMinimaps = minimaps.filter(\n\t\t\t\t\t(minimap) =>\n\t\t\t\t\t\tminimap.viewportVisible &&\n\t\t\t\t\t\tpanelVisibility[minimap.panelIndex] &&\n\t\t\t\t\t\tBoolean(this.ports.panelRuntimes()[minimap.panelIndex]?.glass)\n\t\t\t\t);\n\t\t\t\tconst hasVisibleRegularPanel = this.ports\n\t\t\t\t\t.panelRuntimes()\n\t\t\t\t\t.some(\n\t\t\t\t\t\t(panel, index) =>\n\t\t\t\t\t\t\tBoolean(panel.glass) && panelVisibility[index] && !minimapPanelIndices.has(index)\n\t\t\t\t\t);\n\n\t\t\t\t// Regular panels share the stage camera. Minimap panels use an off-axis\n\t\t\t\t// screen camera, so leave them out of this pass and draw them separately.\n\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\tif (panel.glass) {\n\t\t\t\t\t\tpanel.group.visible = panelVisibility[index] && !minimapPanelIndices.has(index);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (hasVisibleRegularPanel) {\n\t\t\t\t\tthis.ports.renderer.clearDepth();\n\t\t\t\t\tthis.ports.renderer.render(this.ports.panelScene, this.ports.panelCamera);\n\t\t\t\t\tthis._panelSceneRenderPasses += 1;\n\t\t\t\t}\n\n\t\t\t\t// Keep the glass body in the same compositing layer as the other panels,\n\t\t\t\t// but retain the exact camera and transform used by its foreground model.\n\t\t\t\tvisibleMinimaps.forEach((active) => {\n\t\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\t\tif (panel.glass) {\n\t\t\t\t\t\t\tpanel.group.visible = panelVisibility[index] && index === active.panelIndex;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.ports.renderer.clearDepth();\n\t\t\t\t\tthis.ports.renderer.render(this.ports.panelScene, active.screenCamera);\n\t\t\t\t\tthis._panelSceneRenderPasses += 1;\n\t\t\t\t});\n\n\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\tpanel.group.visible = panelVisibility[index];\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t}\n\tprivate renderMinimapScene() {\n\t\treturn withVisibility(\n\t\t\t[\n\t\t\t\t...this.ports.panelRuntimes().map((panel) => panel.group),\n\t\t\t\t...[...this.ports.minimaps().values()].flatMap((view) => [view.layer, view.spatialElementRoot])\n\t\t\t],\n\t\t\t() => {\n\t\t\t\tif (!this.ports.minimaps().size) return;\n\n\t\t\t\tconst minimaps = Array.from(this.ports.minimaps().values());\n\t\t\t\tconst visibleMinimaps = minimaps.filter(\n\t\t\t\t\t(minimap) =>\n\t\t\t\t\t\tminimap.viewportVisible &&\n\t\t\t\t\t\tthis.ports.getPanelTransitionOpacity(this.ports.panelRuntimes()[minimap.panelIndex]) >\n\t\t\t\t\t\t\t0.001\n\t\t\t\t);\n\t\t\t\tif (!visibleMinimaps.length) return;\n\t\t\t\tconst panelVisibility = this.ports.panelRuntimes().map((panel) => panel.group.visible);\n\n\t\t\t\tvisibleMinimaps.forEach((active) => {\n\t\t\t\t\tminimaps.forEach((minimap) => {\n\t\t\t\t\t\tminimap.layer.visible = minimap === active;\n\t\t\t\t\t});\n\t\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\t\tif (panel.glass) panel.group.visible = index === active.panelIndex;\n\t\t\t\t\t});\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tactive.overlayComposite.visible &&\n\t\t\t\t\t\t(!active.overlayCaptureValid ||\n\t\t\t\t\t\t\t(this.measurementMode !== 'reuse-capture' && active.overlayCaptureDirty))\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.ports.renderMinimapBlur(active);\n\t\t\t\t\t\tactive.overlayCaptureDirty = false;\n\t\t\t\t\t\tactive.overlayCaptureValid = true;\n\t\t\t\t\t\tthis._minimapOverlayCapturePasses += 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (\n\t\t\t\t\t\tactive.overlayComposite.visible &&\n\t\t\t\t\t\tthis.ports.panelRuntimes()[active.panelIndex]?.surface === 'glass' &&\n\t\t\t\t\t\t(!active.panelCaptureValid ||\n\t\t\t\t\t\t\t(this.measurementMode !== 'reuse-capture' && active.panelCaptureDirty))\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.ports.renderMinimapPanelCapture(active);\n\t\t\t\t\t\tactive.panelCaptureDirty = false;\n\t\t\t\t\t\tactive.panelCaptureValid = true;\n\t\t\t\t\t}\n\t\t\t\t\tthis.ports.renderer.clearDepth();\n\t\t\t\t\tconst spatialElementVisible = active.spatialElementRoot.visible;\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.ports.frame().catalogDockTarget &&\n\t\t\t\t\t\tthis.ports.frame().catalogHandoff &&\n\t\t\t\t\t\t!this.ports.frame().catalogMotionComplete\n\t\t\t\t\t)\n\t\t\t\t\t\tactive.spatialElementRoot.visible = false;\n\t\t\t\t\tthis.ports.renderer.render(this.ports.minimapScene(), active.screenCamera);\n\t\t\t\t\tactive.spatialElementRoot.visible = spatialElementVisible;\n\t\t\t\t\tthis._minimapSceneRenderPasses += 1;\n\t\t\t\t});\n\n\t\t\t\tthis.ports.panelRuntimes().forEach((panel, index) => {\n\t\t\t\t\tpanel.group.visible = panelVisibility[index];\n\t\t\t\t});\n\t\t\t\tminimaps.forEach((minimap) => {\n\t\t\t\t\tminimap.layer.visible =\n\t\t\t\t\t\tminimap.viewportVisible &&\n\t\t\t\t\t\tthis.ports.getPanelTransitionOpacity(this.ports.panelRuntimes()[minimap.panelIndex]) >\n\t\t\t\t\t\t\t0.001;\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t}\n\trenderModelOutline(target: THREE.RenderTarget | null, opacity = 1) {\n\t\tthis.displayOutlineOpacity.value = 0;\n\t\tif (this.renderMeasurement === 'no-halo' || !this.ports.frame().modelHover) return;\n\t\tconst opacityBefore = this.outlineOpacityScale.value;\n\t\ttry {\n\t\t\treturn withRendererState(this.ports.renderer, () => {\n\t\t\t\tif (\n\t\t\t\t\t!this.ports.frame().stageViewportVisible ||\n\t\t\t\t\t!this.ports.frame().modelHover ||\n\t\t\t\t\t!this.outlineMaskTarget ||\n\t\t\t\t\t!this.outlineQuad\n\t\t\t\t)\n\t\t\t\t\treturn;\n\n\t\t\t\tconst previousClearAlpha = this.ports.renderer.getClearAlpha();\n\t\t\t\tconst previousClearColor = this.ports.renderer.getClearColor(new THREE.Color());\n\t\t\t\tconst previousOpacity = this.outlineOpacityScale.value;\n\n\t\t\t\tif (this.renderMeasurement !== 'halo-frozen-mask' || !this.outlineMaskValid) {\n\t\t\t\t\tthis.ports.renderer.setRenderTarget(this.outlineMaskTarget);\n\t\t\t\t\tthis.ports.renderer.setClearColor(0x000000, 0);\n\t\t\t\t\tthis.ports.renderer.clear();\n\t\t\t\t\tthis.ports.renderer.render(this.outlineMaskScene, this.ports.camera);\n\t\t\t\t\tthis.outlineMaskValid = true;\n\t\t\t\t}\n\t\t\t\tthis.ports.renderer.setClearColor(previousClearColor, previousClearAlpha);\n\t\t\t\tthis.ports.renderer.setRenderTarget(target);\n\n\t\t\t\tthis.outlineOpacityScale.value = opacity;\n\t\t\t\t// Glass can refract the sharp scene capture, so keep the halo in that\n\t\t\t\t// capture while a glass surface is visible. Forced fusion is a test probe.\n\t\t\t\tconst fuseThisFrame =\n\t\t\t\t\tthis.fuseOutline &&\n\t\t\t\t\t(this.renderMeasurement === 'halo-fused' ||\n\t\t\t\t\t\t!this.ports\n\t\t\t\t\t\t\t.panelRuntimes()\n\t\t\t\t\t\t\t.some((panel) => panel.surface === 'glass' && panel.group.visible));\n\t\t\t\tif (fuseThisFrame) this.displayOutlineOpacity.value = opacity;\n\t\t\t\telse if (this.renderMeasurement !== 'halo-mask-only')\n\t\t\t\t\tthis.outlineQuad.render(this.ports.renderer);\n\t\t\t\tthis.outlineOpacityScale.value = previousOpacity;\n\t\t\t});\n\t\t} finally {\n\t\t\tthis.outlineOpacityScale.value = opacityBefore;\n\t\t}\n\t}\n\trenderPanelBlurCaptures(renderTargets: StageRenderTargetSet, forceAll = false) {\n\t\tconst visibleBlurKeys = forceAll\n\t\t\t? undefined\n\t\t\t: new Set(\n\t\t\t\t\tthis.ports.panelRuntimes().flatMap((panel, index) => {\n\t\t\t\t\t\tif (!panel.group.visible) return [];\n\t\t\t\t\t\tconst needsGlassCapture = panel.surface === 'glass' && Boolean(panel.glass);\n\t\t\t\t\t\tconst needsFrostedMinimapCapture =\n\t\t\t\t\t\t\tpanel.surface === 'frosted' &&\n\t\t\t\t\t\t\tBoolean(this.ports.minimaps().get(index)?.overlayComposite.visible);\n\t\t\t\t\t\treturn needsGlassCapture || needsFrostedMinimapCapture\n\t\t\t\t\t\t\t? [this.getPanelBlurKey(panel.options)]\n\t\t\t\t\t\t\t: [];\n\t\t\t\t\t})\n\t\t\t\t);\n\t\trenderTargets.panelBlurCaptures.forEach(({ target, quad }, blurKey) => {\n\t\t\tif (visibleBlurKeys && !visibleBlurKeys.has(blurKey)) return;\n\t\t\tconst size = `${target.width}:${target.height}`;\n\t\t\tif (\n\t\t\t\tthis.renderMeasurement === 'frozen-backdrop' &&\n\t\t\t\tthis.measuredBackdropSeeds.get(target) === size\n\t\t\t)\n\t\t\t\treturn;\n\t\t\tthis.ports.renderer.setRenderTarget(target);\n\t\t\tthis.ports.renderer.clear();\n\t\t\tquad.render(this.ports.renderer);\n\t\t\tif (this.renderMeasurement === 'frozen-backdrop')\n\t\t\t\tthis.measuredBackdropSeeds.set(target, size);\n\t\t\tthis._panelBlurRenderPasses += 1;\n\t\t});\n\t}\n\trenderStageDisplay() {\n\t\tif (!this._stageDisplayQuad) return;\n\t\tthis.ports.renderer.setRenderTarget(null);\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\tthis.ports.renderer.setClearColor(0xffffff, 1);\n\t\tthis.ports.renderer.clear();\n\t\tthis._stageDisplayQuad.render(this.ports.renderer);\n\t}\n\trenderStageContents() {\n\t\tthis.ports.renderer.clear();\n\t\tthis.ports.renderer.render(this.ports.backgroundScene, this.ports.camera);\n\t\tthis.ports.renderer.render(this.ports.tintScene, this.ports.tintCamera);\n\t\tthis.backgroundCoverOpacity.value = 1 - this.ports.frame().backgroundReveal;\n\t\tif (this.backgroundCoverOpacity.value > 0) this.backgroundCover.render(this.ports.renderer);\n\t\tif (\n\t\t\tthis.ports.frame().stageViewportVisible &&\n\t\t\t(!this.ports.frame().catalogHandoff || this.ports.frame().catalogMotionComplete) &&\n\t\t\t(!this.ports.frame().catalog || this.ports.frame().pageModelReady)\n\t\t) {\n\t\t\tthis.ports.renderer.clearDepth();\n\t\t\tthis.ports.renderer.render(this.ports.scene, this.ports.camera);\n\t\t\tthis._stageModelRenderPasses += 1;\n\t\t}\n\t}\n\treleaseOutline() {\n\t\tthis.displayOutlineOpacity.value = 0;\n\t\tthis.displayOutlineMask.value = this.emptyOutlineMask;\n\t\tthis.outlineMaskModel?.removeFromParent();\n\t\tthis.outlineMaskMaterial?.dispose();\n\t\tthis.outlineCompositeMaterial?.dispose();\n\t\tthis.outlineMaskTarget?.dispose();\n\t\tthis.outlineMaskModel = undefined;\n\t\tthis.outlineMaskMaterial = undefined;\n\t\tthis.outlineCompositeMaterial = undefined;\n\t\tthis.outlineMaskTarget = undefined;\n\t\tthis.outlineQuad = undefined;\n\t}\n\tresizeOutline(width: number, height: number) {\n\t\tthis.outlineWidth = width;\n\t\tthis.outlineHeight = height;\n\t\tconst scale = this.renderMeasurement === 'halo-half-mask' ? 0.5 : 1;\n\t\tthis.outlineMaskTarget?.setSize(\n\t\t\tMath.max(1, Math.round(width * scale)),\n\t\t\tMath.max(1, Math.round(height * scale))\n\t\t);\n\t\tthis.outlineMaskValid = false;\n\t\tthis.outlineTexel.value.set(\n\t\t\tthis.ports.interactionTheme().outlineThickness / Math.max(width, 1),\n\t\t\tthis.ports.interactionTheme().outlineThickness / Math.max(height, 1)\n\t\t);\n\t\tthis.outlineGlowTexel.value.set(\n\t\t\t(this.ports.interactionTheme().outlineThickness *\n\t\t\t\tthis.ports.interactionTheme().outlineGlowThickness) /\n\t\t\t\tMath.max(width, 1),\n\t\t\t(this.ports.interactionTheme().outlineThickness *\n\t\t\t\tthis.ports.interactionTheme().outlineGlowThickness) /\n\t\t\t\tMath.max(height, 1)\n\t\t);\n\t}\n\tdispose() {\n\t\tif (this.disposed) return;\n\t\tthis.disposed = true;\n\t\tthis.releaseOutline();\n\t\tthis.emptyOutlineMask.dispose();\n\t\tthis.disposeSceneCapture();\n\t\tthis.backgroundCoverMaterial.dispose();\n\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\tthis.foregroundCanvasTarget?.dispose();\n\t\tthis.foregroundCanvasTarget = undefined;\n\t\tthis.carouselRearTarget?.dispose();\n\t\tthis.carouselRearTarget = undefined;\n\t\tthis.carouselRearCanvas?.remove();\n\t\tthis.foregroundCanvas?.remove();\n\t}\n\n\tget activeRenderTargets() {\n\t\treturn this._activeRenderTargets;\n\t}\n\tget stageDisplayQuad() {\n\t\treturn this._stageDisplayQuad;\n\t}\n\tget minimapOverlayCapturePasses() {\n\t\treturn this._minimapOverlayCapturePasses;\n\t}\n\tget renderTargetSetCreations() {\n\t\treturn this._renderTargetSetCreations;\n\t}\n\tget renderTargetSetResizes() {\n\t\treturn this._renderTargetSetResizes;\n\t}\n\tget renderTargetSetWarmups() {\n\t\treturn this._renderTargetSetWarmups;\n\t}\n\tget stageModelRenderPasses() {\n\t\treturn this._stageModelRenderPasses;\n\t}\n\tget panelBlurRenderPasses() {\n\t\treturn this._panelBlurRenderPasses;\n\t}\n\tget panelSceneRenderPasses() {\n\t\treturn this._panelSceneRenderPasses;\n\t}\n\tget minimapSceneRenderPasses() {\n\t\treturn this._minimapSceneRenderPasses;\n\t}\n\n\t/** The facade advances owners first; this command submits the ordered GPU passes. */\n\trenderFrame(contentOnly: boolean, outline: boolean) {\n\t\tthis.displayOutlineOpacity.value = 0;\n\t\treturn withRendererState(this.ports.renderer, () => {\n\t\t\tthis.ports.renderer.setCanvasTarget(this.ports.backgroundCanvasTarget);\n\t\t\tif (contentOnly) {\n\t\t\t\tthis.ports.renderer.setRenderTarget(null);\n\t\t\t\tif (!this.ports.frame().outgoingBackground) {\n\t\t\t\t\tthis.ports.renderer.setClearColor(0, 0);\n\t\t\t\t\tthis.ports.renderer.clear();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!this._activeRenderTargets) return;\n\t\t\t\tthis.ports.renderer.setRenderTarget(this._activeRenderTargets.sceneCapture);\n\t\t\t\tthis.ports.renderStage();\n\t\t\t\tthis.renderPanelBlurCaptures(this._activeRenderTargets);\n\t\t\t\tif (outline) this.renderModelOutline(this._activeRenderTargets.sceneCapture, 1);\n\t\t\t\tthis.renderStageDisplay();\n\t\t\t\tthis.renderBackgroundPanels();\n\t\t\t}\n\t\t\tthis.renderCarouselRear();\n\t\t\tthis.renderForegroundLayer();\n\t\t});\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualScrollController.d.ts","sourceRo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AO,CAAC,QAAQ,CAAC,aAAa,CAc5B;IAEF,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,qBAAqB;IAgD7B,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,qBAAqB;CAK7B"}
|
|
@@ -253,8 +253,14 @@ export class VirtualScrollController {
|
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
handleFocusIn = (event) => {
|
|
256
|
+
if (this.container.hasAttribute('data-stage-fullscreen'))
|
|
257
|
+
return;
|
|
256
258
|
if (this.navigation || !(event.target instanceof HTMLElement))
|
|
257
259
|
return;
|
|
260
|
+
// Corner controls are already clamped into the viewport. Their 10px inset
|
|
261
|
+
// must not trigger document scrolling when focused before a fullscreen click.
|
|
262
|
+
if (event.target.closest('[data-stage-corner-control]'))
|
|
263
|
+
return;
|
|
258
264
|
const rect = event.target.getBoundingClientRect();
|
|
259
265
|
if (rect.top >= FOCUS_VIEWPORT_MARGIN &&
|
|
260
266
|
rect.bottom <= window.innerHeight - FOCUS_VIEWPORT_MARGIN)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualScrollController.js","sourceRoot":"","sources":["../../src/stage/VirtualScrollController.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,qBAAqB,EACrB,4BAA4B,EAC5B,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EAEvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,iCAAiC,EACjC,6BAA6B,EAC7B,+BAA+B,EAC/B,qBAAqB,EACrB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,YAAY,GAAG,6BAA6B,CAAC;AACnD,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAC;IACxC,WAAW;IACX,SAAS;IACT,KAAK;IACL,MAAM;IACN,UAAU;IACV,QAAQ;IACR,GAAG;CACH,CAAC,CAAC;AASH;;;GAGG;AACH,MAAM,OAAO,uBAAuB;IAejB;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ClD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QACpF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IACrD,CAAC;CACD","sourcesContent":["import {\n\tSTAGE_SCROLL_PRIORITY,\n\tgetStageVisualScrollPosition,\n\tmarkStageScrollInput,\n\tsubscribeStageScrollFrame,\n\tsyncStageScrollToNative,\n\ttype StageScrollFrame\n} from './scrollFrame.js';\nimport {\n\tSTAGE_ANCHOR_NAVIGATION_END_EVENT,\n\tSTAGE_ANCHOR_NAVIGATION_EVENT,\n\tSTAGE_ANCHOR_SCROLL_DURATION_MS,\n\teaseStageAnchorScroll\n} from './scrollAnimation.js';\n\nconst ACTIVE_CLASS = 'stage-virtual-scroll-active';\nconst FOCUS_VIEWPORT_MARGIN = 24;\nconst SCROLL_INTERRUPTION_KEYS = new Set([\n\t'ArrowDown',\n\t'ArrowUp',\n\t'End',\n\t'Home',\n\t'PageDown',\n\t'PageUp',\n\t' '\n]);\n\nexport type ScrollRestoreTarget = { x: number; y: number } | { hash: string };\n\nexport interface ScrollPositions {\n\tnative: { x: number; y: number };\n\tvisual: { x: number; y: number };\n}\n\n/**\n * Keeps native scrolling as the input and scrollbar source while moving the\n * complete visible DOM from the same animation frame consumed by the stage.\n */\nexport class VirtualScrollController {\n\tprivate stopScrollFrames?: () => void;\n\tprivate resizeObserver?: ResizeObserver;\n\tprivate measureFrame = 0;\n\tprivate hashFrame = 0;\n\tprivate anchorScrollFrame = 0;\n\tprivate anchorNavigationTargetId?: string;\n\tprivate scrollY = 0;\n\tprivate started = false;\n\tprivate navigation?: { token: object; interrupted: boolean };\n\tprivate historyHashUrl?: string;\n\t/** The navigation bridge supplies SvelteKit's public history writers. */\n\twriteHash?: (url: URL, replace: boolean) => void;\n\n\tconstructor(\n\t\tprivate readonly container: HTMLElement,\n\t\tprivate readonly content: HTMLElement,\n\t\tprivate readonly spacer: HTMLElement\n\t) {}\n\n\tget active() {\n\t\treturn this.started;\n\t}\n\n\treadPositions(): ScrollPositions {\n\t\tconst visual = getStageVisualScrollPosition();\n\t\treturn {\n\t\t\tnative: { x: window.scrollX, y: window.scrollY },\n\t\t\tvisual: { x: visual.scrollX, y: visual.scrollY }\n\t\t};\n\t}\n\n\tbeginNavigation(token: object) {\n\t\tthis.cancelAnchorScroll();\n\t\tif (this.hashFrame) cancelAnimationFrame(this.hashFrame);\n\t\tthis.hashFrame = 0;\n\t\tthis.navigation = { token, interrupted: false };\n\t}\n\n\tmeasureExtentNow() {\n\t\tif (!this.started) return;\n\t\tif (this.measureFrame) cancelAnimationFrame(this.measureFrame);\n\t\tthis.measureFrame = 0;\n\t\tthis.measureDocumentHeight();\n\t\treturn Number.parseFloat(this.spacer.style.height);\n\t}\n\n\trestoreTarget(target: ScrollRestoreTarget, token: object) {\n\t\tif (!this.started || this.navigation?.token !== token || this.navigation.interrupted) return;\n\t\tlet position: { x: number; y: number };\n\t\tif ('hash' in target) {\n\t\t\tconst element = this.getHashTarget(target.hash);\n\t\t\tposition = { x: 0, y: element ? this.getElementScrollTop(element) : 0 };\n\t\t} else {\n\t\t\tposition = target;\n\t\t}\n\t\twindow.scrollTo({ left: position.x, top: position.y, behavior: 'instant' });\n\t\tsyncStageScrollToNative();\n\t\treturn this.readPositions();\n\t}\n\n\tendNavigation(token: object) {\n\t\tif (this.navigation?.token === token) this.navigation = undefined;\n\t}\n\n\tstart() {\n\t\tif (this.started) return;\n\t\tthis.started = true;\n\n\t\t// Preserve the in-flow height before the content becomes viewport-fixed.\n\t\tthis.measureDocumentHeight();\n\t\tthis.container.classList.add(ACTIVE_CLASS);\n\t\tthis.applyPosition(window.scrollX, window.scrollY);\n\t\tthis.measureDocumentHeight();\n\n\t\tthis.stopScrollFrames = subscribeStageScrollFrame(\n\t\t\tthis.handleScrollFrame,\n\t\t\tSTAGE_SCROLL_PRIORITY.virtualDocument\n\t\t);\n\t\twindow.addEventListener('resize', this.handleResize, { passive: true });\n\t\t// Panel content is moved into the CSS3D renderer after enhancement. Listen\n\t\t// on the stable stage container so anchors and focus keep working there too.\n\t\tthis.container.addEventListener('click', this.handleAnchorClick);\n\t\tthis.container.addEventListener('focusin', this.handleFocusIn);\n\t\twindow.addEventListener('hashchange', this.handleHashChange);\n\t\twindow.addEventListener('popstate', this.handlePopState);\n\t\twindow.addEventListener('wheel', this.handleUserInput, { passive: true });\n\t\twindow.addEventListener('touchstart', this.handleUserInput, { passive: true });\n\t\twindow.addEventListener('pointerdown', this.handleUserInput, { passive: true });\n\t\twindow.addEventListener('keydown', this.handleScrollInterruptionKey);\n\n\t\tif ('ResizeObserver' in window) {\n\t\t\tthis.resizeObserver = new ResizeObserver(this.scheduleMeasurement);\n\t\t\tthis.resizeObserver.observe(this.content);\n\t\t}\n\n\t\tvoid document.fonts?.ready.then(() => this.scheduleMeasurement());\n\t\tif (window.location.hash) this.scheduleHashNavigation();\n\t}\n\n\tdestroy() {\n\t\tif (!this.started) return;\n\t\tthis.started = false;\n\t\tthis.stopScrollFrames?.();\n\t\tthis.stopScrollFrames = undefined;\n\t\twindow.removeEventListener('resize', this.handleResize);\n\t\tthis.container.removeEventListener('click', this.handleAnchorClick);\n\t\tthis.container.removeEventListener('focusin', this.handleFocusIn);\n\t\twindow.removeEventListener('hashchange', this.handleHashChange);\n\t\twindow.removeEventListener('popstate', this.handlePopState);\n\t\twindow.removeEventListener('wheel', this.handleUserInput);\n\t\twindow.removeEventListener('touchstart', this.handleUserInput);\n\t\twindow.removeEventListener('pointerdown', this.handleUserInput);\n\t\twindow.removeEventListener('keydown', this.handleScrollInterruptionKey);\n\t\tthis.resizeObserver?.disconnect();\n\t\tthis.resizeObserver = undefined;\n\t\tif (this.measureFrame) cancelAnimationFrame(this.measureFrame);\n\t\tif (this.hashFrame) cancelAnimationFrame(this.hashFrame);\n\t\tthis.historyHashUrl = undefined;\n\t\tthis.navigation = undefined;\n\t\tthis.cancelAnchorScroll();\n\t\tthis.measureFrame = 0;\n\t\tthis.hashFrame = 0;\n\t\tthis.content.style.removeProperty('transform');\n\t\tthis.spacer.style.removeProperty('height');\n\t\tthis.container.classList.remove(ACTIVE_CLASS);\n\t}\n\n\tprivate readonly handleScrollFrame = (frame: StageScrollFrame) => {\n\t\tthis.applyPosition(frame.scrollX, frame.scrollY);\n\t};\n\n\tprivate readonly handleResize = () => {\n\t\tthis.scheduleMeasurement();\n\t};\n\n\tprivate readonly handleHashChange = (event: HashChangeEvent) => {\n\t\tconst restoredByHistory = event.newURL === this.historyHashUrl;\n\t\tthis.historyHashUrl = undefined;\n\t\tif (!restoredByHistory) this.scheduleHashNavigation();\n\t};\n\tprivate readonly handlePopState = () => {\n\t\tif (!this.writeHash) return;\n\t\t// History restoration wins over a fragment, including SvelteKit shallow entries.\n\t\tif (this.hashFrame) cancelAnimationFrame(this.hashFrame);\n\t\tthis.hashFrame = 0;\n\t\tthis.historyHashUrl = window.location.href;\n\t};\n\tprivate readonly handleUserInput = () => {\n\t\tthis.cancelAnchorScroll();\n\t\tif (this.navigation) this.navigation.interrupted = true;\n\t};\n\tprivate readonly handleScrollInterruptionKey = (event: KeyboardEvent) => {\n\t\tif (SCROLL_INTERRUPTION_KEYS.has(event.key)) this.handleUserInput();\n\t};\n\n\tprivate readonly cancelAnchorScroll = () => {\n\t\tif (this.anchorScrollFrame) cancelAnimationFrame(this.anchorScrollFrame);\n\t\tthis.anchorScrollFrame = 0;\n\t\tthis.completeAnchorNavigation();\n\t};\n\n\tprivate completeAnchorNavigation() {\n\t\tconst targetId = this.anchorNavigationTargetId;\n\t\tif (!targetId) return;\n\t\tthis.anchorNavigationTargetId = undefined;\n\t\twindow.dispatchEvent(\n\t\t\tnew CustomEvent(STAGE_ANCHOR_NAVIGATION_END_EVENT, { detail: { targetId } })\n\t\t);\n\t}\n\n\tprivate readonly scheduleMeasurement = () => {\n\t\tif (!this.started || this.measureFrame) return;\n\t\tthis.measureFrame = requestAnimationFrame(() => {\n\t\t\tthis.measureFrame = 0;\n\t\t\tthis.measureDocumentHeight();\n\t\t});\n\t};\n\n\tprivate readonly handleAnchorClick = (event: MouseEvent) => {\n\t\tif (\n\t\t\tthis.navigation ||\n\t\t\tevent.defaultPrevented ||\n\t\t\tevent.button !== 0 ||\n\t\t\tevent.metaKey ||\n\t\t\tevent.ctrlKey ||\n\t\t\tevent.shiftKey ||\n\t\t\tevent.altKey\n\t\t)\n\t\t\treturn;\n\t\tconst target =\n\t\t\tevent.target instanceof Element ? event.target.closest<HTMLAnchorElement>('a[href]') : null;\n\t\tif (!target) return;\n\n\t\tconst url = new URL(target.href, window.location.href);\n\t\tif (\n\t\t\t!url.hash ||\n\t\t\turl.origin !== window.location.origin ||\n\t\t\turl.pathname !== window.location.pathname ||\n\t\t\turl.search !== window.location.search\n\t\t)\n\t\t\treturn;\n\n\t\tconst element = this.getHashTarget(url.hash);\n\t\tif (!element) return;\n\n\t\tevent.preventDefault();\n\t\tconst animated =\n\t\t\ttarget.hasAttribute('data-spatial-element-tab-id') ||\n\t\t\ttarget.hasAttribute('data-spatial-element-section-navigation');\n\t\tconst navigationHash =\n\t\t\tanimated && element.hasAttribute('data-stage-scroll-top') ? '' : url.hash;\n\t\tif (window.location.hash !== navigationHash) {\n\t\t\tif (this.writeHash) {\n\t\t\t\turl.hash = navigationHash;\n\t\t\t\tthis.writeHash(url, animated);\n\t\t\t} else if (animated) {\n\t\t\t\turl.hash = navigationHash;\n\t\t\t\thistory.replaceState(history.state, '', url);\n\t\t\t} else {\n\t\t\t\twindow.location.hash = navigationHash;\n\t\t\t}\n\t\t}\n\t\tthis.scrollElementIntoView(element, false, animated);\n\t};\n\n\tprivate scheduleHashNavigation() {\n\t\tif (!this.started || this.hashFrame || this.navigation) return;\n\t\tthis.hashFrame = requestAnimationFrame(() => {\n\t\t\tthis.hashFrame = 0;\n\t\t\tconst element = this.getHashTarget(window.location.hash);\n\t\t\tif (element) {\n\t\t\t\tthis.scrollElementIntoView(element, false, element.hasAttribute('data-spatial-element-tab-target'));\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate getHashTarget(hash: string) {\n\t\tif (!hash || hash === '#') return null;\n\t\ttry {\n\t\t\treturn this.container.querySelector<HTMLElement>(\n\t\t\t\t`#${CSS.escape(decodeURIComponent(hash.slice(1)))}`\n\t\t\t);\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate readonly handleFocusIn = (event: FocusEvent) => {\n\t\tif (this.navigation || !(event.target instanceof HTMLElement)) return;\n\t\tconst rect = event.target.getBoundingClientRect();\n\t\tif (\n\t\t\trect.top >= FOCUS_VIEWPORT_MARGIN &&\n\t\t\trect.bottom <= window.innerHeight - FOCUS_VIEWPORT_MARGIN\n\t\t)\n\t\t\treturn;\n\n\t\tthis.scrollElementIntoView(event.target, true);\n\t};\n\n\tprivate getElementScrollTop(element: HTMLElement, center = false) {\n\t\tconst rect = element.getBoundingClientRect();\n\t\tconst style = window.getComputedStyle(element);\n\t\tconst scrollMarginTop = Number.parseFloat(style.scrollMarginTop) || 0;\n\t\tconst documentTop = rect.top + this.scrollY;\n\t\treturn Math.max(\n\t\t\telement.hasAttribute('data-stage-scroll-top')\n\t\t\t\t? 0\n\t\t\t\t: center\n\t\t\t\t\t? documentTop - (window.innerHeight - rect.height) * 0.5\n\t\t\t\t\t: documentTop - scrollMarginTop,\n\t\t\t0\n\t\t);\n\t}\n\n\tprivate scrollElementIntoView(element: HTMLElement, center = false, animated = false) {\n\t\tconst targetY = this.getElementScrollTop(element, center);\n\n\t\tthis.cancelAnchorScroll();\n\t\tif (animated) {\n\t\t\tthis.anchorNavigationTargetId = element.id;\n\t\t\twindow.dispatchEvent(\n\t\t\t\tnew CustomEvent(STAGE_ANCHOR_NAVIGATION_EVENT, {\n\t\t\t\t\tdetail: { targetId: element.id }\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t\tif (!animated || window.matchMedia('(prefers-reduced-motion: reduce)').matches) {\n\t\t\tmarkStageScrollInput(animated ? 'navigation' : 'programmatic');\n\t\t\twindow.scrollTo({ top: targetY, behavior: 'instant' });\n\t\t\tthis.completeAnchorNavigation();\n\t\t\treturn;\n\t\t}\n\n\t\tconst startY = this.scrollY;\n\t\tconst distance = targetY - startY;\n\t\tif (Math.abs(distance) < 0.5) {\n\t\t\tmarkStageScrollInput('navigation');\n\t\t\twindow.scrollTo({ top: targetY, behavior: 'instant' });\n\t\t\tthis.completeAnchorNavigation();\n\t\t\treturn;\n\t\t}\n\n\t\tlet startTime: number | undefined;\n\t\tconst animate = (time: number) => {\n\t\t\tif (!this.started) return;\n\t\t\tstartTime ??= time;\n\t\t\tconst progress = Math.min((time - startTime) / STAGE_ANCHOR_SCROLL_DURATION_MS, 1);\n\t\t\tconst scrollTop = startY + distance * easeStageAnchorScroll(progress);\n\t\t\tmarkStageScrollInput('navigation');\n\t\t\twindow.scrollTo({ top: progress === 1 ? targetY : scrollTop, behavior: 'instant' });\n\n\t\t\tif (progress < 1) {\n\t\t\t\tthis.anchorScrollFrame = requestAnimationFrame(animate);\n\t\t\t} else {\n\t\t\t\tthis.anchorScrollFrame = 0;\n\t\t\t\tthis.completeAnchorNavigation();\n\t\t\t}\n\t\t};\n\n\t\tthis.anchorScrollFrame = requestAnimationFrame(animate);\n\t}\n\n\tprivate applyPosition(scrollX: number, scrollY: number) {\n\t\tthis.scrollY = scrollY;\n\t\tthis.content.style.transform = `translate3d(${-scrollX}px, ${-scrollY}px, 0)`;\n\t}\n\n\tprivate measureDocumentHeight() {\n\t\tconst rect = this.content.getBoundingClientRect();\n\t\tconst height = Math.max(this.content.scrollHeight, rect.height, window.innerHeight);\n\t\tthis.spacer.style.height = `${Math.ceil(height)}px`;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"VirtualScrollController.js","sourceRoot":"","sources":["../../src/stage/VirtualScrollController.ts"],"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,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;YAEpF,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;gBAClB,IAAI,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;YACzD,CAAC;iBAAM,CAAC;gBACP,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;gBAC3B,IAAI,CAAC,wBAAwB,EAAE,CAAC;YACjC,CAAC;QACF,CAAC,CAAC;QAEF,IAAI,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;IAEO,aAAa,CAAC,OAAe,EAAE,OAAe;QACrD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,eAAe,CAAC,OAAO,OAAO,CAAC,OAAO,QAAQ,CAAC;IAC/E,CAAC;IAEO,qBAAqB;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC;QAClD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QACpF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IACrD,CAAC;CACD","sourcesContent":["import {\n\tSTAGE_SCROLL_PRIORITY,\n\tgetStageVisualScrollPosition,\n\tmarkStageScrollInput,\n\tsubscribeStageScrollFrame,\n\tsyncStageScrollToNative,\n\ttype StageScrollFrame\n} from './scrollFrame.js';\nimport {\n\tSTAGE_ANCHOR_NAVIGATION_END_EVENT,\n\tSTAGE_ANCHOR_NAVIGATION_EVENT,\n\tSTAGE_ANCHOR_SCROLL_DURATION_MS,\n\teaseStageAnchorScroll\n} from './scrollAnimation.js';\n\nconst ACTIVE_CLASS = 'stage-virtual-scroll-active';\nconst FOCUS_VIEWPORT_MARGIN = 24;\nconst SCROLL_INTERRUPTION_KEYS = new Set([\n\t'ArrowDown',\n\t'ArrowUp',\n\t'End',\n\t'Home',\n\t'PageDown',\n\t'PageUp',\n\t' '\n]);\n\nexport type ScrollRestoreTarget = { x: number; y: number } | { hash: string };\n\nexport interface ScrollPositions {\n\tnative: { x: number; y: number };\n\tvisual: { x: number; y: number };\n}\n\n/**\n * Keeps native scrolling as the input and scrollbar source while moving the\n * complete visible DOM from the same animation frame consumed by the stage.\n */\nexport class VirtualScrollController {\n\tprivate stopScrollFrames?: () => void;\n\tprivate resizeObserver?: ResizeObserver;\n\tprivate measureFrame = 0;\n\tprivate hashFrame = 0;\n\tprivate anchorScrollFrame = 0;\n\tprivate anchorNavigationTargetId?: string;\n\tprivate scrollY = 0;\n\tprivate started = false;\n\tprivate navigation?: { token: object; interrupted: boolean };\n\tprivate historyHashUrl?: string;\n\t/** The navigation bridge supplies SvelteKit's public history writers. */\n\twriteHash?: (url: URL, replace: boolean) => void;\n\n\tconstructor(\n\t\tprivate readonly container: HTMLElement,\n\t\tprivate readonly content: HTMLElement,\n\t\tprivate readonly spacer: HTMLElement\n\t) {}\n\n\tget active() {\n\t\treturn this.started;\n\t}\n\n\treadPositions(): ScrollPositions {\n\t\tconst visual = getStageVisualScrollPosition();\n\t\treturn {\n\t\t\tnative: { x: window.scrollX, y: window.scrollY },\n\t\t\tvisual: { x: visual.scrollX, y: visual.scrollY }\n\t\t};\n\t}\n\n\tbeginNavigation(token: object) {\n\t\tthis.cancelAnchorScroll();\n\t\tif (this.hashFrame) cancelAnimationFrame(this.hashFrame);\n\t\tthis.hashFrame = 0;\n\t\tthis.navigation = { token, interrupted: false };\n\t}\n\n\tmeasureExtentNow() {\n\t\tif (!this.started) return;\n\t\tif (this.measureFrame) cancelAnimationFrame(this.measureFrame);\n\t\tthis.measureFrame = 0;\n\t\tthis.measureDocumentHeight();\n\t\treturn Number.parseFloat(this.spacer.style.height);\n\t}\n\n\trestoreTarget(target: ScrollRestoreTarget, token: object) {\n\t\tif (!this.started || this.navigation?.token !== token || this.navigation.interrupted) return;\n\t\tlet position: { x: number; y: number };\n\t\tif ('hash' in target) {\n\t\t\tconst element = this.getHashTarget(target.hash);\n\t\t\tposition = { x: 0, y: element ? this.getElementScrollTop(element) : 0 };\n\t\t} else {\n\t\t\tposition = target;\n\t\t}\n\t\twindow.scrollTo({ left: position.x, top: position.y, behavior: 'instant' });\n\t\tsyncStageScrollToNative();\n\t\treturn this.readPositions();\n\t}\n\n\tendNavigation(token: object) {\n\t\tif (this.navigation?.token === token) this.navigation = undefined;\n\t}\n\n\tstart() {\n\t\tif (this.started) return;\n\t\tthis.started = true;\n\n\t\t// Preserve the in-flow height before the content becomes viewport-fixed.\n\t\tthis.measureDocumentHeight();\n\t\tthis.container.classList.add(ACTIVE_CLASS);\n\t\tthis.applyPosition(window.scrollX, window.scrollY);\n\t\tthis.measureDocumentHeight();\n\n\t\tthis.stopScrollFrames = subscribeStageScrollFrame(\n\t\t\tthis.handleScrollFrame,\n\t\t\tSTAGE_SCROLL_PRIORITY.virtualDocument\n\t\t);\n\t\twindow.addEventListener('resize', this.handleResize, { passive: true });\n\t\t// Panel content is moved into the CSS3D renderer after enhancement. Listen\n\t\t// on the stable stage container so anchors and focus keep working there too.\n\t\tthis.container.addEventListener('click', this.handleAnchorClick);\n\t\tthis.container.addEventListener('focusin', this.handleFocusIn);\n\t\twindow.addEventListener('hashchange', this.handleHashChange);\n\t\twindow.addEventListener('popstate', this.handlePopState);\n\t\twindow.addEventListener('wheel', this.handleUserInput, { passive: true });\n\t\twindow.addEventListener('touchstart', this.handleUserInput, { passive: true });\n\t\twindow.addEventListener('pointerdown', this.handleUserInput, { passive: true });\n\t\twindow.addEventListener('keydown', this.handleScrollInterruptionKey);\n\n\t\tif ('ResizeObserver' in window) {\n\t\t\tthis.resizeObserver = new ResizeObserver(this.scheduleMeasurement);\n\t\t\tthis.resizeObserver.observe(this.content);\n\t\t}\n\n\t\tvoid document.fonts?.ready.then(() => this.scheduleMeasurement());\n\t\tif (window.location.hash) this.scheduleHashNavigation();\n\t}\n\n\tdestroy() {\n\t\tif (!this.started) return;\n\t\tthis.started = false;\n\t\tthis.stopScrollFrames?.();\n\t\tthis.stopScrollFrames = undefined;\n\t\twindow.removeEventListener('resize', this.handleResize);\n\t\tthis.container.removeEventListener('click', this.handleAnchorClick);\n\t\tthis.container.removeEventListener('focusin', this.handleFocusIn);\n\t\twindow.removeEventListener('hashchange', this.handleHashChange);\n\t\twindow.removeEventListener('popstate', this.handlePopState);\n\t\twindow.removeEventListener('wheel', this.handleUserInput);\n\t\twindow.removeEventListener('touchstart', this.handleUserInput);\n\t\twindow.removeEventListener('pointerdown', this.handleUserInput);\n\t\twindow.removeEventListener('keydown', this.handleScrollInterruptionKey);\n\t\tthis.resizeObserver?.disconnect();\n\t\tthis.resizeObserver = undefined;\n\t\tif (this.measureFrame) cancelAnimationFrame(this.measureFrame);\n\t\tif (this.hashFrame) cancelAnimationFrame(this.hashFrame);\n\t\tthis.historyHashUrl = undefined;\n\t\tthis.navigation = undefined;\n\t\tthis.cancelAnchorScroll();\n\t\tthis.measureFrame = 0;\n\t\tthis.hashFrame = 0;\n\t\tthis.content.style.removeProperty('transform');\n\t\tthis.spacer.style.removeProperty('height');\n\t\tthis.container.classList.remove(ACTIVE_CLASS);\n\t}\n\n\tprivate readonly handleScrollFrame = (frame: StageScrollFrame) => {\n\t\tthis.applyPosition(frame.scrollX, frame.scrollY);\n\t};\n\n\tprivate readonly handleResize = () => {\n\t\tthis.scheduleMeasurement();\n\t};\n\n\tprivate readonly handleHashChange = (event: HashChangeEvent) => {\n\t\tconst restoredByHistory = event.newURL === this.historyHashUrl;\n\t\tthis.historyHashUrl = undefined;\n\t\tif (!restoredByHistory) this.scheduleHashNavigation();\n\t};\n\tprivate readonly handlePopState = () => {\n\t\tif (!this.writeHash) return;\n\t\t// History restoration wins over a fragment, including SvelteKit shallow entries.\n\t\tif (this.hashFrame) cancelAnimationFrame(this.hashFrame);\n\t\tthis.hashFrame = 0;\n\t\tthis.historyHashUrl = window.location.href;\n\t};\n\tprivate readonly handleUserInput = () => {\n\t\tthis.cancelAnchorScroll();\n\t\tif (this.navigation) this.navigation.interrupted = true;\n\t};\n\tprivate readonly handleScrollInterruptionKey = (event: KeyboardEvent) => {\n\t\tif (SCROLL_INTERRUPTION_KEYS.has(event.key)) this.handleUserInput();\n\t};\n\n\tprivate readonly cancelAnchorScroll = () => {\n\t\tif (this.anchorScrollFrame) cancelAnimationFrame(this.anchorScrollFrame);\n\t\tthis.anchorScrollFrame = 0;\n\t\tthis.completeAnchorNavigation();\n\t};\n\n\tprivate completeAnchorNavigation() {\n\t\tconst targetId = this.anchorNavigationTargetId;\n\t\tif (!targetId) return;\n\t\tthis.anchorNavigationTargetId = undefined;\n\t\twindow.dispatchEvent(\n\t\t\tnew CustomEvent(STAGE_ANCHOR_NAVIGATION_END_EVENT, { detail: { targetId } })\n\t\t);\n\t}\n\n\tprivate readonly scheduleMeasurement = () => {\n\t\tif (!this.started || this.measureFrame) return;\n\t\tthis.measureFrame = requestAnimationFrame(() => {\n\t\t\tthis.measureFrame = 0;\n\t\t\tthis.measureDocumentHeight();\n\t\t});\n\t};\n\n\tprivate readonly handleAnchorClick = (event: MouseEvent) => {\n\t\tif (\n\t\t\tthis.navigation ||\n\t\t\tevent.defaultPrevented ||\n\t\t\tevent.button !== 0 ||\n\t\t\tevent.metaKey ||\n\t\t\tevent.ctrlKey ||\n\t\t\tevent.shiftKey ||\n\t\t\tevent.altKey\n\t\t)\n\t\t\treturn;\n\t\tconst target =\n\t\t\tevent.target instanceof Element ? event.target.closest<HTMLAnchorElement>('a[href]') : null;\n\t\tif (!target) return;\n\n\t\tconst url = new URL(target.href, window.location.href);\n\t\tif (\n\t\t\t!url.hash ||\n\t\t\turl.origin !== window.location.origin ||\n\t\t\turl.pathname !== window.location.pathname ||\n\t\t\turl.search !== window.location.search\n\t\t)\n\t\t\treturn;\n\n\t\tconst element = this.getHashTarget(url.hash);\n\t\tif (!element) return;\n\n\t\tevent.preventDefault();\n\t\tconst animated =\n\t\t\ttarget.hasAttribute('data-spatial-element-tab-id') ||\n\t\t\ttarget.hasAttribute('data-spatial-element-section-navigation');\n\t\tconst navigationHash =\n\t\t\tanimated && element.hasAttribute('data-stage-scroll-top') ? '' : url.hash;\n\t\tif (window.location.hash !== navigationHash) {\n\t\t\tif (this.writeHash) {\n\t\t\t\turl.hash = navigationHash;\n\t\t\t\tthis.writeHash(url, animated);\n\t\t\t} else if (animated) {\n\t\t\t\turl.hash = navigationHash;\n\t\t\t\thistory.replaceState(history.state, '', url);\n\t\t\t} else {\n\t\t\t\twindow.location.hash = navigationHash;\n\t\t\t}\n\t\t}\n\t\tthis.scrollElementIntoView(element, false, animated);\n\t};\n\n\tprivate scheduleHashNavigation() {\n\t\tif (!this.started || this.hashFrame || this.navigation) return;\n\t\tthis.hashFrame = requestAnimationFrame(() => {\n\t\t\tthis.hashFrame = 0;\n\t\t\tconst element = this.getHashTarget(window.location.hash);\n\t\t\tif (element) {\n\t\t\t\tthis.scrollElementIntoView(element, false, element.hasAttribute('data-spatial-element-tab-target'));\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate getHashTarget(hash: string) {\n\t\tif (!hash || hash === '#') return null;\n\t\ttry {\n\t\t\treturn this.container.querySelector<HTMLElement>(\n\t\t\t\t`#${CSS.escape(decodeURIComponent(hash.slice(1)))}`\n\t\t\t);\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate readonly handleFocusIn = (event: FocusEvent) => {\n\t\tif (this.container.hasAttribute('data-stage-fullscreen')) return;\n\t\tif (this.navigation || !(event.target instanceof HTMLElement)) return;\n\t\t// Corner controls are already clamped into the viewport. Their 10px inset\n\t\t// must not trigger document scrolling when focused before a fullscreen click.\n\t\tif (event.target.closest('[data-stage-corner-control]')) return;\n\t\tconst rect = event.target.getBoundingClientRect();\n\t\tif (\n\t\t\trect.top >= FOCUS_VIEWPORT_MARGIN &&\n\t\t\trect.bottom <= window.innerHeight - FOCUS_VIEWPORT_MARGIN\n\t\t)\n\t\t\treturn;\n\n\t\tthis.scrollElementIntoView(event.target, true);\n\t};\n\n\tprivate getElementScrollTop(element: HTMLElement, center = false) {\n\t\tconst rect = element.getBoundingClientRect();\n\t\tconst style = window.getComputedStyle(element);\n\t\tconst scrollMarginTop = Number.parseFloat(style.scrollMarginTop) || 0;\n\t\tconst documentTop = rect.top + this.scrollY;\n\t\treturn Math.max(\n\t\t\telement.hasAttribute('data-stage-scroll-top')\n\t\t\t\t? 0\n\t\t\t\t: center\n\t\t\t\t\t? documentTop - (window.innerHeight - rect.height) * 0.5\n\t\t\t\t\t: documentTop - scrollMarginTop,\n\t\t\t0\n\t\t);\n\t}\n\n\tprivate scrollElementIntoView(element: HTMLElement, center = false, animated = false) {\n\t\tconst targetY = this.getElementScrollTop(element, center);\n\n\t\tthis.cancelAnchorScroll();\n\t\tif (animated) {\n\t\t\tthis.anchorNavigationTargetId = element.id;\n\t\t\twindow.dispatchEvent(\n\t\t\t\tnew CustomEvent(STAGE_ANCHOR_NAVIGATION_EVENT, {\n\t\t\t\t\tdetail: { targetId: element.id }\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t\tif (!animated || window.matchMedia('(prefers-reduced-motion: reduce)').matches) {\n\t\t\tmarkStageScrollInput(animated ? 'navigation' : 'programmatic');\n\t\t\twindow.scrollTo({ top: targetY, behavior: 'instant' });\n\t\t\tthis.completeAnchorNavigation();\n\t\t\treturn;\n\t\t}\n\n\t\tconst startY = this.scrollY;\n\t\tconst distance = targetY - startY;\n\t\tif (Math.abs(distance) < 0.5) {\n\t\t\tmarkStageScrollInput('navigation');\n\t\t\twindow.scrollTo({ top: targetY, behavior: 'instant' });\n\t\t\tthis.completeAnchorNavigation();\n\t\t\treturn;\n\t\t}\n\n\t\tlet startTime: number | undefined;\n\t\tconst animate = (time: number) => {\n\t\t\tif (!this.started) return;\n\t\t\tstartTime ??= time;\n\t\t\tconst progress = Math.min((time - startTime) / STAGE_ANCHOR_SCROLL_DURATION_MS, 1);\n\t\t\tconst scrollTop = startY + distance * easeStageAnchorScroll(progress);\n\t\t\tmarkStageScrollInput('navigation');\n\t\t\twindow.scrollTo({ top: progress === 1 ? targetY : scrollTop, behavior: 'instant' });\n\n\t\t\tif (progress < 1) {\n\t\t\t\tthis.anchorScrollFrame = requestAnimationFrame(animate);\n\t\t\t} else {\n\t\t\t\tthis.anchorScrollFrame = 0;\n\t\t\t\tthis.completeAnchorNavigation();\n\t\t\t}\n\t\t};\n\n\t\tthis.anchorScrollFrame = requestAnimationFrame(animate);\n\t}\n\n\tprivate applyPosition(scrollX: number, scrollY: number) {\n\t\tthis.scrollY = scrollY;\n\t\tthis.content.style.transform = `translate3d(${-scrollX}px, ${-scrollY}px, 0)`;\n\t}\n\n\tprivate measureDocumentHeight() {\n\t\tconst rect = this.content.getBoundingClientRect();\n\t\tconst height = Math.max(this.content.scrollHeight, rect.height, window.innerHeight);\n\t\tthis.spacer.style.height = `${Math.ceil(height)}px`;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const MODEL_INPUT_EVENT = "stage:model-input";
|
|
2
|
+
export interface ModelInputState {
|
|
3
|
+
hovered: boolean;
|
|
4
|
+
active: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface InteractionGuidanceState {
|
|
7
|
+
interacted: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** One learning state per browser tab, shared across products and stage remounts. */
|
|
10
|
+
export declare class InteractionGuidance {
|
|
11
|
+
private readonly storage?;
|
|
12
|
+
private state;
|
|
13
|
+
private readonly listeners;
|
|
14
|
+
constructor(storage?: Pick<Storage, "getItem" | "setItem"> | undefined);
|
|
15
|
+
get snapshot(): Readonly<InteractionGuidanceState>;
|
|
16
|
+
interact(): void;
|
|
17
|
+
subscribe(listener: (state: Readonly<InteractionGuidanceState>) => void): () => void;
|
|
18
|
+
private update;
|
|
19
|
+
}
|
|
20
|
+
/** Lazy browser access keeps server rendering isolated between requests. */
|
|
21
|
+
export declare function getInteractionGuidance(target?: (Window & typeof globalThis) | undefined): InteractionGuidance;
|
|
22
|
+
//# sourceMappingURL=interactionGuidance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactionGuidance.d.ts","sourceRoot":"","sources":["../../src/stage/interactionGuidance.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AACrD,MAAM,WAAW,eAAe;IAAG,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE;AACtE,MAAM,WAAW,wBAAwB;IAAG,UAAU,EAAE,OAAO,CAAA;CAAE;AAGjE,qFAAqF;AACrF,qBAAa,mBAAmB;IAGnB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IAFrC,OAAO,CAAC,KAAK,CAAmD;IAChE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkE;gBAC/D,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,CAAC,YAAA;IAM3E,IAAI,QAAQ,IAAI,QAAQ,CAAC,wBAAwB,CAAC,CAAuB;IACzE,QAAQ;IAGR,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,wBAAwB,CAAC,KAAK,IAAI;IAKvE,OAAO,CAAC,MAAM;CAKd;AAGD,4EAA4E;AAC5E,wBAAgB,sBAAsB,CAAC,MAAM,2CAAqD,uBAUjG"}
|