@nova-lab/core 1.0.0-dev.19 → 1.1.0-dev.229
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 +1035 -10
- package/THIRD_PARTY_NOTICES.md +26 -0
- package/dist/2d/accessibility.d.ts +2 -0
- package/dist/2d/accessibility.js +171 -0
- package/dist/2d/commands.d.ts +2 -0
- package/dist/2d/commands.js +80 -0
- package/dist/2d/effects.d.ts +10 -0
- package/dist/2d/effects.js +566 -0
- package/dist/2d/ktx2.d.ts +5 -0
- package/dist/2d/ktx2.js +542 -0
- package/dist/2d/lighting.d.ts +3 -0
- package/dist/2d/lighting.js +495 -0
- package/dist/2d/lottie.d.ts +3 -0
- package/dist/2d/lottie.js +254 -0
- package/dist/2d/meshes.d.ts +4 -0
- package/dist/2d/meshes.js +451 -0
- package/dist/2d/primitives.d.ts +3 -0
- package/dist/2d/primitives.js +85 -0
- package/dist/2d/render-textures.d.ts +3 -0
- package/dist/2d/render-textures.js +539 -0
- package/dist/2d/svg/documents.d.ts +5 -0
- package/dist/2d/svg/documents.js +7 -0
- package/dist/2d/svg/renderer.d.ts +3 -0
- package/dist/2d/svg/renderer.js +222 -0
- package/dist/2d/svg.d.ts +3 -0
- package/dist/2d/svg.js +4 -0
- package/dist/2d/tools.d.ts +2 -0
- package/dist/2d/tools.js +100 -0
- package/dist/2d/video.d.ts +5 -0
- package/dist/2d/video.js +90 -0
- package/dist/2d.d.ts +2 -0
- package/dist/2d.js +220 -0
- package/dist/3d/animation.d.ts +8 -0
- package/dist/3d/animation.js +1396 -0
- package/dist/3d/area-lights.d.ts +2 -0
- package/dist/3d/area-lights.js +19 -0
- package/dist/3d/audio.d.ts +4 -0
- package/dist/3d/audio.js +500 -0
- package/dist/3d/character.d.ts +2 -0
- package/dist/3d/character.js +136 -0
- package/dist/3d/collision.d.ts +3 -0
- package/dist/3d/collision.js +387 -0
- package/dist/3d/commands.d.ts +2 -0
- package/dist/3d/commands.js +108 -0
- package/dist/3d/controls.d.ts +8 -0
- package/dist/3d/controls.js +1041 -0
- package/dist/3d/documents.d.ts +5 -0
- package/dist/3d/documents.js +227 -0
- package/dist/3d/effects.d.ts +5 -0
- package/dist/3d/effects.js +1986 -0
- package/dist/3d/export.d.ts +4 -0
- package/dist/3d/export.js +347 -0
- package/dist/3d/fbx.d.ts +2 -0
- package/dist/3d/fbx.js +784 -0
- package/dist/3d/gltf.d.ts +2 -0
- package/dist/3d/gltf.js +5 -0
- package/dist/3d/helpers.d.ts +5 -0
- package/dist/3d/helpers.js +191 -0
- package/dist/3d/ik.d.ts +9 -0
- package/dist/3d/ik.js +777 -0
- package/dist/3d/loaders.d.ts +17 -0
- package/dist/3d/loaders.js +1406 -0
- package/dist/3d/nodes.d.ts +8 -0
- package/dist/3d/nodes.js +49 -0
- package/dist/3d/particles.d.ts +5 -0
- package/dist/3d/particles.js +1574 -0
- package/dist/3d/physics/backend.d.ts +7 -0
- package/dist/3d/physics/backend.js +1 -0
- package/dist/3d/physics/rapier.d.ts +3 -0
- package/dist/3d/physics/rapier.js +765 -0
- package/dist/3d/physics.d.ts +5 -0
- package/dist/3d/physics.js +3346 -0
- package/dist/3d/splats.d.ts +7 -0
- package/dist/3d/splats.js +862 -0
- package/dist/3d/text.d.ts +5 -0
- package/dist/3d/text.js +1043 -0
- package/dist/3d/tiles.d.ts +24 -0
- package/dist/3d/tiles.js +1705 -0
- package/dist/3d/tools.d.ts +12 -0
- package/dist/3d/tools.js +338 -0
- package/dist/3d/usdz.d.ts +2 -0
- package/dist/3d/usdz.js +634 -0
- package/dist/3d/xr.d.ts +2 -0
- package/dist/3d/xr.js +202 -0
- package/dist/3d-B4jWF8Qb.js +5591 -0
- package/dist/3d.d.ts +40 -0
- package/dist/3d.js +44 -0
- package/dist/Capsule-BFVpZfvc.js +44 -0
- package/dist/Clip-CAN7t03k.js +204 -0
- package/dist/Color-vuv9UnoY.js +34 -0
- package/dist/DeformedMesh-CPi0P_vc.js +280 -0
- package/dist/Document-DCVEZSvM.js +415 -0
- package/dist/Errors-B2ekO9bZ.js +30 -0
- package/dist/Features-BsjmePtc.js +557 -0
- package/dist/GLTFResourceIO-CYJyCUTt.js +124 -0
- package/dist/GPUParticleState-CQlNpoDa.js +545 -0
- package/dist/Geometry-DytO490z.js +227 -0
- package/dist/Inflate-DWw0V-Up.js +42 -0
- package/dist/InstancedMesh-DPrgrw5z.js +527 -0
- package/dist/Limits-Bw5XQdFr.js +20 -0
- package/dist/LineHelper-Ad0z9uDi.js +131 -0
- package/dist/LoaderIO-BwrM84OM.js +114 -0
- package/dist/Material-BpfLPmK9.js +777 -0
- package/dist/Mesh-BaRxAAJq.js +209 -0
- package/dist/Node-QfgAE2_v.js +877 -0
- package/dist/NovaAssetRegistry-p2QlCwvT.js +1168 -0
- package/dist/NovaNode-CBZ-Ol-W.js +2016 -0
- package/dist/NovaRenderCommandWriter-CWQRa42y.js +1949 -0
- package/dist/NovaTextSelectionService-CipuujCT.js +18526 -0
- package/dist/NovaWebGLProgram-BO250QNF.js +97 -0
- package/dist/Options-CajE7LLJ.js +15 -0
- package/dist/PolygonMesh-D4PnnfIo.js +657 -0
- package/dist/Ready-BzyhRtjD.js +21 -0
- package/dist/Scene-CDfNgf9I.js +911 -0
- package/dist/Shader-b6_HDndT.js +48 -0
- package/dist/SplatShader-wJ6GJ3vo.js +130 -0
- package/dist/Texture-dTKMlTpK.js +267 -0
- package/dist/TextureLoader-CfDzdy2m.js +411 -0
- package/dist/Textures-CGL4Kf-8.js +651 -0
- package/dist/ToneMapping-D9IWvN0u.js +46 -0
- package/dist/WebGPURenderer-DjD0IxVC.js +4921 -0
- package/dist/ZipReader-C-MSEsSr.js +84 -0
- package/dist/core.js +218 -24024
- package/dist/domain/types/base.types.d.ts +18 -9
- package/dist/domain/types/component.types.d.ts +5 -5
- package/dist/domain/types/cursor.types.d.ts +1 -1
- package/dist/domain/types/diagnostics.types.d.ts +2 -0
- package/dist/domain/types/export.types.d.ts +2 -2
- package/dist/domain/types/hit-test.types.d.ts +1 -1
- package/dist/domain/types/motion.types.d.ts +2 -2
- package/dist/domain/types/renderer.types.d.ts +88 -4
- package/dist/domain/types/rendering/index.d.ts +29 -4
- package/dist/domain/types/sound.types.d.ts +1 -1
- package/dist/domain/types/theme.types.d.ts +1 -1
- package/dist/domain/utils/bounds.d.ts +1 -1
- package/dist/domain/utils/nova-text.d.ts +9 -0
- package/dist/domain/utils/schemaBounds.d.ts +2 -2
- package/dist/export-svg-document-ChaNXMaG.js +668 -0
- package/dist/features/3d/Errors.d.ts +57 -0
- package/dist/features/3d/Nova3DApp.d.ts +429 -0
- package/dist/features/3d/animation/Animator.d.ts +260 -0
- package/dist/features/3d/animation/Clip.d.ts +74 -0
- package/dist/features/3d/animation/Graph.d.ts +158 -0
- package/dist/features/3d/animation/Mask.d.ts +40 -0
- package/dist/features/3d/audio/Audio.d.ts +114 -0
- package/dist/features/3d/audio/Sound.d.ts +133 -0
- package/dist/features/3d/character/CharacterController.d.ts +61 -0
- package/dist/features/3d/collision/Capsule.d.ts +25 -0
- package/dist/features/3d/collision/Octree.d.ts +94 -0
- package/dist/features/3d/controls/CameraMotionControls.d.ts +154 -0
- package/dist/features/3d/controls/CameraOrientation.d.ts +47 -0
- package/dist/features/3d/controls/OrbitControls.d.ts +73 -0
- package/dist/features/3d/controls/PointerGesture.d.ts +25 -0
- package/dist/features/3d/controls/PointerLock.d.ts +36 -0
- package/dist/features/3d/controls/Snapping.d.ts +32 -0
- package/dist/features/3d/controls/TransformGizmo.d.ts +79 -0
- package/dist/features/3d/deformation/DeformationGPU.d.ts +52 -0
- package/dist/features/3d/deformation/DeformationShader.d.ts +2 -0
- package/dist/features/3d/deformation/DeformedMesh.d.ts +36 -0
- package/dist/features/3d/deformation/GeometryDeformation.d.ts +25 -0
- package/dist/features/3d/documents/Document.d.ts +59 -0
- package/dist/features/3d/documents/DocumentCommands.d.ts +45 -0
- package/dist/features/3d/documents/DocumentSchema.d.ts +18 -0
- package/dist/features/3d/documents/DocumentTransform.d.ts +4 -0
- package/dist/features/3d/documents/DocumentTypes.d.ts +182 -0
- package/dist/features/3d/documents/DocumentValidation.d.ts +18 -0
- package/dist/features/3d/documents/Projection.d.ts +65 -0
- package/dist/features/3d/effects/CubeLUT.d.ts +24 -0
- package/dist/features/3d/effects/Effects.d.ts +32 -0
- package/dist/features/3d/effects/EffectsGPU.d.ts +80 -0
- package/dist/features/3d/effects/EffectsPlan.d.ts +268 -0
- package/dist/features/3d/effects/EffectsShaders.d.ts +35 -0
- package/dist/features/3d/export/GLTFExporter.d.ts +49 -0
- package/dist/features/3d/export/ThreeMFExporter.d.ts +19 -0
- package/dist/features/3d/export/ZipWriter.d.ts +9 -0
- package/dist/features/3d/fbx/FBXLoader.d.ts +26 -0
- package/dist/features/3d/fbx/FBXParser.d.ts +35 -0
- package/dist/features/3d/fbx/FBXScene.d.ts +20 -0
- package/dist/features/3d/gltf/GLTFLoader.d.ts +16 -0
- package/dist/features/3d/gltf/GLTFTypes.d.ts +64 -0
- package/dist/features/3d/gltf/services/GLTFBinary.d.ts +21 -0
- package/dist/features/3d/gltf/services/GLTFGeometry.d.ts +14 -0
- package/dist/features/3d/gltf/services/GLTFResourceIO.d.ts +64 -0
- package/dist/features/3d/helpers/LineHelper.d.ts +51 -0
- package/dist/features/3d/helpers/StaticHelpers.d.ts +47 -0
- package/dist/features/3d/helpers/TrackedHelpers.d.ts +84 -0
- package/dist/features/3d/ik/ChainIK.d.ts +44 -0
- package/dist/features/3d/ik/IKChain.d.ts +92 -0
- package/dist/features/3d/ik/IKMath.d.ts +49 -0
- package/dist/features/3d/ik/IKSolver.d.ts +97 -0
- package/dist/features/3d/ik/LookAtIK.d.ts +58 -0
- package/dist/features/3d/ik/TwoBoneIK.d.ts +57 -0
- package/dist/features/3d/import/ImportAnimation.d.ts +20 -0
- package/dist/features/3d/import/ImportMath.d.ts +42 -0
- package/dist/features/3d/import/ImportedModel.d.ts +135 -0
- package/dist/features/3d/import/Inflate.d.ts +5 -0
- package/dist/features/3d/import/ModelAsset.d.ts +149 -0
- package/dist/features/3d/import/PolygonMesh.d.ts +54 -0
- package/dist/features/3d/lights/AreaLightTables.d.ts +8 -0
- package/dist/features/3d/lights/AreaLights.d.ts +11 -0
- package/dist/features/3d/loaders/EXRCompression.d.ts +13 -0
- package/dist/features/3d/loaders/EXRLoader.d.ts +39 -0
- package/dist/features/3d/loaders/HDRLoader.d.ts +26 -0
- package/dist/features/3d/loaders/Limits.d.ts +70 -0
- package/dist/features/3d/loaders/LoaderBuffers.d.ts +42 -0
- package/dist/features/3d/loaders/LoaderIO.d.ts +81 -0
- package/dist/features/3d/loaders/LoaderModel.d.ts +80 -0
- package/dist/features/3d/loaders/LoaderText.d.ts +27 -0
- package/dist/features/3d/loaders/MTLLoader.d.ts +105 -0
- package/dist/features/3d/loaders/OBJLoader.d.ts +70 -0
- package/dist/features/3d/loaders/PLYLoader.d.ts +47 -0
- package/dist/features/3d/loaders/STLLoader.d.ts +27 -0
- package/dist/features/3d/model/Camera.d.ts +33 -0
- package/dist/features/3d/model/Environment.d.ts +31 -0
- package/dist/features/3d/model/Geometry.d.ts +59 -0
- package/dist/features/3d/model/InstancedMesh.d.ts +134 -0
- package/dist/features/3d/model/LOD.d.ts +31 -0
- package/dist/features/3d/model/Light.d.ts +200 -0
- package/dist/features/3d/model/Material.d.ts +308 -0
- package/dist/features/3d/model/MaterialExtensions.d.ts +200 -0
- package/dist/features/3d/model/Mesh.d.ts +92 -0
- package/dist/features/3d/model/Node.d.ts +87 -0
- package/dist/features/3d/model/ReflectionProbe.d.ts +45 -0
- package/dist/features/3d/model/RenderTarget.d.ts +41 -0
- package/dist/features/3d/model/Scene.d.ts +173 -0
- package/dist/features/3d/model/Texture.d.ts +143 -0
- package/dist/features/3d/nodes/Nodes.d.ts +8 -0
- package/dist/features/3d/nodes/ShaderNode.d.ts +240 -0
- package/dist/features/3d/particles/GPUParticleSchedule.d.ts +67 -0
- package/dist/features/3d/particles/GPUParticleShaders.d.ts +19 -0
- package/dist/features/3d/particles/GPUParticleState.d.ts +106 -0
- package/dist/features/3d/particles/GPUParticleSystem.d.ts +192 -0
- package/dist/features/3d/particles/ParticleCurves.d.ts +34 -0
- package/dist/features/3d/particles/ParticleOptions.d.ts +78 -0
- package/dist/features/3d/particles/ParticleSystem.d.ts +368 -0
- package/dist/features/3d/physics/PhysicsBackend.d.ts +352 -0
- package/dist/features/3d/physics/PhysicsDebug.d.ts +24 -0
- package/dist/features/3d/physics/PhysicsWorld.d.ts +352 -0
- package/dist/features/3d/physics/basic/BasicCollision.d.ts +75 -0
- package/dist/features/3d/physics/basic/BasicPhysics.d.ts +24 -0
- package/dist/features/3d/physics/basic/BasicShapes.d.ts +103 -0
- package/dist/features/3d/physics/rapier/ContactBuffer.d.ts +32 -0
- package/dist/features/3d/physics/rapier/RapierBackend.d.ts +17 -0
- package/dist/features/3d/physics/rapier/RapierShapes.d.ts +4 -0
- package/dist/features/3d/physics/rapier/RapierWorld.d.ts +198 -0
- package/dist/features/3d/physics/rapier/Validation.d.ts +8 -0
- package/dist/features/3d/services/Background.d.ts +22 -0
- package/dist/features/3d/services/BasicShader.d.ts +55 -0
- package/dist/features/3d/services/ClusteredLights.d.ts +69 -0
- package/dist/features/3d/services/DrawOrder.d.ts +37 -0
- package/dist/features/3d/services/EffectsProcessor.d.ts +38 -0
- package/dist/features/3d/services/EnvironmentBRDF.d.ts +35 -0
- package/dist/features/3d/services/EnvironmentMaps.d.ts +55 -0
- package/dist/features/3d/services/FogShader.d.ts +6 -0
- package/dist/features/3d/services/Frustum.d.ts +7 -0
- package/dist/features/3d/services/GLState.d.ts +86 -0
- package/dist/features/3d/services/GPUPicker.d.ts +31 -0
- package/dist/features/3d/services/InstanceShader.d.ts +3 -0
- package/dist/features/3d/services/LineProgram.d.ts +32 -0
- package/dist/features/3d/services/PBRProgram.d.ts +115 -0
- package/dist/features/3d/services/Renderer.d.ts +50 -0
- package/dist/features/3d/services/Shader.d.ts +22 -0
- package/dist/features/3d/services/ShaderProgram.d.ts +38 -0
- package/dist/features/3d/services/ShadowMaps.d.ts +97 -0
- package/dist/features/3d/services/SpatialIndex.d.ts +16 -0
- package/dist/features/3d/services/TextureLoader.d.ts +40 -0
- package/dist/features/3d/services/TextureMipmaps.d.ts +42 -0
- package/dist/features/3d/services/ToneMapping.d.ts +12 -0
- package/dist/features/3d/services/WebGLRenderer.d.ts +261 -0
- package/dist/features/3d/splats/SplatData.d.ts +136 -0
- package/dist/features/3d/splats/SplatLoaders.d.ts +64 -0
- package/dist/features/3d/splats/SplatShader.d.ts +14 -0
- package/dist/features/3d/splats/SplatSort.d.ts +69 -0
- package/dist/features/3d/splats/Splats.d.ts +116 -0
- package/dist/features/3d/text/FontAtlas.d.ts +246 -0
- package/dist/features/3d/text/SDF.d.ts +28 -0
- package/dist/features/3d/text/Text.d.ts +179 -0
- package/dist/features/3d/text/TextLayout.d.ts +73 -0
- package/dist/features/3d/text/TextShader.d.ts +12 -0
- package/dist/features/3d/tiles/BoundingVolume.d.ts +43 -0
- package/dist/features/3d/tiles/Geodesy.d.ts +106 -0
- package/dist/features/3d/tiles/GlobeControls.d.ts +147 -0
- package/dist/features/3d/tiles/TileContent.d.ts +35 -0
- package/dist/features/3d/tiles/TileFormats.d.ts +77 -0
- package/dist/features/3d/tiles/Tiles3D.d.ts +236 -0
- package/dist/features/3d/tiles/Tileset.d.ts +81 -0
- package/dist/features/3d/tools/BatchedMesh.d.ts +74 -0
- package/dist/features/3d/tools/CanvasSurface.d.ts +81 -0
- package/dist/features/3d/tools/Color.d.ts +11 -0
- package/dist/features/3d/tools/MergeGeometries.d.ts +22 -0
- package/dist/features/3d/tools/Options.d.ts +15 -0
- package/dist/features/3d/tools/Polyhedra.d.ts +30 -0
- package/dist/features/3d/tools/PrimitiveBuffers.d.ts +42 -0
- package/dist/features/3d/tools/Primitives.d.ts +164 -0
- package/dist/features/3d/tools/Ready.d.ts +12 -0
- package/dist/features/3d/tools/SpatialMath.d.ts +57 -0
- package/dist/features/3d/tools/SphericalHarmonics.d.ts +9 -0
- package/dist/features/3d/tools/math/mat3.d.ts +7 -0
- package/dist/features/3d/tools/math/mat4.d.ts +19 -0
- package/dist/features/3d/tools/math/quat.d.ts +6 -0
- package/dist/features/3d/tools/math/vec3.d.ts +16 -0
- package/dist/features/3d/tools/math/vec4.d.ts +5 -0
- package/dist/features/3d/types.d.ts +359 -0
- package/dist/features/3d/usdz/USDAParser.d.ts +50 -0
- package/dist/features/3d/usdz/USDScene.d.ts +20 -0
- package/dist/features/3d/usdz/USDZLoader.d.ts +27 -0
- package/dist/features/3d/usdz/ZipReader.d.ts +16 -0
- package/dist/features/3d/webgpu/Backend.d.ts +40 -0
- package/dist/features/3d/webgpu/BasicShader.d.ts +10 -0
- package/dist/features/3d/webgpu/Constants.d.ts +32 -0
- package/dist/features/3d/webgpu/Deformation.d.ts +71 -0
- package/dist/features/3d/webgpu/Environment.d.ts +66 -0
- package/dist/features/3d/webgpu/Features.d.ts +68 -0
- package/dist/features/3d/webgpu/Layouts.d.ts +27 -0
- package/dist/features/3d/webgpu/Lines.d.ts +40 -0
- package/dist/features/3d/webgpu/LitExtras.d.ts +46 -0
- package/dist/features/3d/webgpu/LitFeatures.d.ts +41 -0
- package/dist/features/3d/webgpu/LitScene.d.ts +60 -0
- package/dist/features/3d/webgpu/LitShader.d.ts +68 -0
- package/dist/features/3d/webgpu/Particles.d.ts +114 -0
- package/dist/features/3d/webgpu/Picking.d.ts +59 -0
- package/dist/features/3d/webgpu/PipelineKey.d.ts +33 -0
- package/dist/features/3d/webgpu/Points.d.ts +41 -0
- package/dist/features/3d/webgpu/Probes.d.ts +45 -0
- package/dist/features/3d/webgpu/ShaderChunks.d.ts +18 -0
- package/dist/features/3d/webgpu/ShaderMaterial.d.ts +57 -0
- package/dist/features/3d/webgpu/ShaderMaterialSource.d.ts +5 -0
- package/dist/features/3d/webgpu/Shadows.d.ts +49 -0
- package/dist/features/3d/webgpu/Splats.d.ts +47 -0
- package/dist/features/3d/webgpu/Textures.d.ts +52 -0
- package/dist/features/3d/webgpu/Transmission.d.ts +30 -0
- package/dist/features/3d/webgpu/UniformLayout.d.ts +30 -0
- package/dist/features/3d/webgpu/UtilityShaders.d.ts +38 -0
- package/dist/features/3d/webgpu/WebGPURenderer.d.ts +327 -0
- package/dist/features/3d/webgpu/effects/EffectsShaders.d.ts +74 -0
- package/dist/features/3d/webgpu/effects/WebGPUEffects.d.ts +140 -0
- package/dist/features/3d/xr/XR.d.ts +100 -0
- package/dist/gltf-By-n0qEg.js +960 -0
- package/dist/index.d.ts +86 -81
- package/dist/model/document-actions/document-commands.d.ts +18 -0
- package/dist/model/documents/svg/create-svg-document-renderer.d.ts +32 -0
- package/dist/model/documents/svg/export-svg-document.d.ts +5 -0
- package/dist/model/documents/svg/import-svg-document.d.ts +6 -0
- package/dist/model/documents/svg/svg-document.types.d.ts +111 -0
- package/dist/model/documents/svg/svg-values.d.ts +16 -0
- package/dist/model/documents/svg/svg-xml.d.ts +18 -0
- package/dist/model/input/NovaInputProxy_Adapter.d.ts +2 -1
- package/dist/model/input/NovaInputValidationController.d.ts +1 -1
- package/dist/model/input/NovaTextInputController.d.ts +1 -1
- package/dist/model/input/NovaTextLayoutEngine.d.ts +2 -6
- package/dist/model/input/index.d.ts +7 -7
- package/dist/model/input/nova-input.types.d.ts +1 -1
- package/dist/model/lighting/LightingRenderer2D.d.ts +58 -0
- package/dist/model/lighting/NovaLighting2D.d.ts +56 -0
- package/dist/model/lighting/lighting-shaders.d.ts +3 -0
- package/dist/model/lighting/lighting-state.d.ts +27 -0
- package/dist/model/lighting/lighting.types.d.ts +107 -0
- package/dist/model/lottie/LottieNode.d.ts +4 -0
- package/dist/model/lottie/lottie.types.d.ts +83 -0
- package/dist/model/lottie/prepare-lottie.d.ts +3 -0
- package/dist/model/lottie/sample-position.d.ts +9 -0
- package/dist/model/motion/NovaMotionEngine.d.ts +3 -3
- package/dist/model/motion/nova-motion-easing.d.ts +1 -1
- package/dist/model/motion/nova-motion-interpolation.d.ts +1 -1
- package/dist/model/motion/nova-motion-presets.d.ts +2 -2
- package/dist/model/motion/nova-motion-timeline.d.ts +1 -1
- package/dist/model/platform/NovaCanvas.d.ts +7 -6
- package/dist/model/primitives/NovaPrimitiveUnsupportedError.d.ts +13 -0
- package/dist/model/primitives/definePrimitive.d.ts +5 -0
- package/dist/model/primitives/primitive.types.d.ts +28 -0
- package/dist/model/render/backends/canvas2d/NovaCanvas2DTargetManager.d.ts +3 -3
- package/dist/model/render/backends/canvas2d/NovaRenderer2D.d.ts +61 -15
- package/dist/model/render/backends/canvas2d/nova-canvas-blend.d.ts +5 -0
- package/dist/model/render/backends/nova-render-backend-factory.d.ts +6 -6
- package/dist/model/render/backends/nova-render-backend.d.ts +8 -2
- package/dist/model/render/backends/webgl/NovaRendererWebGL.d.ts +32 -11
- package/dist/model/render/backends/webgl/NovaStreamCacheIdleLedger.d.ts +12 -1
- package/dist/model/render/backends/webgl/NovaWebGLBatcher.d.ts +1 -1
- package/dist/model/render/backends/webgl/NovaWebGLCircleImagePass.d.ts +23 -0
- package/dist/model/render/backends/webgl/NovaWebGLCompositionPass.d.ts +9 -0
- package/dist/model/render/backends/webgl/NovaWebGLDevice.d.ts +3 -1
- package/dist/model/render/backends/webgl/NovaWebGLDiagnostics.d.ts +1 -1
- package/dist/model/render/backends/webgl/NovaWebGLFrameRenderer.d.ts +162 -53
- package/dist/model/render/backends/webgl/NovaWebGLPathClipPass.d.ts +13 -0
- package/dist/model/render/backends/webgl/NovaWebGLPathUnion.d.ts +23 -0
- package/dist/model/render/compiler/NovaRenderBuilder.d.ts +24 -10
- package/dist/model/render/compiler/NovaRenderCommandWriter.d.ts +10 -5
- package/dist/model/render/compiler/NovaRenderCompiler.d.ts +7 -6
- package/dist/model/render/compiler/NovaRenderFrameBuilder.d.ts +4 -3
- package/dist/model/render/effects/blur.d.ts +8 -0
- package/dist/model/render/effects/color-matrix.d.ts +8 -0
- package/dist/model/render/effects/drop-shadow.d.ts +18 -0
- package/dist/model/render/effects/nova-effect-registry.d.ts +66 -0
- package/dist/model/render/effects/nova-gaussian-kernel.d.ts +7 -0
- package/dist/model/render/effects/nova-gaussian-textures.d.ts +11 -0
- package/dist/model/render/effects/shader-effect.d.ts +64 -0
- package/dist/model/render/geometry/nova-alpha-mask.d.ts +5 -0
- package/dist/model/render/geometry/nova-composition.d.ts +9 -0
- package/dist/model/render/geometry/nova-node-clip.d.ts +17 -0
- package/dist/model/render/geometry/nova-path-geometry.d.ts +24 -0
- package/dist/model/render/geometry/nova-path-tessellation.d.ts +7 -0
- package/dist/model/render/geometry/nova-polygon-triangulation.d.ts +1 -1
- package/dist/model/render/graph/NovaRectBatchBuffer.d.ts +58 -0
- package/dist/model/render/graph/NovaRenderGraph.d.ts +40 -6
- package/dist/model/render/graph/NovaRenderHitIndex.d.ts +1 -1
- package/dist/model/render/graph/nova-auto-rect.d.ts +1 -1
- package/dist/model/render/graph/nova-linear-rect-repack.d.ts +4 -4
- package/dist/model/render/graph/nova-linear-rect-transition.d.ts +2 -2
- package/dist/model/render/graph/nova-render-culling.d.ts +2 -2
- package/dist/model/render/graph/nova-render-dirty-items.d.ts +1 -1
- package/dist/model/render/graph/nova-render-group.d.ts +1 -1
- package/dist/model/render/graph/nova-render-item.d.ts +2 -2
- package/dist/model/render/graph/nova-render-layer.d.ts +1 -1
- package/dist/model/render/graph/nova-render-payload-snapshot.d.ts +3 -1
- package/dist/model/render/graph/nova-render-program.d.ts +5 -3
- package/dist/model/render/graph/nova-render-sequence.d.ts +1 -1
- package/dist/model/render/graph/nova-render-stream.d.ts +2 -2
- package/dist/model/render/ktx2/BasisSession.d.ts +45 -0
- package/dist/model/render/ktx2/KTX2Container.d.ts +26 -0
- package/dist/model/render/ktx2/KTX2Loader.d.ts +55 -0
- package/dist/model/render/meshes/MeshNode.d.ts +13 -0
- package/dist/model/render/meshes/NovaMeshWebGLDevice.d.ts +27 -0
- package/dist/model/render/meshes/geometry.d.ts +7 -0
- package/dist/model/render/meshes/mesh.d.ts +3 -0
- package/dist/model/render/meshes/mesh.types.d.ts +116 -0
- package/dist/model/render/meshes/nova-mesh-registry.d.ts +55 -0
- package/dist/model/render/orchestration/NovaRenderOrchestrator.d.ts +25 -3
- package/dist/model/render/policy/nova-render-policy.d.ts +1 -1
- package/dist/model/render/resources/NovaGlyphAtlasManager.d.ts +2 -2
- package/dist/model/render/resources/NovaTextAtlasManager.d.ts +3 -3
- package/dist/model/render/resources/NovaTextLayoutEngine.d.ts +1 -1
- package/dist/model/render/resources/nova-bitmap-upload.d.ts +10 -0
- package/dist/model/render/schema/NovaRenderContext.d.ts +6 -4
- package/dist/model/render/schema/nova-style-compiler.d.ts +5 -2
- package/dist/model/render/targets/NovaNodeRenderTextureSource.d.ts +29 -0
- package/dist/model/render/targets/NovaRenderTargetManager.d.ts +1 -1
- package/dist/model/render/targets/NovaRenderTexture.d.ts +57 -0
- package/dist/model/render/targets/nova-render-target-refs.d.ts +5 -0
- package/dist/model/render/targets/nova-render-target-resource.d.ts +1 -1
- package/dist/model/render/targets/nova-render-texture-runtime.d.ts +71 -0
- package/dist/model/render/textures/nova-compressed-image.d.ts +20 -0
- package/dist/model/render/utils/nova-icon-rendering.d.ts +3 -1
- package/dist/model/render/utils/nova-image-geometry.d.ts +11 -0
- package/dist/model/render/utils/nova-markdown-layout.d.ts +19 -0
- package/dist/model/render/utils/nova-text-paint.d.ts +26 -0
- package/dist/model/render/utils/nova-wrapped-text-layout.d.ts +19 -0
- package/dist/model/runtime/app/Nova.d.ts +35 -35
- package/dist/model/runtime/app/NovaApp.d.ts +58 -30
- package/dist/model/runtime/app/NovaRaphRuntime.d.ts +2 -2
- package/dist/model/runtime/app/createNovaRaphRuntime.d.ts +3 -3
- package/dist/model/runtime/assets/NovaAssetRegistry.d.ts +89 -2
- package/dist/model/runtime/assets/NovaVideoTexture.d.ts +38 -0
- package/dist/model/runtime/assets/nova-render-texture-image-identity.d.ts +4 -0
- package/dist/model/runtime/commands/NovaCommandBus.d.ts +1 -1
- package/dist/model/runtime/components/NovaComponentNode.d.ts +6 -6
- package/dist/model/runtime/components/NovaComponentRegistry.d.ts +1 -1
- package/dist/model/runtime/components/NovaSchemaRegistry.d.ts +7 -6
- package/dist/model/runtime/components/nova-component-metadata.d.ts +1 -1
- package/dist/model/runtime/components/nova-component.decorator.d.ts +2 -2
- package/dist/model/runtime/components/nova-defined-component.d.ts +3 -3
- package/dist/model/runtime/context/nova-context.d.ts +1 -1
- package/dist/model/runtime/cursor/NovaCursorManager.d.ts +3 -3
- package/dist/model/runtime/diagnostics/NovaDiagnostics_Module.d.ts +3 -3
- package/dist/model/runtime/interaction/NovaEvents.d.ts +16 -6
- package/dist/model/runtime/interaction/NovaHitIndex.d.ts +1 -1
- package/dist/model/runtime/interaction/NovaSpatialIndex.d.ts +2 -2
- package/dist/model/runtime/scene/NovaScene.d.ts +3 -3
- package/dist/model/runtime/scene/nova-scene-components.d.ts +6 -6
- package/dist/model/runtime/state/nova-store-decorators.d.ts +1 -1
- package/dist/model/runtime/state/nova-store-runtime.d.ts +1 -1
- package/dist/model/runtime/state/nova-store-tracking.d.ts +7 -3
- package/dist/model/runtime/sync/NovaSyncScope.d.ts +11 -2
- package/dist/model/runtime/sync/nova-sync-context.d.ts +2 -2
- package/dist/model/runtime/sync/nova-sync-ports.d.ts +2 -2
- package/dist/model/runtime/sync/nova-sync.types.d.ts +15 -3
- package/dist/model/runtime/template/NovaTemplateRuntime.d.ts +6 -6
- package/dist/model/runtime/tree/NovaContainer.d.ts +4 -4
- package/dist/model/runtime/tree/NovaNode.d.ts +58 -18
- package/dist/model/runtime/tree/NovaRaphNode.d.ts +8 -2
- package/dist/model/runtime/tree/NovaSurface.d.ts +32 -10
- package/dist/model/runtime/tree/nova-node-capture-invalidation.d.ts +11 -0
- package/dist/model/semantic/NovaSemanticService.d.ts +1 -1
- package/dist/model/semantic/browser/createAccessibilityBridge.d.ts +29 -0
- package/dist/model/sound/NovaSoundEngine.d.ts +3 -2
- package/dist/model/text-selection/NovaTextSelectionService.d.ts +2 -2
- package/dist/model/text-selection/index.d.ts +2 -2
- package/dist/model/text-selection/nova-text-selection.types.d.ts +1 -1
- package/dist/model/theme/NovaGlobalThemeRegistry.d.ts +2 -2
- package/dist/model/theme/NovaThemeService.d.ts +5 -3
- package/dist/model/theme/createTokenTheme.d.ts +15 -0
- package/dist/model/tools/transform-tools.d.ts +43 -0
- package/dist/nodes--Ds4IS2h.js +621 -0
- package/dist/nova-color-parser-BCN_rFRN.js +250 -0
- package/dist/nova-compressed-image-CE2Ya9Xa.js +46 -0
- package/dist/nova-mesh-registry-B7Xz5mhU.js +24 -0
- package/dist/nova-render-texture-image-identity-DQ09XFKs.js +15 -0
- package/dist/nova-text-paint-CcntsRjI.js +48 -0
- package/dist/tokens.d.ts +2 -0
- package/dist/tokens.js +50 -0
- package/dist/vec4-BTNv1fUp.js +20 -0
- package/package.json +223 -4
|
@@ -0,0 +1,1168 @@
|
|
|
1
|
+
import { r as A, i as I, n as E } from "./nova-render-texture-image-identity-DQ09XFKs.js";
|
|
2
|
+
const y = Symbol("Nova.managed-image");
|
|
3
|
+
let R = 0;
|
|
4
|
+
function u(a) {
|
|
5
|
+
return !!(a && typeof a == "object" && a.__novaAssetRef === !0 && typeof a.id == "string");
|
|
6
|
+
}
|
|
7
|
+
const N = "nova.rtt.", C = /^nova\.rtt\.\d+\.texture-\d+$/;
|
|
8
|
+
class T {
|
|
9
|
+
constructor(e, t, r, i) {
|
|
10
|
+
this._parent = e, this._onUpdate = t, this._onRead = r, this._onUpdates = i, e?._assertAlive(), e?._children.add(this);
|
|
11
|
+
}
|
|
12
|
+
_renderTextureToken;
|
|
13
|
+
_renderTextureBindings;
|
|
14
|
+
_managedSourceKeys;
|
|
15
|
+
_drawableReadDepth = 0;
|
|
16
|
+
_retiredDrawableSources;
|
|
17
|
+
/**
|
|
18
|
+
* Удерживает CPU-источники до выхода из синхронного draw, включая ошибку.
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
_beginDrawableRead() {
|
|
22
|
+
const e = this._parent?._beginDrawableRead();
|
|
23
|
+
this._drawableReadDepth++;
|
|
24
|
+
let t = !1;
|
|
25
|
+
return () => {
|
|
26
|
+
if (!t) {
|
|
27
|
+
t = !0, this._drawableReadDepth--;
|
|
28
|
+
try {
|
|
29
|
+
if (this._drawableReadDepth === 0) {
|
|
30
|
+
const r = this._retiredDrawableSources;
|
|
31
|
+
this._retiredDrawableSources = void 0;
|
|
32
|
+
let i;
|
|
33
|
+
for (const s of r ?? [])
|
|
34
|
+
try {
|
|
35
|
+
s();
|
|
36
|
+
} catch (o) {
|
|
37
|
+
i ??= o;
|
|
38
|
+
}
|
|
39
|
+
if (i !== void 0)
|
|
40
|
+
throw i;
|
|
41
|
+
}
|
|
42
|
+
} finally {
|
|
43
|
+
e?.();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
_retireDrawableSource(e) {
|
|
49
|
+
e && (this._drawableReadDepth ? (this._retiredDrawableSources ??= []).push(e) : e());
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Возвращает ключ существующего backend storage для всех image routes.
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
_managedDrawableStorageKey(e) {
|
|
56
|
+
return this._managedSourceKeys?.get(e) ?? this._parent?._managedDrawableStorageKey(e);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Регистрирует пустой app-owned image без decoder и независимых часов.
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
_registerManagedImage() {
|
|
63
|
+
this._assertAlive();
|
|
64
|
+
let e;
|
|
65
|
+
do {
|
|
66
|
+
if (R >= Number.MAX_SAFE_INTEGER)
|
|
67
|
+
throw new RangeError("[Nova] Managed image identity is exhausted");
|
|
68
|
+
e = w(`nova.video.${++R}`, "image", "frame");
|
|
69
|
+
} while (this._resolveRecordState(e.id) || this._renderTextureBindings?.has(e.id));
|
|
70
|
+
let t;
|
|
71
|
+
const r = {
|
|
72
|
+
type: "image",
|
|
73
|
+
get source() {
|
|
74
|
+
return t.source ?? "";
|
|
75
|
+
}
|
|
76
|
+
}, i = Object.freeze({ ref: e, descriptor: r }), s = ++this._generationClock, o = { record: i, generation: s };
|
|
77
|
+
t = this._createMaterialization(o, { ready: !1 }), t.managed = { owner: this }, Object.defineProperty(r, y, { value: t }), Object.freeze(r), this._records.set(e.id, i), this._recordUseCounts.set(e.id, 1), this._generations.set(e.id, s), this._materialized.set(e.id, t);
|
|
78
|
+
const n = () => !this._disposed && !t.disposed && this._materialized.get(e.id) === t && this._records.get(e.id) === i, d = () => {
|
|
79
|
+
if (!n())
|
|
80
|
+
throw new Error("[Nova] Video texture is destroyed");
|
|
81
|
+
if (this._drawableReadDepth)
|
|
82
|
+
throw new Error("[Nova] Cannot publish a video texture during Nova draw");
|
|
83
|
+
if (t.version >= Number.MAX_SAFE_INTEGER)
|
|
84
|
+
throw new RangeError("[Nova] Video texture revision is exhausted");
|
|
85
|
+
}, c = (l) => this._onRead?.(e.id, l);
|
|
86
|
+
return {
|
|
87
|
+
image: e,
|
|
88
|
+
get alive() {
|
|
89
|
+
return n();
|
|
90
|
+
},
|
|
91
|
+
get ready() {
|
|
92
|
+
return c("ready"), n() && t.ready;
|
|
93
|
+
},
|
|
94
|
+
get width() {
|
|
95
|
+
return c("size"), n() && t.source ? x(t.source) : 0;
|
|
96
|
+
},
|
|
97
|
+
get height() {
|
|
98
|
+
return c("size"), n() && t.source ? S(t.source) : 0;
|
|
99
|
+
},
|
|
100
|
+
get revision() {
|
|
101
|
+
return t.version;
|
|
102
|
+
},
|
|
103
|
+
generation: s,
|
|
104
|
+
assertPublishable: d,
|
|
105
|
+
publish: (l, h) => {
|
|
106
|
+
d();
|
|
107
|
+
const f = t.version, g = t.source, m = t.managed.releaseSource;
|
|
108
|
+
g && this._managedSourceKeys?.delete(g), this._managedSourceKeys ??= /* @__PURE__ */ new WeakMap(), this._managedSourceKeys.set(l, `managed-image:${e.id}:g${s}`), t.source = l, t.managed.releaseSource = h, t.ready = !0, t.version++;
|
|
109
|
+
try {
|
|
110
|
+
this._emitUpdate(o, t, "managed-image", "content-only", f, t.version);
|
|
111
|
+
} finally {
|
|
112
|
+
this._retireDrawableSource(m);
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
destroy: () => {
|
|
116
|
+
n() && (this._records.delete(e.id), this._recordUseCounts.delete(e.id), this._generations.delete(e.id), this._materialized.delete(e.id), this._disposeMaterialization(t), this._emitUpdate(o, t, "managed-image", "removed", t.version, t.version));
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/** Registers one app-owned image without a CPU materialization or global bundle. @internal */
|
|
121
|
+
_registerRenderTextureImage(e, t) {
|
|
122
|
+
if (this._assertAlive(), I(e) || this._renderTextureBindings?.has(e.id) || this._resolveRecordState(e))
|
|
123
|
+
throw new Error("[Nova] Render texture image is already registered");
|
|
124
|
+
return this._renderTextureToken ??= {}, this._renderTextureBindings ??= /* @__PURE__ */ new Map(), A(e, this._renderTextureToken), this._renderTextureBindings.set(e.id, t), () => {
|
|
125
|
+
this._renderTextureBindings?.delete(e.id);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/** Native backend binding. Foreign/disposed/unready RTT refs never become CPU images. @internal */
|
|
129
|
+
_resolveRenderTexture(e, t = !0) {
|
|
130
|
+
if (this._assertAlive(), typeof e == "string") {
|
|
131
|
+
const o = this._renderTextureBindings?.get(e);
|
|
132
|
+
if (o) {
|
|
133
|
+
const n = o();
|
|
134
|
+
if (t && n.error)
|
|
135
|
+
throw n.error;
|
|
136
|
+
return n;
|
|
137
|
+
}
|
|
138
|
+
if (!e.startsWith(N))
|
|
139
|
+
return;
|
|
140
|
+
if (C.test(e) && !this._resolveRecordState(e))
|
|
141
|
+
throw new Error("[Nova] Unknown, foreign or destroyed render texture image id");
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (!u(e))
|
|
145
|
+
return;
|
|
146
|
+
const r = E(e);
|
|
147
|
+
if (!r) {
|
|
148
|
+
if (!e.id.startsWith(N))
|
|
149
|
+
return;
|
|
150
|
+
if (C.test(e.id) && !this._resolveRecordState(e))
|
|
151
|
+
throw new Error("[Nova] Unknown or copied render texture image ref");
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (r !== this._renderTextureToken)
|
|
155
|
+
throw new Error("[Nova] Foreign render texture image owner");
|
|
156
|
+
const i = this._renderTextureBindings?.get(e.id);
|
|
157
|
+
if (!i)
|
|
158
|
+
throw new Error("[Nova] Render texture image is destroyed");
|
|
159
|
+
const s = i();
|
|
160
|
+
if (t && s.error)
|
|
161
|
+
throw s.error;
|
|
162
|
+
return s;
|
|
163
|
+
}
|
|
164
|
+
/** Readiness/version for explicitly declared ordinary image dependencies. @internal */
|
|
165
|
+
_imageDependency(e) {
|
|
166
|
+
const t = this._resolveRenderTexture(e, !1);
|
|
167
|
+
if (t)
|
|
168
|
+
return { ready: t.ready, pending: !t.ready && !t.error, key: `${t.generation}:${t.revision}` };
|
|
169
|
+
const r = this._resolveRecordState(e);
|
|
170
|
+
if (!r || r.record.ref.kind === "font")
|
|
171
|
+
throw new Error("[Nova] Image dependency is not registered");
|
|
172
|
+
const i = this._resolveMaterialization(r);
|
|
173
|
+
return { ready: i.ready, pending: i.managed ? !i.ready && !i.disposed : i.loading, key: `${r.generation}:${i.version}` };
|
|
174
|
+
}
|
|
175
|
+
_records = /* @__PURE__ */ new Map();
|
|
176
|
+
_materialized = /* @__PURE__ */ new Map();
|
|
177
|
+
_isolatedFonts;
|
|
178
|
+
_fontScope;
|
|
179
|
+
_recordUseCounts = /* @__PURE__ */ new Map();
|
|
180
|
+
_generations = /* @__PURE__ */ new Map();
|
|
181
|
+
_children = /* @__PURE__ */ new Set();
|
|
182
|
+
_generationClock = 0;
|
|
183
|
+
_materializationToken = 0;
|
|
184
|
+
_disposed = !1;
|
|
185
|
+
_readyWaiters = /* @__PURE__ */ new Set();
|
|
186
|
+
get pendingCount() {
|
|
187
|
+
let e = 0;
|
|
188
|
+
for (const t of [this._materialized, this._isolatedFonts])
|
|
189
|
+
if (t)
|
|
190
|
+
for (const r of t.values())
|
|
191
|
+
!r.disposed && r.loading && e++;
|
|
192
|
+
return e;
|
|
193
|
+
}
|
|
194
|
+
whenReady(e = {}) {
|
|
195
|
+
return new Promise((t, r) => {
|
|
196
|
+
let i;
|
|
197
|
+
const s = (o) => {
|
|
198
|
+
this._readyWaiters.delete(i), e.signal?.removeEventListener("abort", i), o === void 0 ? t() : r(o);
|
|
199
|
+
};
|
|
200
|
+
i = () => {
|
|
201
|
+
if (e.signal?.aborted) {
|
|
202
|
+
s(e.signal.reason);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
if (this._disposed) {
|
|
206
|
+
s(new Error("[Nova] Asset registry disposed"));
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
let o = !1;
|
|
210
|
+
for (const n of [this._materialized, this._isolatedFonts])
|
|
211
|
+
if (n) {
|
|
212
|
+
for (const d of n.values())
|
|
213
|
+
if (!d.disposed) {
|
|
214
|
+
if (d.loading)
|
|
215
|
+
o = !0;
|
|
216
|
+
else if (!d.ready && !d.managed) {
|
|
217
|
+
s(new Error(`[Nova] Asset failed: ${d.record.ref.id}`));
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
o || s();
|
|
223
|
+
}, this._readyWaiters.add(i), e.signal?.addEventListener("abort", i, { once: !0 }), i();
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
_notifyReadyWaiters() {
|
|
227
|
+
for (const e of this._readyWaiters)
|
|
228
|
+
e();
|
|
229
|
+
}
|
|
230
|
+
use(e) {
|
|
231
|
+
this._assertAlive();
|
|
232
|
+
for (const [r, i] of e.records) {
|
|
233
|
+
const s = i.descriptor[y];
|
|
234
|
+
if (s && s.managed?.owner !== this)
|
|
235
|
+
throw new Error("[Nova] Managed image belongs to another asset registry");
|
|
236
|
+
if (this._renderTextureBindings?.has(r))
|
|
237
|
+
throw new Error("[Nova] Reserved render texture image id");
|
|
238
|
+
const o = this._records.get(r);
|
|
239
|
+
if (o && o.descriptor !== i.descriptor)
|
|
240
|
+
throw new Error(`Nova asset "${r}" уже подключен с другим descriptor`);
|
|
241
|
+
}
|
|
242
|
+
const t = this._onUpdates || this._children.size ? [] : void 0;
|
|
243
|
+
for (const [r, i] of e.records) {
|
|
244
|
+
const s = this._recordUseCounts.get(r) ?? 0;
|
|
245
|
+
if (s === 0) {
|
|
246
|
+
const o = this._parent?._resolveRecordState(r)?.generation ?? 0, n = Math.max(this._materialized.get(r)?.generation ?? 0, this._isolatedFonts?.get(r)?.generation ?? 0), d = Math.max(this._generationClock, o, n) + 1;
|
|
247
|
+
this._disposeCachedMaterializations(r), this._generations.set(r, d), this._generationClock = d, this._records.set(r, i), t?.push({ id: r, generation: d, previousVersion: 0, version: 0, descriptorType: i.descriptor.type, provenance: "registry", change: "defined" });
|
|
248
|
+
}
|
|
249
|
+
this._recordUseCounts.set(r, s + 1);
|
|
250
|
+
}
|
|
251
|
+
t?.length && this._notifyDefinitions(t);
|
|
252
|
+
}
|
|
253
|
+
unuse(e) {
|
|
254
|
+
this._assertAlive();
|
|
255
|
+
for (const [r, i] of e.records) {
|
|
256
|
+
const s = this._records.get(r);
|
|
257
|
+
if ((this._recordUseCounts.get(r) ?? 0) > 0 && s && s.descriptor !== i.descriptor)
|
|
258
|
+
throw new Error(`Nova asset "${r}" нельзя отключить через bundle с другим descriptor`);
|
|
259
|
+
}
|
|
260
|
+
const t = this._onUpdates || this._children.size ? [] : void 0;
|
|
261
|
+
for (const r of e.records.keys()) {
|
|
262
|
+
const i = this._recordUseCounts.get(r) ?? 0;
|
|
263
|
+
if (i === 0)
|
|
264
|
+
continue;
|
|
265
|
+
const s = i - 1;
|
|
266
|
+
if (s > 0) {
|
|
267
|
+
this._recordUseCounts.set(r, s);
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
const o = this._records.get(r), n = this._generations.get(r) ?? 0, d = this._materialized.get(r), c = this._isolatedFonts?.get(r), l = c && (!d || c.version > d.version) ? c : d, h = l?.version ?? 0;
|
|
271
|
+
this._recordUseCounts.delete(r), this._records.delete(r), this._generations.delete(r), this._disposeCachedMaterializations(r), o && this._emitUpdate(
|
|
272
|
+
{ record: o, generation: n },
|
|
273
|
+
l,
|
|
274
|
+
"registry",
|
|
275
|
+
"removed",
|
|
276
|
+
h,
|
|
277
|
+
h,
|
|
278
|
+
t
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
t?.length && this._notifyDefinitions(t);
|
|
282
|
+
}
|
|
283
|
+
invalidateDrawable(e) {
|
|
284
|
+
if (this._assertAlive(), (typeof e != "string" || e.length === 0) && !u(e))
|
|
285
|
+
throw new TypeError("Nova drawable invalidation requires an asset ref or nonempty id");
|
|
286
|
+
const t = this._resolveRecordState(e);
|
|
287
|
+
if (!t)
|
|
288
|
+
throw new Error("Nova drawable asset is not registered");
|
|
289
|
+
const { record: r, generation: i } = t;
|
|
290
|
+
if (u(e) && e.kind !== r.ref.kind)
|
|
291
|
+
throw new TypeError("Nova drawable asset ref kind does not match its definition");
|
|
292
|
+
const s = r.descriptor;
|
|
293
|
+
if (r.ref.kind === "font" || s.type !== "canvas" && s.type !== "image" && s.type !== "pattern" && s.type !== "nine-slice-image" || typeof s.source != "object" || s.source === null)
|
|
294
|
+
throw new TypeError("Nova drawable invalidation requires a caller-owned direct drawable source");
|
|
295
|
+
const o = F(s.source);
|
|
296
|
+
if (!Number.isFinite(o.width) || !Number.isFinite(o.height) || o.width <= 0 || o.height <= 0)
|
|
297
|
+
throw new RangeError("Nova drawable source must have positive finite intrinsic dimensions");
|
|
298
|
+
const n = this._materialized.get(r.ref.id);
|
|
299
|
+
if (s[y])
|
|
300
|
+
throw new TypeError("[Nova] Use the managed video texture publisher");
|
|
301
|
+
if (n && (n.record !== r || n.generation !== i || n.disposed || n.loading || !n.ready))
|
|
302
|
+
throw new Error("Nova drawable materialization is not ready in the current lifecycle");
|
|
303
|
+
const d = n?.version ?? 0;
|
|
304
|
+
if (!Number.isSafeInteger(d) || d < 0 || d >= Number.MAX_SAFE_INTEGER)
|
|
305
|
+
throw new RangeError("Nova drawable materialization version is exhausted");
|
|
306
|
+
const c = s.type === "pattern" ? this._createPatternCanvas(s.source, s, o) : s.source;
|
|
307
|
+
if (s.type === "pattern") {
|
|
308
|
+
const f = F(c);
|
|
309
|
+
if (!Number.isFinite(f.width) || !Number.isFinite(f.height) || f.width <= 0 || f.height <= 0)
|
|
310
|
+
throw new RangeError("Nova pattern bitmap must have positive finite dimensions");
|
|
311
|
+
}
|
|
312
|
+
this._assertAlive();
|
|
313
|
+
const l = this._resolveRecordState(r.ref.id);
|
|
314
|
+
if (l?.record !== r || l.generation !== i || this._materialized.get(r.ref.id) !== n || n && (n.disposed || n.loading || !n.ready || n.version !== d))
|
|
315
|
+
throw new Error("Nova drawable lifecycle changed while preparing invalidation");
|
|
316
|
+
const h = n ?? this._createMaterialization(t, { source: c, ready: !0 });
|
|
317
|
+
h.source = c, h.version = d + 1, this._materialized.set(r.ref.id, h), this._emitUpdate(t, h, "registry", "ready-structural", d, h.version);
|
|
318
|
+
}
|
|
319
|
+
dispose() {
|
|
320
|
+
if (this._disposed)
|
|
321
|
+
return;
|
|
322
|
+
const e = [];
|
|
323
|
+
if (this._children.size) {
|
|
324
|
+
const t = /* @__PURE__ */ new Set(), r = [this];
|
|
325
|
+
for (const i of r) {
|
|
326
|
+
for (const [s, o] of i._records)
|
|
327
|
+
t.has(s) || (t.add(s), e.push({ id: s, generation: i._generations.get(s) ?? 0, previousVersion: 0, version: 0, descriptorType: o.descriptor.type, provenance: "registry", change: "removed" }));
|
|
328
|
+
i._parent && r.push(i._parent);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
this._disposed = !0, this._renderTextureBindings?.clear(), this._notifyReadyWaiters(), this._parent?._children.delete(this);
|
|
332
|
+
for (const t of this._materialized.values())
|
|
333
|
+
this._disposeMaterialization(t);
|
|
334
|
+
if (this._materialized.clear(), this._isolatedFonts) {
|
|
335
|
+
for (const t of this._isolatedFonts.values())
|
|
336
|
+
this._disposeMaterialization(t);
|
|
337
|
+
this._isolatedFonts.clear(), this._isolatedFonts = void 0;
|
|
338
|
+
}
|
|
339
|
+
this._fontScope = void 0, this._recordUseCounts.clear(), this._records.clear(), this._generations.clear(), this._parent = void 0, this._onUpdate = void 0, this._onRead = void 0, this._onUpdates = void 0;
|
|
340
|
+
try {
|
|
341
|
+
this._notifyDefinitions(e);
|
|
342
|
+
} finally {
|
|
343
|
+
for (const t of this._children)
|
|
344
|
+
t._parent = void 0;
|
|
345
|
+
this._children.clear();
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
_notifyDefinitions(e) {
|
|
349
|
+
const t = Array.from(this._children);
|
|
350
|
+
let r;
|
|
351
|
+
try {
|
|
352
|
+
this._onUpdates?.(e.map((i) => {
|
|
353
|
+
const s = this._resolveRecordState(i.id);
|
|
354
|
+
return s ? { id: i.id, generation: s.generation, previousVersion: i.version, version: this._resolveMaterializationVersion(s), descriptorType: s.record.descriptor.type, provenance: "registry", change: "defined" } : { ...i, change: "removed" };
|
|
355
|
+
}));
|
|
356
|
+
} catch (i) {
|
|
357
|
+
r = { error: i };
|
|
358
|
+
}
|
|
359
|
+
for (const i of t)
|
|
360
|
+
if (!(i._parent !== this || i._disposed))
|
|
361
|
+
try {
|
|
362
|
+
i._inheritDefinitions(e);
|
|
363
|
+
} catch (s) {
|
|
364
|
+
r ??= { error: s };
|
|
365
|
+
}
|
|
366
|
+
if (r)
|
|
367
|
+
throw r.error;
|
|
368
|
+
}
|
|
369
|
+
_inheritDefinitions(e) {
|
|
370
|
+
const t = e.filter((r) => !this._records.has(r.id));
|
|
371
|
+
for (const r of t) {
|
|
372
|
+
const i = this._resolveRecordState(r.id);
|
|
373
|
+
this._pruneMaterialization(this._materialized, r.id, i), this._pruneMaterialization(this._isolatedFonts, r.id, i);
|
|
374
|
+
}
|
|
375
|
+
t.length && this._notifyDefinitions(t);
|
|
376
|
+
}
|
|
377
|
+
resolveRecord(e) {
|
|
378
|
+
return this._assertAlive(), this._trackRead(e), this._resolveRecordState(e)?.record;
|
|
379
|
+
}
|
|
380
|
+
resolve(e) {
|
|
381
|
+
this._assertAlive(), this._trackRead(e);
|
|
382
|
+
const t = this._resolveRecordState(e);
|
|
383
|
+
if (!t)
|
|
384
|
+
return;
|
|
385
|
+
const r = this._resolveMaterialization(t);
|
|
386
|
+
return {
|
|
387
|
+
ref: t.record.ref,
|
|
388
|
+
descriptor: t.record.descriptor,
|
|
389
|
+
source: r.source,
|
|
390
|
+
ready: r.ready
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
resolveFontFamily(e) {
|
|
394
|
+
this._assertAlive(), this._trackRead(e);
|
|
395
|
+
const t = this._resolveRecordState(e);
|
|
396
|
+
if (t?.record.descriptor.type !== "font")
|
|
397
|
+
return;
|
|
398
|
+
const r = t.record.ref.id;
|
|
399
|
+
this._pruneMaterialization(this._isolatedFonts, r, t);
|
|
400
|
+
let i = this._isolatedFonts?.get(r);
|
|
401
|
+
if (!i) {
|
|
402
|
+
if (!globalThis.FontFace || typeof document > "u" || !document.fonts)
|
|
403
|
+
return;
|
|
404
|
+
i = this._createFontMaterialization(t, t.record.descriptor, !0), (this._isolatedFonts ??= /* @__PURE__ */ new Map()).set(r, i);
|
|
405
|
+
}
|
|
406
|
+
return i.ready && i.fontFaceAdded ? i.isolatedFontFamily : void 0;
|
|
407
|
+
}
|
|
408
|
+
resolveDrawable(e) {
|
|
409
|
+
if (this._assertAlive(), this._resolveRenderTexture(e, !1))
|
|
410
|
+
throw new TypeError("[Nova] Render texture has no CPU CanvasImageSource; use its native image binding");
|
|
411
|
+
if (e)
|
|
412
|
+
return typeof e == "string" || u(e) ? this.resolve(e)?.source : e;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Подписывает managed mask на readiness/size без чтения его CPU content.
|
|
416
|
+
* Backend читает текущий source и revision при retained replay.
|
|
417
|
+
* @internal
|
|
418
|
+
*/
|
|
419
|
+
_trackManagedImageMetadata(e) {
|
|
420
|
+
if (this._assertAlive(), typeof e != "string" && !u(e))
|
|
421
|
+
return !1;
|
|
422
|
+
const t = this._resolveRecordState(e), r = t?.record.descriptor?.[y];
|
|
423
|
+
return !t || !r?.managed || r.disposed ? !1 : (this._onRead?.(t.record.ref.id, "ready"), this._onRead?.(t.record.ref.id, "size"), !0);
|
|
424
|
+
}
|
|
425
|
+
resolveDrawableFillMode(e) {
|
|
426
|
+
if (this._assertAlive(), this._resolveRenderTexture(e, !1))
|
|
427
|
+
return "stretch";
|
|
428
|
+
if (!e || !(typeof e == "string" || u(e)))
|
|
429
|
+
return "repeat";
|
|
430
|
+
const t = this.resolveRecord(e)?.descriptor;
|
|
431
|
+
return t ? L(t) : "repeat";
|
|
432
|
+
}
|
|
433
|
+
resolveNineSlice(e) {
|
|
434
|
+
this._assertAlive();
|
|
435
|
+
const t = this.resolveRecord(e)?.descriptor;
|
|
436
|
+
return t?.type === "nine-slice-image" ? t : void 0;
|
|
437
|
+
}
|
|
438
|
+
resolveDrawableKey(e, t, r) {
|
|
439
|
+
this._assertAlive();
|
|
440
|
+
const i = this._resolveRenderTexture(t, !1);
|
|
441
|
+
if (i) {
|
|
442
|
+
const s = typeof t == "string" ? t : u(t) ? t.id : void 0;
|
|
443
|
+
return s && (this._onRead?.(s, "revision"), this._onRead?.(s, "ready")), `${e}:${i.targetId}:g${i.generation}:v${i.revision}`;
|
|
444
|
+
}
|
|
445
|
+
if (typeof t == "string" || u(t)) {
|
|
446
|
+
this._trackRead(t);
|
|
447
|
+
const s = u(t) ? t.id : t, o = this._resolveRecordState(t);
|
|
448
|
+
return o ? `${e}:${s}:g${o.generation}:v${this._resolveMaterializationVersion(o)}` : `${e}:${s}:g0:v0`;
|
|
449
|
+
}
|
|
450
|
+
return t ? `${e}:${r(t)}` : `${e}:missing`;
|
|
451
|
+
}
|
|
452
|
+
_trackRead(e) {
|
|
453
|
+
e && this._onRead?.(u(e) ? e.id : e);
|
|
454
|
+
}
|
|
455
|
+
_disposeCachedMaterializations(e) {
|
|
456
|
+
const t = this._materialized.get(e);
|
|
457
|
+
t && (this._disposeMaterialization(t), this._materialized.delete(e));
|
|
458
|
+
const r = this._isolatedFonts?.get(e);
|
|
459
|
+
r && (this._disposeMaterialization(r), this._isolatedFonts.delete(e));
|
|
460
|
+
}
|
|
461
|
+
_pruneMaterialization(e, t, r) {
|
|
462
|
+
const i = e?.get(t);
|
|
463
|
+
i && (i.record !== r?.record || i.generation !== r?.generation) && (this._disposeMaterialization(i), e.delete(t));
|
|
464
|
+
}
|
|
465
|
+
_resolveMaterialization(e) {
|
|
466
|
+
const { record: t, generation: r } = e, i = t.descriptor[y];
|
|
467
|
+
if (i)
|
|
468
|
+
return i;
|
|
469
|
+
const s = this._materialized.get(t.ref.id);
|
|
470
|
+
if (s && s.record === t && s.generation === r && !s.disposed)
|
|
471
|
+
return s;
|
|
472
|
+
s && (this._disposeMaterialization(s), this._materialized.delete(t.ref.id));
|
|
473
|
+
const o = t.descriptor;
|
|
474
|
+
let n;
|
|
475
|
+
switch (o.type) {
|
|
476
|
+
case "canvas":
|
|
477
|
+
n = this._createMaterialization(e, {
|
|
478
|
+
source: o.source,
|
|
479
|
+
ready: !0
|
|
480
|
+
});
|
|
481
|
+
break;
|
|
482
|
+
case "stripe":
|
|
483
|
+
n = this._createMaterialization(e, {
|
|
484
|
+
source: this._createStripeCanvas(o),
|
|
485
|
+
ready: !0
|
|
486
|
+
});
|
|
487
|
+
break;
|
|
488
|
+
case "pattern":
|
|
489
|
+
n = this._createPatternMaterialization(e, o);
|
|
490
|
+
break;
|
|
491
|
+
case "linear-gradient":
|
|
492
|
+
n = this._createMaterialization(e, {
|
|
493
|
+
source: this._createLinearGradientCanvas(o),
|
|
494
|
+
ready: !0
|
|
495
|
+
});
|
|
496
|
+
break;
|
|
497
|
+
case "radial-gradient":
|
|
498
|
+
n = this._createMaterialization(e, {
|
|
499
|
+
source: this._createRadialGradientCanvas(o),
|
|
500
|
+
ready: !0
|
|
501
|
+
});
|
|
502
|
+
break;
|
|
503
|
+
case "conic-gradient":
|
|
504
|
+
n = this._createMaterialization(e, {
|
|
505
|
+
source: this._createConicGradientCanvas(o),
|
|
506
|
+
ready: !0
|
|
507
|
+
});
|
|
508
|
+
break;
|
|
509
|
+
case "noise":
|
|
510
|
+
n = this._createMaterialization(e, {
|
|
511
|
+
source: this._createNoiseCanvas(o),
|
|
512
|
+
ready: !0
|
|
513
|
+
});
|
|
514
|
+
break;
|
|
515
|
+
case "mesh-gradient":
|
|
516
|
+
n = this._createMaterialization(e, {
|
|
517
|
+
source: this._createMeshGradientCanvas(o),
|
|
518
|
+
ready: !0
|
|
519
|
+
});
|
|
520
|
+
break;
|
|
521
|
+
case "nine-slice-image":
|
|
522
|
+
n = this._createNineSliceMaterialization(e, o);
|
|
523
|
+
break;
|
|
524
|
+
case "font":
|
|
525
|
+
n = this._createFontMaterialization(e, o);
|
|
526
|
+
break;
|
|
527
|
+
case "image":
|
|
528
|
+
n = this._createImageMaterialization(e, o);
|
|
529
|
+
break;
|
|
530
|
+
case "svg":
|
|
531
|
+
n = this._createSvgMaterialization(e, o);
|
|
532
|
+
break;
|
|
533
|
+
default:
|
|
534
|
+
n = this._createMaterialization(e, { ready: !1 });
|
|
535
|
+
break;
|
|
536
|
+
}
|
|
537
|
+
return this._materialized.set(t.ref.id, n), n;
|
|
538
|
+
}
|
|
539
|
+
_resolveMaterializationVersion(e) {
|
|
540
|
+
const t = e.record.descriptor[y] ?? this._materialized.get(e.record.ref.id);
|
|
541
|
+
return t?.record === e.record && t.generation === e.generation ? t.version : 0;
|
|
542
|
+
}
|
|
543
|
+
_resolveRecordState(e) {
|
|
544
|
+
if (this._disposed || !e)
|
|
545
|
+
return;
|
|
546
|
+
const t = u(e) ? e.id : e, r = this._records.get(t);
|
|
547
|
+
return r ? {
|
|
548
|
+
record: r,
|
|
549
|
+
generation: this._generations.get(t) ?? 0
|
|
550
|
+
} : this._parent?._resolveRecordState(t);
|
|
551
|
+
}
|
|
552
|
+
_createMaterialization(e, t) {
|
|
553
|
+
return {
|
|
554
|
+
record: e.record,
|
|
555
|
+
generation: e.generation,
|
|
556
|
+
token: ++this._materializationToken,
|
|
557
|
+
source: t.source,
|
|
558
|
+
ready: t.ready,
|
|
559
|
+
loading: t.loading ?? !1,
|
|
560
|
+
version: 0,
|
|
561
|
+
disposed: !1
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
_isCurrentMaterialization(e) {
|
|
565
|
+
if (this._disposed || e.disposed || !e.loading)
|
|
566
|
+
return !1;
|
|
567
|
+
const r = (e.isolatedFontFamily ? this._isolatedFonts : this._materialized)?.get(e.record.ref.id);
|
|
568
|
+
if (r !== e || r.token !== e.token)
|
|
569
|
+
return !1;
|
|
570
|
+
const i = this._resolveRecordState(e.record.ref.id);
|
|
571
|
+
return i?.record === e.record && i.generation === e.generation;
|
|
572
|
+
}
|
|
573
|
+
_completeMaterialization(e, t, r = "ready-structural") {
|
|
574
|
+
if (!this._isCurrentMaterialization(e))
|
|
575
|
+
return;
|
|
576
|
+
const i = e.version;
|
|
577
|
+
e.version += 1, e.ready = !0, e.loading = !1, this._notifyReadyWaiters(), this._emitUpdate(
|
|
578
|
+
{ record: e.record, generation: e.generation },
|
|
579
|
+
e,
|
|
580
|
+
t,
|
|
581
|
+
r,
|
|
582
|
+
i,
|
|
583
|
+
e.version
|
|
584
|
+
);
|
|
585
|
+
}
|
|
586
|
+
_failMaterialization(e, t) {
|
|
587
|
+
if (!this._isCurrentMaterialization(e))
|
|
588
|
+
return;
|
|
589
|
+
const r = e.version;
|
|
590
|
+
e.version += 1, e.ready = !1, e.loading = !1, this._notifyReadyWaiters(), this._detachMaterializationImage(e, !0), this._revokeMaterializationSource(e), this._emitUpdate(
|
|
591
|
+
{ record: e.record, generation: e.generation },
|
|
592
|
+
e,
|
|
593
|
+
t,
|
|
594
|
+
"failed",
|
|
595
|
+
r,
|
|
596
|
+
e.version
|
|
597
|
+
);
|
|
598
|
+
}
|
|
599
|
+
_emitUpdate(e, t, r, i, s, o, n) {
|
|
600
|
+
if (this._disposed || !n && !this._onUpdates && !this._onUpdate)
|
|
601
|
+
return;
|
|
602
|
+
const d = t?.source ? {
|
|
603
|
+
width: x(t.source),
|
|
604
|
+
height: S(t.source)
|
|
605
|
+
} : void 0, c = {
|
|
606
|
+
id: e.record.ref.id,
|
|
607
|
+
generation: e.generation,
|
|
608
|
+
previousVersion: s,
|
|
609
|
+
version: o,
|
|
610
|
+
descriptorType: e.record.descriptor.type,
|
|
611
|
+
provenance: r,
|
|
612
|
+
change: i,
|
|
613
|
+
dimensions: d,
|
|
614
|
+
...r === "font-face" && t?.isolatedFontFamily ? { fontFamily: t.isolatedFontFamily } : {}
|
|
615
|
+
};
|
|
616
|
+
n ? (n.push(c), this._onUpdates || this._onUpdate?.(c)) : this._onUpdates ? this._onUpdates([c]) : this._onUpdate?.(c);
|
|
617
|
+
}
|
|
618
|
+
_assertAlive() {
|
|
619
|
+
if (this._disposed)
|
|
620
|
+
throw new Error("NovaAssetRegistry уже освобождён");
|
|
621
|
+
}
|
|
622
|
+
_detachMaterializationImage(e, t) {
|
|
623
|
+
const r = e.image;
|
|
624
|
+
if (r && (r.onload = null, r.onerror = null, !!t)) {
|
|
625
|
+
try {
|
|
626
|
+
r.src = "";
|
|
627
|
+
} catch {
|
|
628
|
+
}
|
|
629
|
+
e.image = void 0;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
_revokeMaterializationSource(e) {
|
|
633
|
+
const t = e.revokeSource;
|
|
634
|
+
e.revokeSource = void 0, t?.();
|
|
635
|
+
}
|
|
636
|
+
_disposeMaterialization(e) {
|
|
637
|
+
if (!e.disposed) {
|
|
638
|
+
if (e.disposed = !0, e.loading = !1, e.managed) {
|
|
639
|
+
e.source && this._managedSourceKeys?.delete(e.source);
|
|
640
|
+
const t = e.managed.releaseSource;
|
|
641
|
+
e.managed.releaseSource = void 0, e.source = void 0, e.ready = !1, this._retireDrawableSource(t);
|
|
642
|
+
}
|
|
643
|
+
if (this._notifyReadyWaiters(), this._detachMaterializationImage(e, !0), this._revokeMaterializationSource(e), e.fontFaceAdded && e.fontFace)
|
|
644
|
+
try {
|
|
645
|
+
e.fontFaceSet?.delete(e.fontFace);
|
|
646
|
+
} catch {
|
|
647
|
+
}
|
|
648
|
+
e.fontFaceAdded = !1, e.fontFace = void 0, e.fontFaceSet = void 0;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
_createStripeCanvas(e) {
|
|
652
|
+
const t = Math.max(1, e.stripeWidth), r = Math.ceil(Math.sqrt(2) * t * Math.max(2, e.sizeK)), i = document.createElement("canvas"), s = i.getContext("2d");
|
|
653
|
+
if (i.width = r, i.height = r, !s)
|
|
654
|
+
return i;
|
|
655
|
+
s.fillStyle = e.bgColor, s.fillRect(0, 0, r, r), s.translate(r / 2, r / 2), s.rotate(e.angle * Math.PI / 180), s.translate(-r / 2, -r / 2), s.fillStyle = e.stripeColor;
|
|
656
|
+
for (let o = -r; o < r * 2; o += t * 2)
|
|
657
|
+
s.fillRect(o, 0, t, r * 2);
|
|
658
|
+
return i;
|
|
659
|
+
}
|
|
660
|
+
_createLinearGradientCanvas(e) {
|
|
661
|
+
const t = Math.max(2, Math.ceil(e.size ?? 256)), r = document.createElement("canvas"), i = r.getContext("2d");
|
|
662
|
+
if (r.width = t, r.height = t, !i)
|
|
663
|
+
return r;
|
|
664
|
+
const s = e.angle * Math.PI / 180, o = Math.sqrt(2) * t / 2, n = t / 2, d = t / 2, c = Math.cos(s) * o, l = Math.sin(s) * o, h = i.createLinearGradient(n - c, d - l, n + c, d + l), f = z(e.stops, e.from, e.to);
|
|
665
|
+
for (const g of f)
|
|
666
|
+
h.addColorStop(g.offset, g.color);
|
|
667
|
+
return i.fillStyle = h, i.fillRect(0, 0, t, t), r;
|
|
668
|
+
}
|
|
669
|
+
_createRadialGradientCanvas(e) {
|
|
670
|
+
const t = Math.max(2, Math.ceil(e.size ?? 256)), r = document.createElement("canvas"), i = r.getContext("2d");
|
|
671
|
+
if (r.width = t, r.height = t, !i)
|
|
672
|
+
return r;
|
|
673
|
+
const s = e.centerX * t, o = e.centerY * t, n = Math.max(1, e.radiusX * t), d = Math.max(1, e.radiusY * t), c = Math.max(n, d), l = i.createRadialGradient(s, o, 0, s, o, c), h = z(e.stops, e.inner, e.outer);
|
|
674
|
+
for (const f of h)
|
|
675
|
+
l.addColorStop(f.offset, f.color);
|
|
676
|
+
return i.save(), i.translate(s, o), i.scale(n / c, d / c), i.translate(-s, -o), i.fillStyle = l, i.fillRect(s - c, o - c, c * 2, c * 2), i.restore(), r;
|
|
677
|
+
}
|
|
678
|
+
_createConicGradientCanvas(e) {
|
|
679
|
+
const t = Math.max(2, Math.ceil(e.size ?? 256)), r = document.createElement("canvas"), i = r.getContext("2d");
|
|
680
|
+
if (r.width = t, r.height = t, !i)
|
|
681
|
+
return r;
|
|
682
|
+
const s = e.centerX * t, o = e.centerY * t, n = z(e.stops, e.from, e.to);
|
|
683
|
+
if ("createConicGradient" in i && typeof i.createConicGradient == "function") {
|
|
684
|
+
const l = i.createConicGradient(e.startAngle * Math.PI / 180, s, o);
|
|
685
|
+
for (const h of n)
|
|
686
|
+
l.addColorStop(h.offset, h.color);
|
|
687
|
+
return i.fillStyle = l, i.fillRect(0, 0, t, t), r;
|
|
688
|
+
}
|
|
689
|
+
const d = i.createImageData(t, t), c = e.startAngle * Math.PI / 180;
|
|
690
|
+
for (let l = 0; l < t; l += 1)
|
|
691
|
+
for (let h = 0; h < t; h += 1) {
|
|
692
|
+
const f = Math.atan2(l - o, h - s), g = Z((f - c) / (Math.PI * 2), 1), m = Q(n, g), p = (l * t + h) * 4;
|
|
693
|
+
d.data[p] = m.r, d.data[p + 1] = m.g, d.data[p + 2] = m.b, d.data[p + 3] = m.a;
|
|
694
|
+
}
|
|
695
|
+
return i.putImageData(d, 0, 0), r;
|
|
696
|
+
}
|
|
697
|
+
_createNoiseCanvas(e) {
|
|
698
|
+
const t = Math.max(2, Math.ceil(e.size ?? 256)), r = document.createElement("canvas"), i = r.getContext("2d");
|
|
699
|
+
if (r.width = t, r.height = t, !i)
|
|
700
|
+
return r;
|
|
701
|
+
const s = b(e.baseColor), o = b(e.noiseColor), n = v(e.opacity), d = v(e.density), c = i.createImageData(t, t);
|
|
702
|
+
let l = e.seed || 1;
|
|
703
|
+
for (let h = 0; h < c.data.length; h += 4) {
|
|
704
|
+
l = ee(l);
|
|
705
|
+
const f = l / 2147483647, g = f < d ? n * f : 0;
|
|
706
|
+
c.data[h] = _(s.r, o.r, g), c.data[h + 1] = _(s.g, o.g, g), c.data[h + 2] = _(s.b, o.b, g), c.data[h + 3] = _(s.a, o.a, g);
|
|
707
|
+
}
|
|
708
|
+
return i.putImageData(c, 0, 0), r;
|
|
709
|
+
}
|
|
710
|
+
_createMeshGradientCanvas(e) {
|
|
711
|
+
const t = Math.max(2, Math.ceil(e.size ?? 256)), r = document.createElement("canvas"), i = r.getContext("2d");
|
|
712
|
+
if (r.width = t, r.height = t, !i)
|
|
713
|
+
return r;
|
|
714
|
+
i.fillStyle = e.background, i.fillRect(0, 0, t, t);
|
|
715
|
+
for (const s of e.points) {
|
|
716
|
+
const o = s.x * t, n = s.y * t, d = Math.max(1, (s.radius ?? 0.45) * t), c = i.createRadialGradient(o, n, 0, o, n, d), l = v(s.opacity ?? 1);
|
|
717
|
+
c.addColorStop(0, k(s.color, l)), c.addColorStop(1, k(s.color, 0)), i.fillStyle = c, i.fillRect(o - d, n - d, d * 2, d * 2);
|
|
718
|
+
}
|
|
719
|
+
return r;
|
|
720
|
+
}
|
|
721
|
+
_createImageMaterialization(e, t) {
|
|
722
|
+
return this._createImageBackedMaterialization(e, t.source, (r) => r);
|
|
723
|
+
}
|
|
724
|
+
_createPatternMaterialization(e, t) {
|
|
725
|
+
return this._createImageBackedMaterialization(e, t.source, (r) => this._createPatternCanvas(r, t));
|
|
726
|
+
}
|
|
727
|
+
_createNineSliceMaterialization(e, t) {
|
|
728
|
+
return this._createImageBackedMaterialization(e, t.source, (r) => r);
|
|
729
|
+
}
|
|
730
|
+
_createFontMaterialization(e, t, r = !1) {
|
|
731
|
+
const i = this._createMaterialization(e, { ready: !1, loading: !0 });
|
|
732
|
+
r && (this._fontScope ??= Array.from(globalThis.crypto.getRandomValues(new Uint32Array(4)), (l) => l.toString(36)).join("-"), i.isolatedFontFamily = `nova-font-${this._fontScope}-${i.token}`);
|
|
733
|
+
const s = globalThis.FontFace, o = typeof document < "u" ? document.fonts : void 0;
|
|
734
|
+
if (!s || !o)
|
|
735
|
+
return i.ready = !0, i.loading = !1, i;
|
|
736
|
+
(r ? this._isolatedFonts ??= /* @__PURE__ */ new Map() : this._materialized).set(e.record.ref.id, i);
|
|
737
|
+
let d;
|
|
738
|
+
try {
|
|
739
|
+
d = new s(i.isolatedFontFamily ?? t.family, `url(${JSON.stringify(t.src)})`, {
|
|
740
|
+
weight: t.weight,
|
|
741
|
+
style: t.style,
|
|
742
|
+
display: t.display
|
|
743
|
+
});
|
|
744
|
+
} catch {
|
|
745
|
+
return this._failMaterialization(i, "font-face"), i;
|
|
746
|
+
}
|
|
747
|
+
i.fontFace = d, i.fontFaceSet = o;
|
|
748
|
+
let c;
|
|
749
|
+
try {
|
|
750
|
+
c = d.load();
|
|
751
|
+
} catch {
|
|
752
|
+
return this._failMaterialization(i, "font-face"), i;
|
|
753
|
+
}
|
|
754
|
+
return c.then(
|
|
755
|
+
(l) => {
|
|
756
|
+
if (this._isCurrentMaterialization(i)) {
|
|
757
|
+
try {
|
|
758
|
+
o.add(l);
|
|
759
|
+
} catch {
|
|
760
|
+
this._failMaterialization(i, "font-face");
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
if (!this._isCurrentMaterialization(i)) {
|
|
764
|
+
try {
|
|
765
|
+
o.delete(l);
|
|
766
|
+
} catch {
|
|
767
|
+
}
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
770
|
+
i.fontFace = l, i.fontFaceAdded = !0, this._completeMaterialization(i, "font-face");
|
|
771
|
+
}
|
|
772
|
+
},
|
|
773
|
+
() => this._failMaterialization(i, "font-face")
|
|
774
|
+
), i;
|
|
775
|
+
}
|
|
776
|
+
_createSvgMaterialization(e, t) {
|
|
777
|
+
const r = this._createMaterialization(e, { ready: !1, loading: !0 }), i = document.createElement("canvas"), s = i.getContext("2d"), o = D(t.pixelRatio);
|
|
778
|
+
i.width = Math.max(1, Math.ceil(t.width * o)), i.height = Math.max(1, Math.ceil(t.height * o));
|
|
779
|
+
const n = i.width, d = i.height;
|
|
780
|
+
if (!s)
|
|
781
|
+
return r.source = i, r.ready = !0, r.loading = !1, r;
|
|
782
|
+
r.source = i;
|
|
783
|
+
const c = this._createSvgImageSource(t), l = new Image();
|
|
784
|
+
r.image = l, r.revokeSource = c.revoke, this._materialized.set(e.record.ref.id, r), l.onload = () => {
|
|
785
|
+
if (!this._isCurrentMaterialization(r))
|
|
786
|
+
return;
|
|
787
|
+
try {
|
|
788
|
+
s.clearRect(0, 0, i.width, i.height), s.drawImage(l, 0, 0, i.width, i.height);
|
|
789
|
+
} catch {
|
|
790
|
+
this._failMaterialization(r, "svg-loader");
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
r.source = i, this._detachMaterializationImage(r, !0), this._revokeMaterializationSource(r);
|
|
794
|
+
const h = i.width === n && i.height === d;
|
|
795
|
+
this._completeMaterialization(r, "svg-loader", h ? "content-only" : "ready-structural");
|
|
796
|
+
}, l.onerror = () => this._failMaterialization(r, "svg-loader");
|
|
797
|
+
try {
|
|
798
|
+
l.src = c.url;
|
|
799
|
+
} catch {
|
|
800
|
+
this._failMaterialization(r, "svg-loader");
|
|
801
|
+
}
|
|
802
|
+
return r;
|
|
803
|
+
}
|
|
804
|
+
_createSvgImageSource(e) {
|
|
805
|
+
const t = this._resolveSvgSource(e), r = new Blob([t], { type: "image/svg+xml" }), i = URL.createObjectURL(r);
|
|
806
|
+
return { url: i, revoke: () => URL.revokeObjectURL(i) };
|
|
807
|
+
}
|
|
808
|
+
_resolveSvgSource(e) {
|
|
809
|
+
const t = e.source.trim(), r = t.startsWith("data:image/svg+xml") ? J(t) : e.source;
|
|
810
|
+
return e.color ? r.split("currentColor").join(e.color) : r;
|
|
811
|
+
}
|
|
812
|
+
_createPatternCanvas(e, t, r) {
|
|
813
|
+
const i = r?.width ?? x(e), s = r?.height ?? S(e), o = Math.max(0.01, t.scale ?? 1), n = Math.max(1, Math.ceil(t.width ?? i * o)), d = Math.max(1, Math.ceil(t.height ?? s * o)), c = document.createElement("canvas"), l = c.getContext("2d");
|
|
814
|
+
if (c.width = n, c.height = d, !l) {
|
|
815
|
+
if (r)
|
|
816
|
+
throw new Error("Nova pattern bitmap context is unavailable");
|
|
817
|
+
return c;
|
|
818
|
+
}
|
|
819
|
+
return l.clearRect(0, 0, n, d), l.drawImage(
|
|
820
|
+
e,
|
|
821
|
+
t.offsetX ?? 0,
|
|
822
|
+
t.offsetY ?? 0,
|
|
823
|
+
Math.max(1, i * o),
|
|
824
|
+
Math.max(1, s * o)
|
|
825
|
+
), c;
|
|
826
|
+
}
|
|
827
|
+
_createImageBackedMaterialization(e, t, r) {
|
|
828
|
+
if (typeof t != "string")
|
|
829
|
+
return this._createMaterialization(e, {
|
|
830
|
+
source: r(t),
|
|
831
|
+
ready: !0
|
|
832
|
+
});
|
|
833
|
+
const i = this._createMaterialization(e, { ready: !1, loading: !0 }), s = new Image();
|
|
834
|
+
i.image = s, this._materialized.set(e.record.ref.id, i), s.onload = () => {
|
|
835
|
+
if (!this._isCurrentMaterialization(i))
|
|
836
|
+
return;
|
|
837
|
+
let o;
|
|
838
|
+
try {
|
|
839
|
+
o = r(s);
|
|
840
|
+
} catch {
|
|
841
|
+
this._failMaterialization(i, "image-loader");
|
|
842
|
+
return;
|
|
843
|
+
}
|
|
844
|
+
i.source = o, this._detachMaterializationImage(i, o !== s), this._completeMaterialization(i, "image-loader");
|
|
845
|
+
}, s.onerror = () => this._failMaterialization(i, "image-loader");
|
|
846
|
+
try {
|
|
847
|
+
s.src = t;
|
|
848
|
+
} catch {
|
|
849
|
+
this._failMaterialization(i, "image-loader");
|
|
850
|
+
}
|
|
851
|
+
return i;
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
function w(a, e, t) {
|
|
855
|
+
return Object.freeze({
|
|
856
|
+
__novaAssetRef: !0,
|
|
857
|
+
namespace: a,
|
|
858
|
+
kind: e,
|
|
859
|
+
name: t,
|
|
860
|
+
id: `${a}/${e}s/${t}`
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
function U(a, e) {
|
|
864
|
+
const t = /* @__PURE__ */ new Map(), r = {}, i = {}, s = {}, o = {};
|
|
865
|
+
for (const [n, d] of Object.entries(e.icons ?? {})) {
|
|
866
|
+
const c = w(a, "icon", n);
|
|
867
|
+
r[n] = c, t.set(c.id, { ref: c, descriptor: d });
|
|
868
|
+
}
|
|
869
|
+
for (const [n, d] of Object.entries(e.fills ?? {})) {
|
|
870
|
+
const c = w(a, "fill", n);
|
|
871
|
+
i[n] = c, t.set(c.id, { ref: c, descriptor: d });
|
|
872
|
+
}
|
|
873
|
+
for (const [n, d] of Object.entries(e.images ?? {})) {
|
|
874
|
+
const c = w(a, "image", n);
|
|
875
|
+
s[n] = c, t.set(c.id, { ref: c, descriptor: d });
|
|
876
|
+
}
|
|
877
|
+
for (const [n, d] of Object.entries(e.fonts ?? {})) {
|
|
878
|
+
const c = w(a, "font", n);
|
|
879
|
+
o[n] = c, t.set(c.id, { ref: c, descriptor: d });
|
|
880
|
+
}
|
|
881
|
+
return Object.freeze({
|
|
882
|
+
namespace: a,
|
|
883
|
+
icons: Object.freeze(r),
|
|
884
|
+
fills: Object.freeze(i),
|
|
885
|
+
images: Object.freeze(s),
|
|
886
|
+
fonts: Object.freeze(o),
|
|
887
|
+
records: t
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
function j(a, e) {
|
|
891
|
+
return Object.freeze({
|
|
892
|
+
type: "svg",
|
|
893
|
+
source: a,
|
|
894
|
+
width: e.width,
|
|
895
|
+
height: e.height,
|
|
896
|
+
color: e.color,
|
|
897
|
+
pixelRatio: e.pixelRatio ?? "auto"
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
function D(a) {
|
|
901
|
+
if (a === void 0 || a === "auto") {
|
|
902
|
+
const e = typeof window > "u" ? 1 : window.devicePixelRatio || 1;
|
|
903
|
+
return Math.max(1, Math.min(e, 2));
|
|
904
|
+
}
|
|
905
|
+
return Math.max(0.01, a);
|
|
906
|
+
}
|
|
907
|
+
function $(a, e = {}) {
|
|
908
|
+
return Object.freeze({
|
|
909
|
+
type: "image",
|
|
910
|
+
source: a,
|
|
911
|
+
width: e.width,
|
|
912
|
+
height: e.height
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
function O(a, e = {}) {
|
|
916
|
+
return Object.freeze({
|
|
917
|
+
type: "canvas",
|
|
918
|
+
source: a,
|
|
919
|
+
width: e.width,
|
|
920
|
+
height: e.height
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
function W(a, e = {}) {
|
|
924
|
+
return Object.freeze({
|
|
925
|
+
type: "pattern",
|
|
926
|
+
source: a,
|
|
927
|
+
repeat: e.repeat ?? "repeat",
|
|
928
|
+
width: e.width,
|
|
929
|
+
height: e.height,
|
|
930
|
+
scale: e.scale,
|
|
931
|
+
offsetX: e.offsetX,
|
|
932
|
+
offsetY: e.offsetY
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
function G(a) {
|
|
936
|
+
return Object.freeze({
|
|
937
|
+
type: "stripe",
|
|
938
|
+
bgColor: a.bgColor,
|
|
939
|
+
stripeColor: a.stripeColor,
|
|
940
|
+
stripeWidth: Math.max(1, a.stripeWidth),
|
|
941
|
+
angle: a.angle ?? 45,
|
|
942
|
+
sizeK: a.sizeK ?? 50
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
function P(a) {
|
|
946
|
+
return Object.freeze({
|
|
947
|
+
type: "linear-gradient",
|
|
948
|
+
from: a.from,
|
|
949
|
+
to: a.to,
|
|
950
|
+
angle: a.angle ?? 90,
|
|
951
|
+
stops: a.stops,
|
|
952
|
+
size: a.size
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
function B(a) {
|
|
956
|
+
return Object.freeze({
|
|
957
|
+
type: "radial-gradient",
|
|
958
|
+
inner: a.inner,
|
|
959
|
+
outer: a.outer,
|
|
960
|
+
centerX: a.centerX ?? 0.5,
|
|
961
|
+
centerY: a.centerY ?? 0.5,
|
|
962
|
+
radiusX: a.radiusX ?? 0.5,
|
|
963
|
+
radiusY: a.radiusY ?? a.radiusX ?? 0.5,
|
|
964
|
+
stops: a.stops,
|
|
965
|
+
size: a.size
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
function X(a) {
|
|
969
|
+
return Object.freeze({
|
|
970
|
+
type: "conic-gradient",
|
|
971
|
+
from: a.from,
|
|
972
|
+
to: a.to,
|
|
973
|
+
centerX: a.centerX ?? 0.5,
|
|
974
|
+
centerY: a.centerY ?? 0.5,
|
|
975
|
+
startAngle: a.startAngle ?? 0,
|
|
976
|
+
stops: a.stops,
|
|
977
|
+
size: a.size
|
|
978
|
+
});
|
|
979
|
+
}
|
|
980
|
+
function V(a = {}) {
|
|
981
|
+
return Object.freeze({
|
|
982
|
+
type: "noise",
|
|
983
|
+
baseColor: a.baseColor ?? "rgba(255,255,255,0)",
|
|
984
|
+
noiseColor: a.noiseColor ?? "rgba(15,23,42,1)",
|
|
985
|
+
opacity: a.opacity ?? 0.18,
|
|
986
|
+
density: a.density ?? 1,
|
|
987
|
+
seed: a.seed ?? 1,
|
|
988
|
+
size: a.size
|
|
989
|
+
});
|
|
990
|
+
}
|
|
991
|
+
function Y(a) {
|
|
992
|
+
return Object.freeze({
|
|
993
|
+
type: "mesh-gradient",
|
|
994
|
+
background: a.background ?? "transparent",
|
|
995
|
+
points: a.points,
|
|
996
|
+
size: a.size
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
function H(a, e) {
|
|
1000
|
+
return Object.freeze({
|
|
1001
|
+
type: "nine-slice-image",
|
|
1002
|
+
source: a,
|
|
1003
|
+
slice: q(e.slice),
|
|
1004
|
+
width: e.width,
|
|
1005
|
+
height: e.height,
|
|
1006
|
+
centerMode: e.centerMode ?? "stretch"
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
function K(a) {
|
|
1010
|
+
return Object.freeze({
|
|
1011
|
+
type: "font",
|
|
1012
|
+
family: a.family,
|
|
1013
|
+
src: a.src,
|
|
1014
|
+
weight: a.weight,
|
|
1015
|
+
style: a.style,
|
|
1016
|
+
display: a.display
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
1019
|
+
function L(a) {
|
|
1020
|
+
switch (a.type) {
|
|
1021
|
+
case "stripe":
|
|
1022
|
+
return "repeat";
|
|
1023
|
+
case "pattern":
|
|
1024
|
+
return a.repeat;
|
|
1025
|
+
case "linear-gradient":
|
|
1026
|
+
case "radial-gradient":
|
|
1027
|
+
case "conic-gradient":
|
|
1028
|
+
case "noise":
|
|
1029
|
+
case "mesh-gradient":
|
|
1030
|
+
case "image":
|
|
1031
|
+
case "nine-slice-image":
|
|
1032
|
+
return "stretch";
|
|
1033
|
+
default:
|
|
1034
|
+
return "repeat";
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
const re = Object.freeze({
|
|
1038
|
+
global: new T(),
|
|
1039
|
+
define: U,
|
|
1040
|
+
svg: j,
|
|
1041
|
+
image: $,
|
|
1042
|
+
canvas: O,
|
|
1043
|
+
pattern: W,
|
|
1044
|
+
stripe: G,
|
|
1045
|
+
linearGradient: P,
|
|
1046
|
+
radialGradient: B,
|
|
1047
|
+
conicGradient: X,
|
|
1048
|
+
noise: V,
|
|
1049
|
+
meshGradient: Y,
|
|
1050
|
+
nineSliceImage: H,
|
|
1051
|
+
font: K,
|
|
1052
|
+
ref(a, e, t) {
|
|
1053
|
+
return w(a, e, t);
|
|
1054
|
+
}
|
|
1055
|
+
});
|
|
1056
|
+
function q(a) {
|
|
1057
|
+
return typeof a == "number" ? { top: a, right: a, bottom: a, left: a } : {
|
|
1058
|
+
top: a.top ?? 0,
|
|
1059
|
+
right: a.right ?? a.left ?? 0,
|
|
1060
|
+
bottom: a.bottom ?? a.top ?? 0,
|
|
1061
|
+
left: a.left ?? a.right ?? 0
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
function J(a) {
|
|
1065
|
+
const e = a.indexOf(",");
|
|
1066
|
+
if (e < 0)
|
|
1067
|
+
return a;
|
|
1068
|
+
const t = a.slice(0, e).toLowerCase(), r = a.slice(e + 1);
|
|
1069
|
+
return t.includes(";base64") ? atob(r) : decodeURIComponent(r);
|
|
1070
|
+
}
|
|
1071
|
+
function z(a, e, t) {
|
|
1072
|
+
return [...a?.length ? a : [
|
|
1073
|
+
{ offset: 0, color: e },
|
|
1074
|
+
{ offset: 1, color: t }
|
|
1075
|
+
]].map((i) => ({ offset: v(i.offset), color: i.color })).sort((i, s) => i.offset - s.offset);
|
|
1076
|
+
}
|
|
1077
|
+
function Q(a, e) {
|
|
1078
|
+
const t = v(e);
|
|
1079
|
+
let r = a[0], i = a[a.length - 1];
|
|
1080
|
+
for (let c = 0; c < a.length - 1; c += 1) {
|
|
1081
|
+
const l = a[c], h = a[c + 1];
|
|
1082
|
+
if (t >= l.offset && t <= h.offset) {
|
|
1083
|
+
r = l, i = h;
|
|
1084
|
+
break;
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
const s = Math.max(1e-5, i.offset - r.offset), o = v((t - r.offset) / s), n = b(r.color), d = b(i.color);
|
|
1088
|
+
return {
|
|
1089
|
+
r: _(n.r, d.r, o),
|
|
1090
|
+
g: _(n.g, d.g, o),
|
|
1091
|
+
b: _(n.b, d.b, o),
|
|
1092
|
+
a: _(n.a, d.a, o)
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
function b(a) {
|
|
1096
|
+
const e = a.trim();
|
|
1097
|
+
if (e.startsWith("#")) {
|
|
1098
|
+
const r = e.slice(1), i = r.length === 3 ? r.split("").map((s) => s + s).join("") : r.padEnd(6, "0").slice(0, 6);
|
|
1099
|
+
return {
|
|
1100
|
+
r: Number.parseInt(i.slice(0, 2), 16),
|
|
1101
|
+
g: Number.parseInt(i.slice(2, 4), 16),
|
|
1102
|
+
b: Number.parseInt(i.slice(4, 6), 16),
|
|
1103
|
+
a: 255
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
const t = e.match(/rgba?\(([^)]+)\)/);
|
|
1107
|
+
if (t) {
|
|
1108
|
+
const r = t[1].split(",").map((i) => i.trim());
|
|
1109
|
+
return {
|
|
1110
|
+
r: M(Number(r[0] ?? 0)),
|
|
1111
|
+
g: M(Number(r[1] ?? 0)),
|
|
1112
|
+
b: M(Number(r[2] ?? 0)),
|
|
1113
|
+
a: M((r[3] === void 0 ? 1 : Number(r[3])) * 255)
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
return { r: 0, g: 0, b: 0, a: 255 };
|
|
1117
|
+
}
|
|
1118
|
+
function k(a, e) {
|
|
1119
|
+
const t = b(a);
|
|
1120
|
+
return `rgba(${t.r}, ${t.g}, ${t.b}, ${t.a / 255 * v(e)})`;
|
|
1121
|
+
}
|
|
1122
|
+
function v(a) {
|
|
1123
|
+
return Number.isFinite(a) ? Math.max(0, Math.min(1, a)) : 0;
|
|
1124
|
+
}
|
|
1125
|
+
function M(a) {
|
|
1126
|
+
return Number.isFinite(a) ? Math.max(0, Math.min(255, Math.round(a))) : 0;
|
|
1127
|
+
}
|
|
1128
|
+
function _(a, e, t) {
|
|
1129
|
+
return M(a + (e - a) * v(t));
|
|
1130
|
+
}
|
|
1131
|
+
function Z(a, e) {
|
|
1132
|
+
return (a % e + e) % e;
|
|
1133
|
+
}
|
|
1134
|
+
function ee(a) {
|
|
1135
|
+
return a * 1103515245 + 12345 & 2147483647;
|
|
1136
|
+
}
|
|
1137
|
+
function x(a) {
|
|
1138
|
+
return "naturalWidth" in a ? Math.max(1, Number(a.naturalWidth) || 1) : "width" in a ? Math.max(1, Number(a.width) || 1) : Math.max(1, Number(a.displayWidth) || 1);
|
|
1139
|
+
}
|
|
1140
|
+
function F(a) {
|
|
1141
|
+
const e = "naturalWidth" in a ? a.naturalWidth : "videoWidth" in a ? a.videoWidth : "displayWidth" in a ? a.displayWidth : a.width, t = "naturalHeight" in a ? a.naturalHeight : "videoHeight" in a ? a.videoHeight : "displayHeight" in a ? a.displayHeight : a.height;
|
|
1142
|
+
return {
|
|
1143
|
+
width: Number(typeof e == "object" ? e.baseVal.value : e),
|
|
1144
|
+
height: Number(typeof t == "object" ? t.baseVal.value : t)
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
function S(a) {
|
|
1148
|
+
return "naturalHeight" in a ? Math.max(1, Number(a.naturalHeight) || 1) : "height" in a ? Math.max(1, Number(a.height) || 1) : Math.max(1, Number(a.displayHeight) || 1);
|
|
1149
|
+
}
|
|
1150
|
+
export {
|
|
1151
|
+
T as N,
|
|
1152
|
+
re as a,
|
|
1153
|
+
X as b,
|
|
1154
|
+
O as c,
|
|
1155
|
+
K as d,
|
|
1156
|
+
$ as e,
|
|
1157
|
+
P as f,
|
|
1158
|
+
Y as g,
|
|
1159
|
+
H as h,
|
|
1160
|
+
V as i,
|
|
1161
|
+
W as j,
|
|
1162
|
+
B as k,
|
|
1163
|
+
G as l,
|
|
1164
|
+
j as m,
|
|
1165
|
+
U as n,
|
|
1166
|
+
u as o,
|
|
1167
|
+
L as r
|
|
1168
|
+
};
|